Skip to content

[TS] Make string models cheaper for symbolic execution - #525

Merged
CaelmBleidd merged 1 commit into
mainfrom
caelmbleidd/symbolic-string-models
Oct 15, 2026
Merged

CaelmBleidd merged 1 commit into
mainfrom
caelmbleidd/symbolic-string-models

Conversation

@CaelmBleidd

Copy link
Copy Markdown
Member

String source models create avoidable symbolic paths while classifying whitespace, and build substrings through chains of temporary character strings and concatenations. This change uses the existing ECMAScript whitespace table as one SMT predicate, compares UTF-16 code units directly during searches, and copies normalized ranges through symbolic memory operations.

The public TypeScript bodies retain argument normalization, search order, and replacement semantics. Two model-owned helpers provide whitespace classification and validated range copying; unrelated declarations with the same names remain residual. Copied ranges and concatenation also retain tighter proven length bounds.

Validation:

  • 91 focused tests passed across eight classes, including generated-witness replay in Node. After the final readability cleanup, all 22 new-model/catalog tests were rerun successfully.
  • Strict :usvm-ts:detektMain and :usvm-ts:detektTest passed.
  • Both new structural regressions were checked against the base revision: single-character trim produced 15 terminal states instead of 3; a copied-and-concatenated result retained bound 4 instead of the proven 3. Both pass with this change.
  • Concrete differential checks of the source bodies passed for all 65,536 UTF-16 code units and 2,376,384 method comparisons against native JS, including numeric index edge cases, lone surrogates and replacement substitutions. These checks use native shims for storage helpers; the symbolic tests exercise the real helpers and replay their witnesses.

Local JVM checks used Java 21 with an explicitly loaded Byte Buddy agent for MockK. Full repository suites and the 200-class campaign were not rerun; CI and a separate campaign comparison remain the broader validation boundaries.

@CaelmBleidd
CaelmBleidd merged commit b29e7d0 into main Oct 15, 2026
@CaelmBleidd
CaelmBleidd deleted the caelmbleidd/symbolic-string-models branch October 15, 2026 20:26
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