Skip to content

ci(perf): judge benches by their fastest sample, and run the gate only when code changes - #419

Merged
DrunkOnJava merged 2 commits into
mainfrom
ci/perf-gate-noise
Oct 28, 2026
Merged

DrunkOnJava merged 2 commits into
mainfrom
ci/perf-gate-noise

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

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.sh compares 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=mean restores the old reading, and a baseline without sample.json falls back to the mean.
  • perf.yml runs 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_256k at 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.sh against synthetic criterion output in a scratch CRITERION_DIR:
bench estimator main pr verdict
noisy (#416's means 152,627 → 198,000 ns, minimum 150,000 → 151,000) min 150,000 151,000 ok (1.007x)
the same ESTIMATOR=mean 152,627 198,000 REGRESSION (1.297x, the false red reproduced)
real (minimum 150,000 → 210,000) min 150,000 210,000 REGRESSION (1.400x)
no sample.json falls back to the mean 100,000 140,000 REGRESSION
  • actionlint .github/workflows/perf.yml passes.
  • bash -n passes.
  • Nothing was built or run locally: the benches themselves run only on GitHub's runners.

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:

  • No Autodesk DWG SDK source (RealDWG, ObjectARX, ObjectDBX) or NDA-protected Autodesk documentation was consulted or imported.
  • No Open Design Alliance Teigha / Drawings SDK source was consulted or imported. The ODA's public Open Design Specification for .dwg files PDF is explicitly allowed (see CLEANROOM.md).
  • No GPL-licensed DWG implementation source (LibreDWG, etc.) was consulted or imported. This matters because dwg-rs is Apache-2.0 and must remain compatible.

My contribution is based on:

  • The ODA's freely-redistributable Open Design Specification for .dwg files (v5.4.1);
  • Public reverse-engineering notes, research papers, or blog posts cited inline;
  • Reading algorithm-description comments (not executable code) in permissively-licensed projects (MIT / Apache / BSD) to resolve spec ambiguities — disclose any such reading in this PR body so it can be recorded in CLEANROOM.md.

See CLEANROOM.md for 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 -s when asked, which adds a
Signed-off-by trailer to the commit message asserting the DCO.

…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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T23:55:17.829412Z a5df15b New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 27, 2026 23:59
@DrunkOnJava
DrunkOnJava merged commit 1bd559c into main Oct 28, 2026
25 checks passed
@DrunkOnJava
DrunkOnJava deleted the ci/perf-gate-noise branch October 28, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant