Repository navigation
ci(perf): judge benches by their fastest sample, and run the gate only when code changes - #419
Merged
Merged
Conversation
…y when code changes #416, which touches only docs, failed the bench gate on 2026-10-27: stage1_build_section/mixed_256k at 1.30x then 1.34x on two passes, on code identical to its merge-base. The gate compared criterion's means, which the workflow's own methodology note shows moving +55 % between two runs of one binary while the minimum per-iteration time moved +4.9 %. criterion-gate.sh now compares that minimum (ESTIMATOR=mean keeps the old reading, and a baseline without sample.json falls back to it), and the Perf workflow runs on a pull request only when src/, benches/, Cargo.toml, Cargo.lock or the gate itself changes.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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
Two fixes for false reds from the Perf bench gate. The gate is not a required check, but a false red is a CI defect to fix.
criterion-gate.shcompares each bench's minimum per-iteration time over criterion's raw samples (sample.json), not the mean. The workflow's own methodology note recommends this estimator. It measured +4.9 % between two runs of the same binary where the mean moved +55 %. A real regression raises the minimum as well.ESTIMATOR=meanrestores the old reading, and a baseline withoutsample.jsonfalls back to the mean.perf.ymlruns on a pull request only when the change can move a bench:src/**,benches/**,Cargo.toml,Cargo.lock, or the gate's own files. A docs or tooling PR compares identical code, so any difference it reports is noise. A skipped run blocks nothing because the check is not required.The evidence is #416, a PR that changes only README.md, ROADMAP.md and CHANGELOG.md. It failed on 2026-10-27 (run 40601456553), with
stage1_build_section/mixed_256kat 1.297x and then 1.340x across the gate's two passes, on code identical to its merge-base.Spec reference
CI only.
Test plan
criterion-gate.shagainst synthetic criterion output in a scratchCRITERION_DIR:ESTIMATOR=meansample.jsonactionlint .github/workflows/perf.ymlpasses.bash -npasses.Source-provenance declaration
By submitting this PR I certify that my contribution does not incorporate executable code from any source whose license is incompatible with Apache-2.0. Specifically:
CLEANROOM.md).dwg-rsis Apache-2.0 and must remain compatible.My contribution is based on:
CLEANROOM.md.See
CLEANROOM.mdfor the full allowed/forbidden source list and the honest scope of what "clean-room" means for this project.Developer Certificate of Origin
By submitting this PR, I certify that the contribution complies with the
Developer Certificate of Origin 1.1.
Specifically, I affirm that the contribution is my own work (or rightfully
licensed to me) and that it can be distributed under the project's Apache-2.0
license.
I will sign off commits with
git commit -swhen asked, which adds aSigned-off-bytrailer to the commit message asserting the DCO.