[TS] Compare string values in equality operators - #455
Merged
Merged
Conversation
CaelmBleidd
force-pushed
the
caelmbleidd/ts-422-string-value-equality
branch
2 times, most recently
from
October 2, 2026 19:27
e0332a2 to
43b936b
Compare
CaelmBleidd
marked this pull request as ready for review
October 2, 2026 22:15
This was referenced Oct 2, 2026
CaelmBleidd
force-pushed
the
caelmbleidd/ts-422-string-value-equality
branch
from
October 3, 2026 05:21
7927e93 to
127ecb5
Compare
Implement supported string equality cases and preserve explicit unsupported outcomes for unbacked symbolic witnesses. Reuse shared Node replay tests.
CaelmBleidd
force-pushed
the
caelmbleidd/ts-422-string-value-equality
branch
from
October 4, 2026 19:51
e5527a3 to
7217c2a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #422.
TypeScript string equality previously compared heap references, so two distinct references with the same contents could compare unequal. Compare modeled strings by UTF-16 length and code units for
===,!==,==, and!=, while preserving object identity and strict/loose nullish equality.This branch is rebased on
mainat7b9a88b52851b54ba6f379c2c4a81a2a4449d068, after #453 and #459. It retains the current test organization introduced by #453.Change
anyorunknownreference acquires backing only after the execution path proves it is a non-nullish string. The backing belongs to the original reference, so aliases,.length, equality, and witness extraction use the same contents. Unrefined and nullish alternatives retain their existing constraints.box.value, which previously caused a feasible string branch to disappear.analyzeWithOutcomeexposes explicit unsupported paths separately from supported states. Unsupported terminal states do not contribute to coverage or the defaultCOVERED_NEWcollector. Calls reportsUNSUPPORTEDwhen an exhausted analysis reaches no target and contains an explicitly unsupported path.Support boundary
String contents are bounded by the configured
maxArraySize/maxStringLength. References whose string type has not been established and whose backing is absent can still produce explicit unsupported outcomes. A future symbolic string producer must create bounded backing and register its reference. Witness extraction can still reject an input that remains unrefined on an early-return path; successful refined-string witnesses are checked and replayed.Strict comparison of two fake
anywrappers still has the preexisting nested-fake-object limitation. WiththrowExceptionOnStepFailure=false, unsupported operation exceptions become explicit unsupported terminal paths; with that option true, they propagate. Calls uses the latter setting.Verification
7217c2a1094af74217dc0d2ba03e0c058d0fd4e1,:usvm-ts:test: 1,117 tests, 975 passed, 142 skipped, zero failures or errors.:usvm-ts-calls:test: all 13 passed.discoverProperties, with direct machine assertions for completion and unsupported outcomes and Node.js replay for concrete witnesses.:usvm-ts:detektMain,:usvm-ts:detektTest,:usvm-ts-calls:detektMain,:usvm-ts-calls:detektTest, andgit diff --checkpassed.box.valueguard regression failed on the previous late-backing implementation because result1disappeared, and passed with the pinned base production code and the private-field fix.The local checks above use the repository's pinned JacoDB dependency. CI run 37229853473 also passed all six jobs on published head
7217c2a1094af74217dc0d2ba03e0c058d0fd4e1: core, JVM, Python, TypeScript, TypeScript PBT, and lint.