Skip to content

ABI: implement the pinned JSC64 EncodedJSValue boundary codec #166

Description

@chrisbbreuer

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

Home and Bun inspect EncodedJSValue words inline, while zig-js uses its own internal NaN-box tags. Implement an explicit private-ABI boundary codec instead of conflating the two layouts.

Acceptance:

  • Pin the exact JSC64 empty/null/boolean/undefined/int32/double/cell encodings used by the declared Home/Bun revisions.
  • Prove 8-byte size/alignment and exact constant values.
  • Round-trip signed int32, finite doubles, infinities, canonical/noncanonical NaNs, and negative zero without colliding with cells or immediates.
  • Validate aligned non-null external cell handles and reject empty/immediate/number words as cells.
  • Provide explicit primitive conversion to/from zig-js internal Value without changing the internal representation.
  • Add focused reference-derived tests and document why private shims must use this boundary.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions