fix: make benchmark workflow produce bencher-format output#4
Merged
Peariforme merged 2 commits intomasterfrom Feb 25, 2026
Merged
fix: make benchmark workflow produce bencher-format output#4Peariforme merged 2 commits intomasterfrom
Peariforme merged 2 commits intomasterfrom
Conversation
Criterion 0.5 removed the `--output-format bencher` CLI flag, so `benchmark-action/github-action-benchmark` (tool: cargo) could never find the expected `test … bench: X ns/iter` lines in the output file. - Downgrade criterion from 0.5 to 0.4, which still supports `--output-format bencher` - Switch the workflow step to `shell: bash` with `set -o pipefail` so a cargo bench failure is no longer silently masked by `tee`'s exit code https://claude.ai/code/session_01BdDTgdjMPWEbRxZmRpN7VM
Root cause: `cargo bench -p polysim-core -- --output-format bencher` passes the flags to ALL bench targets, including the default `lib.rs` target which uses the libtest harness. libtest rejects `--output-format` as an unknown option, causing cargo bench to fail immediately. Because the original step used a bare pipe (`| tee`), the non-zero exit code from cargo was masked by tee's success, leaving the output file with nothing but cargo's build progress; the benchmark action found no results. Fix: - Add `[lib] bench = false` in polysim-core/Cargo.toml so cargo never invokes the libtest harness for lib.rs during `cargo bench`; only the explicit `[[bench]]` criterion targets run - Restore criterion to 0.5 (was not the issue) - Keep the `set -o pipefail` + `shell: bash` from the previous commit so any future cargo bench failure surfaces immediately https://claude.ai/code/session_01BdDTgdjMPWEbRxZmRpN7VM
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.
Criterion 0.5 removed the
--output-format bencherCLI flag, sobenchmark-action/github-action-benchmark(tool: cargo) could neverfind the expected
test … bench: X ns/iterlines in the output file.--output-format benchershell: bashwithset -o pipefailsoa cargo bench failure is no longer silently masked by
tee's exitcode
https://claude.ai/code/session_01BdDTgdjMPWEbRxZmRpN7VM