From 0d8767043655aee9f9949d3ae3518294b42d8207 Mon Sep 17 00:00:00 2001 From: Guillaume Lagrange Date: Sat, 16 May 2026 11:36:49 -0700 Subject: [PATCH 1/2] ci: fix macOS rustup cache corruption in install-rust action Switch back to `rustup toolchain install` (the rustup-documented way to install the toolchain pinned by rust-toolchain.toml across rustup 1.28+ versions) and disable `cache-bin` on macOS. Caching ~/.cargo/bin caused macOS jobs to fail with `error: unexpected argument 'fmt' found / Usage: rustup-init[EXE]`: rust-cache was restoring a stale cargo proxy from a runner with a different rustup version, overwriting the proxy installed in this run and leaving cargo behaving like rustup-init. Co-Authored-By: Claude --- .github/actions/install-rust/action.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/actions/install-rust/action.yml b/.github/actions/install-rust/action.yml index 04bee8af..f4d9168e 100644 --- a/.github/actions/install-rust/action.yml +++ b/.github/actions/install-rust/action.yml @@ -10,9 +10,14 @@ runs: steps: - name: Install rust-toolchain.toml shell: bash - run: rustup show + run: rustup toolchain install - name: Install additional rustup components if: inputs.components != '' shell: bash run: echo "${{ inputs.components }}" | tr ',' '\n' | xargs rustup component add - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2 + with: + # Avoid caching ~/.cargo/bin on macOS — restoring it on a runner with a + # different rustup version overwrites the cargo proxy with a stale + # rustup-init, breaking `cargo fmt`/`clippy`/etc. + cache-bin: ${{ runner.os != 'macOS' }} From c12d934fd716a3428320f80fd1f6dad679e1e377 Mon Sep 17 00:00:00 2001 From: SuperMuel <69467005+SuperMuel@users.noreply.github.com> Date: Sat, 16 May 2026 14:03:07 -0700 Subject: [PATCH 2/2] fix(skills): misleading DCE advice in setup-harness `benchmark.pedantic` is not a dead-code-elimination tool; it controls the measurement loop. CPython doesn't perform the kind of DCE that `black_box` guards against in compiled languages, so pure-Python benchmarks don't need an equivalent. List the actual primitives for the languages that do (C++: DoNotOptimize, JMH: Blackhole.consume). --- skills/codspeed-setup-harness/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skills/codspeed-setup-harness/SKILL.md b/skills/codspeed-setup-harness/SKILL.md index 1fe35771..d8f7fe1b 100644 --- a/skills/codspeed-setup-harness/SKILL.md +++ b/skills/codspeed-setup-harness/SKILL.md @@ -287,7 +287,7 @@ Good benchmarks are representative, isolated, and stable. Here are guidelines: - **Avoid benchmarking setup**: Use the framework's setup/teardown mechanisms to exclude initialization from measurements. -- **Prevent dead code elimination**: Use `black_box()` (Rust), `benchmark.pedantic()` (Python), or equivalent to ensure the compiler/runtime doesn't optimize away the work you're measuring. +- **Prevent dead code elimination**: Use `black_box()` (Rust), `benchmark::DoNotOptimize` (C++), or `Blackhole.consume` (JMH) so the compiler doesn't optimize away unused results. - **Cover the critical path**: Benchmark the functions that matter most to your users — the ones called frequently or on the hot path.