feat(cli): move benchmark orchestration into Rust

The C benchmark translation unit still contained the complete BMK
implementation, so program builds and paramgrill could silently keep using a
second C implementation even though rust/src/benchzstd.rs already provided the
same ABI. Replace that duplicate with a declaration-only shim and retain
compile-time checks for the by-value result and parameter layouts.

The standalone test tools do not link the full CLI archive. Keep their
helpers archive free of the benchmark and trace-only objects, and add a
separate benchmark archive for paramgrill so the shim remains linkable without
pulling program-only trace dependencies into datagen and similar targets.

Test Plan:
- `cargo test --manifest-path rust/cli/Cargo.toml --no-default-features --features cli,compression,decompression,benchmark,dict-builder --lib -- --test-threads=1` -- 165 passed
- `make -B -C programs -j2 zstd` -- passed
- `./programs/zstd -b1 tests/hello` -- passed
- `make -B -C tests paramgrill` -- passed
- `./tests/paramgrill -S tests/hello` -- passed
- `make -C tests -j2 test-fullbench` -- passed
- targeted Rust clippy and nightly rustfmt checks -- passed
- full all-target clippy remains blocked by pre-existing test-only lints in `zstd_compress.rs` and `fileio_backend.rs`
This commit is contained in:
2026-07-18 18:28:31 +02:00
parent 4c94c644c4
commit 725c064df5
3 changed files with 90 additions and 1270 deletions
+2 -1
View File
@@ -1,7 +1,7 @@
#[cfg(any(feature = "benchmark", feature = "helpers"))]
#[path = "../../src/benchfn.rs"]
mod benchfn;
#[cfg(all(feature = "cli", feature = "benchmark"))]
#[cfg(feature = "benchmark")]
#[path = "../../src/benchzstd.rs"]
mod benchzstd;
#[cfg(any(feature = "benchmark", feature = "helpers"))]
@@ -26,5 +26,6 @@ mod util;
#[cfg(feature = "cli")]
#[path = "../../src/zstd_cli.rs"]
mod zstd_cli;
#[cfg(feature = "cli")]
#[path = "../../src/zstdcli_trace.rs"]
mod zstdcli_trace;