Open and answer this issue on GitHub.
ready · opened 2026-11-28 · updated 2026-11-28 · 0 comments
scripts/perfgate.nika, count(): the line
let totals = sh(f"cat {out}.*.callgrind 2>/dev/null | grep -E '^(totals|summary):'").stdout
matches both lines callgrind writes at the end of each output file, and both hold the same figure:
summary: 92957279108 12978175006 593374528 1478474865 153726635
totals: 92957279108 12978175006 593374528 1478474865 153726635
So every count, and every value in benches/perf.baseline, is twice the real instruction count. For example, check.drive is recorded as 137.9G, but the real count is about 69G. Ratios and the 2% tolerance are unaffected, so the gate’s verdicts stay right. Only the absolute figures are wrong, along with anything that quotes them (docs/measuring.md: never quote a wrong figure).
count(), sum only the totals: line of each file. Use grep -E '^totals:', or summary: where totals: is missing. files then counts files, not lines.benches/perf.baseline with --bless in its own commit, which halves every value. Say in the commit that nothing got faster.The figure for one row of nikaia run scripts/perfgate.nika -- --only check.gate equals the totals: value of a single valgrind --tool=callgrind run of the same command (for a run without child processes).