Add gRPC server for type inference - #292
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a gRPC server for type inference to enable USVM-as-a-service. Key changes include:
- Adding a new gRPC service definition with greeter.proto.
- Updating build configuration and dependency versions (including Wire and grpc-related dependencies) to support the gRPC server.
- Refactoring test resource imports and removing outdated DTO conversion and utility files, along with reorganizing module inclusions in settings.gradle.kts.
Reviewed Changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| usvm-ts-service/src/main/extraproto/greeter.proto | New proto file defining the Greeter service. |
| usvm-ts-service/build.gradle.kts | Updated build script with Wire configurations and a temporary TODO for dependency reference. |
| usvm-ts-dataflow (various test and main files) | Refactored resource loading imports and removed obsolete utility and DTO conversion files. |
| usvm-ts-dataflow/src/main/kotlin/org/usvm/dataflow/ts/infer/annotation/EtsSceneAnnotator.kt | Adjusted annotation fields (renaming and additions) for scene annotations. |
| settings.gradle.kts | Reorganized module inclusions, removing several modules and adding new ones. |
| buildSrc/src/main/kotlin/Dependencies.kt | Upgraded and adjusted dependency versions and package identifiers. |
Comments suppressed due to low confidence (4)
usvm-ts-service/build.gradle.kts:18
- Consider resolving the TODO by updating the protoSource dependency to use 'Libs.jacodb_ets_wire_protos' for consistency.
protoSource("org.jacodb:wire-protos") // TODO: fix to 'Libs.jacodb_ets_wire_protos'
usvm-ts-dataflow/src/main/kotlin/org/usvm/dataflow/ts/infer/annotation/EtsSceneAnnotator.kt:65
- The field renaming (from superClass to superClassName and the addition of implementedInterfaceNames) requires corresponding updates in downstream consumers. Please ensure that clients using these annotations are adjusted accordingly.
category = category,
buildSrc/src/main/kotlin/Dependencies.kt:128
- The update to use 'org.jacodb' for the jacodbPackage aligns with the new module configuration; verify that all modules referencing jacodb use the correct package name.
private const val jacodbPackage = "org.jacodb"
settings.gradle.kts:2
- The reorganization in settings.gradle.kts removes several module includes; please ensure that all dependent build configurations and consumers have been updated to reflect these changes.
include("usvm-python") removed and others
| return EtsScene(listOf(file)) | ||
|
|
||
| logger.info { "Loading Scene from '$path'..." } | ||
| val sceneProto = loadScene(path) |
There was a problem hiding this comment.
@CaelmBleidd I have started to replace JSON-based loadEtsFileAutoConvert with gRPC-based loadScene. Do we want to use gRPC one everywhere?
7e27051 to
1b8136a
Compare
| ) : EtsValue.Visitor<UExpr<out USort>?> { | ||
|
|
||
| private fun resolveLocal(local: EtsValue): ULValue<*, USort> { | ||
| private fun resolveLocal(local: EtsValue): ULValue<*, USort> = with(ctx) { |
Check warning
Code scanning / detekt
Excessive nesting leads to hidden complexity. Prefer extracting code to make it easier to understand.
| is UBoolSort -> mkRegisterStackLValue(sort, localIdx) | ||
| is KFp64Sort -> mkRegisterStackLValue(sort, localIdx) | ||
| is UAddressSort -> mkRegisterStackLValue(sort, localIdx) | ||
| when (sort) { |
Check warning
Code scanning / detekt
Braces do not comply with the specified policy
|
|
||
| class SetupServer : BeforeAllCallback, AfterAllCallback { | ||
| companion object { | ||
| const val PORT = 42000 |
Check warning
Code scanning / detekt
Report missing or invalid underscores in base 10 numbers. Numeric literals should be underscore separated to increase readability.
This PR adds gRPC server for type inference, bringing USVM-as-a-service.