Skip to content

[Epic 2.5] Exact backend: toolexec #349

Closed
14 of 14 issues completed
Closed

Description

@hmdsefi

Summary

The exact-backend spike chose toolexec (RFC-0002 §4.5, decided 2026-10-24). This epic ships it on main. The faultline-toolexec wrapper, run as go test -toolexec, rewrites the test binary's packages so that goroutine starts, channel operations, select, sync primitives, map ranges and math/rand go through sched, a user-space scheduler in the nested module runner/toolexec. The goroutine-mode driver releases one parked goroutine per pass with the seeded toolexec/release stream through internal/gosched, so the same seed gives the same trace hash and the same goroutine order. Runs are labeled exact, replay commands carry the wrapper, FAULTLINE_EXACT=1 refuses a run that would not be exact, and what the rewriter cannot control is listed as coverage gaps. The code moves from spike/exb at d91b8a7 file by file, and the spike's measurements become permanent acceptance tests.

Deliverables

  • internal/gosched, the driver hook and XTE-082's stall rule
  • Nested module runner/toolexec with the sched runtime and the faultline-toolexec wrapper (prepare, state directory, version line, rewrite set, stale-state message)
  • The rewriter with position directives, sorted gaps and the rows of XTE-041 (sync, maps, rand, reflect)
  • Package faultline: exact labels, the toolexec replay command, FAULTLINE_EXACT as a bool, toolexec-gaps.txt
  • Acceptance package runner/toolexec/acceptance with AT-XTE-26 to AT-XTE-42
  • Recorded measurements: point cost, C1 to C3 slowdown, final size

Open questions for the owner

The plan's Task 0 has 12 open questions that wait for the owner, among them exact replay only with Procs 1, FAULTLINE_EXACT as a bool, no trace records for sched decisions, and the size estimate against the 3,000-line limit. Each has a default, and spec XTE is written to the defaults. The refresh task (2.5-00, first in the list below) records the answers, and no code task starts before they are in.

Tasks

Done when

  • Each task's PR is merged into main in task order, one squash commit per task; spike/exb is not merged
  • CI's nested job is green on all four runners with the acceptance package (AT-XTE-43)
  • The backend's final size is at most 3,000 lines, recorded with each task's line count
  • XTE §12's changes are applied (2.5-00) and XTE §9 carries the measured values (2.5-12)

Depends on

  • Epic 2.4: Exact backend spike (decision recorded in RFC-0002 §4.5)
  • Epics 2.1 to 2.3 merged to main (at or after 4b77273)

References

Private planning docs (.helper/docs/, gitignored).

  • Plan: .helper/docs/plans/phase-2/2.5-exact-toolexec.md
  • Specs: .helper/docs/specs/exact-toolexec.md, .helper/docs/rfcs/0002-goroutine-determinism.md §4.5, .helper/docs/specs/exact-backend-spike.md, .helper/docs/specs/goroutine-mode.md, .helper/docs/specs/test-api.md

Activity

  1. hmdsefi commented on Nov 1, 2026

    @hmdsefi
    OwnerAuthor

    All done-when items hold:

    One known gap stays open: a goroutine woken by timers firing at the same instant may not replay if, before its next scheduling point, it starts a goroutine, registers an AfterFunc, draws a random number or is the first to call a Once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions