Skip to content

DraftOwner sparkles:baseReviewed 2026-10-12

Synchronization primitives — Testing and evidence ​

The oracles, the check for every requirement of SPEC.md and primitives.md, the benchmark gates, and the evidence ledger. Delivery order is in PLAN.md.

The trace every requirement needs is requirement -> falsifying scenario -> oracle -> scoped evidence. Lock algorithms fail in interleavings and memory orders that native runs reach rarely, so the primary oracle explores both exhaustively within a bound; native runs then check what the model cannot see.

Oracles at a glance ​

OracleRuns onIndependent ofCannot observe
1. Interleaving modelthe model platform, every buildreal scheduling and hardware: it enumerates schedules and readsschedules and store histories beyond the bound; the kernel; liveness
2. Specification automatainside oracle 1the primitives' code: outcomes are checked against an abstract modelthe same as oracle 1
3. Native stressLinux, Windows, macOS, FreeBSD CI; Winethe model platform; histories are checked for linearizabilityrare interleavings
4. ThreadSanitizerLinux, LDCthe modelthe internal atomics' correctness; schedules the stress run missed
5. Seam fault injectionevery platformthe operating system's spurious-wakeup ratekernel behaviour outside the injected faults
6. Compile-time checksthe compilerruntime behaviouranything dynamic
7. Allocation auditevery platform@nogc inferenceallocations in code the audit did not run
8. Benchmarksthe reference machine; each CI leg logsthe correctness oraclesworkloads other than the measured ones
9. Litmus teststhe arm64 macOS leg; x86-64 legs as controlthe model's memory modelreorderings the hardware never performs during the run
10. Protocol modelTLC, from a TLA+ specificationthe D code: written from SPEC.md and primitives.mdwhether the code matches the model
11. Disassembly checkthe checked build on x86-64 and arm64the benchmarksthe cost of anything but the uncontended path

Oracle 1: the interleaving model ​

The parking lot and every primitive are written over a platform policy: atomic loads, stores and read-modify-writes with their memory orders, relax, bucketWait, the current parker and the seam. The production policy is core.atomic and the operating system. The model policy turns each of those operations into a scheduling point of a deterministic scheduler that runs two or three simulated threads, and fibers on them, and explores schedules depth-first with a preemption bound, as CHESS and loom do.

The model follows the D and C++ memory models rather than sequential consistency. Each atomic location keeps a bounded history of stores with vector clocks; a relaxed or acquire load may read any store the model permits, and the explorer branches on that choice, as loom does. Plain memory that a primitive protects is tracked by vector clock, so a read that no release–acquire edge orders after the last write is reported as a race and as a stale read.

The explorer prunes schedules that differ only in the order of independent operations, by dynamic partial-order reduction, so that the bound can grow. Scenarios too large for exhaustive search run instead under a randomized priority scheduler (PCT), which finds any bug of a small, fixed depth with a known probability per run; their seeds are recorded. Time is virtual: the model platform's clock advances only when the explorer chooses, so deadlines expire at chosen points rather than by wall time.

A simulated thread that parks is not runnable until a simulated unpark makes it so; the seam's wait may return spuriously, a bucket holder may stall indefinitely, a fiber may be cancelled, and a delivery may be delayed past its waiter's return and the reuse of its record — each at a point the explorer chooses.

Every explored schedule is checked for:

  • Mutual exclusion. Two simulated threads never hold a mutex, an exclusive RwLock or LockBits at once.
  • No lost wakeup. No schedule ends with every thread parked while the primitive's state would let one proceed.
  • No deadlock. The explorer reports a schedule in which every thread is blocked.
  • Exactly one outcome. Every park returns once, with one SPEC SYP4 outcome, and a dequeued record is never dequeued again.
  • Ordering. Every pair of primitives.md §13 orders the protected data it is used to publish.
  • No access to dead storage. No delivery touches a record whose park has returned (SYK8).

A scenario lists its threads' operations, the bound, and the expected set of outcomes. The explorer's own correctness is checked against seeded faults: each scenario family has a deliberately broken variant — an unlock that skips the wake, a validation outside the bucket lock, a timeout that ignores a committed token, a release store weakened to relaxed, a delivery through the record — which oracle 1 must report.

Oracle 2: specification automata ​

