ReviewOS

zig-utils/zig-js

ABI: implement exact Yarr RegularExpression boundary

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

Parent: #134 Profiles: #163, #164 Dependencies completed: zig-utils/zig-regex#11, zig-utils/zig-regex#12

Implement the six native Yarr__RegularExpression__* imports used by the pinned Home/Bun JavaScriptCore corpus:

  • init
  • deinit
  • isValid
  • matchedLength
  • matches
  • searchRev

Acceptance criteria:

  • Match the real C++/Rust executable ABI, including the two-argument searchRev(RegularExpression*, BunString) signature; document that the checked-in Zig declaration is stale.
  • Compile BunString patterns through zig-regex with JavaScript-compatible ignore-case, multiline, dot-all, Unicode, UnicodeSets, and sticky behavior where applicable.
  • Preserve valid/invalid compiled state and JavaScriptCore last-match-length behavior, including reset to -1 after a failed match.
  • Return UTF-16 code-unit positions and lengths, including astral and lone-surrogate input.
  • Match JavaScriptCore reverse-search behavior for overlap, empty matches, and subset matches.
  • Keep allocation, null-input, and object lifetime behavior deterministic at the native boundary.
  • Add focused ABI tests plus a linked consumer fixture for all six imports.
  • Refresh both private-import inventories, the implementation matrix, README status, and parent tracking issues with exact evidence.

Backward compatibility is intentionally out of scope while zig-js is pre-release and unused.

Implementation: bc4b9e32 Documentation/inventories: ff6d8730 zig-regex prerequisites: fd4927c, 86159c5

9 days ago

Completed on origin/main.

Evidence:

  • focused Yarr test: 3/3 selected harness tests passed, 0 leaked;
  • compile-link-runtime fixture: 184/184 symbols linked and runtime matrix passed;
  • Home audit: 185/431 implemented, 246 pending;
  • Bun audit: 179/421 implemented, 242 pending;
  • public audit: 117/117 public, 19 extensions, 189 private/support exports;
  • batched build/audit gate: 12/12 steps succeeded.

The README retains the current July 17 isolated 1,540-sample JSC benchmark report unchanged because this ABI-only slice does not alter or rerun benchmarked engine paths.

Sign in to comment on this issue.