adriangb opened a new pull request, #27805: URL: https://github.com/apache/datafusion/pull/27805
## Which issue does this PR close? - None. Follow-up to noisy benchmark-bot results, for example on [#27738](https://github.com/apache/datafusion/pull/27738). ## Rationale for this change `benchmarks/compare.py` flags any query whose min-time ratio is outside ±5%. With noisy benchmarks (for example `sort_pushdown_inexact` with `SIMULATE_LATENCY=true`, 20-35% stddev over 5 iterations), a same-SHA A/A run reported changes from 1.43x faster to 1.56x slower. Reviewers then chase noise. ## What changes are included in this PR? | Case | Verdict rule | |---|---| | Both sides have ≥ 2 iterations | Change only if the 95% bootstrap CI of `median(comp) / median(base)` excludes 1.0 **and** the median ratio is outside `--noise-threshold` | | Either side has 1 iteration | Unchanged: `comp / base` of the displayed value against `--noise-threshold` | - The bootstrap is pure Python (`random`, `statistics`), 2000 resamples, fixed seed 42, so output is reproducible. - The output format is unchanged: same tables, columns, summary rows and `1.12x slower` / `+1.43x faster` / `no change` strings. The displayed times and totals still use min (or mean with `--detailed`). The ratio in the change string is the median ratio when a CI exists. - New opt-in `--show-ci` flag adds a `95% CI (median ratio)` column. It is off by default so existing parsers (the benchmark bot) see the same columns. - JSON input and `dfbench` are unchanged. ## What is the testing strategy for this PR? New `benchmarks/test_compare.py` (`uv run --no-project --with rich python -m unittest test_compare` from `benchmarks/`): - A/A of 10 queries with ±30% noise: all `no change`. Under the old rule the same data reports, for example, Q4 as `1.30x slower`. - 2x slowdown and 2x speedup with the same noise: every query reported. - Single-iteration input falls back to the threshold rule (`1.50x slower`, CI `n/a`). - The CI is identical across calls. ## Are there any user-facing changes? Only for users of `benchmarks/compare.py`: fewer false positives on noisy queries, and a new `--show-ci` flag. No library API changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
