Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/kleene

bench/projecting.md

Joins that project a variable away (2026-11-30)

cargo bench -p kleene-plan --bench projecting -- <shape> <scale> <explain 0|1> <threads>, one run per process (peak resident memory by /usr/bin/time -v where the host has it). "Before" is main at the RED commit (2a15936: the counters only), "after" the GREEN commit: the bindings made one once a variable is no longer needed, the heads added by batch, the why in chunks of new facts. Shapes (see the bench's header):

peak_rows is StratumReport::peak_rows (the most rows a rule's bindings carried at once), proof_rows StratumReport::proof_rows (derivation rows written).

oden: AMD Ryzen Threadripper PRO 3975WX, 32 threads; another session loaded it (load 134-198)

shape explain before peak RSS before s after peak RSS after s rows carried before / after derivation rows before / after
jret 1500 (36024000 facts) off 36.0 GB 50.8 2.27 GB 2.85 576192000 / 36012000 -
jret 1500 on 69.8 GB 75.8 3.78 GB 4.41 576192000 / 36012000 576384000 / 36024000
chain off 1.44 GB 2.16 1.44 GB 2.08 20000000 / 20000000 -
chain on 2.43 GB 3.90 2.30 GB 3.32 20000000 / 20000000 20000000 / 20000000
walk off 0.75 GB 3.67 0.77 GB 2.17 14146088 / 2767311 -
walk on 1.28 GB 4.80 0.92 GB 2.21 14146088 / 2767311 8000000 / 8000000
walk1 off 0.54 GB 2.36 0.48 GB 1.34 3536522 / 2767311 -
walk1 on 1.01 GB 3.26 0.86 GB 1.49 3536522 / 2767311 8000000 / 8000000

Earlier the same evening at load 12: jret 1500 before 36.0 GB / 41.8 s (off) and 69.8 GB / 67.5 s (on).

dwarf: AMD Ryzen 5 7535HS, 12 threads, quiet lock held (load 3.6-7.4 from others)

Seconds, three rounds each (before and after alternating); no /usr/bin/time on the host.

shape explain before s after s
jret 200 (4001600 facts) off 9.58, 8.61, 8.68 0.475, 0.502, 0.490
jret 200 on 14.28, 13.61, 14.00 0.760, 0.690, 0.676
chain off 3.04, 2.36, 2.38 2.44, 2.22, 2.22
chain on 5.19, 4.64, 4.48 4.02, 3.86, 3.82
walk off 5.09, 4.39, 4.37 2.40, 2.20, 2.21
walk on 6.38, 6.06, 5.91 2.67, 2.65, 2.60
walk1 off 2.99, 2.70, 2.68 1.52, 1.49, 1.44
walk1 on 4.68, 3.87, 3.95 1.85, 1.74, 1.67

kleene-iceberg's delta bench (zox-M, func_fcall_func, 12 threads; a reach, a join of one step and a count, from scratch and continued) runs in the same time before and after: from scratch 0.6-1.2 ms, continued 0.1-0.3 ms per case, every round.

Round 2: the join order (2026-11-30)

"Before" is main at 43b414a (round 1); "after" the GREEN commit of round 2. Shapes added to the bench (see its header), each the shape of a stratum heimdal measured on the ripgrep set with kleene 09983f1 (23162 holes; their peak_rows against facts in brackets):

oden, 32 threads (load 40-48 from other sessions)

shape explain before peak RSS before s after peak RSS after s rows carried before / after
place (820 facts) off 4.46 GB 5.18 0.03 GB 0.013 98400000 / 820
place on 4.42 GB 5.15 0.03 GB 0.009 98400000 / 820
fail (4263 facts) off 2.71 GB 2.62 0.15 GB 0.10 57905000 / 4263
fail on 3.64 GB 2.71 0.15 GB 0.09 57905000 / 4263
loose (2000 facts) off 0.75 GB 0.39 0.57 GB 0.29 9800000 / 140000
loose on 0.84 GB 0.40 0.57 GB 0.25 9800000 / 140000
fscope (5000 facts) off 0.47 GB 0.26 0.02 GB 0.08 10000000 / 5000
fscope on 0.46 GB 0.24 0.02 GB 0.09 10000000 / 5000
jret 1000 off 1.27 GB 1.76, 1.39 1.27 GB 1.49, 1.61 20000000 / 20000000
jret 1000 on 2.08 GB 2.24, 1.91 2.08 GB 2.08, 2.08 20000000 / 20000000
chain off 1.44 GB 1.55 1.47 GB 1.53 20000000 / 20000000
chain on 2.30 GB 2.34 2.30 GB 2.27 20000000 / 20000000
walk off 0.75 GB 1.31 0.75 GB 1.38 2767311 / 2767311
walk on 0.89 GB 1.41 0.89 GB 1.45 2767311 / 2767311
walk1 off 0.47 GB 0.82 0.47 GB 0.85 2767311 / 2767311
walk1 on 0.85 GB 0.94 0.84 GB 1.01 2767311 / 2767311

dwarf, 12 threads, quiet lock held (load 7.2-9.5 from others), three rounds

shape explain before s after s
place off 6.40, 6.26, 6.25 0.019, 0.013, 0.013
place on 6.27, 6.16, 6.30 0.012, 0.013, 0.016
fail off 3.74, 3.55, 3.60 0.119, 0.123, 0.118
fail on 4.55, 4.48, 4.38 0.121, 0.129, 0.125
loose off 0.543, 0.534, 0.561 0.385, 0.402, 0.467
loose on 0.588, 0.627, 0.608 0.399, 0.443, 0.395
fscope off 0.429, 0.429, 0.426 0.086, 0.090, 0.085
fscope on 0.437, 0.465, 0.446 0.090, 0.088, 0.089
jret 1000 off 2.53, 2.50, 2.39 2.59, 2.53, 2.37
jret 1000 on 3.78, 3.65, 3.69 3.70, 3.75, 3.59
chain off 2.35, 2.46, 2.34 2.30, 2.36, 2.28
chain on 4.16, 4.24, 4.06 4.18, 4.02, 4.29
walk off 2.46, 2.62, 2.57 2.43, 2.62, 2.97
walk on 2.88, 3.32, 2.77 3.02, 3.10, 2.95
walk1 off 1.55, 1.74, 1.95 1.68, 1.58, 1.78
walk1 on 2.02, 2.11, 2.01 1.90, 1.95, 2.11

The delta bench (zox-M, 12 threads) is the same before and after: from scratch 0.6-0.9 ms, continued 0.1-0.3 ms per case, every round.