Skip to content

Support filter, find, findIndex, and some on fixed tuples - #1173

Closed
blurname wants to merge 1 commit into
vercel-labs:mainfrom
blurname:fix/tuple-predicate-methods
Closed

blurname wants to merge 1 commit into
vercel-labs:mainfrom
blurname:fix/tuple-predicate-methods

Conversation

@blurname

@blurname blurname commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1171.

Fixed tuples currently reject filter, find, findIndex, and some even though the corresponding array operations and other tuple read methods compile. Add native tuple predicate helpers using the existing IR and callback/type-narrowing machinery.

The helpers evaluate the receiver and callback once, read each position when visited, preserve the value observed before a callback mutates that position, and short-circuit the search methods. Empty tuples return the appropriate empty/missing result without invoking the callback. Existing tuple boundaries remain explicit for thisArg, spread arguments, the callback's array parameter, and unsupported asserted narrowing.

Differential coverage checks readonly and mixed tuples, empty tuples, inferred narrowing, Boolean/truthiness predicates, callback mutation, receiver/argument evaluation order, reference identity, exceptions, and generic consumers. Negative compiler tests also verify that a previously cached inferred-narrowing helper does not admit an explicitly asserted predicate.

Validation on macOS arm64 with Node 24.22.0:

  • Workspace build, lint, formatting, and baseline completeness checks pass.
  • On the standalone branch, 24 tuple-related tests pass (6 boundary tests and 18 differential fixtures, each in release/dev modes). The new fixture and tuple-callback-visitation.ts also pass with ASan and the RC audit.
  • Boundary tests and affected TypeScript preflight/order parity batches pass.

Full-gate status: not green. A full local plain run was stopped after the existing WASI test the LLVM target embeds compressed npm sources and builtin shims failed with Buffer.concat of 'unknown' values (SC2020, zlibzoo/index.js:52). The identical failure reproduces with all affected compiler sources loaded from the unchanged base 1b34b4069a235d4d911783cb652fcd87e3bd5db0 and caches disabled. The full sanitized lane has not completed; the targeted sanitized regressions listed above pass. No test is disabled or changed to hide this baseline failure.

The two fixes are on independent branches; the full-gate attempt included both, while focused validation was also run on each standalone branch.

@vercel

vercel Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

@blurname is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@blurname
blurname marked this pull request as ready for review October 17, 2026 06:25
@ctate

ctate commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this. #1209 landed the same fix (plus every), so I'm closing this one. Let us know if you still hit it on main.

@ctate ctate closed this Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support filter, find, findIndex, and some on fixed tuples

2 participants