Inside oracle 1, each primitive's outcomes are compared with a small sequential automaton written from primitives.md alone, not from the implementation: a condition variable's automaton tracks which waiters a notification may select and requires notifyOne/notifyAll's return values to match; a semaphore's tracks the quantities of SYS4 and requires their balance; a barrier's tracks generations and withdrawals. An outcome the automaton does not allow is a failure.

Oracle 3: native stress ​

Each primitive runs a fixed-duration workload with a plain counter updated under the lock, compared with the number of acquisitions afterwards; condition, semaphore, event, barrier and latch workloads count every notification and permit. The workloads run with as many threads as the machine has and with twice as many, with and without deadlines and cancellation, on every CI leg. Their seeds and durations are recorded with each result. Each workload also records a timestamped history. For the operations with a single linearization point — lock and unlock, tryLock, permit acquisition and release, Once's completion, set and reset, and countDown — the history records each call and return and is checked for linearizability against oracle 2's automaton: some sequential order of the operations, consistent with their real-time order, must be one the automaton allows. A condition wait and a barrier arrival span several transitions on different objects, so for them the history records each phase — registration, release of the lock, selection, re-acquisition and return, or arrival, withdrawal and release — and is checked against a concurrent automaton of those phases.

Oracle 4: ThreadSanitizer ​

The native stress suite is built with LDC's ThreadSanitizer on Linux. A data race report on data a primitive protects is a failure: it shows a missing ordering edge in a schedule the run reached. TSan sees the ordering that instrumented atomic operations establish. A futex sleep and its wake carry no memory-model edge of their own (SPEC SYF1 permits spurious returns), so every edge SYH1 and SYH2 require must come from an atomic operation: the waker's release store or read–modify–write of the word or park state, and the waiter's acquire load after its sleep. The primitives must not annotate happens-before edges for ThreadSanitizer at all, since an annotation would supply the very edge under test. Seeded faults must each produce a TSan report, or the configuration's silence proves nothing: a mutex release weakened to relaxed, a thread parker's wake store weakened to relaxed, and a fiber parker's park-state swap weakened to relaxed. TSan says nothing about whether the primitives' internal atomics are correct; oracle 1 owns that.

Oracle 5: seam fault injection ​

A test switch makes the seam's wait return spuriously, or fail with EINTR, at chosen calls, and makes macOS select __ulock over os_sync_*. With it, SPEC SYP4's "no spurious return" is checked natively, and the macOS fallback runs on the macOS leg. The Linux leg runs oracles 3, 5 and 7 a second time built with version (SparklesSyncPortableParker), so the portable fallback (SPEC SYF2) runs natively (DS24).

Oracle 6: compile-time checks ​

static asserts pin: each primitive's size (SYM1, SYR1, SYO1, SYS1, SYE1, SYC1); that copying fails to compile (SYA4); the attributes of non-template operations (SYA2); calls through shared references (SYA3); that InterruptibleMutex has no raw lock or unlock (SYJ1); and, as compile-fail tests, that a Guarded!T's reference cannot escape its guard and that Guarded!(int[]), Guarded!(int*) and a guarded class reference are rejected (SYG2, SYG3). From a module outside the package, where its users are, no guard can be constructed without acquiring its lock, and a default or empty acquisition result converts to false (SYJ1, SYI5, SYG2).

Oracle 7: allocation audit ​

Every operation runs on every platform under a GC-allocation counter and a C-heap allocation counter, in the native stress workloads and as a fresh thread's first operations; any allocation is a failure (SYA1). Work that may allocate once per process, registering the fork handler and looking up the macOS symbols, runs when the image loads, outside every operation.

Oracle 9: litmus tests ​

For every pair of primitives.md §13, a message-passing test writes plain data, performs the releasing operation, and checks the data after the acquiring operation, millions of times, on the arm64 macOS leg, where loads and stores may be reordered. The same tests run on the x86-64 legs as a control. A deliberately weakened variant of each primitive, built only for this oracle, must fail on arm64, or the test proves nothing.

The weakened variant drops every ordering of the primitive's own operations; the parking lot keeps its own, or a variant loses wake-ups inside the lot and hangs instead of answering. Each test streams through thousands of instances of the primitive, one message each, so the reader holds a stale copy of the payload when the flag arrives. The oracle is an optimized build: unoptimized, the weakened locks show no stale read on the Apple and Neoverse cores tested, which commit a lock's stores in order; optimized, the compiler moves the protected accesses across the relaxed atomics, and every weakened variant fails within a few hundred rounds. A waiter that may lose its notify waits with a deadline, so a lost wake-up costs a retry rather than the run.

