Repository navigation
Description
Parent: #502
Related: #481, #480
Depends on: #983, #984
Goal
Coordinate the CPU cost of the existing synchronous JIT and WebAssembly compilers across typed engine threads and embedder host threads without introducing an asynchronous artifact queue that has no measured justification.
Current boundary
Baseline and optimizer compilation claim, compile, adopt, and publish synchronously at VM chunk entry. Stale optimizer generations and owner invalidation already reject publication. Wasm decode, validation, and compilation are likewise synchronous. Compilation requested by a typed JavaScript Thread already runs inside its runnable slot; compilation requested by an untyped embedder thread is outside scheduler accounting.
#481 permits background compilation only if measurement justifies it and artifact claims, teardown, no-GIL readers, W^X, memory pressure, and deterministic tests stay exact. Moving today's compiler async before that evidence would add a queue and cancellation lifetime with no existing queued work to manage.
Scope
- Add an owned compile-pressure benchmark with JIT-off execution controls and 1/2/4/host-width independent Context lanes. Measure cold/warm wall time, compile wall/CPU attribution, publications/rejections, configured stacks, scheduler wait, and peak RSS from a clean revision.
- Add process-wide internal-work classes for native JIT compilation and Wasm compilation.
- A typed runtime thread enters internal work without consuming a second CPU slot. An untyped host compiler registers against the scheduler's reserved host lane; concurrent host compilers beyond that reservation join the bounded background priority queue.
- Extend coherent telemetry with active/peak internal work, reserved-host-lane use, queued work, waits, starts, completions, and cancellations/rejections. The total-capacity invariant must include typed runnable threads and registered host work.
- Wrap the two production VM tier compilers and the production Wasm module compile boundary. Keep claim/compile/publication synchronous and preserve the exact owner/tier generation checks.
- Teardown/invalidation continues waiting for active synchronous claims; there is no stale queued artifact and therefore no synthetic cancellation path.
- Add deterministic normal/TSan tests for nested typed compilation, reserved host work, excess-host queueing, invalidation during compile, and teardown.
- Publish dated raw/report evidence only from a clean tracked revision after the runner and schema land separately.
Non-goals
Asynchronous/background compilation, speculative compiler helpers, changing tier thresholds, OS priority/affinity, and compile-result caching. Any later async queue belongs to #481 and must use the evidence from this issue.
Acceptance
- Concurrent host compilation cannot make total accounted CPU work exceed detected or explicit scheduler capacity.
- Typed compilation never double-counts its requesting runnable thread.
- No thread waits for capacity while holding an artifact-owner lock; stale claims still cannot publish.
- JIT-off controls separate Context/execution scaling from compile cost.
- Forced-off/forced-on tier differentials, artifact lifetime, focused normal/TSan, full units, threadfuzz, and docs/audits pass.
- Dated evidence states whether asynchronous compilation is justified; no queue is added if the data does not support it.
Activity
bench(runtime): measure synchronous compiler pressure (#985)
chrisbbreuer commentedon Sep 23, 2026
Runner/schema foundation landed in
52b6bdee.The new ReleaseFast runner uses a pinned 64-function numeric fixture and records cold/warm wall time, process CPU/RSS, baseline and optimizer timing, publications/failures, generated bytes, and deterministic checksums. Its
jit_offcontrol forces required bytecode.Validation covered JIT-on and JIT-off at 1, 2, 4, and the 11-logical-CPU host width (16 phase rows). JIT-on published exactly 64 baseline artifacts per lane; JIT-off published zero native artifacts. This is runner-only: no production scheduler or compiler behavior changed yet.
Next I am landing the raw/report collector and validator separately, then measuring the clean baseline before changing admission.
tools(runtime): validate compiler pressure evidence (#985)
tools(runtime): require clean benchmark dependencies (#985)
fix(runtime): normalize compiler pressure scaling (#985)
bench(runtime): publish compiler pressure baseline (#985)
chrisbbreuer commentedon Sep 23, 2026
The clean pre-admission baseline is published in
76768e28:Evidence:
docs/.data/compiler-pressure-2026-09-22.jsondocs/.data/compiler-pressure-2026-09-22.mdThe runner, collector, raw evidence, 51-page docs build, and manifest check all pass. I am now implementing synchronous internal-work admission without changing the existing claim/publication lifetime.
feat(runtime): coordinate synchronous compiler work (#985)
chrisbbreuer commentedon Sep 23, 2026
Pushed the synchronous compiler coordination implementation in 04e6477.
Native JIT and WebAssembly compilation now enter the process-wide runtime CPU coordinator without changing their synchronous claim/publication lifetimes. Typed engine threads reuse their runnable slot. Untyped host callers use one automatic reserved lane, then join the allocation-free background queue for general capacity. Schema-v7 telemetry records requests, starts, completions, active/peak work, admission source, wait counts/time, and reserved/general occupancy.
Validation:
The test262 corpus checkout is unavailable in this worktree, so no conformance flip count is claimed. Next I am adding the new admission telemetry to the benchmark output and publishing the post-change comparison.
bench(runtime): record compiler admission pressure (#985)
fix(tools): clarify compiler pressure report (#985)
bench(runtime): publish coordinated compiler pressure (#985)
bench(runtime): complete compiler pressure decision (#985)
bench(runtime): finalize compiler pressure evidence (#985)
chrisbbreuer commentedon Sep 23, 2026
Completed and pushed to main.
Implementation and evidence:
Results:
Validation:
The integrated TSan-only failure for the pre-existing deep-source RangeError witness is byte-for-byte reproducible on the exact parent and reports no race. It is tracked separately as #986 rather than hidden or attributed to this change.
Closing #985 as complete.
fix(ci): classify new repository tooling dependencies (#987)