[TS] Materialize symbolic string input witnesses - #453
Merged
Merged
Conversation
There was a problem hiding this comment.
detekt found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
CaelmBleidd
marked this pull request as ready for review
October 2, 2026 19:32
This was referenced Oct 2, 2026
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.
Summary
Materialize symbolic string references from their modeled UTF-16 backing array instead of emitting placeholder text.
Store string code units in a private array-memory region so mutation of a user array cannot change a string's length, even if internal references alias.
Carry the configured
TsOptions.maxArraySizethrough the symbolic state into test extraction, so exploration and extraction use the same string length bound.Cover empty and nonempty symbolic inputs, array isolation, the configured 10,001-character boundary, and a literal containing NUL, non-ASCII text, and a surrogate pair. Replay every generated witness in Node.js.
Reject symbolic string witnesses whose backing array is missing with a typed test-resolution error; a source-level
anyinput previously produced a false empty-string witness for the length-one branch.Verification
./gradlew :usvm-ts:test --tests org.usvm.machine.TsSymbolicStringInputTest --tests org.usvm.samples.operators.TypeOf --tests org.usvm.samples.lang.Arg --tests org.usvm.machine.call.TsArrayShiftReplayTest --tests org.usvm.machine.call.TsInstanceCallReceiverTest :usvm-ts:detektMain :usvm-ts:detektTest --offline --console=plain158 selected tests: 156 passed, 2 skipped, 0 failed. Both Detekt tasks passed with 0 code smells, and
git diff --checkpassed. The new source-level regression failed against the previous head because it emitted""for the length-one branch; it now observes a typed unsupported witness error and replays both real string outcomes in Node.js. The original alias and 10,001-character probes also passed.5b866c7ffound no actionable defects.Closes #421