ReviewOS

zig-utils/zig-js

ABI: implement stable script execution context identifiers

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

Parent: #134 Related: #140, #163, #164

Goal

Implement the shared pinned ScriptExecutionContextIdentifier__forGlobalObject boundary with stable process-unique identifiers.

Acceptance

  • Return one stable nonzero 32-bit identifier per live global context.
  • Keep sibling realms distinct even when they share one VM, and keep repeated reads identical.
  • Allocate identifiers race-free across parallel independent context creation without reusing live IDs.
  • Return zero for a null context handle and leave VM pending-exception state unchanged on valid reads.
  • Add focused stability/sibling/parallel coverage and a compile-link-runtime fixture call.
  • Refresh Home/Bun inventories with zero unclassified symbols.
  • Update README and compatibility docs, publish small implementation/docs commits on origin/main, and close only after evidence is live.
9 days ago

Implemented and published in two direct main commits:

  • 0c349ddf — lazy atomic nonzero context IDs, stable repeated reads, distinct sibling-realm IDs, parallel independent allocation, null handling, pending-state preservation, fixture linkage, and refreshed inventories
  • 096e2721 — README and compatibility evidence/count refresh

Verification:

  • focused context-identifier matrix: 3/3 passed, 0 leaked
  • eight parallel independent context lifecycles produced distinct stable IDs
  • Home fixture: 226/226 symbols linked and runtime matrix passed
  • Home inventory: 227/431 implemented, 204 pending
  • Bun core inventory: 221/421 implemented, 200 pending
  • public/private audit: 117 public, 19 extensions, 231 private/support exports
  • zero unclassified inventory entries

The benchmark artifact remains 36a617b3: identifier allocation is an ABI lifecycle path and does not change measured execution performance.

Sign in to comment on this issue.