Closes the three tractable pending buckets (all non-no_dir work):
+ lean4-0004..0007: 4 correctness/race benches (ir_interp DCL, jobreg
IO.Ref race, g_opts thread-local leakage, process envvar hash).
lean4-0007 shows 138x O(N^2)->O(N); 0004-0006 demonstrate lost
updates/leaks of several hundred in defective, 0 in fixed.
+ 0ad-0001..0004: 3 CWE-407 list.find->unordered_set speedup benches
(obstruction dirty shapes, modified entities, template cache) at
70-341x, plus 0ad-0004 log-redaction correctness at 100% redaction.
+ activemq-0001..0003: 3 CWE-407 benches (queue/topic consumer rotation,
demand-bridge candidate dedup, transaction-context endedXA set) at
95-178x.
+ linux-0001..0008: 8 Python complexity-class models for the kernel
patches. Coexist with the existing build-and-bench.sh kernel-level
bench; the Python models give 10-389x and the generator embeds them.
+ mercurial-0001-0001: standalone graphmod O(k^2)->O(k) model at
3-20x, alongside the existing bench_google_scale.py (which imports
the real mercurial graphmod).
Progress: 13 -> 33 full coverage. Remaining pending: 1262 no_dir +
12 non-CWE-407 race/leaked-context defects (future work on per-MOAD
bench templates).
40 lines
967 B
Python
40 lines
967 B
Python
#!/usr/bin/env python3
|
|
# run_all.py -- run all lean4 bench scripts and write results.txt
|
|
|
|
import sys
|
|
import os
|
|
import importlib.util
|
|
|
|
BENCH_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
def load_module(filename):
|
|
path = os.path.join(BENCH_DIR, filename)
|
|
spec = importlib.util.spec_from_file_location("mod", path)
|
|
mod = importlib.util.module_from_spec(spec)
|
|
spec.loader.exec_module(mod)
|
|
return mod
|
|
|
|
all_lines = []
|
|
|
|
for fname in [
|
|
"bench-lean4-0001.py",
|
|
"bench-lean4-0002.py",
|
|
"bench-lean4-0003.py",
|
|
"bench-lean4-0004.py",
|
|
"bench-lean4-0005.py",
|
|
"bench-lean4-0006.py",
|
|
"bench-lean4-0007.py",
|
|
]:
|
|
mod = load_module(fname)
|
|
lines = mod.run()
|
|
all_lines.extend(lines)
|
|
all_lines.append("")
|
|
print()
|
|
sys.stdout.flush()
|
|
|
|
out_path = os.path.join(BENCH_DIR, "results.txt")
|
|
with open(out_path, "w") as f:
|
|
f.write("\n".join(all_lines) + "\n")
|
|
|
|
print(f"results written to {out_path}")
|
|
sys.stdout.flush()
|