feat(rust): port the COVER dictionary trainer

Move COVER training, frequency mapping, segment selection, optimization,
dictionary shrinking, and best-candidate synchronization into Rust.  The
remaining C translation unit is an ABI shim, while the public ZDICT and COVER
symbols stay available to the existing C dictionary-builder callers.

Test Plan:
- cargo test --manifest-path rust/Cargo.toml dict_builder_cover
- cargo check --manifest-path rust/Cargo.toml --no-default-features --features compression,decompression,dict-builder
- cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
- make -B -C lib libzstd.a V=1
- git diff --check

Depends-on: Rust compression, entropy, and dictionary-finalization leaves
This commit is contained in:
2026-07-12 10:08:03 +02:00
parent 70260b308b
commit 468ccfa388
3 changed files with 1314 additions and 1291 deletions
+2
View File
@@ -18,6 +18,8 @@ pub mod hist;
pub mod huf_compress;
#[cfg(feature = "decompression")]
pub mod huf_decompress;
#[cfg(feature = "dict-builder")]
pub mod dict_builder_cover;
pub mod legacy;
pub mod mem;
pub mod pool;