ReviewOS

zig-utils/zig-js

GC relocation: rewrite WebAssembly-owned JavaScript roots

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

Parent: #345 Depends on: #347 Roadmap: #335, #144, #134

The current Wasm trace callbacks pass Values by copy, so add an explicit mutating relocation ABI and implement it across every native owner.

Acceptance:

  • Add paired trace/relocate callbacks for WasmGcRef aggregates and instance-owned root storage.
  • Rewrite instance imports/globals/tables, wrapper rare-state owner objects, exception payloads/wrappers, externref/hostref slots, and nested GC aggregates.
  • Rewrite atomic table/global reference Values at the world-stopped boundary.
  • Preserve funcref/native/i31/numeric payloads and native owner identities.
  • Cyclic aggregate, nested exception, instance-root, focused TSan, and leak gates pass.
  • Production movement remains disabled and #345/#335 are updated.
9 days ago

Implemented and pushed in 15822c94.

Delivered:

  • added explicit by-pointer relocation callbacks beside WasmGcRef and instance trace callbacks;
  • rewrites Object Wasm rare-state module/import/export/owner links, atomic global/table Values, execution stack/local roots, exception payloads/externrefs/wrappers/JS exceptions, instance-owned hidden roots, and nested GC aggregates;
  • cyclic aggregate traversal remains iterative and cycle-safe;
  • numeric/vector/funcref/i31/native-owner and aggregate identities remain unchanged;
  • audit repaired WasmException wrapper/js_exception/externref marker coverage.

Local gates:

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

Production movement remains disabled. Keeping this open only for descendant full GitHub Actions evidence.

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.