ReviewOS

zig-utils/zig-js

ABI: implement exact custom inspect invocation boundary

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

Parents: #140, #163, #164 Pinned reference: Bun 4982b91e src/jsc/bindings/UtilInspect.cpp; Home 7ed99c02 ConsoleObject.zig

Implement the shared JSC__JSValue__callCustomInspectFunction private export as a real user-code call boundary, not a formatter shortcut.

Acceptance:

  • Decode and validate the function and this values in the supplied realm/VM.
  • Create the pinned inspect options object with stable stylize, depth, and colors properties.
  • Supply a callable recursive inspect helper as the third argument.
  • Invoke the custom function with exact this and (depth, options, inspect) arguments.
  • Publish thrown values/OOM through the VM-shared pending-exception channel and return the empty ABI sentinel.
  • Root all values across the user-code call and cover GC-triggering callbacks.
  • Add compiled consumer and Zig regressions for arguments, this, color/no-color stylize behavior, recursion, thrown values, cross-VM rejection, and GC safety.
  • Regenerate both pinned inventories and update #140/#163/#164 totals with zero unclassified entries.
9 days ago

Implemented and pushed to main as f095db7. The boundary validates callable/receiver VM ownership, constructs realm-native stylize, depth, and colors options in pinned order, passes callable inspect as the third argument, invokes with exact this and (depth, options, inspect), preserves first pending exceptions, and explicitly roots construction plus callback values across GC. Focused matrix passed 3/3 with no leaks; both ABI audits passed; the independent 324-symbol consumer compiled/linked and exercised this call before its later bounded watchdog section. Inventories are Home 320 implemented / 111 pending and Bun 311 / 110. Full CI: https://github.com/zig-utils/zig-js/actions/runs/29700271582 (queued); closure waits for green.

9 days ago

The first matrix for f095db7 failed for infrastructure only: Pantry timed out downloading Zig, reported setup complete, then jobs failed with zig: command not found. I cancelled the doomed attempt after 14 identical failures; a single unit-shard retry then installed Zig successfully and passed in 2m06s. The fresh matrix on descendant 6d2af84 will provide the terminal validation for #322: https://github.com/zig-utils/zig-js/actions/runs/29700993746

9 days ago

Accepted by descendant CI run 29703497726: 39 jobs passed, with only the intentional nightly skip. The exact custom-inspect invocation boundary, independent fixture coverage, and full sanitizer/fuzz matrix are green.

Sign in to comment on this issue.