ReviewOS

zig-utils/zig-gc

Add post-commit relocation verification hooks

#36
Open chris opened this 8 days ago ·
8 days ago

Expose an optional, allocation-free post-commit verification pair so embedders can prove that audited roots and live-cell edges no longer contain any old payload address while the forwarding plan is still available.

Scope

  • Add paired verifyRelocationRoots / verifyRelocationCell hooks.
  • Invoke them only after every relocation commit and index/publication repair, before forwarding scratch is released.
  • Iterate the current live graph (new payloads for moved cells, original payloads for pinned cells).
  • Require both hooks or neither at compile time.
  • Add a generic test that observes the post-commit destination graph and rejects stale old pointers.
  • Document that verification is infallible/allocation-free and may trap on invariant failure.
8 days ago

Implemented and pushed to main in 5883b02. The optional roots/cell verification pair is compile-time all-or-nothing and runs after every relocation commit/index/publication update while forwarding records remain live. The generic compaction test proves current roots, moved cells, pinned cells, strong edges, and weak edges contain no old payloads. Local Debug, ReleaseSafe, and TSan suites pass. Keeping open until GitHub Actions validates the descendant commit.

Sign in to comment on this issue.