Oracle 10: the protocol model ​

A TLA+ specification models the parking lot and the mutex, condition, semaphore and reader–writer protocols at the level of SPEC.md and primitives.md: buckets, queues, woken-waiter records, the lock bits, tokens, timeouts, cancellation and fork. Bucket acquisition is assumed strongly fair: SYP13 promises none, and the S1 liveness properties need each bucket acquisition to succeed eventually. TLC checks its safety invariants — those of oracle 1 — and the liveness properties oracle 1 cannot. They assume that every holder eventually releases, that every committed wake is delivered, and that every loop keeps running, and they hold under weak fairness: every waiter of a mutex that neither times out nor is cancelled acquires it (SYM8), no designation lasts forever (SYM6, SYP15), every selected condition waiter returns (SYC7), every waiter of an InterruptibleMutex that is not cancelled acquires it (SYJ5), and every waiter of a RwLock that does not time out acquires its mode (SYR7); the parking lot calls settle exactly when a park ends cancelled (SYI3). The model must accept a trace in which a waiter withdraws by timeout or cancellation, and must reject a seeded starvation fault. The model is written from the specification, not the code, so it also checks the specification; whether the code implements it is a manual review obligation, recorded with each result.

Oracle 11: disassembly check ​

In the checked build, the uncontended lock and unlock of Mutex and LockBits must each compile to one atomic read-modify-write and a branch, with no call, on x86-64 and arm64; a test inspects the generated code. It checks SYM2 and that the platform policy compiles away (DS12).

Benchmarks ​

The benchmarks extend the survey's mutex-throughput.d into the test runner's @benchmark suite. On the reference machine — the 32-hardware-thread Linux host the survey measured on — the gates are:

GateWorkloadAcceptance
B1uncontended lock/unlock, one threadwithin 10% of the three-state futex word
B28 iterations under the lock, 16 outside, 2, 4, 32 and 64 threads, 100 ms per cell, 5 runsmedian throughput at least the three-state futex word's at every thread count
B3as B2at most 0.01 sleeps per acquisition at 32 and 64 threads
B4as B2, minimum over maximum acquisitions per threadat 32 threads, over 21 runs, a median at least the three-state futex word's less 0.03
B5k mutexes, each contended by 2 threads that park, k from 2 to parkingBuckets / 2; the keys either all in one bucket or in k distinct buckets, each mutex on its own cache linethe one-bucket run's throughput, as a fraction of the distinct-bucket run's, sets the collision cost DS2 accepts; recorded; the owner sets its pass threshold at S2 (DS2)
B6notifyAll to 31 waiters with the lock held, repeatedat most one wake per release of the lock (SYC6)
B7InterruptibleMutex against Mutex, as B1 and B2recorded; B1 for Mutex must not regress when InterruptibleMutex is present (DS13)

parkingBuckets, spinSteps, designatedSpinSteps and starvationBound (SPEC §7) are set by B2, B4 and B5; a change to any of them reruns all seven.

Requirement checks ​

The seam and the parking lot ​

