From d87dadef04912ded3de196ac28badb833d24a36a Mon Sep 17 00:00:00 2001 From: aherlihy Date: Sat, 2 Dec 2023 18:18:41 +0100 Subject: [PATCH] More benchmarks --- .../scala/datalog/benchmarks/BenchMacro.scala | 147 ++++++++ .../benchmarks/BenchMacroBaseline.scala | 138 +++++--- dl_bench.sh | 4 +- .../scala/test/MacroCompilerPrograms.scala | 319 ++++++++++-------- src/test/scala/test/MacroCompilerTest.scala | 22 +- .../cbaexprvalue/cbaexprvalue_optimized.scala | 77 ++--- .../cbaexprvalue/cbaexprvalue_worst.scala | 80 ++--- .../test/examples/equal/equal_optimized.scala | 42 +-- .../test/examples/equal/equal_worst.scala | 42 +-- 9 files changed, 552 insertions(+), 319 deletions(-) diff --git a/bench/src/test/scala/datalog/benchmarks/BenchMacro.scala b/bench/src/test/scala/datalog/benchmarks/BenchMacro.scala index 8f981de5..56101d1a 100644 --- a/bench/src/test/scala/datalog/benchmarks/BenchMacro.scala +++ b/bench/src/test/scala/datalog/benchmarks/BenchMacro.scala @@ -24,6 +24,14 @@ import datalog.{ TastyslistlibinverseWorstMacroCompilerWithFacts as TastyslistlibinverseMacroCompilerWithFacts, TastyslistlibinverseWorstMacroCompilerWithFactsOnline as TastyslistlibinverseMacroCompilerWithFactsOnline, TastyslistlibinverseWorstMacroCompilerOnline as TastyslistlibinverseMacroCompilerOnline, + CbaexprvalueWorstMacroCompiler as CbaexprvalueMacroCompiler, + CbaexprvalueWorstMacroCompilerWithFacts as CbaexprvalueMacroCompilerWithFacts, + CbaexprvalueWorstMacroCompilerWithFactsOnline as CbaexprvalueMacroCompilerWithFactsOnline, + CbaexprvalueWorstMacroCompilerOnline as CbaexprvalueMacroCompilerOnline, + EqualWorstMacroCompiler as EqualMacroCompiler, + EqualWorstMacroCompilerWithFacts as EqualMacroCompilerWithFacts, + EqualWorstMacroCompilerWithFactsOnline as EqualMacroCompilerWithFactsOnline, + EqualWorstMacroCompilerOnline as EqualMacroCompilerOnline, } import scala.compiletime.uninitialized @@ -54,6 +62,14 @@ object BenchMacro { val tastyslistlibinverseWithFactsCompiled = TastyslistlibinverseMacroCompilerWithFacts.compile() val tastyslistlibinverseOnlineCompiled = TastyslistlibinverseMacroCompilerOnline.compile() val tastyslistlibinverseWithFactsOnlineCompiled = TastyslistlibinverseMacroCompilerWithFactsOnline.compile() + val equalCompiled = EqualMacroCompiler.compile() + val equalWithFactsCompiled = EqualMacroCompilerWithFacts.compile() + val equalOnlineCompiled = EqualMacroCompilerOnline.compile() + val equalWithFactsOnlineCompiled = EqualMacroCompilerWithFactsOnline.compile() + val cbaexprvalueCompiled = CbaexprvalueMacroCompiler.compile() + val cbaexprvalueWithFactsCompiled = CbaexprvalueMacroCompilerWithFacts.compile() + val cbaexprvalueOnlineCompiled = CbaexprvalueMacroCompilerOnline.compile() + val cbaexprvalueWithFactsOnlineCompiled = CbaexprvalueMacroCompilerWithFactsOnline.compile() } import BenchMacro.* @@ -408,4 +424,135 @@ class BenchMacro { // println(s"macro rules online, results =${res.size}") } + + /** + * Both facts + rules available at compile-time, no online optimization + */ + @Benchmark + def equal_macro_aot_offline(blackhole: Blackhole) = { + val expectedSize = 0 + val facts = Paths.get(EqualMacroCompilerWithFacts.factDir) + val res = EqualMacroCompilerWithFacts.runCompiled(equalWithFactsCompiled)( // facts already loaded at compile-time + program => () //println(s"size succ = ${program.namedRelation("succ").get().size}") + ) + assert(res.size == expectedSize) + blackhole.consume(res) + // println(s"macro AOT offline results =${res.size}") + } + + /** + * Only rules available at compile-time, no online optimization + */ + @Benchmark + def equal_macro_rules_offline(blackhole: Blackhole) = { + val expectedSize = 0 + + val facts = Paths.get(EqualMacroCompiler.factDir) + val res = EqualMacroCompiler.runCompiled(equalCompiled)( + program => + //println(s"size succ = ${program.namedRelation("succ").get().size}") + program.loadFromFactDir(facts.toString) + ) + assert(res.size == expectedSize) + blackhole.consume(res) + // println(s"macro rules offline, results =${res.size}") + } + + /** + * Both facts + rules available at compile-time, online optimization + */ + @Benchmark + def equal_macro_aot_online(blackhole: Blackhole) = { + val expectedSize = 0 + + val facts = Paths.get(EqualMacroCompilerWithFactsOnline.factDir) + val res = EqualMacroCompilerWithFactsOnline.runCompiled(equalWithFactsOnlineCompiled)( + program => {} // facts already loaded at compile-time + ) + assert(res.size == expectedSize) + blackhole.consume(res) + // println(s"macro AOT online, results =${res.size}") + } + + /** + * Only rules available at compile-time, online optimization + */ + @Benchmark + def equal_macro_rules_online(blackhole: Blackhole) = { + val expectedSize = 0 + + val facts = Paths.get(EqualMacroCompilerOnline.factDir) + val res = EqualMacroCompilerOnline.runCompiled(equalOnlineCompiled)( + program => program.loadFromFactDir(facts.toString) + ) + assert(res.size == expectedSize) + blackhole.consume(res) + // println(s"macro rules online, results =${res.size}") + } + + /** + * Both facts + rules available at compile-time, no online optimization + */ + @Benchmark + def cbaexprvalue_macro_aot_offline(blackhole: Blackhole) = { + val expectedSize = 6 + val facts = Paths.get(CbaexprvalueMacroCompilerWithFacts.factDir) + val res = CbaexprvalueMacroCompilerWithFacts.runCompiled(cbaexprvalueWithFactsCompiled)( // facts already loaded at compile-time + program => () //println(s"size succ = ${program.namedRelation("succ").get().size}") + ) + assert(res.size == expectedSize) + blackhole.consume(res) + // println(s"macro AOT offline results =${res.size}") + } + + /** + * Only rules available at compile-time, no online optimization + */ + @Benchmark + def cbaexprvalue_macro_rules_offline(blackhole: Blackhole) = { + val expectedSize = 6 + + val facts = Paths.get(CbaexprvalueMacroCompiler.factDir) + val res = CbaexprvalueMacroCompiler.runCompiled(cbaexprvalueCompiled)( + program => + //println(s"size succ = ${program.namedRelation("succ").get().size}") + program.loadFromFactDir(facts.toString) + ) + assert(res.size == expectedSize) + blackhole.consume(res) + // println(s"macro rules offline, results =${res.size}") + } + + /** + * Both facts + rules available at compile-time, online optimization + */ + @Benchmark + def cbaexprvalue_macro_aot_online(blackhole: Blackhole) = { + val expectedSize = 6 + + val facts = Paths.get(CbaexprvalueMacroCompilerWithFactsOnline.factDir) + val res = CbaexprvalueMacroCompilerWithFactsOnline.runCompiled(cbaexprvalueWithFactsOnlineCompiled)( + program => {} // facts already loaded at compile-time + ) + assert(res.size == expectedSize) + blackhole.consume(res) + // println(s"macro AOT online, results =${res.size}") + } + + /** + * Only rules available at compile-time, online optimization + */ + @Benchmark + def cbaexprvalue_macro_rules_online(blackhole: Blackhole) = { + val expectedSize = 6 + + val facts = Paths.get(CbaexprvalueMacroCompilerOnline.factDir) + val res = CbaexprvalueMacroCompilerOnline.runCompiled(cbaexprvalueOnlineCompiled)( + program => program.loadFromFactDir(facts.toString) + ) + assert(res.size == expectedSize) + blackhole.consume(res) + // println(s"macro rules online, results =${res.size}") + } + } diff --git a/bench/src/test/scala/datalog/benchmarks/BenchMacroBaseline.scala b/bench/src/test/scala/datalog/benchmarks/BenchMacroBaseline.scala index 6b9ca491..130401a8 100644 --- a/bench/src/test/scala/datalog/benchmarks/BenchMacroBaseline.scala +++ b/bench/src/test/scala/datalog/benchmarks/BenchMacroBaseline.scala @@ -22,6 +22,10 @@ import test.examples.tastyslistlib.tastyslistlib_worst import test.examples.tastyslistlib.tastyslistlib_optimized import test.examples.tastyslistlibinverse.tastyslistlibinverse_worst import test.examples.tastyslistlibinverse.tastyslistlibinverse_optimized +import test.examples.cbaexprvalue.cbaexprvalue_worst +import test.examples.cbaexprvalue.cbaexprvalue_optimized +import test.examples.equal.equal_worst +import test.examples.equal.equal_optimized object AckermannWorst extends ackermann_worst object AckermannOptimized extends ackermann_optimized @@ -33,6 +37,10 @@ object TastyslistlibWorst extends tastyslistlib_worst object TastyslistlibOptimized extends tastyslistlib_optimized object TastyslistlibinverseWorst extends tastyslistlibinverse_worst object TastyslistlibinverseOptimized extends tastyslistlibinverse_optimized +object EqualWorst extends equal_worst +object EqualOptimized extends equal_optimized +object CbaexprvalueWorst extends cbaexprvalue_worst +object CbaexprvalueOptimized extends cbaexprvalue_optimized @Fork(1) @Warmup(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS, batchSize = 10) @@ -54,18 +62,6 @@ class BenchMacroBaseline { ) } - @Benchmark - def ackermann_jit_irop_online(blackhole: Blackhole) = { - val jo = JITOptions(mode = Mode.Interpreted, sortOrder = SortOrder.Sel) - val engine = new StagedExecutionEngine(new DefaultStorageManager(), jo) - val program = Program(engine) - program.loadFromFactDir(AckermannWorst.factDirectory) - AckermannWorst.pretest(program) - - blackhole.consume( - program.namedRelation(AckermannWorst.toSolve).solve() - ) - } @Benchmark def ackermann_interpreter_optimized_offline(blackhole: Blackhole) = { @@ -107,18 +103,6 @@ class BenchMacroBaseline { ) } - @Benchmark - def fib_jit_irop_online(blackhole: Blackhole) = { - val jo = JITOptions(mode = Mode.Interpreted, sortOrder = SortOrder.Sel) - val engine = new StagedExecutionEngine(new DefaultStorageManager(), jo) - val program = Program(engine) - program.loadFromFactDir(FibWorst.factDirectory) - FibWorst.pretest(program) - - blackhole.consume( - program.namedRelation(FibWorst.toSolve).solve() - ) - } @Benchmark def fib_interpreter_optimized_offline(blackhole: Blackhole) = { @@ -160,9 +144,23 @@ class BenchMacroBaseline { ) } + @Benchmark - def prime_jit_irop_online(blackhole: Blackhole) = { - val jo = JITOptions(mode = Mode.Interpreted, sortOrder = SortOrder.Sel) + def prime_interpreter_optimized_offline(blackhole: Blackhole) = { + val jo = JITOptions(mode = Mode.Interpreted) + val engine = new StagedExecutionEngine(new DefaultStorageManager(), jo) + val program = Program(engine) + program.loadFromFactDir(PrimeOptimized.factDirectory) + PrimeOptimized.pretest(program) + + blackhole.consume( + program.namedRelation(PrimeOptimized.toSolve).solve() + ) + } + + @Benchmark + def prime_interpreter_worst_offline(blackhole: Blackhole) = { + val jo = JITOptions(mode = Mode.Interpreted) val engine = new StagedExecutionEngine(new DefaultStorageManager(), jo) val program = Program(engine) program.loadFromFactDir(PrimeWorst.factDirectory) @@ -173,49 +171,94 @@ class BenchMacroBaseline { ) } + /** -----------------Cbaexprvalue-----------------* */ @Benchmark - def prime_interpreter_optimized_offline(blackhole: Blackhole) = { + def cbaexprvalue_jit_lambda_online(blackhole: Blackhole) = { + val jo = JITOptions(mode = Mode.JIT, granularity = Granularity.DELTA, compileSync = CompileSync.Blocking, sortOrder = SortOrder.Sel, backend = Backend.Lambda) + val engine = new StagedExecutionEngine(new DefaultStorageManager(), jo) + val program = Program(engine) + program.loadFromFactDir(CbaexprvalueWorst.factDirectory) + CbaexprvalueWorst.pretest(program) + + blackhole.consume( + program.namedRelation(CbaexprvalueWorst.toSolve).solve() + ) + } + + + @Benchmark + def cbaexprvalue_interpreter_optimized_offline(blackhole: Blackhole) = { val jo = JITOptions(mode = Mode.Interpreted) val engine = new StagedExecutionEngine(new DefaultStorageManager(), jo) val program = Program(engine) - program.loadFromFactDir(PrimeOptimized.factDirectory) - PrimeOptimized.pretest(program) + program.loadFromFactDir(CbaexprvalueOptimized.factDirectory) + CbaexprvalueOptimized.pretest(program) blackhole.consume( - program.namedRelation(PrimeOptimized.toSolve).solve() + program.namedRelation(CbaexprvalueOptimized.toSolve).solve() ) } @Benchmark - def prime_interpreter_worst_offline(blackhole: Blackhole) = { + def cbaexprvalue_interpreter_worst_offline(blackhole: Blackhole) = { val jo = JITOptions(mode = Mode.Interpreted) val engine = new StagedExecutionEngine(new DefaultStorageManager(), jo) val program = Program(engine) - program.loadFromFactDir(PrimeWorst.factDirectory) - PrimeWorst.pretest(program) + program.loadFromFactDir(CbaexprvalueWorst.factDirectory) + CbaexprvalueWorst.pretest(program) blackhole.consume( - program.namedRelation(PrimeWorst.toSolve).solve() + program.namedRelation(CbaexprvalueWorst.toSolve).solve() ) } - /** -----------------Tastyslistlib-----------------* */ + + /** -----------------Equal-----------------* */ @Benchmark - def tastyslistlib_jit_lambda_online(blackhole: Blackhole) = { + def equal_jit_lambda_online(blackhole: Blackhole) = { val jo = JITOptions(mode = Mode.JIT, granularity = Granularity.DELTA, compileSync = CompileSync.Blocking, sortOrder = SortOrder.Sel, backend = Backend.Lambda) val engine = new StagedExecutionEngine(new DefaultStorageManager(), jo) val program = Program(engine) - program.loadFromFactDir(TastyslistlibWorst.factDirectory) - TastyslistlibWorst.pretest(program) + program.loadFromFactDir(EqualWorst.factDirectory) + EqualWorst.pretest(program) blackhole.consume( - program.namedRelation(TastyslistlibWorst.toSolve).solve() + program.namedRelation(EqualWorst.toSolve).solve() + ) + } + + + @Benchmark + def equal_interpreter_optimized_offline(blackhole: Blackhole) = { + val jo = JITOptions(mode = Mode.Interpreted) + val engine = new StagedExecutionEngine(new DefaultStorageManager(), jo) + val program = Program(engine) + program.loadFromFactDir(EqualOptimized.factDirectory) + EqualOptimized.pretest(program) + + blackhole.consume( + program.namedRelation(EqualOptimized.toSolve).solve() ) } @Benchmark - def tastyslistlib_jit_irop_online(blackhole: Blackhole) = { - val jo = JITOptions(mode = Mode.Interpreted, sortOrder = SortOrder.Sel) + def equal_interpreter_worst_offline(blackhole: Blackhole) = { + val jo = JITOptions(mode = Mode.Interpreted) + val engine = new StagedExecutionEngine(new DefaultStorageManager(), jo) + val program = Program(engine) + program.loadFromFactDir(EqualWorst.factDirectory) + EqualWorst.pretest(program) + + blackhole.consume( + program.namedRelation(EqualWorst.toSolve).solve() + ) + } + + + /** -----------------Tastyslistlib-----------------* */ + @Benchmark + def tastyslistlib_jit_lambda_online(blackhole: Blackhole) = { + val jo = JITOptions(mode = Mode.JIT, granularity = Granularity.DELTA, compileSync = CompileSync.Blocking, sortOrder = SortOrder.Sel, backend = Backend.Lambda) val engine = new StagedExecutionEngine(new DefaultStorageManager(), jo) val program = Program(engine) program.loadFromFactDir(TastyslistlibWorst.factDirectory) @@ -226,6 +269,7 @@ class BenchMacroBaseline { ) } + @Benchmark def tastyslistlib_interpreter_optimized_offline(blackhole: Blackhole) = { val jo = JITOptions(mode = Mode.Interpreted) @@ -253,18 +297,6 @@ class BenchMacroBaseline { ) } - @Benchmark - def tastyslistlibinverse_jit_irop_online(blackhole: Blackhole) = { - val jo = JITOptions(mode = Mode.Interpreted, sortOrder = SortOrder.Sel) - val engine = new StagedExecutionEngine(new DefaultStorageManager(), jo) - val program = Program(engine) - program.loadFromFactDir(TastyslistlibinverseWorst.factDirectory) - TastyslistlibinverseWorst.pretest(program) - - blackhole.consume( - program.namedRelation(TastyslistlibinverseWorst.toSolve).solve() - ) - } @Benchmark def tastyslistlibinverse_interpreter_optimized_offline(blackhole: Blackhole) = { diff --git a/dl_bench.sh b/dl_bench.sh index aa1cfc3e..831c239b 100755 --- a/dl_bench.sh +++ b/dl_bench.sh @@ -10,7 +10,9 @@ scp herlihy@diascld$1.iccluster.epfl.ch:/scratch/herlihy/carac/bench.out results #cat results/$2$1.csv | sed -e 's/"datalog\.benchmarks\.examples\.\([^\.]*\)\./\1_/' | sed -e 's/_EOL\([^"]*\)"*/,/' | sed -e "1s/Benchmark/Benchmark_mode_storage_sort_onlineSort_fuzzy_compileSync_granularity_backend,/" | sed -e "1s/\"//g" > results/$2$1_clean.csv cat results/$2$1.csv | - sed -e 's/"datalog\.benchmarks\.BenchMacro(.*)\.//' | + sed -e 's/"datalog\.benchmarks\.BenchMacroBaselineSlow\.//' | + sed -e 's/"datalog\.benchmarks\.BenchMacroBaseline\.//' | + sed -e 's/"datalog\.benchmarks\.BenchMacro\.//' | sed -e 's/jit_lambda/jit-lambda_nothing/' | sed -e 's/interpreter_optimized/interpreter-hand-optimized_nothing/' | sed -e 's/interpreter_worst/interpreter_nothing/' | diff --git a/src/test/scala/test/MacroCompilerPrograms.scala b/src/test/scala/test/MacroCompilerPrograms.scala index bebcc43d..f36c8705 100644 --- a/src/test/scala/test/MacroCompilerPrograms.scala +++ b/src/test/scala/test/MacroCompilerPrograms.scala @@ -1,18 +1,18 @@ package datalog import buildinfo.BuildInfo -import datalog.execution.{Backend, ExecutionEngine, JITOptions, MacroCompiler, SolvableProgram, SortOrder} +import datalog.execution.{Backend, ExecutionEngine, + JITOptions, MacroCompiler, SolvableProgram, SortOrder} import datalog.dsl.* import datalog.execution.ir.* import datalog.storage.{DefaultStorageManager, StorageManager} import test.examples.ackermann.* import test.examples.fib.* import test.examples.prime.* -import test.examples.fib.* -import test.examples.prime.* +import test.examples.cbaexprvalue.* +import test.examples.equal.* import test.examples.tastyslistlib.* import test.examples.tastyslistlibinverse.* -import test.examples.prime.* import java.nio.file.Paths @@ -37,264 +37,319 @@ class SimpleProgram(engine: ExecutionEngine) extends SolvableProgram(engine) { override val toSolve = pathFromA.name } -object SimpleMacroCompiler extends MacroCompiler(SimpleProgram(_), JITOptions(backend = Backend.MacroQuotes)) { +object SimpleMacroCompiler extends MacroCompiler( + SimpleProgram(_), + JITOptions(backend = Backend.MacroQuotes)) { // Currently crashes without the `this.` prefix: https://github.com/lampepfl/dotty/issues/18434 inline def compile(): StorageManager => Any = ${this.compileImpl()} } // TODO: move these into the test files -// Ackermann -class AckermannOptimizedProgram(engine: ExecutionEngine) extends SolvableProgram(engine) with ackermann_optimized { +/** ---------- Ackermann ---------- **/ +class AckermannWorstProgram(engine: ExecutionEngine) extends SolvableProgram(engine) with ackermann_worst { val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/ackermann/facts" initializeEmptyFactsFromDir(factDir) pretest(this) } -object AckermannOptimizedMacroCompiler extends MacroCompiler(AckermannOptimizedProgram(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { - inline def compile(): StorageManager => Any = ${this.compileImpl()} - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/ackermann/facts" -} - -class AckermannWorstProgram(engine: ExecutionEngine) extends SolvableProgram(engine) with ackermann_worst { +class AckermannWorstProgramWithFacts(engine: ExecutionEngine) extends SolvableProgram(engine) with ackermann_worst { val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/ackermann/facts" - initializeEmptyFactsFromDir(factDir) + loadFromFactDir(factDir) pretest(this) } -object AckermannWorstMacroCompiler extends MacroCompiler(AckermannWorstProgram(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { + +object AckermannWorstMacroCompiler extends MacroCompiler( + AckermannWorstProgram(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { // println("Ackermann NO FACTS") inline def compile(): StorageManager => Any = ${this.compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/ackermann/facts" } -class AckermannWorstProgramWithFacts(engine: ExecutionEngine) extends SolvableProgram(engine) with ackermann_worst { - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/ackermann/facts" - loadFromFactDir(factDir) - pretest(this) -} -object AckermannWorstMacroCompilerWithFacts extends MacroCompiler(AckermannWorstProgramWithFacts(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { +object AckermannWorstMacroCompilerWithFacts extends MacroCompiler( + AckermannWorstProgramWithFacts(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { // println("Ackermann WITH FACTS OFFLINE") inline def compile(): StorageManager => Any = ${compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/ackermann/facts" } -class AckermannWorstProgramOnline(engine: ExecutionEngine) extends SolvableProgram(engine) with ackermann_worst { - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/ackermann/facts" - initializeEmptyFactsFromDir(factDir) - pretest(this) -} -object AckermannWorstMacroCompilerOnline extends MacroCompiler(AckermannWorstProgramOnline(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { + +object AckermannWorstMacroCompilerOnline extends MacroCompiler( + AckermannWorstProgram(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { // println("Ackermann NO FACTS ONLINE") inline def compile(): StorageManager => Any = ${this.compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/ackermann/facts" } -class AckermannWorstProgramWithFactsOnline(engine: ExecutionEngine) extends SolvableProgram(engine) with ackermann_worst { - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/ackermann/facts" - loadFromFactDir(factDir) - pretest(this) -} -object AckermannWorstMacroCompilerWithFactsOnline extends MacroCompiler(AckermannWorstProgramWithFactsOnline(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { +object AckermannWorstMacroCompilerWithFactsOnline extends MacroCompiler( + AckermannWorstProgramWithFacts(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { // println("Ackermann WITH FACTS ONLINE") inline def compile(): StorageManager => Any = ${compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/ackermann/facts" } /** ---------- Fib ---------- **/ -class FibOptimizedProgram(engine: ExecutionEngine) extends SolvableProgram(engine) with fib_optimized { - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/fib/facts" - initializeEmptyFactsFromDir(factDir) - pretest(this) -} -object FibOptimizedMacroCompiler extends MacroCompiler(FibOptimizedProgram(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { - inline def compile(): StorageManager => Any = ${this.compileImpl()} - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/fib/facts" -} - class FibWorstProgram(engine: ExecutionEngine) extends SolvableProgram(engine) with fib_worst { val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/fib/facts" initializeEmptyFactsFromDir(factDir) pretest(this) } -object FibWorstMacroCompiler extends MacroCompiler(FibWorstProgram(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { - inline def compile(): StorageManager => Any = ${this.compileImpl()} - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/fib/facts" -} - class FibWorstProgramWithFacts(engine: ExecutionEngine) extends SolvableProgram(engine) with fib_worst { val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/fib/facts" loadFromFactDir(factDir) pretest(this) } -object FibWorstMacroCompilerWithFacts extends MacroCompiler(FibWorstProgramWithFacts(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { - inline def compile(): StorageManager => Any = ${compileImpl()} + +object FibWorstMacroCompiler extends MacroCompiler( + FibWorstProgram(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { + // println("Fib NO FACTS") + inline def compile(): StorageManager => Any = ${this.compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/fib/facts" } -class FibWorstProgramOnline(engine: ExecutionEngine) extends SolvableProgram(engine) with fib_worst { + +object FibWorstMacroCompilerWithFacts extends MacroCompiler( + FibWorstProgramWithFacts(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { + // println("Fib WITH FACTS OFFLINE") + inline def compile(): StorageManager => Any = ${compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/fib/facts" - initializeEmptyFactsFromDir(factDir) - pretest(this) } -object FibWorstMacroCompilerOnline extends MacroCompiler(FibWorstProgramOnline(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { + +object FibWorstMacroCompilerOnline extends MacroCompiler( + FibWorstProgram(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { + // println("Fib NO FACTS ONLINE") inline def compile(): StorageManager => Any = ${this.compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/fib/facts" } -class FibWorstProgramWithFactsOnline(engine: ExecutionEngine) extends SolvableProgram(engine) with fib_worst { - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/fib/facts" - loadFromFactDir(factDir) - pretest(this) -} -object FibWorstMacroCompilerWithFactsOnline extends MacroCompiler(FibWorstProgramWithFactsOnline(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { +object FibWorstMacroCompilerWithFactsOnline extends MacroCompiler( + FibWorstProgramWithFacts(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { + // println("Fib WITH FACTS ONLINE") inline def compile(): StorageManager => Any = ${compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/fib/facts" } /** ---------- Prime ---------- **/ -class PrimeOptimizedProgram(engine: ExecutionEngine) extends SolvableProgram(engine) with prime_optimized { +class PrimeWorstProgram(engine: ExecutionEngine) extends SolvableProgram(engine) with prime_worst { val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/prime/facts" initializeEmptyFactsFromDir(factDir) pretest(this) } -object PrimeOptimizedMacroCompiler extends MacroCompiler(PrimeOptimizedProgram(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { - inline def compile(): StorageManager => Any = ${this.compileImpl()} +class PrimeWorstProgramWithFacts(engine: ExecutionEngine) extends SolvableProgram(engine) with prime_worst { val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/prime/facts" + loadFromFactDir(factDir) + pretest(this) } -class PrimeWorstProgram(engine: ExecutionEngine) extends SolvableProgram(engine) with prime_worst { +object PrimeWorstMacroCompiler extends MacroCompiler( + PrimeWorstProgram(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { + // println("Prime NO FACTS") + inline def compile(): StorageManager => Any = ${this.compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/prime/facts" - initializeEmptyFactsFromDir(factDir) - pretest(this) } -object PrimeWorstMacroCompiler extends MacroCompiler(PrimeWorstProgram(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { - inline def compile(): StorageManager => Any = ${this.compileImpl()} + +object PrimeWorstMacroCompilerWithFacts extends MacroCompiler( + PrimeWorstProgramWithFacts(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { + // println("Prime WITH FACTS OFFLINE") + inline def compile(): StorageManager => Any = ${compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/prime/facts" } -class PrimeWorstProgramWithFacts(engine: ExecutionEngine) extends SolvableProgram(engine) with prime_worst { +object PrimeWorstMacroCompilerOnline extends MacroCompiler( + PrimeWorstProgram(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { + // println("Prime NO FACTS ONLINE") + inline def compile(): StorageManager => Any = ${this.compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/prime/facts" - loadFromFactDir(factDir) - pretest(this) } -object PrimeWorstMacroCompilerWithFacts extends MacroCompiler(PrimeWorstProgramWithFacts(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { + +object PrimeWorstMacroCompilerWithFactsOnline extends MacroCompiler( + PrimeWorstProgramWithFacts(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { + // println("Prime WITH FACTS ONLINE") inline def compile(): StorageManager => Any = ${compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/prime/facts" } -class PrimeWorstProgramOnline(engine: ExecutionEngine) extends SolvableProgram(engine) with prime_worst { - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/prime/facts" + +/** ---------- Equal ---------- **/ +class EqualWorstProgram(engine: ExecutionEngine) extends SolvableProgram(engine) with equal_worst { + val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/equal/facts" initializeEmptyFactsFromDir(factDir) pretest(this) } -object PrimeWorstMacroCompilerOnline extends MacroCompiler(PrimeWorstProgramOnline(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { +class EqualWorstProgramWithFacts(engine: ExecutionEngine) extends SolvableProgram(engine) with equal_worst { + val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/equal/facts" + loadFromFactDir(factDir) + pretest(this) +} + +object EqualWorstMacroCompiler extends MacroCompiler( + EqualWorstProgram(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { + // println("Equal NO FACTS") inline def compile(): StorageManager => Any = ${this.compileImpl()} - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/prime/facts" + val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/equal/facts" } -class PrimeWorstProgramWithFactsOnline(engine: ExecutionEngine) extends SolvableProgram(engine) with prime_worst { - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/prime/facts" - loadFromFactDir(factDir) - pretest(this) +object EqualWorstMacroCompilerWithFacts extends MacroCompiler( + EqualWorstProgramWithFacts(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { + // println("Equal WITH FACTS OFFLINE") + inline def compile(): StorageManager => Any = ${compileImpl()} + val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/equal/facts" +} + +object EqualWorstMacroCompilerOnline extends MacroCompiler( + EqualWorstProgram(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { + // println("Equal NO FACTS ONLINE") + inline def compile(): StorageManager => Any = ${this.compileImpl()} + val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/equal/facts" } -object PrimeWorstMacroCompilerWithFactsOnline extends MacroCompiler(PrimeWorstProgramWithFactsOnline(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { + +object EqualWorstMacroCompilerWithFactsOnline extends MacroCompiler( + EqualWorstProgramWithFacts(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { + // println("Equal WITH FACTS ONLINE") inline def compile(): StorageManager => Any = ${compileImpl()} - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/prime/facts" + val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/equal/facts" } -/** ---------- Tastyslistlib ---------- **/ -class TastyslistlibOptimizedProgram(engine: ExecutionEngine) extends SolvableProgram(engine) with tastyslistlib_optimized { - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlib/facts" +/** ---------- Cbaexprvalue ---------- **/ +class CbaexprvalueWorstProgram(engine: ExecutionEngine) extends SolvableProgram(engine) with cbaexprvalue_worst { + val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/cbaexprvalue/facts" initializeEmptyFactsFromDir(factDir) pretest(this) } -object TastyslistlibOptimizedMacroCompiler extends MacroCompiler(TastyslistlibOptimizedProgram(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { +class CbaexprvalueWorstProgramWithFacts(engine: ExecutionEngine) extends SolvableProgram(engine) with cbaexprvalue_worst { + val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/cbaexprvalue/facts" + loadFromFactDir(factDir) + pretest(this) +} + +object CbaexprvalueWorstMacroCompiler extends MacroCompiler( + CbaexprvalueWorstProgram(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { + // println("Cbaexprvalue NO FACTS") inline def compile(): StorageManager => Any = ${this.compileImpl()} - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlib/facts" + val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/cbaexprvalue/facts" +} + +object CbaexprvalueWorstMacroCompilerWithFacts extends MacroCompiler( + CbaexprvalueWorstProgramWithFacts(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { + // println("Cbaexprvalue WITH FACTS OFFLINE") + inline def compile(): StorageManager => Any = ${compileImpl()} + val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/cbaexprvalue/facts" +} + +object CbaexprvalueWorstMacroCompilerOnline extends MacroCompiler( + CbaexprvalueWorstProgram(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { + // println("Cbaexprvalue NO FACTS ONLINE") + inline def compile(): StorageManager => Any = ${this.compileImpl()} + val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/cbaexprvalue/facts" +} + +object CbaexprvalueWorstMacroCompilerWithFactsOnline extends MacroCompiler( + CbaexprvalueWorstProgramWithFacts(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { + // println("Cbaexprvalue WITH FACTS ONLINE") + inline def compile(): StorageManager => Any = ${compileImpl()} + val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/cbaexprvalue/facts" } +/** ---------- Tastyslistlib ---------- **/ class TastyslistlibWorstProgram(engine: ExecutionEngine) extends SolvableProgram(engine) with tastyslistlib_worst { val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlib/facts" initializeEmptyFactsFromDir(factDir) pretest(this) } -object TastyslistlibWorstMacroCompiler extends MacroCompiler(TastyslistlibWorstProgram(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { - inline def compile(): StorageManager => Any = ${this.compileImpl()} - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlib/facts" -} - class TastyslistlibWorstProgramWithFacts(engine: ExecutionEngine) extends SolvableProgram(engine) with tastyslistlib_worst { val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlib/facts" loadFromFactDir(factDir) pretest(this) } -object TastyslistlibWorstMacroCompilerWithFacts extends MacroCompiler(TastyslistlibWorstProgramWithFacts(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { - inline def compile(): StorageManager => Any = ${compileImpl()} + +object TastyslistlibWorstMacroCompiler extends MacroCompiler( + TastyslistlibWorstProgram(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { + // println("Tastyslistlib NO FACTS") + inline def compile(): StorageManager => Any = ${this.compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlib/facts" } -class TastyslistlibWorstProgramOnline(engine: ExecutionEngine) extends SolvableProgram(engine) with tastyslistlib_worst { + +object TastyslistlibWorstMacroCompilerWithFacts extends MacroCompiler( + TastyslistlibWorstProgramWithFacts(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { + // println("Tastyslistlib WITH FACTS OFFLINE") + inline def compile(): StorageManager => Any = ${compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlib/facts" - initializeEmptyFactsFromDir(factDir) - pretest(this) } -object TastyslistlibWorstMacroCompilerOnline extends MacroCompiler(TastyslistlibWorstProgramOnline(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { + +object TastyslistlibWorstMacroCompilerOnline extends MacroCompiler( + TastyslistlibWorstProgram(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { + // println("Tastyslistlib NO FACTS ONLINE") inline def compile(): StorageManager => Any = ${this.compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlib/facts" } -class TastyslistlibWorstProgramWithFactsOnline(engine: ExecutionEngine) extends SolvableProgram(engine) with tastyslistlib_worst { - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlib/facts" - loadFromFactDir(factDir) - pretest(this) -} -object TastyslistlibWorstMacroCompilerWithFactsOnline extends MacroCompiler(TastyslistlibWorstProgramWithFactsOnline(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { +object TastyslistlibWorstMacroCompilerWithFactsOnline extends MacroCompiler( + TastyslistlibWorstProgramWithFacts(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { + // println("Tastyslistlib WITH FACTS ONLINE") inline def compile(): StorageManager => Any = ${compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlib/facts" } /** ---------- Tastyslistlibinverse ---------- **/ -class TastyslistlibinverseOptimizedProgram(engine: ExecutionEngine) extends SolvableProgram(engine) with tastyslistlibinverse_optimized { - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlibinverse/facts" - initializeEmptyFactsFromDir(factDir) - pretest(this) -} -object TastyslistlibinverseOptimizedMacroCompiler extends MacroCompiler(TastyslistlibinverseOptimizedProgram(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { - inline def compile(): StorageManager => Any = ${this.compileImpl()} - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlibinverse/facts" -} - class TastyslistlibinverseWorstProgram(engine: ExecutionEngine) extends SolvableProgram(engine) with tastyslistlibinverse_worst { val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlibinverse/facts" initializeEmptyFactsFromDir(factDir) pretest(this) } -object TastyslistlibinverseWorstMacroCompiler extends MacroCompiler(TastyslistlibinverseWorstProgram(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { - inline def compile(): StorageManager => Any = ${this.compileImpl()} - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlibinverse/facts" -} - class TastyslistlibinverseWorstProgramWithFacts(engine: ExecutionEngine) extends SolvableProgram(engine) with tastyslistlibinverse_worst { val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlibinverse/facts" loadFromFactDir(factDir) pretest(this) } -object TastyslistlibinverseWorstMacroCompilerWithFacts extends MacroCompiler(TastyslistlibinverseWorstProgramWithFacts(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { - inline def compile(): StorageManager => Any = ${compileImpl()} + +object TastyslistlibinverseWorstMacroCompiler extends MacroCompiler( + TastyslistlibinverseWorstProgram(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { + // println("Tastyslistlibinverse NO FACTS") + inline def compile(): StorageManager => Any = ${this.compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlibinverse/facts" } -class TastyslistlibinverseWorstProgramOnline(engine: ExecutionEngine) extends SolvableProgram(engine) with tastyslistlibinverse_worst { + +object TastyslistlibinverseWorstMacroCompilerWithFacts extends MacroCompiler( + TastyslistlibinverseWorstProgramWithFacts(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax)) { + // println("Tastyslistlibinverse WITH FACTS OFFLINE") + inline def compile(): StorageManager => Any = ${compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlibinverse/facts" - initializeEmptyFactsFromDir(factDir) - pretest(this) } -object TastyslistlibinverseWorstMacroCompilerOnline extends MacroCompiler(TastyslistlibinverseWorstProgramOnline(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { + +object TastyslistlibinverseWorstMacroCompilerOnline extends MacroCompiler( + TastyslistlibinverseWorstProgram(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { + // println("Tastyslistlibinverse NO FACTS ONLINE") inline def compile(): StorageManager => Any = ${this.compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlibinverse/facts" } -class TastyslistlibinverseWorstProgramWithFactsOnline(engine: ExecutionEngine) extends SolvableProgram(engine) with tastyslistlibinverse_worst { - val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlibinverse/facts" - loadFromFactDir(factDir) - pretest(this) -} -object TastyslistlibinverseWorstMacroCompilerWithFactsOnline extends MacroCompiler(TastyslistlibinverseWorstProgramWithFactsOnline(_), JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { +object TastyslistlibinverseWorstMacroCompilerWithFactsOnline extends MacroCompiler( + TastyslistlibinverseWorstProgramWithFacts(_), + JITOptions(backend = Backend.MacroQuotes, sortOrder = SortOrder.IntMax, runtimeSort = SortOrder.Sel)) { + // println("Tastyslistlibinverse WITH FACTS ONLINE") inline def compile(): StorageManager => Any = ${compileImpl()} val factDir = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/tastyslistlibinverse/facts" } - diff --git a/src/test/scala/test/MacroCompilerTest.scala b/src/test/scala/test/MacroCompilerTest.scala index 017a3109..cfefd1f8 100644 --- a/src/test/scala/test/MacroCompilerTest.scala +++ b/src/test/scala/test/MacroCompilerTest.scala @@ -4,15 +4,15 @@ import datalog.execution.{ExecutionEngine, MacroCompiler, SolvableProgram} import datalog.dsl.* import datalog.execution.ir.* import datalog.storage.StorageManager -import datalog.{AckermannOptimizedMacroCompiler, FibOptimizedMacroCompiler, PrimeOptimizedMacroCompiler, SimpleMacroCompiler, TastyslistlibinverseOptimizedMacroCompiler, TastyslistlibOptimizedMacroCompiler} +import datalog.{AckermannWorstMacroCompiler, FibWorstMacroCompiler, PrimeWorstMacroCompiler, SimpleMacroCompiler, TastyslistlibinverseWorstMacroCompiler, TastyslistlibWorstMacroCompiler} object MacroCompilerTest { val simpleCompiled = SimpleMacroCompiler.compile() - val ackermannCompiled = AckermannOptimizedMacroCompiler.compile() - val tastyslistlibinverseCompiled = TastyslistlibinverseOptimizedMacroCompiler.compile() - val fibCompiled = FibOptimizedMacroCompiler.compile() - val primeCompiled = PrimeOptimizedMacroCompiler.compile() - val tastyslistlibCompiled = TastyslistlibOptimizedMacroCompiler.compile() + val ackermannCompiled = AckermannWorstMacroCompiler.compile() + val tastyslistlibinverseCompiled = TastyslistlibinverseWorstMacroCompiler.compile() + val fibCompiled = FibWorstMacroCompiler.compile() + val primeCompiled = PrimeWorstMacroCompiler.compile() + val tastyslistlibCompiled = TastyslistlibWorstMacroCompiler.compile() } import MacroCompilerTest.* @@ -24,27 +24,27 @@ class MacroCompilerTest extends munit.FunSuite { assertEquals(res, Set(Seq("b"), Seq("c"), Seq("d"))) } test("ackermann test") { - val res = AckermannOptimizedMacroCompiler.runCompiled(ackermannCompiled) { program => + val res = AckermannWorstMacroCompiler.runCompiled(ackermannCompiled) { program => program.loadFromFactDir(program.factDir) } } test("fib test") { - val res = FibOptimizedMacroCompiler.runCompiled(fibCompiled) { program => + val res = FibWorstMacroCompiler.runCompiled(fibCompiled) { program => program.loadFromFactDir(program.factDir) } } test("prime test") { - val res = PrimeOptimizedMacroCompiler.runCompiled(primeCompiled) { program => + val res = PrimeWorstMacroCompiler.runCompiled(primeCompiled) { program => program.loadFromFactDir(program.factDir) } } test("tastylistlib test") { - val res = TastyslistlibOptimizedMacroCompiler.runCompiled(tastyslistlibCompiled) { program => + val res = TastyslistlibWorstMacroCompiler.runCompiled(tastyslistlibCompiled) { program => program.loadFromFactDir(program.factDir) } } test("tastyslistlibinverse test") { - val res = TastyslistlibinverseOptimizedMacroCompiler.runCompiled(tastyslistlibinverseCompiled) { program => + val res = TastyslistlibinverseWorstMacroCompiler.runCompiled(tastyslistlibinverseCompiled) { program => program.loadFromFactDir(program.factDir) } println(res) diff --git a/src/test/scala/test/examples/cbaexprvalue/cbaexprvalue_optimized.scala b/src/test/scala/test/examples/cbaexprvalue/cbaexprvalue_optimized.scala index 28e76b6f..d5d73d46 100644 --- a/src/test/scala/test/examples/cbaexprvalue/cbaexprvalue_optimized.scala +++ b/src/test/scala/test/examples/cbaexprvalue/cbaexprvalue_optimized.scala @@ -10,12 +10,12 @@ trait cbaexprvalue_optimized { val factDirectory = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/cbaexprvalue/facts" val toSolve = "data_term" def pretest(program: Program): Unit = { - val kind = program.relation[Constant]("kind") - val term = program.relation[Constant]("term") - val app = program.relation[Constant]("app") - val lits = program.relation[Constant]("lits") - val vars = program.relation[Constant]("vars") - val abs = program.relation[Constant]("abs") + val kind = program.namedRelation[Constant]("kind") + val term = program.namedRelation[Constant]("term") + val app = program.namedRelation[Constant]("app") + val lits = program.namedRelation[Constant]("lits") + val vars = program.namedRelation[Constant]("vars") + val abs = program.namedRelation[Constant]("abs") val ctrl_term = program.relation[Constant]("ctrl_term") val ctrl_var = program.relation[Constant]("ctrl_var") val data_term = program.relation[Constant]("data_term") @@ -24,40 +24,37 @@ trait cbaexprvalue_optimized { val i, v, l, x, t1, f, b, a = program.variable() val any1, any2 = program.variable() - kind( "Lit" ) :- () - kind( "Var" ) :- () - kind( "Abs" ) :- () - kind( "App" ) :- () - - lits( 0, "3") :- () - lits( 1, "2" ) :- () - - term( 0, "Lit", 0 ) :- () - term( 1, "Lit", 1 ) :- () - - vars( 0, "x" ) :- () - vars( 1, "y" ) :- () - vars( 2, "z" ) :- () - - term( 2, "Var", 0 ) :- () - term( 3, "Var", 1 ) :- () - term( 4, "Var", 2 ) :- () - - abs( 0, 0, 8 ) :- () - abs( 1, 1, 7 ) :- () - abs( 2, 2, 4 ) :- () - - term( 5, "Abs", 0 ) :- () - term( 6, "Abs", 1 ) :- () - term( 7, "Abs", 2 ) :- () - - app( 0, 9, 1 ) :- () - app( 1, 2, 0 ) :- () - app( 2, 5, 6 ) :- () - - term( 8, "App", 0 ) :- () - term( 9, "App", 1 ) :- () - term( 10, "App", 2 ) :- () +// kind( "Lit" ) :- () +// kind( "Var" ) :- () +// kind( "Abs" ) :- () +// kind( "App" ) :- () +// +// lits( 0, "3") :- () +// lits( 1, "2" ) :- () + +// vars( 0, "x" ) :- () +// vars( 1, "y" ) :- () +// vars( 2, "z" ) :- () + +// abs( 0, 0, 8 ) :- () +// abs( 1, 1, 7 ) :- () +// abs( 2, 2, 4 ) :- () + +// term(0, "Lit", 0) :- () +// term(1, "Lit", 1) :- () +// term(2, "Var", 0) :- () +// term(3, "Var", 1) :- () +// term(4, "Var", 2) :- () +// term(5, "Abs", 0) :- () +// term(6, "Abs", 1) :- () +// term(7, "Abs", 2) :- () +// term(8, "App", 0) :- () +// term(9, "App", 1) :- () +// term(10, "App", 2) :- () + +// app( 0, 9, 1 ) :- () +// app( 1, 2, 0 ) :- () +// app( 2, 5, 6 ) :- () data_term( i, v ) :- ( term(i, "Lit", l), lits(l, v) ) diff --git a/src/test/scala/test/examples/cbaexprvalue/cbaexprvalue_worst.scala b/src/test/scala/test/examples/cbaexprvalue/cbaexprvalue_worst.scala index c8961d3c..6e8004b3 100644 --- a/src/test/scala/test/examples/cbaexprvalue/cbaexprvalue_worst.scala +++ b/src/test/scala/test/examples/cbaexprvalue/cbaexprvalue_worst.scala @@ -10,12 +10,12 @@ trait cbaexprvalue_worst { val factDirectory = s"${BuildInfo.baseDirectory}/src/test/scala/test/examples/cbaexprvalue/facts" val toSolve = "data_term" def pretest(program: Program): Unit = { - val kind = program.relation[Constant]("kind") - val term = program.relation[Constant]("term") - val app = program.relation[Constant]("app") - val lits = program.relation[Constant]("lits") - val vars = program.relation[Constant]("vars") - val abs = program.relation[Constant]("abs") + val kind = program.namedRelation[Constant]("kind") + val term = program.namedRelation[Constant]("term") + val app = program.namedRelation[Constant]("app") + val lits = program.namedRelation[Constant]("lits") + val vars = program.namedRelation[Constant]("vars") + val abs = program.namedRelation[Constant]("abs") val ctrl_term = program.relation[Constant]("ctrl_term") val ctrl_var = program.relation[Constant]("ctrl_var") val data_term = program.relation[Constant]("data_term") @@ -24,40 +24,40 @@ trait cbaexprvalue_worst { val i, v, l, x, t1, f, b, a = program.variable() val any1, any2 = program.variable() - kind( "Lit" ) :- () - kind( "Var" ) :- () - kind( "Abs" ) :- () - kind( "App" ) :- () - - lits( 0, "3") :- () - lits( 1, "2" ) :- () - - term( 0, "Lit", 0 ) :- () - term( 1, "Lit", 1 ) :- () - - vars( 0, "x" ) :- () - vars( 1, "y" ) :- () - vars( 2, "z" ) :- () - - term( 2, "Var", 0 ) :- () - term( 3, "Var", 1 ) :- () - term( 4, "Var", 2 ) :- () - - abs( 0, 0, 8 ) :- () - abs( 1, 1, 7 ) :- () - abs( 2, 2, 4 ) :- () - - term( 5, "Abs", 0 ) :- () - term( 6, "Abs", 1 ) :- () - term( 7, "Abs", 2 ) :- () - - app( 0, 9, 1 ) :- () - app( 1, 2, 0 ) :- () - app( 2, 5, 6 ) :- () - - term( 8, "App", 0 ) :- () - term( 9, "App", 1 ) :- () - term( 10, "App", 2 ) :- () +// kind( "Lit" ) :- () +// kind( "Var" ) :- () +// kind( "Abs" ) :- () +// kind( "App" ) :- () +// +// lits( 0, "3") :- () +// lits( 1, "2" ) :- () +// +// term( 0, "Lit", 0 ) :- () +// term( 1, "Lit", 1 ) :- () +// +// vars( 0, "x" ) :- () +// vars( 1, "y" ) :- () +// vars( 2, "z" ) :- () +// +// term( 2, "Var", 0 ) :- () +// term( 3, "Var", 1 ) :- () +// term( 4, "Var", 2 ) :- () +// +// abs( 0, 0, 8 ) :- () +// abs( 1, 1, 7 ) :- () +// abs( 2, 2, 4 ) :- () +// +// term( 5, "Abs", 0 ) :- () +// term( 6, "Abs", 1 ) :- () +// term( 7, "Abs", 2 ) :- () +// +// app( 0, 9, 1 ) :- () +// app( 1, 2, 0 ) :- () +// app( 2, 5, 6 ) :- () +// +// term( 8, "App", 0 ) :- () +// term( 9, "App", 1 ) :- () +// term( 10, "App", 2 ) :- () data_term( i, v ) :- ( term(i, "Lit", l), lits(l, v) ) diff --git a/src/test/scala/test/examples/equal/equal_optimized.scala b/src/test/scala/test/examples/equal/equal_optimized.scala index 3d28c0c8..2c3dadda 100644 --- a/src/test/scala/test/examples/equal/equal_optimized.scala +++ b/src/test/scala/test/examples/equal/equal_optimized.scala @@ -15,7 +15,7 @@ trait equal_optimized { val isEqual = program.relation[Constant]("isEqual") - val succ = program.relation[Constant]("succ") + val succ = program.namedRelation[Constant]("succ") val m, n, r, pn, pm = program.variable() @@ -25,25 +25,25 @@ trait equal_optimized { isEqual(r) :- equal("5", "7", r) - succ("0", "1") :- () - succ("1", "2") :- () - succ("2", "3") :- () - succ("3", "4") :- () - succ("4", "5") :- () - succ("5", "6") :- () - succ("6", "7") :- () - succ("7", "8") :- () - succ("8", "9") :- () - succ("9", "10") :- () - succ("10", "11") :- () - succ("11", "12") :- () - succ("12", "13") :- () - succ("13", "14") :- () - succ("14", "15") :- () - succ("15", "16") :- () - succ("16", "17") :- () - succ("17", "18") :- () - succ("18", "19") :- () - succ("19", "20") :- () +// succ("0", "1") :- () +// succ("1", "2") :- () +// succ("2", "3") :- () +// succ("3", "4") :- () +// succ("4", "5") :- () +// succ("5", "6") :- () +// succ("6", "7") :- () +// succ("7", "8") :- () +// succ("8", "9") :- () +// succ("9", "10") :- () +// succ("10", "11") :- () +// succ("11", "12") :- () +// succ("12", "13") :- () +// succ("13", "14") :- () +// succ("14", "15") :- () +// succ("15", "16") :- () +// succ("16", "17") :- () +// succ("17", "18") :- () +// succ("18", "19") :- () +// succ("19", "20") :- () } } diff --git a/src/test/scala/test/examples/equal/equal_worst.scala b/src/test/scala/test/examples/equal/equal_worst.scala index 33f84faf..f42b0998 100644 --- a/src/test/scala/test/examples/equal/equal_worst.scala +++ b/src/test/scala/test/examples/equal/equal_worst.scala @@ -15,7 +15,7 @@ trait equal_worst { val isEqual = program.relation[Constant]("isEqual") - val succ = program.relation[Constant]("succ") + val succ = program.namedRelation[Constant]("succ") val m, n, r, pn, pm = program.variable() @@ -25,25 +25,25 @@ trait equal_worst { isEqual(r) :- equal("5", "7", r) - succ("0", "1") :- () - succ("1", "2") :- () - succ("2", "3") :- () - succ("3", "4") :- () - succ("4", "5") :- () - succ("5", "6") :- () - succ("6", "7") :- () - succ("7", "8") :- () - succ("8", "9") :- () - succ("9", "10") :- () - succ("10", "11") :- () - succ("11", "12") :- () - succ("12", "13") :- () - succ("13", "14") :- () - succ("14", "15") :- () - succ("15", "16") :- () - succ("16", "17") :- () - succ("17", "18") :- () - succ("18", "19") :- () - succ("19", "20") :- () +// succ("0", "1") :- () +// succ("1", "2") :- () +// succ("2", "3") :- () +// succ("3", "4") :- () +// succ("4", "5") :- () +// succ("5", "6") :- () +// succ("6", "7") :- () +// succ("7", "8") :- () +// succ("8", "9") :- () +// succ("9", "10") :- () +// succ("10", "11") :- () +// succ("11", "12") :- () +// succ("12", "13") :- () +// succ("13", "14") :- () +// succ("14", "15") :- () +// succ("15", "16") :- () +// succ("16", "17") :- () +// succ("17", "18") :- () +// succ("18", "19") :- () +// succ("19", "20") :- () } }