Commit Graph
11606 Commits
Author SHA1 Message Date
ddidderr a6b58a7dfc feat(mt): move serial failure turn policy into Rust
Move the scalar failed-job skip decision and wrapping next-job transition into
Rust. C keeps the serial mutex, error assertion, condition broadcast, and LDM
window cleanup around the projected result.

Test Plan:
- 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
2026-07-19 19:44:19 +02:00
ddidderr 082c5a7dbe feat(mt): move LDM window wait policy into Rust
Move the MT reusable-input wait decision and lock/overlap/condition-wait
ordering into Rust through a small callback projection. C retains ownership
of the pthread synchronization objects, private LDM window, and diagnostics.
Add layout assertions and callback-order tests for enabled and disabled LDM.

Test Plan:
- 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
2026-07-19 19:41:35 +02:00
ddidderr bd9ca5115d feat(decompress): move DCtx prefix copy into Rust
Move the `ZSTD_copyDCtx` prefix-copy leaf into the Rust decompression module.
Rust uses the C-projected address of `inBuff` to preserve the exact private
context cutoff, while C retains the configuration-dependent context layout
and shallow-pointer ownership semantics. Add a focused boundary test and
remove the now-unused C copy helper.

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 copy_prefix -- --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
2026-07-19 19:32:48 +02:00
ddidderr 1cb3efd0af feat(compress): move overflow correction policy into Rust
Move the overflow-correction branch and ordering into the Rust rewrite while
keeping the C-owned window correction, workspace table markers, index reducer,
and dictionary fields behind callbacks. Rust now preserves the original
need-correction fast path, dirty/reduce/clean ordering, saturating
nextToUpdate adjustment, and dictionary invalidation. Add focused callback
ordering and safe-window tests.

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 overflow_correction -- --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
2026-07-19 19:30:20 +02:00
ddidderr 9c298999ac 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
2026-07-19 19:17:41 +02:00
ddidderr bff97833b6 feat(compress): move long-match update arithmetic into Rust
Move the bounded nextToUpdate catch-up arithmetic used after very long
matches into Rust. C continues to calculate the source index against the
private match-state window and retains all surrounding assertions and setup;
Rust owns the exact wrapping U32 threshold and 192-byte catch-up policy.

Test Plan:
- cargo fmt --manifest-path rust/Cargo.toml -- --check
- ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml limit_next_to_update --lib (1 passed)
- ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --lib (692 passed)
- ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
- ulimit -v 41943040 && MAKEFLAGS=-j1 make -B -C programs -j1 zstd
- ulimit -v 41943040 && MAKEFLAGS=-j1 make -C tests -j1 test-zstream ZSTREAM_TESTTIME=-T1s (84 tests and both short fuzz rounds passed)
2026-07-19 19:08:13 +02:00
ddidderr e95778be1a feat(compress): move frame-block preparation order into Rust
Move the frame-chunk match-state preparation policy into Rust while keeping
window and workspace mutations behind narrow C callbacks. Rust now guarantees
the original overflow-correction, dictionary-validity, maximum-distance, and
nextToUpdate-clamp order; the C side retains the private ZSTD_MatchState_t
layout and exact primitive operations.

Test Plan:
- cargo fmt --manifest-path rust/Cargo.toml -- --check
- ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml frame_chunk --lib (3 passed)
- ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --lib (691 passed)
- ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
- ulimit -v 41943040 && MAKEFLAGS=-j1 make -B -C programs -j1 zstd
- ulimit -v 41943040 && MAKEFLAGS=-j1 make -C tests -j1 test-zstream ZSTREAM_TESTTIME=-T1s (84 tests and both short fuzz rounds passed)
2026-07-19 19:01:15 +02:00
ddidderr adaae03552 feat(mt): move frame progression job aggregation into Rust
Move the multithreaded frame-progression ring scan into Rust so the Rust
scheduler owns job-ID masking, ready-job range handling, error-output
normalization, and active-worker accounting. Keep C-owned job descriptors and
mutex-protected snapshots behind the narrow ZSTDMT_projectJob callback, which
preserves the private synchronization boundary while making the aggregation
policy directly testable in Rust.