RequirementCheckOracle
SYF1, SYF4a waiter sleeps while the value holds, returns on a wake and on a past deadline; a wake on an address whose storage was freed has no effect beyond a spurious return3
SYF4 on macOSa wait whose remaining time reaches zero between the check and the call returns timed out under both mechanisms, and a positive remainder below 1 ns sleeps at least 1 ns5
SYF2each leg's build selects the table's mechanism; the macOS leg runs both mechanisms; the FreeBSD leg runs _umtx_op; the Linux leg also runs the portable fallback3, 5, 6
SYF3the macOS selection is read once and cached5
SYP1the B5 workload with colliding keys gives the same outcomes as with distinct buckets1, 3
SYP2a park racing an unpark across the validation point is never stranded1
SYP3an unpark issued from beforeSleep wakes a waiter enqueued before it1
SYP4injected spurious seam returns never end a park1, 5
SYP5a deadline or cancellation racing a committed unpark returns unparked with its token1
SYI3, SYI2a semaphore release commits a permit, its delivery is delayed, and a cancellation wins the test parker's sleep: the acquire succeeds, settle is not called, and a consuming parker's request stays pending1
SYP14, SYC7notify, requeue onto a held mutex, then a cancellation and the old deadline fire before the unlock: the waiter sleeps again, stays queued, and reports a notification with the lock held1
SYP14, SYP4, SYK2a non-interruptible timed mutex wait times out at its deadline; an untimed interruptible semaphore wait is cancelled; with a two-bit generation, a stale delivery resumes a still-queued waiter, the parking lot calls prepare again under the bucket lock, and the next release's wake reaches the waiter, which acquires1
SYI3a counting parker sees exactly one settle for each park that ends cancelled, before its record is reused, and none for a park that ends unparked, invalid or timed out, or whose cancellation was spurious1
SYP6three waiters on one key are unparked in enqueue order1
SYP7callback arguments match the queue the automaton predicts2
SYP8requeued records keep their order, do not wake, and a stale timeout of a moved record is spurious under its new key (SYP14)1, 2
SYP8a requeue races the waiter's own timeout, cancellation and stale wake: in every schedule the waiter resolves under the bucket that holds its record, which a checked build asserts1
SYP9a filter's wake, skip and stop answers select exactly the records it accepted1, 2
SYP10, SYP12no system call, loop post, suspension or yield happens with a bucket locked, checked by a model-platform assertion1
SYP11the table is a static array of parkingBuckets buckets; the allocation audit sees no allocation6, 7
SYP13the bucket lock passes the mutual-exclusion and lost-wakeup checks; with a bucket holder stalled indefinitely, a fiber contending for the bucket yields and the other fibers on its loop keep running1, 3
SYP13, SYK2two fibers on one worker and a thread contend for one bucket on the ring path; across 10⁶ handoffs none stays in a kernel bucket wait after the bucket is released1, 3
SYP14a word used both as LockBits and as an address wait fails an assertion in a checked build1, 3
SYP15a designated or parked bit left with no waiter behind it is cleared by the next contended operation, and a new waiter is then woken1, 10
SYP15with an RwLock's drain key, which has no parked bit of its own (DS30), in its main key's bucket and not, clearing the main key's stale parked bit counts only the main key's records and the last reader's wake reaches the drainer; a handed-off waiter is never registered1
SYP14, SYP8notifyOne moving a condition waiter onto a mutex that already has waiters rewrites its tag and its interruptibility, with no assertion1
SYP15, SYM6a woken waiter loses to a barging locker, reaches its deadline and returns; its record is reused; its registration is gone and its designation passes to a parked waiter Q; with Q still on its way, the next unlock wakes nobody; with Q parked again, the next contended unlock wakes a waiter1

Parkers, cancellation, attributes, ordering and lifecycle ​

RequirementCheckOracle
SYK1a parker installed and restored around a call is used by parks inside it and not after1, 3
SYK2, SYK4a test parker records the order of prepare, commitWake and deliverWake, and the queue holds each record once1
SYK3the thread parker allocates nothing and never reports cancelled3, 7
SYK5event-horizon's fiber parker passes its own suite (its specification); here, a test parker that cancels is never stranded1
SYK6a queue of thread-parker and test-parker records is served in enqueue order1
SYK7relax is called at most spinSteps times per park1
SYK8a delivery delayed past the waiter's return, the reuse of its record, its thread's exit and its fiber's destruction touches no record storage1, 3
SYK9a condition wait meets a contended bucket after choosing a fiber parker and before releasing the lock: its thread sleeps and the fiber does not yield; the pin is restored on every return path; a park while pinned uses the thread parker; a test scheduler that suspends a pinned fiber fails an assertion1, 3
SYI1–SYI5per interruptible operation: cancellation before selection reports cancelled with nothing held; cancellation after a grant succeeds and leaves the cancellation pending; inside a protected region the operation does not observe it; non-interruptible operations never observe it1, 2
SYA1the allocation audit7
SYA2–SYA6the compile-time checks; .init values pass the stress suite from static storage3, 6
SYH1, SYH2the ordering check of oracle 1 for every pair of primitives.md §13, and the litmus tests1, 9
SYX1a child forked while another thread holds a bucket lock, and while a mutex has a designated waker and parked waiters in the parent, locks that mutex and a mutex in that bucket, and its own waiters are woken3
SYX2thread exit with a record never enqueued, and with a delivery to it still in flight, leaves the table unchanged1, 3
SYK1, SYK9a pinned fiber meeting a contended bucket sleeps its thread; a fiber holding a Mutex calls Condition.wait, its pin is dropped, it suspends, and a fiber on the same loop notifies it; a condition wait while another lock pins the caller fails an assertion1, 3
SYI1, SYI3, SYI4a fiber in a non-interruptible Semaphore.acquire receives a cancellation that persists; it does not loop, it acquires once a fiber on the same loop releases, and the request is still pending; with a consuming test parker, cleanup after a cancelled result waits normally; with a latching one, every later interruptible operation returns cancelled and the same cleanup waits normally inside a protected region1
SYF2 fallbackthe portable thread parker's waiter returns only after delivery has released its mutex, with delivery delayed at every point1

