From 747559e619b4ad29384dc063bf526388a57da327 Mon Sep 17 00:00:00 2001 From: ddidderr Date: Sun, 19 Jul 2026 08:21:56 +0200 Subject: [PATCH] docs(rust): refresh migration boundary Document that Rust now owns sequence-store construction, block post-build policy, public sequence conversion, and optional-format decompression loops. Keep the remaining private C callback and dictionary/CLI boundaries explicit so the hybrid state is not mistaken for a completed all-Rust rewrite. Test Plan: - git diff --check (passed) --- rust/README.md | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/rust/README.md b/rust/README.md index f88dabc34..cde0ddf02 100644 --- a/rust/README.md +++ b/rust/README.md @@ -42,17 +42,16 @@ zstd ABI: partitions, while `zstd_compress` emits those partitions through the Rust single-block serializer. C retains split discovery's context setup and the outer block-dispatch decision. `zstd_compress` also owns ordinary - sequence-block entropy emission, sequence collection, and the legacy RLE - compatibility gate after C builds the sequence store; C retains the - sequence-store builder and no-compress fallback. Rust also owns the - frame-chunk block loop, including block sizing, target/split/internal - dispatch, output accounting, and frame-state updates; C supplies the - private state-preparation and block-compression callbacks. Rust also owns - the single-threaded buffered/stable stream state machine, including direct - versus buffered output, pending-output draining, and frame reset policy. - The - external-sequence-and-literals block loop is Rust-owned as well; C retains - only its CCtx-dependent sequence-conversion callback. + sequence-block entropy emission, sequence collection, the legacy RLE + compatibility gate, and sequence-store construction; C supplies only the + private matchfinder, LDM, external-sequence-producer, and state-preparation + callbacks. Rust also owns the frame-chunk block loop, including block + sizing, target/split/internal dispatch, output accounting, and frame-state + updates; C supplies the private block-compression callbacks. Rust also + owns the single-threaded buffered/stable stream state machine, including + direct versus buffered output, pending-output draining, and frame reset + policy. The external-sequence-and-literals block loop and public sequence + conversion are Rust-owned as well; C retains only CCtx-facing adapters. - `zstd_compress_frame` serializes frame headers, skippable frames, and the last empty block; it takes scalar frame parameters so the C-owned `ZSTD_CCtx_params` layout never crosses the language boundary. @@ -107,10 +106,11 @@ zstd ABI: - `zstd_cli` owns the Rust parser, safety policy, and dispatch. It is built by the separate `cli/` static-library package only for program archives, so library builds do not acquire program-only dependencies. The C - `fileio` layer retains the format-specific codec callbacks, loops, and - metadata, while Rust owns the mixed-format probe/dispatch loop and - decompression result policy/final accounting. Rust already owns the file - preference policy, filename decisions, + `fileio` layer retains the format-specific codec callbacks, private + asynchronous-pool adapters, and metadata, while Rust owns the mixed-format + probe/dispatch loop, optional-format decompression loops, and decompression + result policy/final accounting. Rust already owns the file preference + policy, filename decisions, source/destination opening, dictionary buffers, asynchronous I/O pools, and pass-through copy leaf. - `timefn` provides the monotonic nanosecond clock behind `UTIL_time_t`, @@ -122,15 +122,14 @@ zstd ABI: feature, because the parser layer requires the C `fileio` backend that tests do not compile. -Sequence-store construction and its no-compress fallback, remaining -CCtx-dependent block and sequence conversion, dictionary ingestion and CDict -lifecycle, optional-format decompression loops, and the CLI zstd compression -leaf remain in C. The single-threaded buffered/stable stream state machine, -MT outer scheduling and flush policy, external-sequence/literals block loop, -block decoder wrappers, and decompression result policy now run in Rust. The -remaining C paths must move before the rewrite is complete. Keeping that -boundary explicit prevents a passing hybrid build from being mistaken for the -final all-Rust result. +Dictionary ingestion and CDict lifecycle, the CLI zstd compression leaf, and +private CCtx, matchfinder, workspace, and codec callbacks remain in C. The +single-threaded buffered/stable stream state machine, MT outer scheduling and +flush policy, sequence-store and block policy, external-sequence/literals +block loop, optional-format decompression loops, block decoder wrappers, and +decompression result policy now run in Rust. The remaining C paths must move +before the rewrite is complete. Keeping that boundary explicit prevents a +passing hybrid build from being mistaken for the final all-Rust result. ## Legacy decoding