Test Plan:
- cargo fmt --manifest-path rust/Cargo.toml -- --check
- ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --lib (691 passed)
- ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
- ulimit -v 41943040 && MAKEFLAGS=-j1 make -B -C programs -j1 zstd
- ulimit -v 41943040 && MAKEFLAGS=-j1 make -C tests -j1 test-zstream ZSTREAM_TESTTIME=-T1s (84 tests and both short fuzz rounds passed)
2026-07-19 18:53:08 +02:00
ddidderr fec11ae7d0 feat(compress): move sequence-store branch policy into Rust
Move buildSeqStore's preloaded external-sequence, LDM, external-producer,
fallback, and ordinary matchfinder branch ordering into Rust. Keep the
private CCtx, matchfinder, LDM, and producer operations behind narrow C
callbacks, add ABI layout assertions, update the Rust boundary documentation,
and cover each policy branch with focused tests.

Test Plan:
- cargo fmt --manifest-path rust/Cargo.toml -- --check
- ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --lib (690 passed)
- ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
- ulimit -v 41943040 && MAKEFLAGS=-j1 make -B -C programs -j1 zstd
- ulimit -v 41943040 && MAKEFLAGS=-j1 make -C tests -j1 test-zstream ZSTREAM_TESTTIME=-T1s (84 tests and both short fuzz rounds passed)
2026-07-19 18:42:26 +02:00
ddidderr d38c1e2a62 feat(ldm): move sequence-store emission into Rust
Remove the LDM-specific C sequence-store callback and reuse the existing Rust
sequence-store leaf from the fast matcher through a crate-local opaque wrapper.
The LDM C shim now retains only private match-state extraction and compressor
dispatch, with explicit SeqDef and SeqStore_t layout checks protecting the
cross-module pointer contract. The Rust boundary documentation now reflects
that sequence-store encoding is Rust-owned.

Test Plan:
- ulimit -v 41943040 && cargo fmt --manifest-path rust/Cargo.toml && git diff --check
- ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml zstd_ldm::tests --lib (7 passed)
- ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml store_seq_preserves_literal --lib (1 passed)
- ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --lib (683 passed)
- 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 (passed; existing fileio const-cast warnings)
- ulimit -v 41943040 && make -C tests -j1 test-zstream ZSTREAM_TESTTIME=-T1s (84 tests and both short fuzz rounds passed; existing zstreamtest warning)
2026-07-19 18:27:52 +02:00
ddidderr db8c58ac97 feat(compress): move CCtx reset storage policy into Rust
Move the post-match-state CCtx storage reservation and publication policy into
Rust while keeping the private C workspace and context layouts behind narrow
callbacks. The Rust leaf now preserves the sequence, LDM, external-sequence,
literal, buffered-input/output, bucket, and entropy-code allocation order,
including zeroing and reset callbacks. C remains responsible for workspace
resize/layout, private field publication, allocator callbacks, and the LDM
window reset details. ABI layout assertions and fake-callback tests cover
ordinary, LDM/external-producer, and allocation-failure paths.

Test Plan:
- ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo fmt --manifest-path rust/Cargo.toml
- ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml cctx_storage --lib (3 passed)
- ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --lib (683 passed)
- 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 (passed; existing fileio const-cast warnings)
- ulimit -v 41943040 && make -C tests -j1 test-zstream ZSTREAM_TESTTIME=-T1s (84 tests and both short fuzz rounds passed; existing zstreamtest warning)
2026-07-19 18:16:44 +02:00
ddidderr 853792f2c4 feat(compress): move CCtx reset planning into Rust
Move the scalar planning portion of ZSTD_resetCCtx_internal across an
explicit C/Rust boundary. Rust now computes window and block sizes, sequence
capacities, buffered I/O sizes, LDM and external-sequence reservations, the
index-reset policy, and the CCtx workspace estimate. C retains private
workspace resizing, reservations, pointer publication, and layout-dependent
callbacks.

Add ABI layout assertions and focused planner tests for buffered sizing, LDM
and index-reset policy, external sequence capacity, and invalid unadjusted LDM
inputs. Keep the migration boundary documented so the hybrid state remains
explicit while deeper CCtx reset and matchfinder operations stay in C.

