ReviewOS

zig-utils/zig-js

GC generations: add multi-age survivor and card-table core

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

Parent: #145 Dependency: zig-utils/zig-gc#37 Related: #1, #97, #144

Replace the one-cycle nursery policy with the first measurable multi-age generation core.

Scope

  • Land configurable survivor aging and persistent old-to-young cards in zig-gc.
  • Select and document an explicit zig-js tenuring age.
  • Preserve strong, weak, finalization, handle, host, and side-cell roots across repeated minor collections.
  • Expose exact generation telemetry for later tuning and benchmark evidence.
  • Keep collection at existing safe boundaries in this slice; parallel mid-script coordination remains a later child.

Acceptance

  • Live young cells survive multiple minor collections and promote exactly at policy age.
  • Dead young cells are reclaimed at every age.
  • Old-to-young strong and weak edges remain sound without repeated stores.
  • Full collection and disabling the nursery leave no stranded young generation.
  • Debug, ReleaseSafe, suppression-free TSan, leak, and inventory gates are green.
9 days ago

Implemented across zig-gc 1ccf87d and zig-js 06e334d2 / d1acf185, now on both repositories’ main branches. The runtime selects a three-minor survivor policy, preserves persistent old-to-young remembered owners, exposes distinct survivor/promotion/reclamation telemetry, and profiles those metrics correctly. Focused nursery coverage passed 8/8 with zero leaks in Debug, ReleaseSafe, and TSan; compaction Debug passed 5/5; relocation-inventory and release-compatibility checks passed.

Sign in to comment on this issue.