Repository navigation
Closed
Description
Context
sched is the user-space scheduler that rewritten code calls instead of starting goroutines, locking mutexes or ranging over maps directly. It parks a goroutine at each scheduling point and lets the driver release one per pass with the seeded toolexec/release stream. It lives in the nested module runner/toolexec, so the root module keeps its dependency rule.
Goal
Create the nested module runner/toolexec and the sched core: points, Go, mutexes, OnceDo, Select, Keys, the rand helpers and the gap registry, with XTE-060's goroutine identity.
Scope
runner/toolexec/go.mod,go.sum(requires onlygithub.com/hmdsefi/faultlineand gograph).runner/toolexec/sched/sched.go:Point,Go,Lock/Unlock,RLock/RUnlock/WLock/WUnlock,OnceDo,Select,Keys,Rand,RandV1,Gaps, and the internals Task 3 uses (self,point,park,wake,wakeIfInAttempt).sched_test.go,contract_test.go,core_test.go.- Out of scope: the helpers for the new rewrite rows (2.5-03).
Acceptance criteria
- The driver's
Lockreturns once the holder releases the mutex, even when the holder reaches a point first; no hang (AT-XTE-14). - A process holding a rewritten mutex across
time.Sleep(time.Second)while an invariant locks it fails in under 20 s of wall time with §7's deadlock text (AT-XTE-15). - Calls from a goroutine outside the attempt's bubble return without parking and leave
Pending()false (AT-XTE-16). -
selfreads the goroutine and bubble once per park, andwakefires only when the pending set can change. - From
runner/toolexec:go vet ./...andgo test -race ./...are green, plusFAULTLINE_CHECK_DETERMINISM=1 go test ./....
Implementation notes
- The code comes from
spike/exbatd91b8a7, file by file withgit show, never by merging the branch. schedtakesReset's caller as the driver; there is noOnDriver(XTE-060).- 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 2 - Spec:
.helper/docs/specs/exact-toolexec.md(XTE-001, XTE-051, XTE-060 to XTE-063, XTE-066 to XTE-070, AT-XTE-14 to AT-XTE-16)
Activity