Test Plan:
- `cargo fmt --manifest-path rust/Cargo.toml -- --check`
- capped focused planner tests: 3 passed
- capped full Rust library tests: 680 passed, 0 failed
- capped `cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings`: passed
- capped native `make -B -C programs -j1 zstd`: passed; only known fileio const-cast warnings
- capped `make -C tests -j1 test-zstream ZSTREAM_TESTTIME=-T1s`: 84 tests and both short fuzzer rounds passed; only known zstream initializer warning
2026-07-19 17:56:41 +02:00
ddidderr 127dd21195 feat(compress): move match-state reset policy into Rust
Move the reset decision tree for match-state tables from C into a Rust-owned
callback projection. Rust now decides chain/hash3/row/optimal allocations,
reset versus continue behavior, clean versus leave-dirty policy, scalar
publication, and allocation-error propagation. C retains the cwksp phases,
window invalidation, private pointer assignments, zeroing, and hash-salt
implementation behind callbacks, so the private match-state and workspace
layouts remain C-owned.

Update the migration boundary documentation and add callback-order probes for
CCtx optimal storage, CCtx row salting, CDict row zeroing, and table allocation
failure.

Test Plan:
- cargo fmt --manifest-path rust/Cargo.toml -- --check
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --lib (677 passed)
- 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 (84 tests and both short fuzzer rounds)
2026-07-19 17:43:45 +02:00
ddidderr 09334d2065 feat(compress): move CCtx workspace estimator into Rust
The CCtx workspace estimator still assembled its private sizing formula in C,
even though the match-state and component-sum leaves already lived in Rust.
That left buffering, LDM, static-context, and external-sequence sizing policy
outside the rewrite boundary.

Move the complete size_t formula into a Rust entry point. C now supplies only
private object sizes, sanitizer redzone policy, and LDM scalar fields through a
small ABI record. Rust retains the C wrapping/alignment behavior and focused
branch coverage while the C adapter preserves the existing public estimator
surface.

Test Plan:
- cargo fmt --manifest-path rust/Cargo.toml -- --check
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release estimate_cctx_workspace_size
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release (667 passed)
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --release --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 (84 tests and both short fuzzer rounds)
2026-07-19 17:21:02 +02:00
ddidderr e6101bb1af feat(compress): move advanced CDict allocation policy into Rust
The advanced CDict bridge previously left custom-memory validation,
workspace allocation, and create/init failure ordering inside one C helper.
That made the Rust policy seam stop before allocation and obscured which
allocation owned cleanup after private CDict construction failed.

Move validation, workspace-size query dispatch, allocation, and cleanup
ordering into the Rust bridge. C retains the private workspace-size formula,
workspace/object placement, allocator callbacks, and CDict initialization.
The focused probes cover invalid allocators, allocation failure, creation
failure, and initialization failure with exact callback ordering.

Test Plan:
- cargo fmt --manifest-path rust/Cargo.toml -- --check
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release create_cdict_advanced
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release (665 passed)
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --release --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 (84 tests and both short fuzzer rounds)
2026-07-19 17:10:08 +02:00
ddidderr 5449a4b3c0 feat(compress): move advanced CDict policy into Rust
ZSTD_createCDict_advanced2 previously selected compression parameters,
resolved dedicated-dictionary-search fallback, and ordered allocation and
initialization entirely in C. That left a large public dictionary boundary
outside the Rust rewrite and made the failure ordering implicit in the C
wrapper.

The Rust params API now owns advanced-CDict parameter preparation, including
the dedicated-search override/fallback and row-matchfinder resolution. A Rust
dictionary bridge owns the create -> init sequence and frees a created CDict
when initialization fails. The C shim retains only the private workspace and
custom-memory allocation, dictionary initialization, and teardown callbacks;
opaque parameter-field pointers and compile-time layout assertions preserve
the existing ABI. Focused probes cover policy publication and all callback
failure-ordering paths, and the migration README records the remaining C
boundary.

Test Plan:
- `rustfmt --check` and `cargo fmt --manifest-path rust/Cargo.toml -- --check` -- passed
- `cargo test --manifest-path rust/Cargo.toml --release` -- 663 passed
- `cargo clippy --manifest-path rust/Cargo.toml --release --all-targets -- -D warnings` -- passed
- `make -B -C programs -j1 zstd` -- passed
- `make -C tests -j1 test-zstream ZSTREAM_TESTTIME=-T1s` -- 84 tests and both fuzz rounds passed
2026-07-19 16:53:31 +02:00
ddidderr 35ad752b00 docs(rust): document advanced CDict boundary
Record that Rust now owns advanced CDict one-shot validation and begin/end
ordering while C retains the private operations behind callbacks.

Test Plan:
- Documentation-only change; code validation is covered by 8b783e8.
2026-07-19 16:37:03 +02:00
ddidderr 8b783e8252 feat(compress): move advanced CDict compression orchestration into Rust
Move deprecated advanced CDict one-shot validation and begin-then-end ordering
behind a Rust-owned boundary while preserving the explicit frame policy. Keep
the private CDict begin and end operations in C callbacks.

