Skip to content

[2.5-07] Exact backend: rewriter sync rows #342

Closed

Description

@hmdsefi

Context

The hangs the spike found came from sync uses the rewriter did not see: Cond waits that release a scheduled mutex behind sched's back, interface Lock calls, mutex method values passed to helpers, sync.OnceFunc's internal mutex, and goroutines started by WaitGroup.Go or AfterFunc. Each becomes a rewrite row that calls a Task 3 helper.

Goal

Rewrite every sync row of XTE-041 (method values, interface locks, RLocker, Cond, WaitGroup.Go, Once*, AfterFunc, runtime.Gosched) and handle XTE-042's method expressions and interface method values.

Scope

  • New rewrite_sync.go: syncFuncs, pkgFuncs, importKeep, selector, pkgFunc, syncMethodOf, ifaceLock, ifaceRecv, keepImport; the rands field becomes keeps.
  • New rewrite_sync_test.go; rewrite.go, main.go (version), version_test.go.
  • Out of scope: map, rand and reflect rows (2.5-08).

Acceptance criteria

  • Golden outputs match for every sync row of XTE-041, with no gap recorded (AT-XTE-11).
  • sync/atomic calls are neither rewritten nor recorded as gaps (XTE-043).
  • A replaced import stays used, so the rewritten file compiles.
  • From runner/toolexec: go vet ./... and go test -race ./... are green, plus FAULTLINE_CHECK_DETERMINISM=1 go test ./....

Implementation notes

  • Review depth: two seats.

References

These paths are in the private planning docs (.helper/docs/, gitignored) in the maintainer's checkout.

  • Plan: .helper/docs/plans/phase-2/2.5-exact-toolexec.md, Task 7
  • Spec: .helper/docs/specs/exact-toolexec.md (XTE-041, XTE-042, XTE-043, AT-XTE-11)

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions