Parent: #502
Found by: hosted CI for 8297fbb
Verified failure
The automatic runtime scheduler grants logical_cpu_count - 1 general runnable slots. On the four-CPU Linux runner, both of these promoted no-GIL cases start four shared-realm Threads, put every admitted Thread into a nonblocking loop, and wait on the host thread for all four to publish readiness:
cve/mc-life-wasm-grow-relocate.js: Debug shard 2 timed out after 600 seconds; ReleaseSafe eventually panicked while out of memory after 507 seconds.cve/mc-grow-s4-detach-nullvec-repro.js: Debug shard 3 timed out after 600 seconds.
Their checked evidence is 313 ms and 151 ms respectively. The fourth Thread remains queued forever because the first three never call a blocking primitive. Weighted admission cannot preempt a runnable Thread, and the untyped host wait owns no scheduler slot to release.
This is a production liveness gap in the bounded scheduler, not a corpus timeout problem. Any program that starts more CPU-bound shared-realm Threads than the automatic limit and waits for all of them can deadlock before user-level stop conditions become reachable.
Scope
- Add cooperative runnable-slot handoff at bounded JavaScript execution checkpoints when scheduler waiters exist.
- Cover both tree-walker and bytecode VM execution paths.
- Keep the no-contention cost amortized and avoid a coordinator lock when no waiter is published.
- Preserve interpreter roots, GIL/no-GIL state, termination checks, and exact runnable/blocked accounting across a handoff.
- Add a deterministic one-slot regression whose first Thread spins until a queued peer publishes readiness.
- Re-run both promoted corpus witnesses in Debug and ReleaseSafe no-GIL modes.
Definition of done
- A one-slot shared-realm CPU-loop handoff test completes without sleeps or an unbounded watchdog.
- Tree-walker and VM/IIFE-shaped variants both exercise the handoff.
- Runnable/blocked/slot counters reconcile exactly after completion.
- Hosted Debug and ReleaseSafe shards pass the scheduler-exposed corpus cases (
mc-grow-buffer-storm.js,mc-life-wasm-grow-relocate.js, and the original detach witness). - Focused unsuppressed TSan and the full unit gate pass.
- #502 records the landed commit and evidence.
Guardrails
Do not raise the automatic slot limit, special-case these corpus files, exempt JavaScript Threads from admission, weaken the corpus deadline, or add wall-clock sleeps as scheduler synchronization.