Test Plan:
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release compress_using_cdict_advanced -- --nocapture
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --release --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
2026-07-19 16:36:39 +02:00
ddidderr 174d4165e3 docs(rust): document static CCtx boundary
Record that Rust now owns static CCtx workspace validation and dispatch while
C retains private workspace construction and context initialization.

Test Plan:
- Documentation-only change; code validation is covered by 463ceeb86.
2026-07-19 16:32:25 +02:00
ddidderr 463ceeb86f feat(compress): move static CCtx gating into Rust
Move public ZSTD_initStaticCCtx null, alignment, minimum-size, and callback
dispatch into Rust. Keep private workspace reservations, block-state buffers,
and CPU initialization in the C callback.

Test Plan:
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release init_static_cctx -- --nocapture
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --release --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
2026-07-19 16:32:00 +02:00
ddidderr c892684b34 docs(rust): document static CDict boundary
Record that Rust now owns static CDict workspace validation and dispatch while
C retains private workspace construction and dictionary initialization.

Test Plan:
- Documentation-only change; code validation is covered by 12b99469b.
2026-07-19 16:28:55 +02:00
ddidderr 12b99469b8 feat(compress): move static CDict gating into Rust
Move public ZSTD_initStaticCDict alignment, null, workspace-size, and callback
dispatch into Rust. Keep C static workspace construction and dictionary
initialization behind a private callback.

Test Plan:
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release init_static_cdict -- --nocapture
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --release --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
2026-07-19 16:28:32 +02:00
ddidderr 616472cc1d docs(rust): document CDict free boundary
Record that Rust now owns CDict null handling and workspace/object teardown
ordering while C retains private workspace and allocator callbacks.

Test Plan:
- Documentation-only change; code validation is covered by 14157558f.
2026-07-19 16:19:59 +02:00
ddidderr 14157558f7 feat(compress): move CDict free policy into Rust
Move public CDict null handling, workspace/object teardown ordering, and
embedded-object selection behind a Rust-owned boundary. Keep private workspace
and allocator teardown in C callbacks.

Test Plan:
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release free_cdict -- --nocapture
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --release --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
2026-07-19 16:19:26 +02:00
ddidderr 7cacbcee03 docs(rust): document CDict constructor boundary
Record that Rust now owns regular and by-reference CDict constructor parameter
selection and default-level normalization while C retains advanced allocation
and workspace lifecycle.

Test Plan:
- Documentation-only change; code validation is covered by 9f4d92808.
2026-07-19 16:14:52 +02:00
ddidderr 9f4d92808b feat(compress): move CDict constructor policy into Rust
Move regular and by-reference CDict parameter selection and default-level
normalization behind a Rust-owned boundary. Keep advanced allocation, private
workspace setup, and CDict scalar publication in C callbacks.

Test Plan:
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release create_cdict -- --nocapture
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --release --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
2026-07-19 16:14:34 +02:00
ddidderr 778a7406ad docs(rust): document CCtx creation boundary
Record that Rust now owns public CCtx allocation validation and
allocate-before-init ordering while C retains private context initialization.

Test Plan:
- Documentation-only change; code validation is covered by aa817a56b.
2026-07-19 16:08:43 +02:00
ddidderr aa817a56b1 feat(compress): move CCtx creation policy into Rust
Move public CCtx creation validation, allocation failure handling, and
allocate-before-init ordering behind a Rust-owned boundary. Keep the private
ZSTD_CCtx initialization and custom allocator invocation in C callbacks.

Test Plan:
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release create_cctx -- --nocapture
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --release --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
2026-07-19 16:08:20 +02:00
ddidderr c6179c2458 docs(rust): document CDict begin boundary
Record that Rust now owns the legacy CDict-begin fixed frame policy and
unknown-source pledge while C retains the private begin callback.

Test Plan:
- Documentation-only change; code validation is covered by 2fdd548a3.
2026-07-19 16:03:12 +02:00
ddidderr 2fdd548a36 feat(compress): move CDict begin policy into Rust
Move the legacy ZSTD_compressBegin_usingCDict fixed frame policy and unknown
source pledge behind a Rust-owned boundary. Keep the private CDict begin
operation in C behind an explicit callback and preserve the parameterized
advanced API in C.

