ReviewOS

zig-utils/zig-js

ABI: pin profile-selectable Home and Bun JSType layouts

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

Parents: #163, #164 Depends on: #165, #169

The pinned Home and Bun source revisions do not use the same private JSType numbering. Bun includes WebAssemblyStreamingContext = 27, shifting the later object-family tags (Object = 34 in Bun versus 33 in Home). A single unversioned return mapping would therefore be wrong for one consumer.

Acceptance:

  • Generate exact, hash-pinned full JSType inventories from both consumer source revisions.
  • Record and audit every shared, added, removed, and renumbered enum member.
  • Add an explicit private-ABI consumer profile selection; reject unknown profiles.
  • Map every zig-js value/cell kind represented by the declared profiles to the selected exact tag.
  • Export exact JSC__JSValue__jsType and JSC__JSCell__getType signatures without exposing internal tags.
  • Add separate compile-link-runtime evidence for the Home and Bun selections, including strings, BigInts, symbols, functions, errors, arrays, typed arrays, and ordinary objects.
  • Update both private inventories and README/API documentation without changing public/extension counts.
9 days ago

Completed on main in 74d461f; documentation followed in 6a6657f.

Evidence:

  • hash-pinned full layouts: Home 97 members, Bun 98, 97 shared, one Bun-only insertion, 70 renumbered shared tags;
  • unknown -Dprivate-abi-consumer values fail configuration;
  • zig build test-private-jstype: Home-selected 2/2 symbols and 20 real cell kinds pass;
  • zig build test-private-jstype -Dprivate-abi-consumer=bun: separately compiled Bun-selected 2/2 symbols and the same 20 kinds pass with shifted tags;
  • zig build c-api-audit: 117 public, 19 extensions, 11 private profile exports;
  • inventories advance to Home 11/432 and Bun core 11/422.

The JSType audit also explicitly accepts the byte-identical JSType source at the newly observed Home revision 38702f9e; the broader 58-file Home private-profile alias remains separate work rather than being silently inferred.

Sign in to comment on this issue.