Repository navigation
perf: define SHORT_SUM_LENGTH constant for phase 1 checksums - #2562
Merged
Merged
Conversation
Add SHORT_SUM_LENGTH (2 bytes) alongside MAX_SUM_LENGTH (16 bytes) in the signature crate. Upstream rsync uses abbreviated 2-byte checksums during phase 1 to reduce signature size, switching to full 16-byte checksums in phase 2 redo passes (rsync.h:714-715). - Make both constants pub and re-export from signature crate root - Deduplicate SUM_LENGTH in layout.rs by importing MAX_SUM_LENGTH
oferchen
added a commit
that referenced
this pull request
May 1, 2026
* perf: define SHORT_SUM_LENGTH constant for phase 1 checksums Add SHORT_SUM_LENGTH (2 bytes) alongside MAX_SUM_LENGTH (16 bytes) in the signature crate. Upstream rsync uses abbreviated 2-byte checksums during phase 1 to reduce signature size, switching to full 16-byte checksums in phase 2 redo passes (rsync.h:714-715). - Make both constants pub and re-export from signature crate root - Deduplicate SUM_LENGTH in layout.rs by importing MAX_SUM_LENGTH * style: fix rustfmt import grouping in signature lib.rs
oferchen
added a commit
that referenced
this pull request
May 5, 2026
* perf: define SHORT_SUM_LENGTH constant for phase 1 checksums Add SHORT_SUM_LENGTH (2 bytes) alongside MAX_SUM_LENGTH (16 bytes) in the signature crate. Upstream rsync uses abbreviated 2-byte checksums during phase 1 to reduce signature size, switching to full 16-byte checksums in phase 2 redo passes (rsync.h:714-715). - Make both constants pub and re-export from signature crate root - Deduplicate SUM_LENGTH in layout.rs by importing MAX_SUM_LENGTH * style: fix rustfmt import grouping in signature lib.rs
4 tasks done
oferchen
added a commit
that referenced
this pull request
May 21, 2026
…SSC-1) Emit a one-time stderr warning at SSH spawn time when both rsync wire compression (--compress) and SSH stream compression (-C / -o Compression=yes on the rsync `-e ssh ...` invocation) are enabled. SSH cannot meaningfully recompress the already-compressed rsync stream, so doing both wastes CPU and can occasionally expand the payload. Detection is conservative: it only inspects the SSH command-line built by the user via `-e` / `--rsh`. Parsing `~/.ssh/config` is left to SSC-3 (#2563); the documentation companion lives in SSC-2 (#2562). The emitter uses a process-global `OnceLock<bool>` so subsequent SSH spawns in the same process do not flood stderr. The detection predicate is split out into a `should_warn_double_compression` helper so the four new tests (warns_on_double_compression, no_warning_when_only_rsync_compress, no_warning_when_only_ssh_compress, no_warning_when_neither_compresses) can exercise the logic without depending on `OnceLock` state.
oferchen
added a commit
that referenced
this pull request
May 21, 2026
…H -C (SSC-1) (#4667) * feat(core): warn on double-compression when --compress meets SSH -C (SSC-1) Emit a one-time stderr warning at SSH spawn time when both rsync wire compression (--compress) and SSH stream compression (-C / -o Compression=yes on the rsync `-e ssh ...` invocation) are enabled. SSH cannot meaningfully recompress the already-compressed rsync stream, so doing both wastes CPU and can occasionally expand the payload. Detection is conservative: it only inspects the SSH command-line built by the user via `-e` / `--rsh`. Parsing `~/.ssh/config` is left to SSC-3 (#2563); the documentation companion lives in SSC-2 (#2562). The emitter uses a process-global `OnceLock<bool>` so subsequent SSH spawns in the same process do not flood stderr. The detection predicate is split out into a `should_warn_double_compression` helper so the four new tests (warns_on_double_compression, no_warning_when_only_rsync_compress, no_warning_when_only_ssh_compress, no_warning_when_neither_compresses) can exercise the logic without depending on `OnceLock` state. * fix(engine): close race in concurrent_register_and_dispatch_on_overlapping_files Cross-tree fix bundled with SSC-1 because this master-side flaky stress test has been blocking CI on multiple unrelated PRs (#4663, #4665, #4667). The race: SMALL_OPS=4000 dispatcher operations spread across WORKERS rayon workers can complete before the registrar's first `register_file(0, ...)` returns. When that happens every `apply_chunk_parallel` returns the typed "unknown" error, `expected` (the success-byte counter) stays 0, and the sanity assertion `assert!(expected > 0)` at line 264 fires. The probability is small on Linux but reliably observable on Windows under the tracing feature build. Added a separate `registrations_done` AtomicU64 the registrar bumps after each `register_file` returns. Workers block on `registrations_done >= 1` via yield_now before starting their dispatch loop. The race against the registrar for ndx >= 1 is preserved, so the test still stresses the register-vs-dispatch surface. Followup candidates: SMALL_NUM/SMALL_OPS retuning, deterministic injection points - not necessary for the immediate unblock.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…H -C (SSC-1) (#4667) * feat(core): warn on double-compression when --compress meets SSH -C (SSC-1) Emit a one-time stderr warning at SSH spawn time when both rsync wire compression (--compress) and SSH stream compression (-C / -o Compression=yes on the rsync `-e ssh ...` invocation) are enabled. SSH cannot meaningfully recompress the already-compressed rsync stream, so doing both wastes CPU and can occasionally expand the payload. Detection is conservative: it only inspects the SSH command-line built by the user via `-e` / `--rsh`. Parsing `~/.ssh/config` is left to SSC-3 (#2563); the documentation companion lives in SSC-2 (#2562). The emitter uses a process-global `OnceLock<bool>` so subsequent SSH spawns in the same process do not flood stderr. The detection predicate is split out into a `should_warn_double_compression` helper so the four new tests (warns_on_double_compression, no_warning_when_only_rsync_compress, no_warning_when_only_ssh_compress, no_warning_when_neither_compresses) can exercise the logic without depending on `OnceLock` state. * fix(engine): close race in concurrent_register_and_dispatch_on_overlapping_files Cross-tree fix bundled with SSC-1 because this master-side flaky stress test has been blocking CI on multiple unrelated PRs (#4663, #4665, #4667). The race: SMALL_OPS=4000 dispatcher operations spread across WORKERS rayon workers can complete before the registrar's first `register_file(0, ...)` returns. When that happens every `apply_chunk_parallel` returns the typed "unknown" error, `expected` (the success-byte counter) stays 0, and the sanity assertion `assert!(expected > 0)` at line 264 fires. The probability is small on Linux but reliably observable on Windows under the tracing feature build. Added a separate `registrations_done` AtomicU64 the registrar bumps after each `register_file` returns. Workers block on `registrations_done >= 1` via yield_now before starting their dispatch loop. The race against the registrar for ndx >= 1 is preserved, so the test still stresses the register-vs-dispatch surface. Followup candidates: SMALL_NUM/SMALL_OPS retuning, deterministic injection points - not necessary for the immediate unblock.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SHORT_SUM_LENGTH(2 bytes) constant alongsideMAX_SUM_LENGTH(16 bytes) in the signature cratepuband re-export fromsignaturecrate rootSUM_LENGTHinlayout.rsby importingMAX_SUM_LENGTHThis constant is a prerequisite for implementing phase-aware checksum length toggling (#663).
Test plan
cargo check -p signaturepasses