Skip to content

fix: make benchmark workflow produce bencher-format output#4

Merged
Peariforme merged 2 commits intomasterfrom
claude/fix-benchmark-workflow-wKrnk
Feb 25, 2026
Merged

fix: make benchmark workflow produce bencher-format output#4
Peariforme merged 2 commits intomasterfrom
claude/fix-benchmark-workflow-wKrnk

Conversation

@Peariforme
Copy link
Copy Markdown
Owner

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

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
@Peariforme Peariforme merged commit 5febffc into master Feb 25, 2026
8 checks passed
@Peariforme Peariforme deleted the claude/fix-benchmark-workflow-wKrnk branch February 25, 2026 22:10
This was referenced Feb 25, 2026
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.

2 participants