From db3e11efe07a991cc31a59fcceb5e8edf351d07d Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 5 Dec 2025 04:17:14 -0500 Subject: [PATCH 1/3] bench: Add `strip = false` to the bench profile This is already the default but gungraun requires it, so make it explicit. --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 6b4e691a..8501f4e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,3 +53,4 @@ lto = "fat" [profile.bench] # Required for gungraun debug = true +strip = false From a5f6e7162406ae775eb981e283c5e9cc28bcd5e9 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 5 Dec 2025 04:46:20 -0500 Subject: [PATCH 2/3] bench: Disambiguate benchmark names in `mem_icount` The latest release of gungraun uses global symbols to register tests. Since it doesn't know about modules, these conflict. Add the module name so this isn't an issue, but keep the modules around because they are useful for organization. --- builtins-test/benches/mem_icount.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/builtins-test/benches/mem_icount.rs b/builtins-test/benches/mem_icount.rs index 966ceea8..37595e82 100644 --- a/builtins-test/benches/mem_icount.rs +++ b/builtins-test/benches/mem_icount.rs @@ -108,7 +108,7 @@ mod mcpy { ], setup = setup, )] - fn bench((len, mut dst, src): (usize, AlignedSlice, AlignedSlice)) { + fn bench_cpy((len, mut dst, src): (usize, AlignedSlice, AlignedSlice)) { unsafe { black_box(memcpy( black_box(dst.as_mut_ptr()), @@ -118,7 +118,7 @@ mod mcpy { } } - library_benchmark_group!(name = memcpy; benchmarks = bench); + library_benchmark_group!(name = memcpy; benchmarks = bench_cpy); } mod mset { @@ -157,7 +157,7 @@ mod mset { ], setup = setup, )] - fn bench((len, mut dst): (usize, AlignedSlice)) { + fn bench_set((len, mut dst): (usize, AlignedSlice)) { unsafe { black_box(memset( black_box(dst.as_mut_ptr()), @@ -167,7 +167,7 @@ mod mset { } } - library_benchmark_group!(name = memset; benchmarks = bench); + library_benchmark_group!(name = memset; benchmarks = bench_set); } mod mcmp { @@ -225,7 +225,7 @@ mod mcmp { ], setup = setup )] - fn bench((len, mut dst, src): (usize, AlignedSlice, AlignedSlice)) { + fn bench_cmp((len, mut dst, src): (usize, AlignedSlice, AlignedSlice)) { unsafe { black_box(memcmp( black_box(dst.as_mut_ptr()), @@ -235,7 +235,7 @@ mod mcmp { } } - library_benchmark_group!(name = memcmp; benchmarks = bench); + library_benchmark_group!(name = memcmp; benchmarks = bench_cmp); } mod mmove { @@ -384,7 +384,7 @@ mod mmove { ], setup = setup_forward )] - fn forward((len, spread, mut buf): (usize, usize, AlignedSlice)) { + fn forward_move((len, spread, mut buf): (usize, usize, AlignedSlice)) { // Test moving from the start of the buffer toward the end unsafe { black_box(memmove( @@ -478,7 +478,7 @@ mod mmove { ], setup = setup_backward )] - fn backward((len, spread, mut buf): (usize, usize, AlignedSlice)) { + fn backward_move((len, spread, mut buf): (usize, usize, AlignedSlice)) { // Test moving from the end of the buffer toward the start unsafe { black_box(memmove( @@ -489,7 +489,7 @@ mod mmove { } } - library_benchmark_group!(name = memmove; benchmarks = forward, backward); + library_benchmark_group!(name = memmove; benchmarks = forward_move, backward_move); } use mcmp::memcmp; From a5ab6252c12bb59f3910237a75c585966ed54a90 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 5 Dec 2025 04:59:08 -0500 Subject: [PATCH 3/3] ci: bench: Enable all `icount` benches in CI So far we haven't been running the `mem_icount` benches in CI, but this would be useful. Use a glob pattern for the test so this and future icount benchmarks all get run. --- ci/bench-icount.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/bench-icount.sh b/ci/bench-icount.sh index 56aa1df0..1d7d23dc 100755 --- a/ci/bench-icount.sh +++ b/ci/bench-icount.sh @@ -25,7 +25,7 @@ tag="$(echo "$target" | cut -d'-' -f1)" # Run benchmarks once function run_icount_benchmarks() { cargo_args=( - "--bench" "icount" + "--bench" "*icount*" "--no-default-features" "--features" "unstable,unstable-float,icount" )