Skip to content

feat(runner/toolexec): rewrite sync method values, interface locks, conds and once functions - #577

Merged
hmdsefi merged 1 commit into
mainfrom
plan/2.5-task-07
Nov 1, 2026
Merged

hmdsefi merged 1 commit into
mainfrom
plan/2.5-task-07

Conversation

@hmdsefi

@hmdsefi hmdsefi commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Adds the rewriter's sync rows. Stacked on #576.

  • Method values of sync locks, WaitGroup.Wait, Once.Do and the Cond methods become the matching sched helpers (LockFunc, WaitFunc, CondWaitFunc and so on), so code that passes mu.Unlock around still reaches a scheduling point.
  • Lock and Unlock called through an interface go through ILock and IUnlock, which take any value with that method, so an interface that is not a sync.Locker still compiles.
  • A sync call or method value whose receiver is reached through an unexported embedded field of another package is left as written and records the gap method receiver not nameable in this file, because the rewritten code could not name that field. This also covers a plain m.Lock(), which the previous PR rewrote.
  • sync.OnceFunc, OnceValue and OnceValues go through their sched versions, and Cond.Wait, Signal and Broadcast become scheduling points.
  • time.AfterFunc and context.AfterFunc bind their function wrapped with sched.Func, also in a go statement.
  • RWMutex.RLocker and WaitGroup.Go calls go through sched too. Method expressions of all these methods, and method values of interface Lock and Unlock, record a coverage gap instead of being rewritten.
  • rewrite_sync_test.go covers AT-XTE-11; more tests pin the gap rows and the generated sched imports.

The plan's render emitted __fl_sched.Func( twice for time.AfterFunc(d, mu.Unlock), and broke (<-ch).mu.Lock(). One condition changed so an insertion at the start of a sub-range is left to the enclosing text. The wrapper's version goes from 3 to 4.

Closes #342

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@hmdsefi
hmdsefi merged commit 7f83ab8 into main Nov 1, 2026
18 checks passed
@hmdsefi
hmdsefi deleted the plan/2.5-task-07 branch November 1, 2026 02:26
@hmdsefi hmdsefi mentioned this pull request Nov 1, 2026
14 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[2.5-07] Exact backend: rewriter sync rows

1 participant