Skip to main content

Module compare

Module compare 

Source
Expand description

Compare one commit’s measurements against another’s.

This is the part that can block a pull request, so it is deliberately narrow about what it will fail on. Only instruction counts gate. Wall clock is reported beside them and never gated: on identical hardware it moves 4-20% run to run, so a threshold tight enough to catch a real regression fires constantly, and one loose enough to stay quiet catches nothing.

Rendering lives in markdown, separate from the comparison itself, so a chart or a different report format is a new function rather than a rewrite.

Structs§

Change
One metric, on one series, on both sides.
Comparison
Gate
When an instruction count has risen far enough to fail tak compare.
Gates
The gate for every series, as tak.toml declares it.

Constants§

ALLOWED_EMPTY
The line saying an empty comparison passed only because allow_empty let it, shared by every report that can say it so they word it alike.
GATED_METRIC
The only metric a gate may fire on.

Functions§

build_trend
Assemble a trend from trunk history plus the revision under comparison.
check_pct
Reject a gate percentage that cannot mean what it says.
compare
Compare two sets of records.
describe
How a series is named in prose: bench, plus the tool when it is not the project itself, plus the runner.
escape_control
text with every control character written as its escape (\n, \u{1b}), borrowed unchanged in the usual case of there being none.
gate_source
The Comparison::gate_source line: where the gate came from, when the base had no tak.toml or the head’s would gate differently; None when there is nothing to say.
markdown
sparkline
A sparkline, scaled to the series’ own range.

Type Aliases§

Key
What identifies a comparable series.
Trend
Recent values for each series, oldest first.