--- name: fair-baseline description: Finds the honest comparison for a performance or quality claim (the standard tool or best known method), runs both under identical conditions, and reports medians with spread. Use when a claim says faster, better, cheaper or state of the art, and especially when the baseline was chosen by the claimant. --- # Fair baseline "10× faster" is only as true as the thing it's 10× faster than. The commonest way a real result gets inflated is a weak or unfairly run comparison. Part of the Verification Bench (case file: see `verify`). ## Steps 1. **Choose the baseline yourself.** The obvious standard (the language's built-in, the best-known library, the published state of the art), not only the one the claimant picked. If theirs differs, run both. 2. **Reproduce the baseline's own published number first**, where one exists (a built-in like `sorted()` has none; skip this then). If you can't, your setup is off; fix that before comparing. 3. **Make the conditions identical**, and write each down: | Check | Common unfairness | |---|---| | Build mode | release vs debug, `-O3` vs `-O0` | | Hardware | same machine, same power mode, nothing else running | | Threads | parallel vs single-threaded | | Warmth | warm cache or JIT for one, cold for the other | | Inputs | same data, same sizes, same order (sorted inputs flatter some algorithms) | | Work done | same output checked; the fast one may skip validation or I/O | | Settings | tuned for theirs, defaults for the baseline | 4. **Measure properly.** At least 5 runs each, report median and spread. - CLIs: `hyperfine --warmup 3 --runs 10 '' ''` - Python: `python -m pyperf timeit` or `timeit` with `-r 7` - Rust: `criterion`; JS: `mitata` or `tinybench` - None installed and no network: a loop around the language's monotonic clock (`time.perf_counter`, `Instant::now`, `performance.now`), median of the runs, warm-up runs discarded. Say which you used. 5. **Check they give the same answer** on every input you timed. A faster wrong answer isn't faster. 6. **Sweep the size.** Three or more input sizes: claims often hold only at one. ## Entry ```markdown ### fair-baseline · · PASS | FAIL | INCONCLUSIVE - Baseline: , reproduced its published : yes/no - Conditions: - Saw: | size | theirs (median, spread) | baseline | ratio | - Same answers on all inputs: yes/no ```