feat(mt): move serial sequence turn policy into Rust

Move MT serial turn/skip control and the ordering of LDM generation,
checksum updates, and turn advancement into the Rust rewrite. Keep the C
serial mutexes, LDM window/hash state, checksum state, and codec callbacks
behind a narrow callback bridge so the synchronization and private layouts
remain unchanged. Add focused tests for skipped predecessors, empty LDM
turns, and LDM-before-checksum ordering.

Test Plan:
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo fmt --manifest-path rust/Cargo.toml -- --check
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml serial_turn_ -- --nocapture
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
- ulimit -v 41943040 make -B -C programs -j1 zstd
- ulimit -v 41943040 make -C tests -j1 test-zstream ZSTREAM_TESTTIME=-T1s
This commit is contained in:
2026-07-19 19:17:41 +02:00
parent bff97833b6
commit 9c298999ac
3 changed files with 237 additions and 37 deletions
+6 -3
View File
@@ -97,8 +97,10 @@ zstd ABI:
job-creation decisions, compression-job stage sequencing and error flow,
pending-output decisions through scalar job projections, and frame
progression's job-ring scan, error normalization, and active-worker
accounting. Rust also owns frame-block preparation ordering; C callbacks
retain the private match-state window and workspace operations.
accounting. Rust also owns frame-block preparation ordering and the MT
serial turn/skip policy, including LDM-before-checksum sequencing; C
callbacks retain the private match-state window, workspace operations,
synchronization, LDM state, and checksum state.
- Dictionary support
- `zstd_ddict` owns, loads, copies, and references decode dictionaries.
- Legacy decoding
@@ -149,7 +151,8 @@ shared- and separate-destination decompression scheduling,
single-threaded stream initialization and the buffered/stable stream state
machine, MT stream initialization, MT outer scheduling and flush policy, MT
compression-job stage sequencing and error flow, MT frame-progression job
aggregation, frame-block preparation ordering, public sequence-API
aggregation, frame-block preparation ordering, MT serial turn/skip and
LDM/checksum sequencing, public sequence-API
orchestration, sequence-store and block policy, external-producer invocation
and success-path validation, external-sequence-store reset,
external-sequence/literals block loop, optional-format decompression loops,