Parent: #459 Depends on: #476, #481, #482, #490 Related: #477, #478, #492, #503
Goal
Coordinate GC helpers, JIT/Wasm compilation, JavaScript Threads, Workers, waiters, and host tasks under explicit bounded CPU, memory, and latency budgets.
Problem
GC, native compilation, Wasm work, shared-realm Threads, isolated Workers, and benchmark workers make separate concurrency decisions. As parallel tiers land, independent pools/helpers can oversubscribe cores, steal latency from mutators, inflate RSS, or create priority inversions even when each subsystem is locally correct.
Scope
- Inventory every engine-created thread/helper/pool, its ownership, lifecycle, blocking behavior, memory/scratch, affinity, priority, and participation in GC/JIT teardown.
- Add a per-VM/process resource coordinator with configurable and automatically bounded CPU slots, compilation queue, GC helper count, worker admission, scratch/memory pressure, and shutdown.
- Prioritize mutator progress, foreground latency, termination/debugger work, GC safety, and bounded memory over speculative compilation.
- Prevent GC/JIT/Wasm helpers from deadlocking or starving when JavaScript threads block in Lock/Condition/Atomics.wait, host callbacks, join, or module loading.
- Apply backpressure/cancellation to stale compilation and queued internal work with exact ownership and no partially published artifact.
- Expose embedder controls and machine-readable scheduling decisions without making host thread handles cross-affine.
- Benchmark dedicated and oversubscribed hosts, small/large core counts, mixed subsystems, and memory pressure.
No-workaround rules
- No hardcoded benchmark core count, sleep/yield loop, hidden GIL, unbounded pool/queue, OS-priority abuse, dropped task, canceled required GC, or throughput result that silently starves latency work.
Acceptance
- A machine-readable thread/resource inventory has zero unclassified engine-created concurrency. Completed by #983, #984, and #985; the fail-closed audit reports 6 production call sites across 6 resource classes and 143 reviewed test-only direct spawns.
- Deterministic scheduler-pressure tests cover GC, compilation, Workers/Threads, Atomics/waits, modules, termination, OOM, and teardown.
- #461/#492 show bounded queues/threads/RSS, stable tail latency, and no throughput collapse under oversubscription.
- Single-thread/small-core workloads do not pay material coordination overhead.
- No-GIL, TSan, lifecycle/mid-GC fuzz, artifact lifetime, and Wasm threads gates pass.
Foundation
Current pooling/scheduler guidance lives in docs/threads/production-readiness.md and docs/threads/limits.md; subsystem work is tracked by #476/#481/#482/#490.