feat(compress): port the optimal parser to Rust

Move the binary-tree optimal and ultra block parsers into Rust with a narrow
C projection of match-state, sequence-store, and entropy-table fields. Keep
the established C entry points as wrappers, and avoid reading uninitialized
entropy costs during dictionary tree updates.

Test Plan:
- cargo test --manifest-path rust/Cargo.toml
- cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
- cargo +nightly fmt --manifest-path rust/Cargo.toml --all -- --check
- make -B -C tests test-zstream V=1
- git diff --check

Refs: rust/src/zstd_opt.rs, lib/compress/zstd_opt.c
This commit is contained in:
2026-07-12 09:51:45 +02:00
parent 9b909aaef8
commit 5d03dca147
3 changed files with 2014 additions and 1425 deletions
+2
View File
@@ -55,6 +55,8 @@ pub mod zstd_lazy;
#[cfg(feature = "compression")]
pub mod zstd_ldm;
#[cfg(feature = "compression")]
pub mod zstd_opt;
#[cfg(feature = "compression")]
pub mod zstd_opt_tree;
#[cfg(feature = "compression")]
pub mod zstd_presplit;