Skip to content

[TS] Preserve sparse array slots in source mutation models - #477

Merged
CaelmBleidd merged 2 commits into
mainfrom
caelmbleidd/fix-main-sparse-array-dispatch
Oct 13, 2026
Merged

CaelmBleidd merged 2 commits into
mainfrom
caelmbleidd/fix-main-sparse-array-dispatch

Conversation

@CaelmBleidd

@CaelmBleidd CaelmBleidd commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

The reverse and unshift source models rejected arrays with known holes, stopping previously supported sparse-array programs. Extend their accepted receivers to arrays with known own-element presence or a dense-array proof. The TypeScript bodies now preserve missing elements through ordinary indexed writes and deletes; model-owned prepareOwnSlots and hasOwnSlot primitives provide the required metadata.

All calls continue through normal model selection, application events, and residual fallback. The generic call resolver and dispatcher have no special sparse-array handling. The models retain their length/result limit of 16 and the existing unshift arity bound of three arguments.

Regressions cover asymmetric holes, aliases, boxed values, conditional deletion, zero/multiple unshift arguments, disabled models, and Node.js replay. They explicitly require ModelApplied events. Three of the six sparse regression tests fail on the previous PR head because its resolver bypass does not apply the source models.

Validation on the final implementation:

  • Full :usvm-ts:check :usvm-ts-dataflow:check :usvm-ts-calls:check passed locally: 1510 passed, 175 skipped, zero failures/errors.
  • JDK 11, ETS_IR_PROVIDER=ts-frontend, sequential execution; MockK JVM self-attach enabled locally.
  • Detekt main/test and git diff --check passed.
  • Native Node.js replay passed for the sparse source witnesses.

Remote CI must validate the published head before merging.

@CaelmBleidd CaelmBleidd changed the title [TS] Preserve sparse array mutations under source model dispatch [TS] Preserve sparse array slots in source mutation models Oct 13, 2026
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/fix-main-sparse-array-dispatch branch from c8f3cc4 to ff9d354 Compare October 13, 2026 21:38
@CaelmBleidd
CaelmBleidd merged commit 6e68f69 into main Oct 13, 2026
6 checks passed
@CaelmBleidd
CaelmBleidd deleted the caelmbleidd/fix-main-sparse-array-dispatch branch October 13, 2026 21:39
CaelmBleidd added a commit that referenced this pull request Oct 13, 2026
Apply the sparse array model and regression changes from PR #477 (6e68f69). The PR #418 head still inherited the two failing SparseArrayIteratorSourceTest cases.

Validation: full usvm-ts, usvm-ts-dataflow, and usvm-ts-calls checks passed on JDK 11 with the native TypeScript frontend. Main/test Detekt and git diff --check passed.
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.

1 participant