Conversation
…th-selection # Conflicts: # buildSrc/src/main/kotlin/Versions.kt # usvm-core/src/main/kotlin/org/usvm/Machine.kt # usvm-core/src/main/kotlin/org/usvm/ps/PathSelectorFactory.kt # usvm-jvm/build.gradle.kts
# Conflicts: # usvm-core/build.gradle.kts
usvm-ml-path-selection/src/main/kotlin/org/usvm/ModifiedUMachineOptions.kt
Show resolved
Hide resolved
| class CoverageCounterStatistics<State : UState<*, *, *, *, State>>( | ||
| private val coverageStatistics: CoverageStatistics<*, *, State>, | ||
| private val coverageCounter: CoverageCounter, | ||
| private val methodName: String |
There was a problem hiding this comment.
Do we include method signature here?
usvm-ml-path-selection/src/main/kotlin/org/usvm/ps/BlockGraph.kt
Outdated
Show resolved
Hide resolved
usvm-ml-path-selection/src/main/kotlin/org/usvm/util/ModifiedUtil.kt
Outdated
Show resolved
Hide resolved
usvm-ml-path-selection/src/main/kotlin/org/usvm/CoverageCounter.kt
Outdated
Show resolved
Hide resolved
usvm-ml-path-selection/src/main/kotlin/org/usvm/machine/ModifiedJcMachine.kt
Outdated
Show resolved
Hide resolved
usvm-ml-path-selection/src/main/kotlin/org/usvm/ps/FeaturesLogger.kt
Outdated
Show resolved
Hide resolved
| testStatementsCounts.values.sum(), | ||
| testFinished.values.sumOf { if (it) 1.0 else 0.0 }.toFloat(), | ||
| ) | ||
| return Json.encodeToJsonElement(statistics).jsonObject |
There was a problem hiding this comment.
It is better to return a statistics object, avoiding serialization to json.
| if (path.isEmpty()) { | ||
| return | ||
| } | ||
| val jsonData = buildJsonObject { |
There was a problem hiding this comment.
It is better to use serializable object instead of creating a json manually.
There was a problem hiding this comment.
The first field of this object would need to be a multidimensional array of floats of unknown depth. I can think of 2 ways of making it serializabe: writing a custom serializer or making it a JsonArray. Both options seem to me like doing almost the same thing as creating a json manually, but probably even worse.
| return blockList.map { getBlockFeatures(it) } | ||
| } | ||
|
|
||
| fun saveGraph(filePath: Path) { |
There was a problem hiding this comment.
It is better to split the BlockGraph data structure and graph printer
| env, edgesDataBuffer, | ||
| edgesShape.map { it.toLong() }.toLongArray() | ||
| ) | ||
| val result = gnnSession!!.run(mapOf(Pair("x", featuresData), Pair("edge_index", edgesData))) |
| ) | ||
| val result = gnnSession!!.run(mapOf(Pair("x", featuresData), Pair("edge_index", edgesData))) | ||
| val output = (result.get("output").get().value as Array<*>).map { | ||
| (it as FloatArray).toList() |
There was a problem hiding this comment.
It is better to use FloatArray if possible
* fix: lint * fix: inherit test method annotations from fakeMethod * feat: introduce reflection utils renderer, remove spring import manager * Fix class expression render for primitive and array types (UnitTestBot#144) * Fix empty unbound wildcard type bound (UnitTestBot#147) * feat: introduce reflection utils inline strategy Signed-off-by: Andrew Petrukhin <dartmol2300@gmail.com> * refactor: update reflection utils inline strategy ownership * fix: update JcSpringMvcTestTransformer.kt to match actual context init * fix: style * feat: remove unsafe import manager * fix: pass isAccessibleFromTestClass separately from inline strategy * fix: remove file renderer from unsafe utils renderer * fix: style --------- Signed-off-by: Andrew Petrukhin <dartmol2300@gmail.com>
No description provided.