Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
beef938
Support parameterized EtsIR model families
CaelmBleidd Sep 20, 2026
c48f468
Add primary numeric intrinsic models
CaelmBleidd Sep 20, 2026
28becf2
Test primary numeric intrinsic semantics
CaelmBleidd Sep 20, 2026
f403bbe
Allow calls runner to use bundled frontend
CaelmBleidd Sep 20, 2026
51d405d
Model Array and String search methods in TypeScript
CaelmBleidd Sep 20, 2026
6ec06c8
Let EtsIR adapters resolve raw call inputs
CaelmBleidd Sep 20, 2026
3f826bc
Test adapters with unresolved namespace receivers
CaelmBleidd Sep 20, 2026
c7daaf0
Extend source sequence models
CaelmBleidd Sep 20, 2026
b4a22f7
Expand semantic model dependencies
CaelmBleidd Sep 20, 2026
0826fab
Bound sequence offset normalization
CaelmBleidd Sep 20, 2026
635026a
Add adjacent numeric intrinsic models
CaelmBleidd Sep 20, 2026
d1f242a
Declare source model dependencies and domains
CaelmBleidd Sep 20, 2026
24acd4d
Model numeric Date APIs in TypeScript
CaelmBleidd Sep 20, 2026
d0b9f2d
Guard sparse Array search domains
CaelmBleidd Sep 20, 2026
fdd0611
Canonicalize Array search zero results
CaelmBleidd Sep 20, 2026
dbfcfa2
Require concrete String code units
CaelmBleidd Sep 20, 2026
284a6d2
Handle Date UTC omissions and invalid timezone offsets
CaelmBleidd Sep 20, 2026
c9890ed
Truncate Date fractions toward zero
CaelmBleidd Sep 20, 2026
563718b
Resolve Date calls through any aliases
CaelmBleidd Sep 20, 2026
33781b4
Model remaining UTC minute setters
CaelmBleidd Sep 20, 2026
1cdd5f1
Strengthen Date model registrations and tests
CaelmBleidd Sep 20, 2026
cf2d6d8
Fix Date registration formatting
CaelmBleidd Sep 20, 2026
6f32a79
Use Math.floor in Date calendar arithmetic
CaelmBleidd Sep 20, 2026
194ea90
Document model coverage and declare Date rounding dependency
CaelmBleidd Sep 20, 2026
1a6315d
Fix Date test formatting
CaelmBleidd Sep 20, 2026
2e80186
Allow modeled NaN checks in Array removal matrix
CaelmBleidd Sep 20, 2026
b279fbe
Satisfy numeric model style checks
CaelmBleidd Sep 20, 2026
8e1353c
Clean up sequence model style
CaelmBleidd Sep 20, 2026
c08c8c6
Support symbolic Calls inputs and preflight telemetry
CaelmBleidd Sep 20, 2026
d57f7d9
Fix symbolic value semantics and add bounded array and string models
CaelmBleidd Sep 20, 2026
411b48b
Support Error and Array constructors, replacement, and erased assertions
CaelmBleidd Sep 20, 2026
2502bdb
Reject callable arguments before querying modeled string types
CaelmBleidd Sep 20, 2026
1ec9cd9
Isolate Error model storage from user property resolution
CaelmBleidd Sep 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion usvm-ts-calls/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ val toolStatus = providers.exec {
val generateBuildMetadata = tasks.register("generateBuildMetadata") {
inputs.property("toolRevision", toolRevision)
inputs.property("toolStatus", toolStatus)
inputs.property("jacodbVersion", Versions.jacodb)
outputs.dir(generatedBuildMetadataDirectory)

doLast {
Expand All @@ -39,7 +40,11 @@ val generateBuildMetadata = tasks.register("generateBuildMetadata") {
.file("org/usvm/ts/calls/build.properties")
.asFile
metadataFile.parentFile.mkdirs()
metadataFile.writeText("tool.revision=$buildIdentity\n", Charsets.UTF_8)
metadataFile.writeText(
"tool.revision=$buildIdentity\n" +
"native.frontend.revision=bundled:${Versions.jacodb}\n",
Charsets.UTF_8,
)
}
}

Expand Down
55 changes: 43 additions & 12 deletions usvm-ts-calls/src/main/kotlin/org/usvm/ts/calls/CallsExperiment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import kotlinx.serialization.decodeFromString
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import org.usvm.PathSelectionStrategy
import org.usvm.machine.TsRuntimeFeatureLimitationEvent
import org.usvm.machine.call.TsResidualCallPolicy
import org.usvm.machine.call.TsUnknownCallEvent
import org.usvm.ts.pbt.model.JsConcreteValue
import org.usvm.ts.pbt.model.PropertyInput
import org.usvm.ts.pbt.model.TypeScriptEntryPoint
Expand Down Expand Up @@ -115,6 +117,7 @@ internal enum class CallsSymbolicStatus {
UNREACHED,
UNREPRESENTABLE,
UNSUPPORTED,
RUNTIME_LIMITATION,
TIMEOUT,
TOOL_ERROR,
UNMAPPED,
Expand All @@ -131,6 +134,8 @@ internal data class CallsSymbolicSearchRequest(
val expectedNativeFrontendRevision: String,
val seed: Long,
val budget: Duration,
val unknownCallEventSink: ((TsUnknownCallEvent) -> Unit)? = null,
val runtimeLimitationEventSink: ((TsRuntimeFeatureLimitationEvent) -> Unit)? = null,
)

internal data class CallsSymbolicSearchResult(
Expand Down Expand Up @@ -175,6 +180,7 @@ internal data class CallsRunTargetIdentity(
val functionId: String,
val targetId: String,
val siteId: String,
val targetMode: CallsSourceTargetMode = CallsSourceTargetMode.ENTRY,
)

@Serializable
Expand All @@ -187,6 +193,7 @@ internal data class CallsTargetResult(
val functionId: String,
val targetId: String,
val siteId: String,
val targetMode: CallsSourceTargetMode = CallsSourceTargetMode.ENTRY,
val profile: CallsExperimentProfile,
val seed: Long,
val symbolicStatus: CallsSymbolicStatus,
Expand Down Expand Up @@ -244,16 +251,25 @@ internal object CallsExperimentJson {
}

internal object CallsBuildIdentity {
val toolRevision: String by lazy {
private val properties: Properties by lazy {
val properties = Properties()
val resource = checkNotNull(javaClass.getResourceAsStream("/org/usvm/ts/calls/build.properties")) {
"Missing calls build identity"
}
resource.use(properties::load)

properties
}

val toolRevision: String by lazy {
checkNotNull(properties.getProperty("tool.revision")).takeIf(String::isNotBlank)
?: error("Missing tool revision in calls build identity")
}

val nativeFrontendRevision: String by lazy {
checkNotNull(properties.getProperty("native.frontend.revision")).takeIf(String::isNotBlank)
?: error("Missing native frontend revision in calls build identity")
}
}

internal class CallsExperimentRunner(
Expand Down Expand Up @@ -297,6 +313,7 @@ internal class CallsExperimentRunner(
functionId = function.functionId,
targetId = target.targetId,
siteId = target.siteId,
targetMode = target.mode,
)
}
}
Expand Down Expand Up @@ -370,6 +387,7 @@ internal class CallsExperimentRunner(
target = target,
seed = seed,
profile = profile,
appendUnknownCall = { event -> append(rawOutput, event) },
)

append(rawOutput, result)
Expand All @@ -386,18 +404,29 @@ internal class CallsExperimentRunner(
target: CallsSourceTarget,
seed: Long,
profile: CallsExperimentProfile,
appendUnknownCall: (CallsRawRecord) -> Unit,
): CallsTargetResult {
val request = CallsSymbolicSearchRequest(
sourceRoot = sourceRoot,
project = project,
function = function,
target = target,
profile = profile,
frozenModelIds = manifest.modelSet.ids,
expectedNativeFrontendRevision = manifest.nativeFrontendRevision,
seed = seed,
budget = manifest.perTargetBudgetMillis.milliseconds,
)
val symbolic = symbolicEngine.search(
CallsSymbolicSearchRequest(
sourceRoot = sourceRoot,
project = project,
function = function,
target = target,
profile = profile,
frozenModelIds = manifest.modelSet.ids,
expectedNativeFrontendRevision = manifest.nativeFrontendRevision,
seed = seed,
budget = manifest.perTargetBudgetMillis.milliseconds,
request.copy(
unknownCallEventSink = callsUnknownCallEventSink(
cell = request.cellIdentity(experimentId = manifest.experimentId),
appendAndFlush = appendUnknownCall,
),
runtimeLimitationEventSink = callsRuntimeLimitationEventSink(
cell = request.cellIdentity(experimentId = manifest.experimentId),
appendAndFlush = appendUnknownCall,
),
),
)
val replay = symbolic.inputs?.let { inputs ->
Expand All @@ -418,6 +447,7 @@ internal class CallsExperimentRunner(
functionId = function.functionId,
targetId = target.targetId,
siteId = target.siteId,
targetMode = target.mode,
profile = profile,
seed = seed,
symbolicStatus = symbolic.status,
Expand Down Expand Up @@ -488,7 +518,8 @@ internal object CallsRawResultsReader {
identity != null &&
result.revision == identity.revision &&
result.development == identity.development &&
result.siteId == identity.siteId
result.siteId == identity.siteId &&
result.targetMode == identity.targetMode
},
) { "Result target identity does not match metadata" }
val resultKeys = results.map { result ->
Expand Down
Loading
Loading