Repository navigation
fix(ci): compile the criterion benches without release optimization - #2320
Merged
Merged
Conversation
`Benchmarks Compile` only checks that the benches compile — it runs `cargo bench --workspace --no-run`, and nothing in CI ever executes the result. But `cargo bench` inherits the release profile (`codegen-units = 1`, thin LTO) and the repo adds `debug = true`, so every run paid for fully optimized, fully debug-annotated binaries nobody runs. That cost became a failure on 2026-09-14. The job was killed with "The runner has received a shutdown signal" / exit 143 on 9 of its 15 runs that day, across four PRs (#2306, #2308 and two dependabot PRs), always 4–9 minutes into the silent link phase that takes 17–21 minutes when it completes. None of the day's other 1,053 jobs was killed. Runner version, compute agent, region and image were identical on passing and killed runs; the target dir is under 3 GB, so it is not disk. Because the required `build` check aggregates this job, every affected PR was unmergeable. Measured locally with 4 jobs, matching the runner's vCPUs, same 17 bench executables: as configured 19m36s peak 12.0 GB system largest rustc 3.1 GB this change 6m42s peak 5.7 GB system largest rustc 1.3 GB The configured build's duration matches CI's passing runs, and its peak lands where the runners died. That supports a memory limit on a 16 GB runner without proving it, but the change is right on its own terms: the same compile check, a third of the time, less than half the memory. Scoped to that one step. Release builds, and PR Benchmarks — which builds `--release` and times it with hyperfine — are untouched. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Add CARGO_PROFILE_BENCH_OPT_LEVEL: "0" before approval.
Pull request overview
This PR reduces resource usage for the compile-only CI benchmark step without affecting release builds or benchmark execution.
Changes:
- Disables bench-profile LTO and debug info.
- Increases bench codegen units to 16.
- Documents CI failures and measured resource savings.
File summaries
| File | Summary |
|---|---|
.github/workflows/ci.yml |
Adjusts benchmark compilation settings; the bench profile still requires opt-level = 0 to avoid release-level optimization. |
Review details
Suppressed comments (1)
.github/workflows/ci.yml:671
[profile.bench]still inherits the release profile'sopt-level = 3; these overrides only disable LTO/debug info and increase codegen units, so rustc still performs full per-unit release optimization. Since this job only checks compilation, addCARGO_PROFILE_BENCH_OPT_LEVEL: "0"to actually avoid the release optimization described by this change.
CARGO_PROFILE_BENCH_LTO: "false"
CARGO_PROFILE_BENCH_CODEGEN_UNITS: "16"
CARGO_PROFILE_BENCH_DEBUG: "false"
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
✅ Compatibility Test Results
What's tested
Full results available in workflow artifacts |
robcohen
added a commit
to NikodemMarek/rustledger
that referenced
this pull request
Sep 15, 2026
…d-postings Brings the branch up to date. The base predated rustledger#2320, so the required `build` check failed on the Benchmarks Compile runner being killed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr
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.
Benchmarks Compileonly checks that the benches compile (cargo bench --workspace --no-run); nothing in CI runs them. Butcargo benchinherits the release profile (codegen-units = 1, thin LTO), and this repo addsdebug = true, so every run built fully optimized, fully debug-annotated binaries that never execute.This PR builds that step without the optimization:
Why now
On 2026-09-14 the job was killed on 9 of its 15 runs, across #2306, #2308 and two dependabot PRs:
The runner has received a shutdown signal/ exit 143, with no compiler error. Every kill came 4–9 minutes into the link phase, which prints nothing and takes 17–21 minutes when the job completes. No other job was killed out of the day's 1,053. The requiredbuildcheck aggregates this job, so each affected PR was blocked.Ruled out from the logs:
Measured
Locally, with 4 jobs to match the runner's vCPUs, building the same 17 bench executables:
The configured build's duration matches CI's passing runs, and its peak falls where the runners were killed. That supports a memory limit on a 16 GB runner, but doesn't prove one. The change stands regardless: the same compile check, in a third of the time and less than half the memory.
Validated on a real runner
This PR's own CI skips
Benchmarks Compile. Thechangespath filter counts*.rs, Cargo files and tests as code, not.github/workflows/**, so a PR that only editsci.ymlnever runs the job it changes. To exercise it anyway, CI was dispatched manually on this branch (workflow_dispatchalways builds): run 34877539480.CARGO_PROFILE_BENCH_LTO: false,CARGO_PROFILE_BENCH_CODEGEN_UNITS: 16,CARGO_PROFILE_BENCH_DEBUG: false.Finished bench profile [optimized] target(s) in 9m 00s, with no+ debuginfo.That 9 minutes is a cold build (sccache: 26 hits, 540 misses). The new flags invalidate every cached artifact, so every dependency was rebuilt. Once main has saved caches under these settings, the job should be faster still.
Unrelated failing checks
Cargo Deny, andqualitywhich aggregates it, fail onRUSTSEC-2026-0285, a TLS 1.3 advisory that started failing every PR in the Quality workflow at about 16:00 on 2026-09-14. It has nothing to do with this change, and neither check is required.Scope
Only the one step. Release builds are untouched, and so is PR Benchmarks, which builds
--releaseand times it with hyperfine and never uses the bench profile.🤖 Generated with Claude Code