Parent: #502 Related: #480, #985
Executed baseline
On exact main at b4f5544d61036e296ebd0046579d0b991b509025, the focused coordinator witness
zig test src/runtime_threads.zig -lc --test-filter 'host internal work uses one reservation and queues excess background work'passes and proves the existing schema-v7 boundary correctly admits one host-reserved compiler plus one general-slot compiler while queueing the third. RuntimeInternalWorkSnapshot records CPU requests, admissions, waiters, and wait time, but neither the coordinator nor the native/Wasm compiler entry points account or bound their temporary allocator bytes. GC auxiliary scratch is measured per Context by the opt-in runtime profiler, but it likewise has no process-wide admission policy. Concurrent contexts/hosts can therefore obey the CPU-slot contract while independently growing GC/JIT/Wasm scratch.
This is a resource-policy gap, not a leak or current correctness failure. Defaults must preserve existing unlimited behavior.
Required change
- Add one process-wide, fail-closed byte-admission contract for temporary GC auxiliary, native-compilation, and Wasm-compilation storage.
- Keep long-lived precise-heap cells, decoded Wasm modules, and published executable mappings/metadata in their existing ownership domains; they are not compiler scratch.
- Preserve synchronous JIT/Wasm compilation, exact claim/invalidation/publication semantics, GC abort/rollback behavior, and existing CPU-slot priority/FIFO ordering.
- A finite host/embedder limit may reject temporary growth as OOM, but a transient JIT scratch rejection must leave the tier retryable rather than caching semantic unsupportedness.
- Publish coherent schema-versioned current/peak/requested/rejected/released bytes and waiter/admission counters by domain plus a reconciled process total.
- Defaults remain unlimited; no benchmark/source recognition, hidden reserve, spin/sleep admission loop, or allocation moved outside the measured boundary.
Definition of done
- Deterministic allocator tests cover exact alloc/resize/remap/free accounting, per-domain and total caps, overflow-safe rejection, release/re-admission, nested work, OOM rollback, and teardown-zero balance.
- GC auxiliary storage uses the shared byte contract without entering the public Context heap limit or changing collector safety.
- Baseline and optimizing JIT temporary analysis/lowering storage use the contract; executable mappings and adopted metadata remain separately owned.
- Wasm decode/validation temporary storage is bounded without misclassifying the retained decoded module.
- Coherent telemetry invariants hold under concurrent readers/writers and unsuppressed TSan.
- Focused GC/JIT/Wasm/no-GIL gates and
zig build test-parallelpass. The broader threadfuzz lifecycle profile has the same four failures on the exact parent and candidate and is tracked separately in #1028. - Exact-parent dedicated and oversubscribed evidence records unchanged checksums plus RSS/latency/throughput and the new byte gauges before any performance claim.
- Parent issues #502 and #480 are updated with landed commits and evidence.