ReviewOS

zig-utils/zig-gc

Heap: expose cumulative minor-generation accounting

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

Downstream: zig-utils/zig-js#365 Related: #37

The generation benchmark must compare complete workloads even when automatic or cooperative safepoints perform multiple minor collections. The existing last_minor_* fields are exact for one cycle but cannot reconstruct cumulative survival, reclamation, and promotion across a run.

Acceptance:

  • Accumulate young-input, survived, reclaimed, and promoted bytes across successful minor collections.
  • Expose the totals through the race-safe Heap.accounting() snapshot.
  • Keep full collection and nursery enable/disable semantics explicit; totals remain historical counters rather than live-state gauges.
  • Add deterministic multi-cycle tests and document the telemetry.
  • Integrate the counters into zig-js #365 benchmark rows.
9 days ago

Implemented on main in 7be845a: accounting now exposes historical minor young-input, survived, reclaimed, and promoted bytes with deterministic multi-cycle conservation checks and documentation. Debug and ReleaseSafe passed locally; GitHub Actions run 29718590639 passed both unit and 20-iteration Linux TSan jobs. Downstream zig-js #365 consumes these counters in b5318119.

Sign in to comment on this issue.