bench: add reps (median ± spread) to compare_bench.py#30
Merged
Conversation
Within-node variance bit us once already (a benchmark "+19% wall" that was
concurrent-job contention, not code). Make that noise visible: a label's PATH
may now be a comma-separated list of rep CSVs/dirs — repeated runs of the same
config — reduced to the MEDIAN per metric, with the relative half-range shown as
`median ±N%`. Δ% compares medians.
- parse_run: LABEL=PATH[,PATH...]; each path a CSV or dir.
- load_reps: median + spread per (key, metric) across reps.
- print_table: `median ±N%` cells when reps>1; header shows `label (n=N)`.
- --json: emits {nreps, median, spread} per run.
Single-path usage is unchanged (no spread shown). Pure stdlib.
Usage:
compare_bench.py --baseline main=r1_main,r2_main,r3_main \
--compare branch=r1_br,r2_br,r3_br
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes within-node benchmark noise visible. A label's
PATHcan now be acomma-separated list of rep CSVs/dirs — repeated runs of the same config —
reduced to the median per metric, with the relative half-range shown as
median ±N%. Δ% compares medians.Motivated by this investigation: a scary "+19% wall" turned out to be
concurrent-job contention on a shared node, not code. Reps surface that kind of
run-to-run variance directly instead of letting a single noisy run mislead.
Changes
parse_run:LABEL=PATH[,PATH...]— each path a CSV file or a directory.load_reps: median + spread (relative half-range) per(key, metric)across reps.print_table:median ±N%cells whenreps>1; banner showslabel (n=N).--json: emits{nreps, median, spread}per run.Single-path usage is unchanged (no spread shown). Pure stdlib; benchmark tooling only.
Example
🤖 Generated with Claude Code