bench_tools,ci: gate benchmark regressions on the confidence interval - #14958
Open
asaf-sw wants to merge 1 commit into
Open
bench_tools,ci: gate benchmark regressions on the confidence interval#14958asaf-sw wants to merge 1 commit into
asaf-sw wants to merge 1 commit into
Conversation
asaf-sw
force-pushed
the
asaf/ci-08-benchmark-noise
branch
2 times, most recently
from
August 13, 2026 07:19
700ade7 to
e0c4df0
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e0c4df0. Configure here.
asaf-sw
force-pushed
the
asaf/ci-08-benchmark-noise
branch
from
August 13, 2026 07:36
e0c4df0 to
eb2ba82
Compare
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
asaf-sw
force-pushed
the
asaf/ci-08-benchmark-noise
branch
from
August 13, 2026 08:22
eb2ba82 to
1070543
Compare
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.

Problem
The
benchmarkingjob fails on noise:Same commit, two attempts:
transfers_benchmark_cairo_nativetransfers_sequential_benchmark_vmThe true change is 0%, so the observed noise floor reaches at least 31.59% while the limit is 8.0%. The cairo_native absolute time swung 197ms to 159ms between runs of the same binary, and the two benchmarks moved in opposite directions.
Two defects underneath:
types/estimates.rsalready deserializes it, butcheck_regressionscomparedmean.point_estimateagainst the limit, so a single noisy measurement fails the job.runner.rsprinted per-benchmark results only after something had already failed; on success it printed just "All benchmarks passed regression check!". So the run-to-run noise was invisible, which is why the limit was never calibrated against it.Change
--regression-limitfrom 8.0 to 40.0, clear of observed noise with margin.check_regressionsinto a purecompare_estimates, so the decision logic is unit testable at all. That is what the new tests exercise.Verification
New tests in
comparison_test.rs:noisy_change_with_interval_below_the_limit_is_not_a_regressionchange_with_interval_above_the_limit_is_a_regressionchange_below_the_limit_passesabsolute_limit_trips_independently_of_the_relative_checkno_benchmarks_produces_no_comparisonscargo clippy -p bench_tools --all-targets -- -D warningsclean, YAML parses.Which change actually rescues the observed failure
Worth being precise, because the two changes cover different failure modes. The observed run's intervals were tight: base vm
[819.16, 872.45] ms, new vm[1091.6, 1127.5] ms. That puts the change interval at roughly[+25%, +38%], so the interval lower bound is about +25%.Against the old 8.0 limit that still fails. It is the raised limit, not the confidence interval, that prevents this particular false regression. The interval gate covers the complementary case, where a single run is too noisy to support any conclusion, and it is a strict improvement in its own right, but it is not what rescues this run. Anyone reviewing the 35.0 number should weigh it on its own merits rather than assuming the interval gate is carrying it.
Note on the number
The limit is compared against the lower bound of the change confidence interval, not the point estimate. For the worst same-commit run observed, that lower bound is about +25%, so 40.0 clears it with roughly 15 points of margin, and a run noisier than anything seen so far still would not fail.
It is derived from four same-commit data points, which is thin. Now that passing runs print their numbers, the limit can be re-derived from the actual distribution after a few weeks. I left that instruction as a comment on the step.
The absolute-time backstop was dead (found in review)
An earlier revision of this PR claimed the absolute-time limits remained the backstop. They did not. They named
transfers_benchmark_cairo_nativeandtransfers_benchmark_vm, but the benchmarks are actually namedtransfers_sequential_benchmark_cairo_nativeandtransfers_sequential_benchmark_vm(types/benchmark_config.rs:59,73).absolute_time_ns_limits.get(bench_name)never matched, so the limits guarded nothing.Fixing the names alone would have made things worse. The real measurements from run 31621989610 are:
transfers_sequential_benchmark_cairo_nativetransfers_sequential_benchmark_vmSo the vm benchmark already exceeds its nominal 1000 ms limit on noise alone, and cairo_native has been observed at 197 ms against a 200 ms limit. Turning the limits on at those values would have converted a dead config into a live false-failure source.
This PR therefore fixes the names and sets values with headroom over the highest observed numbers: 300 ms and 1600 ms.
To stop this recurring, an absolute limit naming a benchmark that is not being compared is now a hard error rather than a silent no-op, covered by
absolute_limit_naming_an_unknown_benchmark_panics.🤖 Generated with Claude Code