Repository navigation
gungraun-runner 0.20.0 (new): Gungraun benchmark runner for fv-lab - #1626
Merged
Merged
Conversation
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>
Contributor
|
Warning Review limit reached
This review includes 2 billable files and costs up to $0.50.
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. View limit details
|
Member
Author
|
Results from build-bot on head
|
norrietaylor
approved these changes
Nov 22, 2026
7332
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.
What
This adds a new package,
gungraun-runner0.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 thegungraunlibrary, whosemain!harness execsgungraun-runnerfrom 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
.cratefiles:gungraun-runner-0.20.0.crate(sha2561e146037…) andgungraun-0.20.0.crate(c041375e…). I chose them over GitHub tag archives because only the.cratecarries 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.cargo fetch --lockedruns first. Thencargo build --frozen --release --bin gungraun-runnerruns under thedetbuildpreload. RUSTFLAGS add-C linker=gcc,codegen-units=1, v0 mangling and--remap-path-prefixfor the source and cargo-home paths, as cargo-mutants does. The lock has no-syscrates and no build script that downloads anything.glibc,subsetOf gcc ["libgcc"](libgcc_s, for unwinding) andvalgrind, which the runner execs for every measurement. build.sh fails closed if the binary ever NEEDs anything outside glibc and libgcc_s.cargo benchand calls thecargoon 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:
fib(20)through#[library_benchmark],library_benchmark_group!andmain!). The crate depends on the gungraun library from the second Source, withgungraun-runnerpatched to the runner source being built.cargo bench, which uses Callgrind, then withGUNGRAUN_DEFAULT_TOOL=cachegrind.Instructions:count in the Callgrind output, and a non-emptycallgrind.*.outandcachegrind.*.outundertarget/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 --versionreports 0.20.0, and--helplists--default-tool.valgrind_in_closure:valgrindis on PATH from the runtime closure, and--tool=callgrind --helpworks.Not exercised:
binary_benchmark_group!);cachegrindfeature, which pullsvalgrind-requests→ bindgen/libclang. PlainGUNGRAUN_DEFAULT_TOOL=cachegrindis 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:
If we want floors,
pkgmgr lock-patch gungraun-runnercan 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