Test Plan:
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release compress_begin_using_cdict_public -- --nocapture
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --release --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
2026-07-19 16:02:50 +02:00
ddidderr fe136f2128 docs(rust): document advanced begin boundary
Record that Rust now owns public advanced-begin parameter validation and
init-then-begin ordering while C retains private context initialization and
begin callbacks.

Test Plan:
- Documentation-only change; code validation is covered by feee05372.
2026-07-19 15:57:42 +02:00
ddidderr feee053725 feat(compress): move advanced begin policy into Rust
Move public ZSTD_compressBegin_advanced parameter validation and init-then-begin
sequencing behind a Rust-owned boundary. Keep C responsible for private
ZSTD_CCtx_params initialization and ZSTD_compressBegin_internal through
explicit callbacks.

Test Plan:
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release compress_begin_advanced -- --nocapture
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --release --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
2026-07-19 15:57:21 +02:00
ddidderr 57bad12ec5 docs(rust): document dictionary begin boundary
Record that Rust now owns the compressBegin_usingDict family’s unknown-source
parameter selection and default-level normalization while C retains the private
begin callback.

Test Plan:
- Documentation-only change; code validation is covered by 9c0b9bd25.
2026-07-19 15:51:51 +02:00
ddidderr 9c0b9bd250 feat(compress): move dictionary begin policy into Rust
Move the compressBegin_usingDict family parameter selection and default-level
normalization into Rust, covering the public ZSTD_compressBegin entry point as
well. C retains private ZSTD_CCtx_params initialization and
ZSTD_compressBegin_internal through callbacks, with the unknown pledged-size
contract preserved.

Test Plan:
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release compress_begin_using_dict -- --nocapture
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --release --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
2026-07-19 15:51:36 +02:00
ddidderr da3d4ed232 docs(rust): document usingCDict boundary
Record that Rust now owns the public usingCDict fixed-frame policy and
begin/end sequencing while C retains the private CDict compression callbacks.

Test Plan:
- Documentation-only change; code validation is covered by 0fbc9ff37.
2026-07-19 15:47:15 +02:00
ddidderr 0fbc9ff37b feat(compress): move usingCDict wrapper policy into Rust
Move the public ZSTD_compress_usingCDict frame-policy construction and
begin-then-end sequencing behind a Rust-owned boundary. Keep the existing C
CDict parameter selection, private context initialization, and end-of-frame
operations behind narrow callbacks, while preserving the dictionary error
short-circuit and hardcoded frame flags.

Test Plan:
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release compress_using_cdict -- --nocapture
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --release --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
2026-07-19 15:46:54 +02:00
ddidderr dc99093506 docs(rust): document usingDict boundary
Record that Rust now owns the public usingDict parameter-selection,
dictionary-presence, and default-level policy while C retains private context
initialization and compression callbacks.

Test Plan:
- Documentation-only change; code validation is covered by 556cdc53b.
2026-07-19 15:42:31 +02:00
ddidderr 556cdc53bf feat(compress): move usingDict policy into Rust
Move ZSTD_compress_usingDict parameter selection, dictionary-presence handling,
and default compression-level normalization behind a Rust-owned orchestration
boundary. Keep C responsible for the private ZSTD_CCtx_params initialization
and advanced compression operation through explicit callbacks, including the
build-specific excluded-strategy mask.

Test Plan:
- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --release
- ulimit -v 41943040; make -B -C programs -j1 zstd
- ulimit -v 41943040; make -C tests -j1 test-zstream ZSTREAM_TESTTIME=-T1s
2026-07-19 15:42:07 +02:00
ddidderr dd404fccbc docs(rust): document advanced compression boundary
Record that Rust now owns public advanced-compression parameter validation and
initialization ordering while C retains private context setup and execution.

Test Plan:
- git diff --cached --check
2026-07-19 15:35:32 +02:00
ddidderr 50e7addbc6 feat(compress): move advanced API policy into Rust
Move ZSTD_compress_advanced parameter validation and init-before-compress
orchestration into Rust. Keep simpleApiParams initialization and the private
advanced compression operation behind C callbacks.

Test Plan:
- cargo test --manifest-path rust/Cargo.toml --lib
- cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
- make -B -C programs -j1 zstd
- make -C tests -j1 test-zstream ZSTREAM_TESTTIME=-T1s
- focused compress_advanced unit tests
2026-07-19 15:35:14 +02:00
ddidderr 4f6a3a5749 docs(rust): document CCtx copy boundary
Record that Rust now owns public CCtx-copy pledge and frame-parameter policy,
while C retains the private workspace and table-copy operation.

