Repository navigation
ci(perf): bench the merge-base and the PR on the same host - #217
Merged
Merged
Conversation
The gate compared a PR run against a criterion baseline cached from the last push to main. Hosted runners differ in CPU, so whenever the two ran on different hardware every bench moved by a constant factor the confirmation re-run cannot clear. PR #215 touched no benchmarked code and still failed with lz77_decompress and stage1_build_section 1.35-1.78x slower on both passes; four dependabot PRs that only bumped action versions failed the same way on October 21. A PR run now checks out its merge-base with main in a second worktree, benches it as baseline `main` into the same target directory, then benches the merge commit as `pr`, so the ratio and absolute floor judge code rather than hardware. Stale criterion output restored by rust-cache is removed first. The baseline cache steps are gone; a push to main just runs the benches. run-benches.sh skips a target the tree being benched does not declare, so it also runs on an older merge-base.
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. |
5 tasks done
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
The Perf gate now benches a PR's merge-base and the PR in the same job on the same host, instead of comparing against a baseline cached from an earlier
mainrun on whatever runner that was.Spec reference
CI only; no format change. Fixes a false-red gate: a red check is a defect to fix (
docs/maintaining.md, housekeeping item 6).Evidence that the old comparison measured hardware, not code:
lz77_decompress/literal_only/16384(1.77x, then 1.78x),stage1_build_section/mixed_256k(1.39x, 1.35x),mixed_64k(1.36x, 1.36x) anduniform_16k(1.37x, 1.40x) on both passes. A consistent factor across both passes is a host difference.Change
actions/checkoutfetches full history; the job adds a detached worktree atgit merge-base origin/main HEAD, runs the PR'srun-benches.shthere withCARGO_TARGET_DIRpointing at the workspace target (baselinemain), then benches the PR merge commit (pr). The gate script, ratio (1.20x), absolute floor (5 µs) and confirmation re-run are unchanged.rm -rf target/criterionfirst, because rust-cache can restore criterion output measured on another host.mainruns the benches as a smoke check.run-benches.shskips a bench target the tree being benched does not declare, so the PR's script also runs on an older merge-base.timeout-minutes: 45for two builds and up to three bench passes.Test plan
bash -non the script$CARGO_TARGET_DIR/criterionwhen set (criterion-0.7.0/src/lib.rs,cargo_target_directory), so both baselines share one directoryab1d42b, candidate merge commitf334e17, same host. All 8 cells within thresholds:lz77_decompress/literal_only/163840.990x,stage1_build_section/mixed_256k1.001x,mixed_64k1.003x,uniform_16k1.009x, the cells that read 1.35–1.78x against the cached baseline on fix(fixtures): write the R2000 file-header CRC and end sentinel #215.Source-provenance declaration
Clean-room declaration. CI configuration only, written from scratch. No Autodesk SDK, ODA SDK, LibreDWG or other DWG implementation source was consulted.