Skip to content

ABI: implement exact deep equality and matching #229

Description

@chrisbbreuer

Goal

Implement the exact pinned Home/Bun private-JSC structural comparison family:

  • JSC__JSValue__deepEquals
  • JSC__JSValue__strictDeepEquals
  • JSC__JSValue__jestDeepEquals
  • JSC__JSValue__jestStrictDeepEquals
  • JSC__JSValue__jestDeepMatch

This is a child of #134, #140, #163, and #164.

Required semantics

Shared structural engine

  • Preserve primitive SameValue/strict comparison rules, pairwise cycle detection, and failure-atomic traversal.
  • Compare enumerable string and Symbol properties with exact ordinary Get/proxy/getter observability and ordering-independent key matching.
  • Cover dense, sparse, and accessor Arrays; ordinary/null-prototype/class objects; boxed primitives; functions; and cross-realm prototypes.
  • Cover Date, RegExp, Error name/message/cause/enumerables, Map, Set, ArrayBuffer, DataView, every numeric TypedArray, detached/shared backing, and float NaN/signed-zero behavior.
  • Preserve strict-mode distinctions for prototypes, missing versus explicit undefined, sparse holes, Error causes/types, and bitwise typed-float comparison.
  • Reject invalid or foreign-VM inputs deterministically, publish traversal exceptions, and preserve the first pending exception.

Jest modes and subset matching

  • Implement asymmetric matcher dispatch and its exception/callability behavior only for Jest-enabled equality.
  • Implement recursive subset matching for jestDeepMatch, including inherited/existing properties, nested object-containing behavior, cycles, and optional replacement of matched properties.
  • Keep non-Jest equality free of matcher hooks.

Child issues

Completion evidence

  • Add focused matrices for primitives, prototypes, arrays/holes, cycles, maps/sets, buffers/views, dates/regex/errors, getters/proxies, Symbols, asymmetric matchers, subset replacement, sibling realms, foreign VMs, and first-wins exceptions.
  • Add all five symbols to both pinned inventories and the linkable private-value fixture.
  • Keep public/private export classification at zero unclassified symbols.
  • Run focused tests during implementation, then one batched Home/Bun/public ABI audit.
  • Update README and compatibility documentation with exact counts and evidence.
  • Close only after implementation and documentation commits are on origin/main.

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