Parent: #44 Successor to: #52 Related: #47, #49, #132, #146
The baseline array profile attributed 65.3% of collapsed leaves to runChunk, followed by dense storage movement, bound calculation, Value conversion, append, and prototype validation.
Evidence: https://github.com/zig-utils/zig-js/blob/main/docs/.data/baseline-jit-profile-2026-07-16.md
Goal
Lower verified packed-array regions or enter exact runtime kernels from native code while preserving observable Array/prototype semantics.
Acceptance
- Complete existing-index, growth, append/reallocation, length, hole, extensibility, prototype, and concurrent-mutation guards.
- Preserve canonical accessors, proxy/prototype hooks, sparse arrays, restrictions, OOM, GC barriers, exceptions, termination, and exact checkpoints.
- Differential-test append, indexed read/write, growth/reallocation, invalidation, shared mutation, and moving GC.
- Resolve optimizer-vs-VM-kernel tier arbitration from exact-parent measurements.
- Publish a material residual-dispatch reduction without moving work into repeated guards/callbacks.
- Pass focused JIT, full unit, no-GIL, and suppression-free TSan gates.
Children
- #448 — guarded packed existing-index reads/writes in deterministic and loop regions.
- #449 — packed growth, append/reallocation, and measured tier arbitration.
- #453 — targeted residual-dispatch attribution and broad completion evidence.
Result
Packed existing-index reads/writes, exact-end assignment, literal append, zero/variadic spare-capacity push, and rooted reallocating push now execute through guarded optimizer paths. Canonical callbacks remain for observable/shared/special cases. Reserve-before-publication makes growth OOM failure-atomic; precise scratch roots survive moving GC.
The exact-parent focused A/B keeps 19,564 spare-capacity appends direct and moves all 14 measured reallocations from general dispatch to the narrow rooted callback. The separate published-workload profile confirms VM packed kernels still win before optimizer OSR, so accepted README scores remain unchanged.
Final evidence in #453 passes 1,409/1,409 unit tests across four shards, 3/3 relevant no-GIL corpus cases normally and under suppression-free TSan, all benchmark publication harnesses, and the 6/12 release matrix with private ABI pending 0. The remaining release gates are unrelated #146/#134 work.