ReviewOS

zig-utils/zig-js

ABI: implement retained exception SourceProvider lifecycle

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

Parent: #163 Related: #250 Roadmap: #134

The final genuine Home private-JSC import, JSC__SourceProvider__deref, now participates in zig-js's retained exception/debug-source ownership rather than acting as an inert compatibility symbol.

Acceptance

  • Define a typed opaque SourceProvider handle and exact retain/release contract tied to a live VM source.
  • Retain and replace providers correctly during first-phase exception projection.
  • Implement consuming dereference with explicit null/foreign/stale/wrong-VM preconditions.
  • Use and release the provider exactly once across deferred source collection, replacement, exception destruction, GC relocation, and VM teardown.
  • Cover repeated/deferred/skipped collection, replacement, sibling realms, relocation, and teardown.
  • Add an independently compiled Home fixture plus Debug, ReleaseSafe, and TSan evidence.
  • Pin the semantic contract and reach Home 447/447 with zero pending/unclassified entries.
  • Reconcile exact main CI and close #163.

Completed by ba2afece and e3fdc523; exact-main run 29806223245 passed 43/43 jobs.

9 days ago

Implemented in ba2afece and documented in e3fdc523.

Pinned/verified result:

  • Home inventory: 447/447 private symbols implemented, zero pending/unclassified
  • intrusive provider owns a copied debug-script source independently of the VM heap
  • projected static BunStrings borrow that provider across precise GC and terminal VM teardown
  • repeated collection releases/replaces the prior provider and restores collection capacity
  • final release is atomic and covered from a different thread; null release is inert
  • invalid, foreign, stale, or repeated non-null raw pointers retain the pinned upstream caller-UB precondition
  • full fixture: Debug 392/392, ReleaseSafe 392/392, TSan 392/392 with no sanitizer report
  • audits: Home 447/447 and public C API 117/117

The exact source hashes and semantics are checked by docs/abi/source-provider-lifecycle-424.json. Exact descendant main reconciliation is run 29806223245.

9 days ago

Closed against exact main commit e3fdc52385204c75fe6ae5c64d48dae6e5ede418: Actions run 29806223245 completed successfully with all 43 jobs terminal and no failures.

Sign in to comment on this issue.