Benchmarks¶
Every benchmark from the upstream Nim reference under
integration_tests/examples/ is auto-translated to Python DSL via
tools/nim_to_dsl.py and lives in examples/. All compile through
HIR/MIR cleanly; the smoke-tested ones also compile + run end-to-end
on this box.
Canonical benchmarks¶
Benchmark |
Relations |
Rules |
Strata |
MIR steps |
Notes |
|---|---|---|---|---|---|
|
4 |
1 |
1 |
2 |
Classic 3-way self-join |
|
3 |
3 |
3 |
6 |
Transitive closure |
|
2 |
2 |
2 |
4 |
Same-generation |
|
5 |
4 |
2 |
4 |
Pointer analysis |
|
7 |
12 |
3 |
10 |
Context-sensitive points-to |
|
8 |
8 |
2 |
6 |
Ontology closure |
|
22 |
24 |
17 |
39 |
CRDT replication semantics |
|
38 |
38 |
32 |
68 |
Rust borrow-checker |
|
39 |
23 |
11 |
30 |
Binary disassembly (needs |
|
16 |
10 |
2 |
9 |
Register-SCC subquery of ddisasm |
|
76 |
84 |
16 |
60 |
Java points-to (needs |
LSQB triangle variants¶
Benchmark |
Notes |
|---|---|
|
Basic 3-way triangle count |
|
2-hop path |
|
Count variant of q6 |
|
Left-join / optional pattern |
|
2-hop with negation |
|
Count-only triangle |
Running one¶
# Synthetic, no input data:
python examples/run_benchmark.py triangle
# Needs a CSV dir:
python examples/run_benchmark.py tc --data /path/to/edges
# Needs a CSV dir + meta JSON:
python examples/run_benchmark.py doop \
--data /path/to/doop_input_dir \
--meta /path/to/batik_meta.json
# Compile only (no run):
python examples/run_benchmark.py galen --no-run
# Cap fixpoint for a sanity-check run:
python examples/run_benchmark.py polonius_test --data /path/to/data --max-iter 3
Each invocation prints one line per phase (DSL build → emit → compile → load → run) with wall-clock timings — useful when diagnosing where time is going on your box.
Regenerating from Nim¶
When upstream Nim sources change, regenerate every benchmark with:
for nim in integration_tests/examples/*/*.nim; do
python tools/nim_to_dsl.py "$nim" --out examples/$(basename "$nim" .nim).py
done
The translator is deliberately noisy — it raises on any syntax it
hasn’t been taught, so you’ll see exactly which benchmarks regressed.
See tools/nim_to_dsl.py’s header for the full supported subset.