ReviewOS

zig-utils/zig-js

GC relocation: publish fragmentation, stress, and terminal compatibility evidence

#337
Closed chris opened this 9 days ago ·
9 days ago

Parent: #144 Depends on: #333, #334, #335, #336 Related: #97, #145, #147 Roadmap: #134

Own the terminal evidence needed to declare moving/compacting collection production-ready.

Scope

  • Add deterministic fragmentation and compaction-effectiveness benchmarks with committed raw samples.
  • Stress repeated relocation during allocation churn, weak/finalization activity, host reentry, module/Promise/timer work, Wasm execution, and shared-realm mutation.
  • Fault-inject every relocation planning/allocation boundary and verify bounded recovery.
  • Run long lifecycle, leak, ReleaseSafe, no-GIL, sanitizer, and TSan matrices on every declared supported host/architecture.
  • Publish an exact compatibility matrix, reproduction commands, and explicit unsupported boundaries.
  • Update the concise README only with accepted, reproducible headline results.

Acceptance

  • Fragmentation and retained backing bytes materially improve without throughput/memory regressions outside stated bounds.
  • All relocation stress seeds, fault points, lifecycle/leak gates, and suppression-free TSan jobs pass.
  • Normal, JIT, C/Objective-C/private ABI, inspector, Worker/Thread, Promise/module/timer, and Wasm suites pass with movement enabled.
  • Raw benchmark evidence and machine-readable compatibility results are committed.
  • #144 and the corresponding #134/#147 gates can close from this evidence.
9 days ago

Evidence contribution from #352 / 5243acf: deterministic integration coverage now proves useful heap compaction rather than address churn—mixed pinned/moved cells, reduced backing chunk count and capacity, unchanged live slots/accounting, an immediate dense no_candidates fixed point, and unchanged heap/backing/verifier state under forced scratch OOM. Focused Debug, ReleaseSafe, and TSan: 3/3, zero leaks; relocation inventory audit green.

9 days ago

#353 is complete on main in 9f296900 and 06e27470. The committed clean evidence contains 14 raw alternating samples: explicit compaction reduced retained backing and chunks by 90.8% (8.81 → 0.81 MiB; 141 → 13), preserved 6,559 live slots and the exact checksum, moved 4,097 cells / 524,416 bytes per run, reached immediate no_candidates, cost 0.99 ms median, and kept post-action probe throughput at 1.00x control. README and benchmark documentation now link the reproducible report and TSV.

9 days ago

Terminal evidence gained an exact public metric boundary in #356 / b50bbd7e: embedders can distinguish unsupported, already-dense, planning-OOM, and compacted results and receive exact moved cells/bytes. Tests cover zero outputs for every non-moving result and nonzero totals for useful movement; the Objective-C witness now uses deterministic fragmentation rather than address churn.

9 days ago

Terminal compatibility evidence from #357 / 3e38a5ac: the public Zig API now has an opaque stable-handle lifetime boundary, with a deterministic useful-movement witness proving fixed handle address, changed payload address, intact post-move semantics, dense fixed point, foreign release rejection, and zero leaks under Debug/ReleaseSafe/TSan.

9 days ago

Terminal evidence advanced via #359 / ca92af0: the suite now performs useful relocation during a live compiled numeric loop, not merely between evaluations. It proves pending-request semantics at a marking-precise but movement-unsafe checkpoint, active Function/Object/protected-root relocation, exact native resumption/result, stable immutable tier identity, reduced backing, and dense fixed point. Debug, ReleaseSafe, TSan, C/Objective-C hosts/audits, inventory, and release-matrix validation are green.

9 days ago

Embedding evidence advanced via #360 / 7b82cf9: a real C callback now schedules rather than performs movement, retains its argument through counted protection, and observes the underlying payload move during the subsequent warmed native tier while wrapper identity/property semantics survive. Debug/ReleaseSafe/TSan each pass 8/8 with zero leaks; C/C++/Objective-C hosts and all inventories are green.

9 days ago

Concurrency and boundary evidence is now complete through #361 / 373181a: a real parked no-GIL JavaScript peer keeps a scheduled compaction pending across warmed baseline checkpoints; after join, the unchanged request performs useful relocation and reaches an immediate dense fixed point. Debug, ReleaseSafe, and suppression-free TSan each pass the full 9/9 compaction slice with zero leaks. #336 is closed; #337 now owns only terminal descendant-matrix and compatibility evidence.

9 days ago

Terminal evidence is accepted. The committed fragmentation benchmark reports 90.8% less retained backing (8.81 → 0.81 MiB), a 0.99 ms median explicit pause, and 1.00x post-action throughput; relocation inventory/release checks, focused Debug/ReleaseSafe/TSan stress, weak/native/Wasm boundaries, fault paths, scheduled C API/JIT safepoints, and no-GIL deferral are covered. Descendant full CI completed with 42 successes, one intentional nightly skip, and zero failures/cancellations: https://github.com/zig-utils/zig-js/actions/runs/29716788619.

Sign in to comment on this issue.