Skip to content

Commit

Permalink
Hacky solution to issue 59: uses a fresh IR generated from source tex…
Browse files Browse the repository at this point in the history
…t for each perm for verification; print stmts included for testing this fix
  • Loading branch information
jenna committed Nov 16, 2023
1 parent 875e2d6 commit 8a9cc41
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/scala/gvc/benchmarking/BenchmarkExecutor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,21 @@ object BenchmarkExecutor {
reserved.perm.permutationContents
)

val convertedToIR = new SelectVisitor(
val convertedToIRTemp = new SelectVisitor(
syncedPrograms(reserved.perm.programID).ir
).visit(asLabelSet)

val reconstructedSourceText =
IRPrinter.print(convertedToIRTemp, includeSpecs = true)

// Hacky solution for issue 59; since SelectVisitor produces an IR that BaselineChecker can't
// use correctly. The IR produces a correct source program though.
// Solution: recreate IR from reconstructedSourceText (aka text from IR generated from perm in SelectVisitor)
// Use this fresh IR for verification
val convertedToIR = Main.generateIR(reconstructedSourceText, libraries)
val testText =
IRPrinter.print(convertedToIR, includeSpecs = true)
println(testText)

conn.dynamicModes.get(reserved.measurementMode) match {
case Some(mode) =>
Expand Down

0 comments on commit 8a9cc41

Please sign in to comment.