8000 gungraun-runner 0.20.0 (new): Gungraun benchmark runner for fv-lab by bryan-minimal · Pull Request #1626 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content

gungraun-runner 0.20.0 (new): Gungraun benchmark runner for fv-lab - #1626

Merged
bryan-minimal merged 1 commit into
mainfrom
gungraun
Nov 23, 2026
Merged

bryan-minimal merged 1 commit into
mainfrom
gungraun

Conversation

@bryan-minimal
Copy link
Copy Markdown
Member

What

This adds a new package, gungraun-runner 0.20.0, the latest release (2026-09-26). Gungraun, formerly iai-callgrind, is the Rust benchmark harness that measures benchmarks under Valgrind's Callgrind and Cachegrind. A project's benches depend on the gungraun library, whose main! harness execs gungraun-runner from PATH. This package ships that binary.

Version match. The library refuses to run with a runner whose version differs from its own. This package is the latest release, 0.20.0, so a project that uses it should pin gungraun = "=0.20.0". Whenever this package is bumped, those projects need to bump their dev-dependency in step.

It's for the fv-lab loadout: exact instruction-count benchmarks of Rust code. The hypervisor exposes no hardware PMU, so perf-based harnesses don't work there.

Package

  • Source. Both sources are crates.io .crate files: gungraun-runner-0.20.0.crate (sha256 1e146037…) and gungraun-0.20.0.crate (c041375e…). I chose them over GitHub tag archives because only the .crate carries the Cargo.lock it was published with, the same reasoning as cargo-llvm-cov (cargo-llvm-cov: add 0.9.2 #1612). Each sha256 equals the crates.io index checksum.
  • Build. cargo fetch --locked runs first. Then cargo build --frozen --release --bin gungraun-runner runs under the detbuild preload. RUSTFLAGS add -C linker=gcc, codegen-units=1, v0 mangling and --remap-path-prefix for the source and cargo-home paths, as cargo-mutants does. The lock has no -sys crates and no build script that downloads anything.
  • Runtime deps. glibc, subsetOf gcc ["libgcc"] (libgcc_s, for unwinding) and valgrind, which the runner execs for every measurement. build.sh fails closed if the binary ever NEEDs anything outside glibc and libgcc_s.
  • No toolchain shipped. The runner is driven by cargo bench and calls the cargo on PATH (cargo metadata), so rust is the user's, as with cargo-mutants.

Tests

A real benchmark runs at build time, on both arches. The last part of build.sh does this:

  1. It builds a one-benchmark crate (fib(20) through #[library_benchmark], library_benchmark_group! and main!). The crate depends on the gungraun library from the second Source, with gungraun-runner patched to the runner source being built.
  2. It runs that crate twice with the installed runner on PATH: first with cargo bench, which uses Callgrind, then with GUNGRAUN_DEFAULT_TOOL=cachegrind.
  3. It requires a non-zero Instructions: count in the Callgrind output, and a non-empty callgrind.*.out and cachegrind.*.out under target/gungraun.

This exercises the runner lookup on PATH, the library↔runner version handshake, and valgrind from this package's runtime closure.

The benchmark runs in the build because building any gungraun benchmark needs the library's proc-macro tree from crates.io, and only the build may fetch; a standalone test has no crates. Its dependency tree is pinned: its Cargo.lock is seeded with the gungraun library's published Cargo.lock, and the build fails if the resolved tree has any registry crate that lock does not pin. Nothing from the benchmark is installed.

Standalone tests, which check what a user's closure provides:

  • version_check: gungraun-runner --version reports 0.20.0, and --help lists --default-tool.
  • valgrind_in_closure: valgrind is on PATH from the runtime closure, and --tool=callgrind --help works.

Not exercised:

  • a benchmark run inside a standalone test (no crates there);
  • DHAT, Massif and the other non-default tools;
  • flamegraphs;
  • binary benchmarks (binary_benchmark_group!);
  • the library's cachegrind feature, which pulls valgrind-requests → bindgen/libclang. Plain GUNGRAUN_DEFAULT_TOOL=cachegrind is covered.

Lock advisories (OSV.dev, all 226 registry crates in the runner's Cargo.lock)

None is a CVE in reachable code, and none is lock-patched here:

  • rustix 1.1.5, RUSTSEC-2026-0486 / GHSA-jh2m-fhpj-3vr7: xattr functions mark unwritten bytes as initialized when given a zero-length buffer. Fixed in 1.1.6.
  • paste 1.0.15, RUSTSEC-2024-0436: unmaintained, no fixed release.
  • unsafe-libyaml 0.2.11, RUSTSEC-2024-0449: unmaintained, no f 8000 ixed release.

If we want floors, pkgmgr lock-patch gungraun-runner can generate them as a follow-up.

How tested

Per instructions, there was no local Rust build. Verification is build-bot's amd64 and arm64 build of this PR, which runs the benchmark above, plus the standalone tests. Results will follow in a comment below.

🤖 Generated with Claude Code

The binary the gungraun library's harness execs to measure Rust benchmarks
under Callgrind/Cachegrind. Built from the crates.io .crate with its
published Cargo.lock; runtime deps glibc, libgcc, valgrind. build.sh runs a
real one-benchmark project against the installed runner (Callgrind, then
Cachegrind), its tree pinned by the gungraun library's published lock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 21, 2026 17:00
@coderabbitai
coderabbitai Bot commented Nov 21, 2026
Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 45 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 65 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2f8d806 and 65101c3.

Files selected for processing: 2

  • packages/gungraun-runner/build.ncl
  • packages/gungraun-runner/build.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@bryan-minimal
Copy link
Copy Markdown
Member Author

Results from build-bot on head 65101c34: amd64 and arm64 both pass, and the tests really ran.

  • gungraun-runner was built fresh on both arches (full_build: true): about 63s on amd64 and 67s on arm64. Every step of that build.sh, including the self-test, exits non-zero on failure (set -euo pipefail), so a passing build means:
    • the Callgrind benchmark ran under the installed runner and printed a non-zero Instructions: count;
    • the Cachegrind benchmark ran;
    • both left a non-empty .out file;
    • the lock-pin check passed.
  • Standalone tests: check.standalone_verdict is pass with standalone_tests: 2 and rebuilt: true on both amd64 and arm64.
  • Not done: I did not run a negative control on the self-test, such as a deliberately wrong assertion pushed to show it fails. That would mean a red build-bot run on this PR. build-bot also doesn't keep the per-package build log in Cloud Logging, so the benchmark's actual instruction counts aren't visible from here.

@bryan-minimal
bryan-minimal added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 7a3b9cc Nov 23, 2026
16 checks passed
@bryan-minimal
bryan-minimal deleted the gungraun branch November 23, 2026 01:29
bryan-minimal added a commit that referenced this pull request Nov 23, 2026
… on main as #1626/#1613)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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

0