Parent: #531 Discovered while attributing: #532 Related: #501, #496, #493, #461
Problem
The shared-realm transition-publication benchmark still loses throughput beyond two lanes after Shape and ordinary-property lock work. A three-second sample of an amplified eight-lane run shows the dominant scheduled-yield stack in Interpreter.debugStatementLocation: the per-Interpreter 64-entry direct-mapped cache repeatedly aliases hot AST statement nodes, falls back to the Context-wide mutable location registry, and contends on DebugRegistryLock even though no debugger, host statement hook, or profiler hook is installed.
This is engine debugger/source-location state, not a JavaScript program race and not ordinary Object synchronization. Concurrent dynamic source/eval registration still mutates the Context registry, so removing its lock is not valid.
Scope
- Add opt-in attribution for statement-location cache hits/misses plus debug-registry lock acquisitions, contention, and spins; normal execution must not pay atomic-counter overhead.
- Freeze the existing #531 base/variant/contended source, jobs, timing boundary, and checksums as the end-to-end witness.
- Replace pathological direct mapping with a bounded collision-resistant or set-associative Interpreter-local lookup that preserves exact node/location identity.
- Keep registry mutation synchronized and reentrant for concurrent dynamic evaluation and inspector callbacks.
- Preserve statement hooks, debugger statements, script IDs/URLs/start lines, stack locations, inspector resolution, safepoints, Context teardown, and OOM atomicity.
No-workaround rules
- Do not omit statement-location metadata, skip
serviceDebugStatement, disable hooks/safepoints, precompute benchmark nodes, recognize source/workload names, globally intern attacker-controlled source, or make the registry append without a safe publication design. - Do not modify stacks, queues, jobs, Worker lifecycle, or the user-owned #474/#482/#502 work.
Acceptance
- Attribution lands before the cache change and exactly reports configuration/warmup/invocation deltas.
- Base and anti-specialization rows show materially fewer registry acquisitions/contentions at 1/2/4/8 lanes; contended Shape behavior remains visible and unchanged.
- Cache storage is fixed and bounded per Interpreter, with adversarial collision/eviction coverage and no attacker-controlled unbounded retention.
- Concurrent dynamic eval/source publication, nested inspector reentrancy, exact statement hooks/locations, stack traces, and allocation failure pass.
- Suppression-free TSan, no-GIL focused witnesses, threadfuzz, full units, and affected debugger/source-location test262 pass.
- Exact-parent evidence reports wall/CPU/instructions, debug-lock work, allocation, GC, and RSS without treating profiler timings as scored evidence.