Repository navigation
Verify identical timestamp comparisons consider content differences - #2069
Merged
Merged
Conversation
This was referenced May 5, 2026
oferchen
added a commit
that referenced
this pull request
May 5, 2026
…tness (#3644) Sub-design for the prune insertion point of `docs/design/zsync-inspired-matching.md` (#2068, blocking impl #2069, proptest #2070, benchmark #2071). Covers what zsync does at write_blocks (rsum.c:109-119) and how oc-rsync mirrors it inside crates/match/. Pins the insertion to the inner-loop COPY emit at generator.rs:214. Specifies the MatchedBlocks bitmap (1 bit per signature block, 128 B at 1k blocks, 12.5 MB at 100M), placement alongside DeltaSignatureIndex, and the extended probe order (bithash -> tag_table -> bucket lookup -> bitmap filter -> strong-checksum). Spells out duplicate-bucket correctness with a worked example, the property-test contract, and the bench corpora (VM disk images, log tarballs, synthetic). Restates the wire-compat invariants and the no-CLI/no-protocol cleanup contract.
5 tasks done
oferchen
added a commit
that referenced
this pull request
May 5, 2026
Pin the wire-boundary invariants for the four planned zsync-inspired matching optimizations (bithash, seq-match, prune, compact-keys), inventory existing golden tests on the match/delta path, and flag the one gap (no wire-byte pin for duplicate-basis-block COPY-token sequences) that #2069 must close before landing.
6 tasks
oferchen
added a commit
that referenced
this pull request
May 6, 2026
Introduce MatchedBlocks, a per-generator-session bitmap that records
which basis blocks have already been emitted as DeltaToken::Copy. The
delta generator threads the bitmap into find_match_slices_filtered so
that already-matched basis blocks are skipped before the strong-checksum
verify, mirroring zsync librcksum's matched-block hash removal in
hash.c:111-128 (remove_block_from_hash) triggered at write_blocks
(rsum.c:109-119).
Bits are keyed by basis block_idx, not by (rsum, strong) tuple. Two
blocks with identical content live at distinct block_idx slots, so
marking one leaves the other findable. Pruning only changes which
sibling block_idx is named in a Copy token when duplicate content
exists; the receiver applies the same bytes either way, so the wire
output stays equivalent (golden byte tests unchanged).
The want_i adjacent-match hint deliberately bypasses the bitmap: the
hint targets the just-matched index plus one, which the bitmap leaves
unset by construction.
Property tests pin two contracts from docs/design/zsync-prune.md:
prune_does_not_reduce_matched_bytes:
For sources built from a permutation of unique basis-block
positions, total Copy-token bytes under prune-on are >= prune-off.
prune_preserves_apply_round_trip:
apply_delta(basis, generate(basis, source, prune)) == source for
both prune-on and prune-off.
Hand-rolled regressions also cover three identical basis blocks and
the surplus-source-occurrences case where prune-on correctly falls
through to literal emission once every basis sibling is consumed.
Closes #2069
Closes #2070
oferchen
added a commit
that referenced
this pull request
May 6, 2026
* feat(match): add zsync-inspired matched-block pruning bitmap
Introduce MatchedBlocks, a per-generator-session bitmap that records
which basis blocks have already been emitted as DeltaToken::Copy. The
delta generator threads the bitmap into find_match_slices_filtered so
that already-matched basis blocks are skipped before the strong-checksum
verify, mirroring zsync librcksum's matched-block hash removal in
hash.c:111-128 (remove_block_from_hash) triggered at write_blocks
(rsum.c:109-119).
Bits are keyed by basis block_idx, not by (rsum, strong) tuple. Two
blocks with identical content live at distinct block_idx slots, so
marking one leaves the other findable. Pruning only changes which
sibling block_idx is named in a Copy token when duplicate content
exists; the receiver applies the same bytes either way, so the wire
output stays equivalent (golden byte tests unchanged).
The want_i adjacent-match hint deliberately bypasses the bitmap: the
hint targets the just-matched index plus one, which the bitmap leaves
unset by construction.
Property tests pin two contracts from docs/design/zsync-prune.md:
prune_does_not_reduce_matched_bytes:
For sources built from a permutation of unique basis-block
positions, total Copy-token bytes under prune-on are >= prune-off.
prune_preserves_apply_round_trip:
apply_delta(basis, generate(basis, source, prune)) == source for
both prune-on and prune-off.
Hand-rolled regressions also cover three identical basis blocks and
the surplus-source-occurrences case where prune-on correctly falls
through to literal emission once every basis sibling is consumed.
Closes #2069
Closes #2070
* fix(match): use slice::fill in matched_blocks property test
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…tness (#3644) Sub-design for the prune insertion point of `docs/design/zsync-inspired-matching.md` (#2068, blocking impl #2069, proptest #2070, benchmark #2071). Covers what zsync does at write_blocks (rsum.c:109-119) and how oc-rsync mirrors it inside crates/match/. Pins the insertion to the inner-loop COPY emit at generator.rs:214. Specifies the MatchedBlocks bitmap (1 bit per signature block, 128 B at 1k blocks, 12.5 MB at 100M), placement alongside DeltaSignatureIndex, and the extended probe order (bithash -> tag_table -> bucket lookup -> bitmap filter -> strong-checksum). Spells out duplicate-bucket correctness with a worked example, the property-test contract, and the bench corpora (VM disk images, log tarballs, synthetic). Restates the wire-compat invariants and the no-CLI/no-protocol cleanup contract.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Pin the wire-boundary invariants for the four planned zsync-inspired matching optimizations (bithash, seq-match, prune, compact-keys), inventory existing golden tests on the match/delta path, and flag the one gap (no wire-byte pin for duplicate-basis-block COPY-token sequences) that #2069 must close before landing.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
* feat(match): add zsync-inspired matched-block pruning bitmap
Introduce MatchedBlocks, a per-generator-session bitmap that records
which basis blocks have already been emitted as DeltaToken::Copy. The
delta generator threads the bitmap into find_match_slices_filtered so
that already-matched basis blocks are skipped before the strong-checksum
verify, mirroring zsync librcksum's matched-block hash removal in
hash.c:111-128 (remove_block_from_hash) triggered at write_blocks
(rsum.c:109-119).
Bits are keyed by basis block_idx, not by (rsum, strong) tuple. Two
blocks with identical content live at distinct block_idx slots, so
marking one leaves the other findable. Pruning only changes which
sibling block_idx is named in a Copy token when duplicate content
exists; the receiver applies the same bytes either way, so the wire
output stays equivalent (golden byte tests unchanged).
The want_i adjacent-match hint deliberately bypasses the bitmap: the
hint targets the just-matched index plus one, which the bitmap leaves
unset by construction.
Property tests pin two contracts from docs/design/zsync-prune.md:
prune_does_not_reduce_matched_bytes:
For sources built from a permutation of unique basis-block
positions, total Copy-token bytes under prune-on are >= prune-off.
prune_preserves_apply_round_trip:
apply_delta(basis, generate(basis, source, prune)) == source for
both prune-on and prune-off.
Hand-rolled regressions also cover three identical basis blocks and
the surplus-source-occurrences case where prune-on correctly falls
through to literal emission once every basis sibling is consumed.
Closes #2069
Closes #2070
* fix(match): use slice::fill in matched_blocks property test
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…tness (#3644) Sub-design for the prune insertion point of `docs/design/zsync-inspired-matching.md` (#2068, blocking impl #2069, proptest #2070, benchmark #2071). Covers what zsync does at write_blocks (rsum.c:109-119) and how oc-rsync mirrors it inside crates/match/. Pins the insertion to the inner-loop COPY emit at generator.rs:214. Specifies the MatchedBlocks bitmap (1 bit per signature block, 128 B at 1k blocks, 12.5 MB at 100M), placement alongside DeltaSignatureIndex, and the extended probe order (bithash -> tag_table -> bucket lookup -> bitmap filter -> strong-checksum). Spells out duplicate-bucket correctness with a worked example, the property-test contract, and the bench corpora (VM disk images, log tarballs, synthetic). Restates the wire-compat invariants and the no-CLI/no-protocol cleanup contract.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
Pin the wire-boundary invariants for the four planned zsync-inspired matching optimizations (bithash, seq-match, prune, compact-keys), inventory existing golden tests on the match/delta path, and flag the one gap (no wire-byte pin for duplicate-basis-block COPY-token sequences) that #2069 must close before landing.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
* feat(match): add zsync-inspired matched-block pruning bitmap
Introduce MatchedBlocks, a per-generator-session bitmap that records
which basis blocks have already been emitted as DeltaToken::Copy. The
delta generator threads the bitmap into find_match_slices_filtered so
that already-matched basis blocks are skipped before the strong-checksum
verify, mirroring zsync librcksum's matched-block hash removal in
hash.c:111-128 (remove_block_from_hash) triggered at write_blocks
(rsum.c:109-119).
Bits are keyed by basis block_idx, not by (rsum, strong) tuple. Two
blocks with identical content live at distinct block_idx slots, so
marking one leaves the other findable. Pruning only changes which
sibling block_idx is named in a Copy token when duplicate content
exists; the receiver applies the same bytes either way, so the wire
output stays equivalent (golden byte tests unchanged).
The want_i adjacent-match hint deliberately bypasses the bitmap: the
hint targets the just-matched index plus one, which the bitmap leaves
unset by construction.
Property tests pin two contracts from docs/design/zsync-prune.md:
prune_does_not_reduce_matched_bytes:
For sources built from a permutation of unique basis-block
positions, total Copy-token bytes under prune-on are >= prune-off.
prune_preserves_apply_round_trip:
apply_delta(basis, generate(basis, source, prune)) == source for
both prune-on and prune-off.
Hand-rolled regressions also cover three identical basis blocks and
the surplus-source-occurrences case where prune-on correctly falls
through to literal emission once every basis sibling is consumed.
Closes #2069
Closes #2070
* fix(match): use slice::fill in matched_blocks property test
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
should_skip_copycompares file contents when metadata reports an exact timestamp matchTesting
[Codex Task](