Skip to content

Adopt JacoDB native TypeScript frontend in USVM - #344

Merged
CaelmBleidd merged 21 commits into
mainfrom
caelmbleidd/native-ts-frontend
Aug 22, 2026
Merged

Adopt JacoDB native TypeScript frontend in USVM#344
CaelmBleidd merged 21 commits into
mainfrom
caelmbleidd/native-ts-frontend

Conversation

@CaelmBleidd

@CaelmBleidd CaelmBleidd commented Aug 21, 2026

Copy link
Copy Markdown
Member

Summary

  • Make the merged JacoDB native TypeScript frontend the default frontend for .ts sources and pin the published JacoDB neo artifact 9ea33879c9.
  • Add opt-in local composite substitution through -PuseLocalJacodb[=<path>], so JacoDB frontend changes can be tested before a new remote artifact is available.
  • Stabilize the legacy ArkAnalyzer resource-generation bootstrap still present in ci-ts by pinning @types/node@18 before installation; its bundled TypeScript 4.9 cannot parse the latest floating Node declarations.
  • Adapt symbolic execution and TypeScript dataflow to the native frontend's IR:
    • map literal types to their runtime base sorts and advance through explicit NOP nodes;
    • execute pre/post increment and decrement expressions;
    • canonicalize array descriptors, bind closure environments, initialize native module fields, and preserve import/field behavior;
    • resolve native pointer calls for the built-in Number, including Number() returning 0;
    • preserve nominal instanceof alternatives and run the type guesser to a fixed point;
    • execute overload implementations in USVM, and canonicalize static overload groups before forking so bodyless declarations do not create equivalent states;
    • support concrete string concatenation, including ECMAScript-compatible formatting of finite fractional and extreme number values.
  • Add focused regression tests for the migrated IR shapes and execution behavior, including overload state counts and concrete number formatting boundaries.

Architectural boundary

JacoDB preserves TypeScript declarations and structural types. It does not choose which overload is executable. Runtime overload selection and state-forking policy remain in USVM.

Verification

The final integration test uses the JacoDB artifact published by JitPack, with no local composite substitution:

./gradlew \
  :usvm-ts:test \
  :usvm-ts-dataflow:test

Result: BUILD SUCCESSFUL (28 actionable tasks). This verifies both remote dependency resolution and the native frontend integration.

Detekt was also run under JDK 21 while developing the migration:

env JAVA_HOME=/path/to/jdk-21 \
./gradlew \
  -PuseLocalJacodb=/path/to/jacodb \
  :usvm-ts:detekt

Result: BUILD SUCCESSFUL; no new warnings remain in the overload or number-formatting changes.

The CI ArkAnalyzer bootstrap was reproduced from a clean neo/2025-09-03 clone with the same manifest pin; npm install and npm run build both completed successfully.

JacoDB PR UnitTestBot/jacodb#363 is merged into neo. JitPack reports merge commit 9ea33879c9 as successfully published, and its jacodb-ets JAR contains the bundled TypeScript frontend runtime.

Comment thread usvm-ts/src/main/kotlin/org/usvm/machine/expr/TsExprResolver.kt Outdated
Comment thread usvm-ts/src/main/kotlin/org/usvm/machine/expr/TsExprResolver.kt
Comment thread usvm-ts/src/main/kotlin/org/usvm/machine/expr/TsExprResolver.kt Outdated
Comment thread usvm-ts/src/main/kotlin/org/usvm/machine/types/TsTypeSystem.kt Outdated
@CaelmBleidd
CaelmBleidd marked this pull request as ready for review August 22, 2026 16:55
@CaelmBleidd
CaelmBleidd merged commit 348d910 into main Aug 22, 2026
10 of 11 checks passed
@CaelmBleidd
CaelmBleidd deleted the caelmbleidd/native-ts-frontend branch August 22, 2026 17:11
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