Parent: #473
Measured problem
After #1008, the frozen representative_json invocation allocates 1,001,001 GC cells. Its unpublished JSON.parse containers still take one allocator-slab lock and one publication lock per object or array. Exact current-main attribution recorded 4,954,046 cell-slab lock acquisitions, including 1,001,001 single-allocation and 1,001,001 publication acquisitions.
The existing Interpreter.gc_object_reserve is traced, relocated, and already fed through gc.allocObjectBatch for sustained VM allocation. JSON.parse can use the same rooted reserve because each container remains private until the parse succeeds.
Executed ReleaseFast/real-GC adaptive prototype against pushed #1008:
- total invocation cells remain exactly 1,001,001;
- base slab-lock acquisitions fall 4,954,046 -> 3,114,143 (-37.1%);
- variant slab-lock acquisitions fall 4,548,530 -> 3,110,056 (-31.6%);
- single-allocation acquisitions fall 1,001,001 -> 407,017;
- publication acquisitions fall 1,001,001 -> 444,141;
- 37,124 bounded 16-cell batch acquisitions replace the removed per-cell traffic.
The policy is adaptive: the first 16 private containers in each interpreter invocation retain exact one-cell allocation, and only sustained demand fills a 16-cell rooted reserve. A real-GC unit proves both the cold and sustained thresholds.
Three alternating exact-parent pairs, exact checksums and thermal state 0 throughout:
representative_json: 0.993529x retired instructions;representative_json_variant: 0.989040x;representative_json_reviver_source: 0.985153x;- escaped-string control: 0.997527x;
- depth-4096 stringify control: 0.994145x;
- shallow-4096 stringify control: 0.999669x.
Scope
- Route only JSON.parse's unpublished object/array construction through a sustained private allocation helper.
- Preserve arena/no-GC mode as one exact allocation per container.
- Reuse the existing traced and relocated interpreter object reserve; do not add a second root mechanism.
- Preserve parse atomicity, prototypes, array flags, OOM behavior, moving-GC safety, no-GIL isolation, and all observable allocation semantics.
Acceptance
- Seven alternating exact-parent pairs retain the parse gains with exact checksums and neutral controls.
- Cold first-16 and sustained 17th-container behavior is pinned under real GC.
- JSON test262 is 165/165 and the same files agree in required-VM mode.
- Real-GC JSON/OOM and 50,000-level deep-input probes pass.
- Moving-GC/root relocation coverage and no-GIL JSON.parse TSan witnesses pass.
- Commit lands directly on
mainwith evidence linked here and in #473.