Primitives ​

RequirementCheckOracle
SYL1–SYL3LockBits on 1-, 2-, 4- and 8-byte words passes the mutex scenarios while another thread toggles the other bits1, 3
SYM1, SYM2size assertion; the model counts one CAS and no parking-lot call per uncontended acquire and release1, 6, 11
SYM3–SYM5lock, deadline and try scenarios; an unlock of a free mutex fails an assertion in a checked build1, 3
SYM6, SYM7no schedule has two designated wakers; an unlock with one pending makes no parking-lot call1, 10
SYM8an adversarial schedule in which barging lockers always win hands the waiter the lock within starvationBound + 1 wakes1, 10
SYM9the model counts at most spinSteps relax steps per lock, none with a designated waker pending1
SYM10a locker whose validation finds the mutex free returns holding it, in every mutex scenario; the protocol model rejects a validation that only declines (mx-fault-purevalidate)1, 10
SYJ1–SYJ5guard-only acquisition; cancellation racing a grant on either side of the handoff; FIFO grants; a holder that suspends1, 2, 6
SYJ3a cancellation request arrives and a handoff is committed before the waiter's park is arbitrated: the waiter holds the mutex and the request stays pending1
SYJ6a try on a held InterruptibleMutex reports unavailable without parking, and on a free one returns a guard; the same through InterruptibleGuarded!T3, 6
SYJ1, SYC3a waitInterruptible on an InterruptibleMutex is cancelled while the cancellation persists: it returns cancelled holding the mutex1
SYG1–SYG4the guard releases on scope exit; the escape and payload compile-fail tests; condition waits through a guard1, 6
SYC1–SYC9condition scenarios against the automaton: wait, timeout, cancellation, notify one and all, held and free lock; after a timeout or cancellation the lock is held again, and a cancellation during re-acquisition is not observed1, 2, 10
SYC2, SYC5, SYJ5W is moved onto a held Mutex with W at starvationBound, and onto a held InterruptibleMutex: the release hands W the lock and wait returns holding it after one acquisition; a notifyOne between W's enqueue and its release moves W onto its own lock's queue, and wait still returns holding the lock once1
SYC6, SYJ5notifyAll with two waiters on a free InterruptibleMutex: both return holding it in turn1
SYR1–SYR6reader–writer scenarios against the automaton, including: U holds upgradable, R holds shared, W queues, U upgrades, R releases — U acquires exclusive before W; an upgrade that times out keeps upgradable; an upgrade racing the pass of a timed-out writer that grants a queued reader never leaves an exclusive and a shared holder together; with two upgradable waiters and a reader queued behind a writer in any order, the pass grants the reader alongside the first and skips the second (SYR5); a downgrade without its mode fails an assertion1, 2, 3
SYR7U1 and U2 park for upgradable mode behind a writer, U1 releases without upgrading, and U2 acquires; the last reader's release wakes a pending upgrade; a writer that times out of its drain as the last reader leaves still lets the writer queued behind it acquire1, 2
SYO1–SYO6three callers race; init runs once; an Exception lets another caller run init, and a fresh caller that wins the retry sees the failed attempt's writes (also a litmus test); an Error poisons; a waiter's timeout leaves init running1, 3
SYS1–SYS5the SYS4 balance under every explored schedule, with timeouts and cancellation; after release(1) then acquire, available plus handed off is 0 and initial plus released minus completed is 0; a release that would overflow the count fails an assertion1, 2, 3
SYE1–SYE4manual and auto-reset scenarios against the automaton, with timeouts and cancellation racing set; a manual-reset set begun before a reset never releases a wait begun after it1, 2
SYB1–SYB3generations never mix; a party that times out before the n-th arrival is withdrawn, the generation completes only with n present, and no ordering is required from a party's writes after its withdrawal; a cancellation that loses to the generation's completion leaves the arrival successful and its request unsettled (SYI2, SYI3); the latch releases once and stays open1, 2, 3
SYW1–SYW3a word that already differs returns at once with no park; a store without a wake leaves waiters parked; a wake ends a wait whose word never changed; wakes return exact counts1, 2

