ReviewOS

zig-utils/zig-js

GC relocation: complete Function cell root coverage

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

Parent: #335 Roadmap: #144, #134

The relocation audit found Function fields that carry live heap references but were absent from the marker: realm_global, arrow_new_target, this_cell.value, and the captured with_stack. Moving GC cannot safely copy or rewrite Function cells until marking and relocation share complete field coverage.

Acceptance:

  • Trace closure, realm global, home/super/object links, import.meta, arrow this/new.target, derived-constructor this cell, and captured with objects.
  • Relocation rewrites the same fields.
  • Prove every edge independently with focused tests.
  • Rescan old Function cells during minor collection because this_cell.value is initialized by super().
  • Focused normal and TSan runs report zero failures and leaks.
  • Update #335/#333 without enabling broader movement.
9 days ago

Implemented and pushed in 8265aa93.

Delivered:

  • marking now covers realm_global, arrow_new_target, this_cell.value, and every captured with_stack object in addition to the existing Function edges;
  • relocateFunction rewrites the exact same complete field set through the shared zig-gc forwarding plan;
  • old Function cells are now rescanned during minor collection because super() mutates the shared derived-constructor this_cell.value after publication;
  • an exact regression assigns every field a distinct managed target and proves both reachability and rewriting;
  • relocation design documentation records the completed slice while production movement stays disabled.

Local gates:

  • filtered normal: 3/3 passed, 0 failed, 0 leaked;
  • filtered TSan: 3/3 passed, 0 failed, 0 leaked;
  • relocation inventory: 9 cell kinds, 26 pointer surfaces, 21 boundary tags; movement disabled.

Keeping this open only for a descendant full GitHub Actions matrix.

9 days ago

Completed and accepted. The implementation-specific local evidence is recorded above, and descendant full CI at https://github.com/zig-utils/zig-js/actions/runs/29716788619 completed with 42 successful jobs, one intentional nightly skip, zero failures, and zero cancellations.

Sign in to comment on this issue.