Test Plan:
- git diff --cached --check
2026-07-19 15:30:29 +02:00
ddidderr 41255c8dcc feat(compress): move CCtx copy policy into Rust
Move public ZSTD_copyCCtx pledge normalization and frame-parameter policy into
Rust while retaining the private workspace and match-table copy implementation
behind a C callback.

Test Plan:
- cargo test --manifest-path rust/Cargo.toml --lib
- cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
- make -B -C programs -j1 zstd
- make -C tests -j1 test-zstream ZSTREAM_TESTTIME=-T1s
- focused copy_cctx unit tests
2026-07-19 15:30:07 +02:00
ddidderr c9bcec362c docs(rust): document CDict reset boundary
Record that Rust now selects the CDict attach-versus-copy reset path while C
retains the workspace- and match-state-heavy reset operations.

Test Plan:
- git diff --cached --check
2026-07-19 15:24:22 +02:00
ddidderr 9fdc27d596 feat(compress): move CDict reset selection into Rust
Move the shared CDict attach-versus-copy policy and callback dispatch into a
Rust-owned ABI leaf. Keep both workspace- and match-state-heavy reset
implementations in C behind opaque callbacks.

Test Plan:
- cargo test --manifest-path rust/Cargo.toml --lib
- cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
- make -B -C programs -j1 zstd
- make -C tests -j1 test-zstream ZSTREAM_TESTTIME=-T1s
- focused reset_using_cdict unit tests
2026-07-19 15:23:55 +02:00
ddidderr 5f1e0e3d91 docs(rust): document compression begin boundary
Record that shared compression-begin dictionary selection now runs in Rust,
while C retains the reset, attach, and private dictionary operation callbacks.

Test Plan:
- git diff --cached --check
2026-07-19 15:13:23 +02:00
ddidderr a3127511ce feat(compress): move begin dictionary policy into Rust
Move shared compression-begin dictionary selection, CDict attach
thresholds, reset ordering, insertion dispatch, and dictionary result
publication into a Rust-owned ABI leaf. Keep CCtx reset, CDict attach,
and private dictionary insertion behind C callbacks.

Test Plan:
- cargo test --manifest-path rust/Cargo.toml --lib
- cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
- make -B -C programs -j1 zstd
- make -C tests -j1 test-zstream ZSTREAM_TESTTIME=-T1s
- focused compress_begin unit tests
2026-07-19 15:12:38 +02:00
ddidderr cc8cc47da7 docs(rust): document CDict initialization boundary
Clarify that CDict initialization ordering and scalar publication now run in
Rust, while allocation, private dictionary loading, and match/workspace
callbacks remain C-owned.

Test Plan:
- git diff --cached --check
2026-07-19 15:02:27 +02:00
ddidderr 7775396fae feat(compress): move CDict initialization policy into Rust
Move shared CDict initialization ordering and scalar publication into a
Rust-owned ABI leaf used by both dynamic and static CDict creation. Keep
content allocation/copy, entropy workspace reservation, match-state reset,
and dictionary insertion behind narrow C callbacks so private CDict and
workspace layouts remain C-owned.

Test Plan:
- cargo test --manifest-path rust/Cargo.toml --lib
- cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
- make -B -C programs -j1 zstd
- make -C tests -j1 test-zstream ZSTREAM_TESTTIME=-T1s
- focused cdict_init unit test
2026-07-19 15:02:02 +02:00
ddidderr 73ba17a76d docs(rust): document external sequence boundaries
Record that Rust now owns external-producer invocation and successful-path
validation plus external raw-sequence-store reset, while C retains private
transfer, fallback, and context operations.

Test Plan:
- git diff --cached --check
2026-07-19 14:48:57 +02:00
ddidderr 814b7af16d feat(compress): move external sequence store reset into Rust
Move the mutable external raw-sequence-store assignment and cursor reset
behind a Rust-owned pointer projection. Keep the public C entry point and
its stage/LDM assertions in C, without exposing RawSeqStore_t to Rust.

Test Plan:
- cargo test --manifest-path rust/Cargo.toml --lib
- cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
- make -B -C programs -j1 zstd
- make -C tests -j1 test-zstream ZSTREAM_TESTTIME=-T1s
- focused reference_external_sequences unit tests
2026-07-19 14:48:30 +02:00