Evidence ledger ​

RequirementsStateEvidenceGap
SYF1, SYF4; SYP1–SYP12, SYP15; SYK1–SYK4, SYK6–SYK8; SYX1, SYX2; SYL1–SYL3; SYM1, SYM3, SYM4, SYM6, SYM8, SYM10; SYJ1, SYJ2, SYJ4–SYJ6; SYG1–SYG4; SYC1, SYC3, SYC4, SYC6–SYC9; SYO1–SYO6verified on Linux x86-64oracle 1: the scenarios of libs/base/src/sparkles/base/sync/parking_lot_test.d, mutex_test.d and primitives_test.d, each family with its seeded fault reported; oracles 3, 5 and 6: lifecycle_test.d, seam_test.d and the native rows, dub test :base -- -i "sync\." (140 tests), with libs/base/src/sparkles/base/sync_access_test.d for oracle 6's checks from outside the package; oracle 10: libs/base/tla/sync/check.sh, 37 configurations of ParkingLot.tla and LockProtocols.tla; oracle 11: libs/base/tools/check-sync-fast-path.d, x86-64 and arm64oracle 2's automata are the scenarios' own assertions, not separate automata; oracle 3 records no linearizability histories yet; SYF4's sub-nanosecond remainder is reached on no clock the suite runs on
SYI1–SYI5, SYJ3partly verifiedoracle 1: a cancellation that ends an interruptible sleep is settled exactly once, and loses to a committed grantthe test parker has no pending request: a request that outlives a lost arbitration, and a latching parker's later operations, are not modelled
SYP13, SYP14; SYC2, SYC5partly verifiedoracle 1: no wait, system call or fiber yield with a bucket held; a requeue racing a timeout; a notifier racing a fast-path locker on a free handoff locka stalled bucket holder with fibers yielding, and the ring path's handoffs, need the fiber parker (event-horizon M20); a requeue followed by a cancellation and the old deadline, and a waiter moved at starvationBound, have no scenario
SYM2, SYM5, SYM7, SYM9partly verifiedSYM2: oracle 11's one read–modify–write and no callthe model counts no CAS, parking-lot call or relax step, and no scenario unlocks a free mutex
SYH1, SYH2; SYA1partly verifiedoracle 1's ordering checks; oracle 4: a fully weakened platform produces a report; oracle 7: -c allocation-audit, Linux, warmed on the main thread and cold on a fresh threadno single-fault TSan controls, and the weakened InterruptibleMutex workload stayed silent in one of three local runs; oracle 7 runs in no CI job; a cold process is covered by construction, its once-per-process work running at image load, not by a test
SYF2 (portable fallback)verified on Linux x86-64dub test :base -c unittest-portable -- -i "sync\."; the model's portable scenario—
SYF2 on Windows; SYF1, SYF3, SYF4 on macOS and FreeBSDverifiedWindows: ci/test-windows.sh runs the base suite on WaitOnAddress, and the leg also runs -c unittest-portable; macOS arm64: the base suite, its __ulock run, and the portable configuration; FreeBSD 14.5: the freebsd job and nix run .#freebsd-vm -- testFreeBSD runs the native seam only, not the portable configuration
SYH1 on arm64 (oracle 9)partly verifiedlibs/base/tools/check-sync-litmus.d on Apple M4 (macOS, and Linux in a VM) and Neoverse (the ubuntu-24.04-arm leg): every weakened variant shows a stale read, the real primitives none: before DS29 within 770 rounds; after it the condition wait on Neoverse needs more than 5000, so the budget is 90 s of rounds per pair; x86-64 runs it as the controlnine pairs: Mutex, InterruptibleMutex, Once's completion seen through isComplete, a condition wait, which publishes through its mutex, and S3's RwLock, Semaphore, events and Latch; no litmus for LockBits, a parked Once caller, the Once retry pair, the barrier, the address wait, or park/unpark; S3's readers acquire through the try forms (tryAcquire, tryWait, isOpen), so no pair crosses a parked handoff, and RwLock's pair is an exclusive release seen by a shared acquisition only
SYK9 for fiberspartly verifiedthe model's condition wait by a fiber drops its pin for the sleep and restores it; event-horizon's scheduler fails the suspension of a fiber holding a Mutex (libs/event-horizon/src/sparkles/event_horizon/fiber_park_test.d)a pinned fiber meeting a contended bucket has no scenario
B2, B3, B6passthe reference machine: dub test :base -b bench -- --bench -i "sync\.bench"—
B1partly met0.94 of the futex word in an optimized standalone build; 1.18 under the runner's bench buildthe runner's figure exceeds the 10% gate
B4partly metthe reference machine, starvationBound 4 and designatedSpinSteps 40: 0.769, 0.736 and 0.775 against the futex word's 0.796, 0.811 and 0.795, passing two runs of three; over nine runs with 40, 80 and 160 such steps, Mutex's 21-run median spans 0.70–0.83 and the futex word's 0.80–0.82; at 64 threads Mutex is the fairer, 0.68–0.72 against 0.62–0.67Mutex's run-to-run spread exceeds the tolerance (DS29)
B5, B7recordedB5: one bucket runs at 0.83–0.98 of distinct buckets for 2 to 64 mutexes, and at 1.05 and 0.78 for 2 and 8 after DS29; B7: InterruptibleMutex sleeps on almost every contended acquisition, 0.3 per µsthe owner sets B5's threshold (DS2)
SYR1–SYR7, SYS1–SYS5, SYE1–SYE4, SYB1–SYB3, SYW1–SYW3partly verifiedoracle 1: the scenarios of libs/base/src/sparkles/base/sync/rwlock_test.d and waits_test.d, each primitive with its seeded fault (a release weakened to relaxed) reported, among them the four races the seventh review found, each failing before its fix, and sync.model.SYK9.aReleaseStaysPinnedThroughTheBucket; the drain scenarios again with the drain key in its main key's bucket, where sync.model.SYP15.theLastMainWaiterClearsTheParkedBit reports a parked bit counted over the whole bucket; oracles 3 and 6: their native stress and size and copy checks; oracle 4: the S3 workloads of libs/base/tools/check-sync-tsan.d, silent over the native platform and reported over the weakened one; oracle 7: every S3 operation under -c allocation-audit, contended, timed, completing a barrier generation with a waiter parked, parking on a manual-reset event, and on a fresh thread; oracle 9: pairs for RwLock, Semaphore, both events and Latch, every weakened variant showing a stale read within 322 rounds on an Apple M4 aarch64 Linux builder; oracle 10: WaitProtocols.tla, 15 configurations of the semaphore and reader–writer protocols, with seeded faults and a starvation fault rejectedoracle 2's automata are the scenarios' own assertions; oracle 3 records no linearizability histories; WaitProtocols.tla makes a release pass one step, so it cannot show a change of the word inside a pass, the races of the seventh review; the TSan controls weaken every ordering at once, not one edge, as for S1 and S2; no litmus pair for the barrier or the address wait (DS30); RwLock has no B-gate
SYX3planned—SYX3 states a limit, with nothing to test
SYK5planned—specified by event-horizon's fiber-parker.md; delivered and tested in its M20

The specification's independent-review gate is partly met: a first independent review on 2026-10-15 raised twelve findings and three gaps (DS13–DS22); a second review of that revision raised twelve more (DS23); a third, of that revision and of event-horizon's fiber parker, raised fourteen (DS25); a fourth, by the third round's reviewer and a second with no earlier context, raised the findings DS26 resolves. A fifth, the first of the implementation, by the same two reviewers, and a sixth, of the tree that resolved the fifth, raised the findings DS28 resolves; the tree that resolves the sixth has not been reviewed on its own. A seventh, by the same two reviewers, of S3's implementation and the S1–S2 machinery it reuses, raised the findings DS30's amendment resolves. An eighth, of that tree, by the first reviewer (cut short) and a fresh one, found no defect in the primitives; its findings on this ledger, SYR5's wording and the drain key's shared bucket are resolved here and by the SYP15 scenarios of rwlock_test.d.