ReviewOS

zig-utils/zig-js

ABI: define and implement versioned Bun and Home private-JSC profiles

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

Parent: #134 Depends on: #135 Public JavaScriptCore C-API compatibility remains separate from these private shims.

This issue replaces vague private-ABI claims with exact, auditable Home and Bun compatibility profiles.

Acceptance

  • Inventory concrete Home and Bun revisions and every required symbol, layout, calling convention, provider, and semantic assumption.
  • Implement both complete profiles with generated symbol/layout/provider verification.
  • Reject unknown, mismatched, or drifted revisions explicitly.
  • Add independently compiled compile-link-runtime fixtures for each pinned consumer.
  • Keep public C-API compatibility separate from private ABI shims.
  • Reach zero missing and zero unclassified entries for every declared profile.
  • Run private fixtures in Debug, ReleaseSafe, and TSan and gate sanitizer propagation in CI (#423).

Declared profiles

  • #163 — Home 7ed99c02e50034f869d0db6d487115bb44332fe4: 447/447.
  • #164 — Bun 4982b91e3702094330f3be3883354c52b8c01323: 437/437.
  • #422 — consumer-owned provider classification and final-link audit.
  • #423 — complete private-fixture TSan propagation gate.
  • #424 — retained exception SourceProvider lifecycle.

All historical implementation children are closed. Exact main commit e3fdc52385204c75fe6ae5c64d48dae6e5ede418 passed all 43 Actions jobs.

9 days ago

Profile work is now structurally separated. #162 completed the pinned Home public-C consumer at 50/50 symbols (b5d131b, 8b329a2); it does not count toward private compatibility. Private Home and Bun implementations remain tracked by #163 and #164.

9 days ago

Home private inventory child #165 is complete (20228d6, 4ae1d42). The exact pinned source denominator is 448 unique externs: 432 genuine private entries still pending under #163, 15 public-C overlaps, and one platform import; zero duplicates/unclassified. This is inventory evidence only, not a private compatibility claim.

9 days ago

First real private implementation slice is complete: #166 added the exact JSC64 boundary, and #167 now exports 4/432 Home private symbols with runtime evidence. The pinned Home profile has 428 private entries remaining; public and private counts remain mechanically separate.

9 days ago

Bun core inventory #169 is complete: 437 src/jsc symbols, 422 private (4 implemented / 418 pending), 15 public overlap. Exact comparison proves the profiles differ: 3 Bun-only, 14 Home-only, and 28 changed signatures among 434 shared names.

9 days ago

Shared Home/Bun child #170 is complete. The exact JSC64 BigInt bridge adds three real context-owned cell shims and advances the pinned inventories to Home 7/432 and Bun core 7/422 without changing the 117 public functions or 19 extensions. Commits: 46ccb1f and 3c53b3e.

9 days ago

Shared equality child #171 is complete. Exact strict and SameValue shims advance Home to 9/432 and Bun core to 9/422, with semantic coverage for NaN, signed zero, strings, BigInts, object identity, sentinels, and foreign contexts. Public/extension counts remain 117/19. Commits: 9538d72 and f5e54f4.

9 days ago

Profile-selectable JSType child #172 is complete. The exact source inventories prove 97 Home tags versus 98 Bun tags, with one Bun-only insertion and 70 renumbered shared members. Both separately compiled profiles pass 2/2 signatures across 20 real cell kinds. Home advances to 11/432 and Bun core to 11/422; public/extension totals stay 117/19. Commits: 74d461f and 6a6657f.

9 days ago

Home revision-alias child #173 is complete. Current Home 38702f9e is accepted only through its own manifest after proving all 58 JSC source hashes and all 448 declarations unchanged from the immutable base; requesting that checkout under the older alias is rejected. Commits: 17e6532 and 7f9d2b5.

9 days ago

Shared BigInt-cell child #174 is complete. Five exact opaque-cell shims add arbitrary-precision i64/u64/f64 ordering and signed modulo extraction, advancing Home to 16/432 and Bun core to 16/422 with public/extension totals unchanged at 117/19. Commits: f18d0d7 and 0b81e97.

9 days ago

Shared JSCell/JSString child #175 is complete. Seven exact symbols add UTF-16/WTF-8 length, 8-bit eligibility, equality, object access, primitive boxing, and foreign-context rejection. Home advances to 23/432 and Bun core to 23/422; public/extension totals stay 117/19. Commits: 379ed5d and 70b2a2e.

9 days ago

Shared object-foundation child #176 is complete. Three exact symbols add fresh ordinary/null-prototype construction and exact Number/String/Boolean/BigInt wrapper unboxing. Home advances to 26/432 and Bun core to 26/422; public/extension totals remain 117/19. Commits: 06ec44c and 1c4f5ec.

9 days ago

Shared BigInt comparison/arithmetic child #177 is complete in aa3828f and 24626fb. Home is now 29/432 and Bun core 29/422; the profile parents remain open for their pending inventories.

9 days ago

Shared ToObject/prototype child #178 is complete in dacec16 and a2024aa. Home is now 31/432 and Bun core 31/422; both profile parents remain open for their pending inventories.

9 days ago

Shared numeric DateInstance child #179 is complete in 6bdec54 and f2e55b6. Home is now 33/432 and Bun core 33/422; parsing/timezone/ISO-buffer contracts remain pending separately.

9 days ago

Closed #253 on main through 657cbba8: Home 260/431, Bun 254/421, compiled consumer 259/259, both audits zero-unclassified.

9 days ago

Tracker synchronized through #255: contiguous-vector exports are complete on main; Home is 262/431, Bun is 256/421, the compiled fixture is 261/261, and both inventories remain zero-unclassified. #254 is linked and remains open for async Promise-chain stack reconstruction.

9 days ago

#254 is complete and the tracker is synchronized: pending-Promise async stack reconstruction covers async functions/generators, forwarding/hop bounds, realm limits, materialized stacks, GC handoff, and sibling realms. Current evidence is Home 263/431, Bun 257/421, fixture 262/262, zero unclassified.

9 days ago

Opened #256 for the next bounded private-ABI slice: validated MAP_PRIVATE shared-memfd import into exact ArrayBuffer/Uint8Array values with no-copy slice semantics and exactly-once full-region unmapping. Opaque native JSC::ArrayBuffer handles remain deliberately separate until their producer/lifetime contract is specified.

9 days ago

Completed #256 on main through ae61fd67 (runtime e0164ae9). Evidence: focused ownership/GC matrix green; compiled consumer 263/263; Home 264/431 with 167 pending; Bun 258/421 with 163 pending; both audits zero-unclassified; Bun-selected tags green. README/docs are current, while the 1,540-sample benchmark remains unchanged because this embedding-only path is outside the workload.

9 days ago

Opened #257 for the three opaque native ArrayBuffer exports plus their real bindgen producer. The pinned converter transfers RefPtr<JSC::ArrayBuffer>::leakRef() as an adopted +1, so completion requires an independent backing-store handle that can outlive its JS wrapper/VM—not a raw cell pointer or realm-retaining test adapter.

9 days ago

Opened #258 for the next executable private-ABI cluster: exact GetterSetter/CustomGetterSetter cells, their four null predicates, generated type checks, and non-indexed property traversal that returns descriptor cells without invoking ordinary getters.

9 days ago

Owned structured serialization child #323 landed in a40ec46 with focused 3/3 runtime coverage, both pinned ABI audits, exact ownership-token/free semantics, and portable SharedArrayBuffer flag handling. Full CI is still draining at https://github.com/zig-utils/zig-js/actions/runs/29698929044; the umbrella remains open.

9 days ago

Created #324 as the next bounded private-ABI ownership slice: the three external ZigString exports explicitly deferred by #199. It requires exact deferred callback/finalizer semantics, GC and teardown evidence, encoding/error/OOM coverage, a compiled consumer, and both inventory updates; symbol-only or eager-callback copies are excluded.

9 days ago

Custom-inspect child #322 is now on main in f095db7 with exact receiver/argument/options order, ANSI style mapping, callback exception handling, cross-VM rejection, and construction/callback GC roots. Home is 320/431 and Bun is 311/421 implemented. Full CI: https://github.com/zig-utils/zig-js/actions/runs/29700271582.

9 days ago

New follow-up #326 tracks deferring C-API class-instance finalizers outside collector locks. The hazard was found while integrating the generic post-sweep hook for #324; it is separated so external string ownership does not silently absorb a broader class-lifecycle change.

9 days ago

Private-profile progress update: #327 is implemented on main through eed1a550 with six TextCodec exports, pure-Zig deterministic fallback decoders, SHA-256-pinned generated tables, and independent consumer coverage. Home is now 329/431 private symbols implemented (102 pending); Bun core is 320/421 (101 pending); the Home fixture is 333/333. Descendant acceptance is running at https://github.com/zig-utils/zig-js/actions/runs/29703497726.

9 days ago

The current private-ABI descendant matrix is accepted: run 29703497726 completed 39/39 runnable jobs with one intentional nightly skip. #322 and #327 are closed. Work has moved to #329 for the 14 shared AbortSignal exports, with the Bun-only timer handle isolated in #330.

9 days ago

Closed #368 via 4be4789d / 01cfa77b: exact private property iteration is now shared across Home and Bun, with separate compiled consumer evidence. Current private progress is Home 352/471 (119 pending) and Bun 344/461 (117 pending), zero unclassified.

9 days ago

#369 landed in 07a3e398. The shared private profiles now stand at Home 356/471 (115 pending) and Bun 348/461 (113 pending), zero unclassified. Home 343/343 and the dedicated Bun fixture pass in Debug and ReleaseSafe.

9 days ago

#370 landed in 01b3aef3. The shared profiles now stand at Home 359/471 (112 pending) and Bun 351/461 (110 pending), zero unclassified; Home 346/346 and the Bun-profiled fixture pass in Debug and ReleaseSafe.

9 days ago

Child #371 is complete at 930f177b. The shared API-lock call/exception-cell and trap-free proxy-target boundary passes focused engine plus compiled Home/Bun fixtures in Debug and ReleaseSafe. Current profile totals: Home 361/471, Bun 353/461.

9 days ago

Child #372 is complete at 3e96dde2. Current profile totals are Home 362/471 and Bun 354/461; the shared Math.pow export/builtin path passes focused and compiled-consumer gates in Debug and ReleaseSafe.

9 days ago

Implemented the next private ABI slice in #373 / df79596: async-context frame capture, brand inquiry, and encoded-value call. The active realm context and wrapper edges are now traced and relocated, including callback-triggered GC and throw restoration. Debug/ReleaseSafe engine and compiled-consumer gates passed.

9 days ago

Shared private-ABI child #374 is complete in 172fea6. Ten DOMFormData symbols now have exact compiled Home/Bun consumer evidence, one branded engine representation, VM-scoped handles, current HTML string/Blob/File entry semantics, form-urlencoded codec behavior, opaque native BlobImpl round-trip, and forced-GC coverage. Debug and ReleaseSafe pass; Home is 375/471 implemented and Bun is 367/461, with zero unclassified entries.

9 days ago

Private-ABI child #378 is complete in 9c51dee. The exact 13-entry CommonStrings table is VM-stable across sibling realms, isolated across VMs, and exception-neutral. Home is now 376/471 implemented and Bun 368/461; Home 363/363 and the exact Bun fixture pass in Debug and ReleaseSafe.

9 days ago

FetchHeaders umbrella #375 is complete in final commits 2683d572 + 6f44964b: all 25/25 pinned symbols now have exact core/Pico/UWS/H3 evidence. Current profile counts are Home 401/471 (70 pending) and Bun 393/461 (68 pending); Home links 388/388 and inventories retain zero unclassified entries.

9 days ago

Closed shared child #390 in 4c1b2873/367a3df5. Three cached-bytecode imports now have exact owned, deterministic, parser-validated artifacts plus Debug/ReleaseSafe Home+Bun consumers and TSan-clean concurrent generation. Home is 404/471 (67 pending), Bun 396/461 (65 pending), zero unclassified.

9 days ago

#391 is complete in a84af344 + a9b4d5b5: four shared VM imports implemented with exact ownership/deferral semantics. Current exact totals are Home 408/471 (63 pending) and Bun 400/461 (61 pending), zero unclassified; release matrix private pending = 124.

9 days ago

Child #392 now owns the shared BunDebugger__willHotReload import for both exact private profiles, including multi-VM delivery and detach/reentrancy safety.

9 days ago

Child #393 now owns Bun__ErrorCode__determineSpecificType for both exact private profiles.

9 days ago

Linked #394 under #393 for the exact inspector fallback used by Bun/Home received-value diagnostics.

9 days ago

#393 core landed in 18527d73: exact shared ErrorCode diagnostics advance Home to 410/471 and Bun to 402/461. The slice remains open for linked inspector-fallback child #394.

9 days ago

Completed the shared received-value diagnostic boundary in #393 and its inspector fallback in #394 through 522e19c. Exact profile totals remain Home 410/471 and Bun 402/461; pending exports are unchanged and remain explicit.

9 days ago

Implemented the linked LifecycleReporter/TestReporter child #396 in bf847786 + b187b027. Eight formerly pending shared symbols are now real session-backed inspector agents with source/protocol pinning and dual-profile consumers. Home is 418/471 and Bun is 410/461. Waiting on targeted private-abi-boundary in run 29766523096 before closing the child.

9 days ago

#398 implements the five shared HTTPServer request-lifecycle imports on the inspector-session foundation from #396. Commits 34a06e80 / c19d255b; exact pinned counts are Home 423/471 (48 pending) and Bun 415/461 (46 pending). Debug/ReleaseSafe focused and compiled dual-profile fixtures, source audits, and docs build pass; fixing main CI is running.

9 days ago

#400 completes the shared process-signal boundary in 99433614 / a856d0ec. Exact coverage is now Home 424/471 (47 pending) and Bun 416/461 (45 pending). The pinned cross-platform map, realm-local EventEmitter semantics, listener exceptions, dual-profile Debug/ReleaseSafe fixtures, audits, and concise docs are complete.

9 days ago

Green compatibility checkpoint: #396, #398, and #400 are now closed on the fixing main private-abi-boundary job. Current published counts remain Home 424/471 and Bun 416/461 at a856d0ec; local #401 work will move Home to 425/471 after its small push.

9 days ago

Published checkpoint 737bd957: #401 adds the real Home ScriptExecutionContext live registry/retirement lifecycle; #402 adds the two exact retired module-registry shims. Counts are now Home 427/471 (44 pending) and Bun 418/461 (43 pending). Both slices have Debug/ReleaseSafe linked-consumer evidence and are included in the bounded private-ABI CI job.

9 days ago

Heap snapshot/profile child #403 is implemented on main through 7983fca: real VM-wide graph serialization, WebKit/V8 formats, stable relocation-safe IDs, external ArrayBuffer accounting, dominator retained sizes, OOM atomicity, both ownership ABIs, and Debug/ReleaseSafe/TSan evidence. The child remains open only for its exact fixing CI gate.

9 days ago

New tracked child #404 owns the remaining CPU sampling-profiler ABI cluster: per-VM lifecycle, safe cooperative stack sampling, Chrome/Markdown serialization, Home/Bun output ownership, OOM, and sanitizer evidence. This keeps the three profiler symbols out of the broad pending bucket without treating link-only stubs as progress.

9 days ago

Closed #401, #402, and #403 after the exact private ABI job went green on main: https://github.com/zig-utils/zig-js/actions/runs/29776746300/job/88467854285. The next coherent boundary set is #404 (per-VM CPU profiles).

9 days ago

CPU profiler child #404 is implemented on main through 9ab79698: per-VM cooperative sampling, Chrome JSON, Markdown, ownership fixtures, and pinned source contract are green locally. Awaiting exact main private-ABI CI before closure.

9 days ago

Created #405 as the next coherent ABI child: all six readable-stream conversion exports plus the native Web Streams state they require.

9 days ago

#404 is complete. Per-VM CPU sampling profiles landed through 9ab796987fe04331761e620b2e928b9534330a4f; the exact fixing-main private-abi-boundary job passed its Debug, ReleaseSafe, and TSan evidence. The pinned counts remain Home 433/471 and Bun 424/461 at that checkpoint; #405 is the next active private-ABI slice.

9 days ago

#405 is implemented on main through 4275f7c2: all six pinned ReadableStream consumers now share realm-local stream/reader/controller machinery, exact Home/Bun contracts, and compiled Debug/ReleaseSafe/TSan fixtures. Inventories are now Home 439/471 (32 pending) and Bun 430/461 (31 pending). #405 remains open only for its exact fixing-main CI gate.

9 days ago

Created #406 for the next coherent boundary: real WebAssembly.compileStreaming/instantiateStreaming plus the pinned JSC__Wasm__StreamingCompiler__addBytes opaque feed. It explicitly preserves the frozen WG1 baseline while validating modern coverage through the existing WG3 and upstream-main profiles.

9 days ago

#407 is implemented on main through a35f025e. Fetch bodies now preserve real streams, derive bodyUsed from disturbance, share all six #405 conversions, and tee live bodies for Response/Request cloning with combined cancellation. Focused Debug, ReleaseSafe, and TSan evidence passes; exact main CI is pending before closure.

9 days ago

#409 implements one shared Home/Bun private symbol on main (1174cbe7, 0cc83217). Inventories advance to Home 440/471 and Bun 431/461. Exact external consumers pass Debug, ReleaseSafe, and TSan; the current child remains open only for exact main CI.

9 days ago

The declared exact profile is complete with zero pending/unclassified entries, and exact main e3fdc52385204c75fe6ae5c64d48dae6e5ede418 passed all 43 jobs in run 29806223245.

Sign in to comment on this issue.