Downstream zig-js #97 still spends the dominant shared-realm object-churn worker time waiting for Heap.alloc_lock while batches publish or the collector sweeps. The current TTAS + bounded-yield policy fixed repeated failing CAS writes (#26), but a fresh 10-second eight-lane profile at zig-js daf74724 / zig-gc 092d8d7 still recorded 14,619 scheduler-yield top stacks and 1,908 allocObjectBatch top stacks. Every waiter polls the shared lock word and periodically yields; short publication sections and the longer sweep tail share the same handoff path.
Scope
- Prototype a fair queued allocation-metadata lock whose waiters spin on private/local state and hand ownership directly to the next waiter.
- Preserve the uncontended fast path, the single-mutator lock-free path, all-list/counter/born-cell ordering, and collector exclusion.
- Avoid heap allocation, TLS lifetime hazards, reentrancy, or abandoned stack-node references in the lock implementation.
- Reject the design if it regresses one/two lanes or fails to materially improve both four and eight lanes in an order-balanced exact-parent downstream A/B.
Acceptance
Downstream zig-js #97 still spends the dominant shared-realm object-churn worker time waiting for
Heap.alloc_lockwhile batches publish or the collector sweeps. The current TTAS + bounded-yield policy fixed repeated failing CAS writes (#26), but a fresh 10-second eight-lane profile at zig-jsdaf74724/ zig-gc092d8d7still recorded 14,619 scheduler-yield top stacks and 1,908allocObjectBatchtop stacks. Every waiter polls the shared lock word and periodically yields; short publication sections and the longer sweep tail share the same handoff path.Scope
Acceptance