ReviewOS

zig-utils/zig-js

GC relocation: preserve Object weak, finalization, native, and Wasm semantics

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

Parent: #335 Depends on: #344 Roadmap: #144, #134

Finish Object relocation at the semantic boundaries that cannot be treated as ordinary strong edges.

Acceptance:

  • Rewrite surviving WeakRef, WeakMap/WeakSet, ephemeron, unregister-token, and FinalizationRegistry references in the correct order around weak processing.
  • Rewrite native-private registered roots and C/Home/Bun callback-owned containers through explicit relocation hooks.
  • Rewrite WebAssembly externref/hostref/global/table/exception/gc-ref roots or pin the native owner with a checked invariant.
  • Preserve exactly-once finalization and external-owner release.
  • Repeated-move, dead-weak, cleanup-order, focused TSan, and leak gates pass.
  • Production movement remains disabled and #335 is updated.
9 days ago

Internal weak/finalization ordering is complete via #346 in 88dae824. Dead targets are nulled before forwarding; every surviving weak/ephemeron/finalization slot rewrites, and old-address weak indexes are invalidated. Native-private and Wasm callback boundaries remain.

9 days ago

Native-private payload rewriting is complete via #347 in 6c8ba4a2, including a repaired Promise.finally constructor marker edge. The only remaining child boundary is Wasm-owned mutable root storage.

9 days ago

All three boundary children are now implemented: internal weak/finalization ordering (#346), native-private payload hooks (#347), and Wasm-owned roots (#348). Latest implementation is 15822c94; every focused normal/TSan gate is green with zero leaks. Keeping #345 open only for a descendant full 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.