Skip to content

Ensure copy skip heuristics verify file content - #2071

Merged
oferchen merged 1 commit into
masterfrom
fix-failed-file-comparison-test
Nov 8, 2025
Merged

oferchen merged 1 commit into
masterfrom
fix-failed-file-comparison-test

Conversation

@oferchen

@oferchen oferchen commented Nov 8, 2025 •

Copy link
Copy Markdown
Owner

Summary

  • prevent should_skip_copy from skipping files whose metadata matches but contents differ
  • share the content comparison helper for copy decisions used by link-dest lookups
  • satisfy clippy by trimming unused link-dest parameters

Testing

  • cargo test -p oc-rsync-engine --lib
  • cargo clippy --workspace --all-targets --all-features -- -D warnings

[Codex Task](

@oferchen
oferchen merged commit fdf7f4b into master Nov 8, 2025
@oferchen
oferchen deleted the fix-failed-file-comparison-test branch November 8, 2025 15:13

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 115 to +118
return false;
}

true
files_contents_identical(source_path, destination_path).unwrap_or(false)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid reading entire file contents in metadata skip path

The new call to files_contents_identical means every invocation of should_skip_copy now performs a full byte‑for‑byte comparison whenever sizes and mtimes match. execute_transfer uses this helper for every existing destination (lines 68‑77 of copy/transfer.rs), so a no‑op sync will now re‑read both source and destination files in their entirety just to confirm a skip. That effectively enables --checksum behaviour by default and scales linearly with file size, which will massively slow down typical rsync runs with large unchanged files and diverges from upstream’s size/mtime heuristic. Consider limiting the expensive content check to link‑dest validation or an explicit checksum mode.

Useful? React with 👍 / 👎.

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.
oferchen added a commit that referenced this pull request May 16, 2026
…2067, #2071)

Adds three Criterion harnesses under a new internal `bench-internal`
feature flag that exposes the minimum surface needed to measure the
zsync-inspired matching insertion points without affecting release
builds:

- `bithash_rejection` (#2063): measures the bithash prefilter
  rejection rate at 1/16/128 MiB basis sizes, on matching and random
  targets. Reports static utilization plus observed post-tag
  rejection rate.
- `seq_match_redundant` (#2067): measures `generate_delta` throughput
  on log-file, tar-archive, and random-control corpora with a target
  that is basis plus a handful of small mutations, exercising the
  `want_i` adjacent-match hint path.
- `prune_duplicate_heavy` (#2071): measures match throughput with
  the matched-block pruning bitmap on and off across a zero-heavy
  VM-disk-style basis, a repeated-blocks synthetic corpus, and a
  no-duplicates regression control.

The new feature exposes only bench-only accessors
(`bithash_utilization`, `bithash_admits`, `tag_admits`) and the
prune toggle (`with_prune_matched`). It is never enabled by default,
never propagated to CLI/daemon, and there is no way to turn it on
from a release `oc-rsync` invocation.
oferchen added a commit that referenced this pull request May 16, 2026
…2067, #2071) (#4177)

Adds three Criterion harnesses under a new internal `bench-internal`
feature flag that exposes the minimum surface needed to measure the
zsync-inspired matching insertion points without affecting release
builds:

- `bithash_rejection` (#2063): measures the bithash prefilter
  rejection rate at 1/16/128 MiB basis sizes, on matching and random
  targets. Reports static utilization plus observed post-tag
  rejection rate.
- `seq_match_redundant` (#2067): measures `generate_delta` throughput
  on log-file, tar-archive, and random-control corpora with a target
  that is basis plus a handful of small mutations, exercising the
  `want_i` adjacent-match hint path.
- `prune_duplicate_heavy` (#2071): measures match throughput with
  the matched-block pruning bitmap on and off across a zero-heavy
  VM-disk-style basis, a repeated-blocks synthetic corpus, and a
  no-duplicates regression control.

The new feature exposes only bench-only accessors
(`bithash_utilization`, `bithash_admits`, `tag_admits`) and the
prune toggle (`with_prune_matched`). It is never enabled by default,
never propagated to CLI/daemon, and there is no way to turn it on
from a release `oc-rsync` invocation.
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
…2067, #2071) (#4177)

Adds three Criterion harnesses under a new internal `bench-internal`
feature flag that exposes the minimum surface needed to measure the
zsync-inspired matching insertion points without affecting release
builds:

- `bithash_rejection` (#2063): measures the bithash prefilter
  rejection rate at 1/16/128 MiB basis sizes, on matching and random
  targets. Reports static utilization plus observed post-tag
  rejection rate.
- `seq_match_redundant` (#2067): measures `generate_delta` throughput
  on log-file, tar-archive, and random-control corpora with a target
  that is basis plus a handful of small mutations, exercising the
  `want_i` adjacent-match hint path.
- `prune_duplicate_heavy` (#2071): measures match throughput with
  the matched-block pruning bitmap on and off across a zero-heavy
  VM-disk-style basis, a repeated-blocks synthetic corpus, and a
  no-duplicates regression control.

The new feature exposes only bench-only accessors
(`bithash_utilization`, `bithash_admits`, `tag_admits`) and the
prune toggle (`with_prune_matched`). It is never enabled by default,
never propagated to CLI/daemon, and there is no way to turn it on
from a release `oc-rsync` invocation.
oferchen added a commit that referenced this pull request May 18, 2026
…2067, #2071) (#4177)

Adds three Criterion harnesses under a new internal `bench-internal`
feature flag that exposes the minimum surface needed to measure the
zsync-inspired matching insertion points without affecting release
builds:

- `bithash_rejection` (#2063): measures the bithash prefilter
  rejection rate at 1/16/128 MiB basis sizes, on matching and random
  targets. Reports static utilization plus observed post-tag
  rejection rate.
- `seq_match_redundant` (#2067): measures `generate_delta` throughput
  on log-file, tar-archive, and random-control corpora with a target
  that is basis plus a handful of small mutations, exercising the
  `want_i` adjacent-match hint path.
- `prune_duplicate_heavy` (#2071): measures match throughput with
  the matched-block pruning bitmap on and off across a zero-heavy
  VM-disk-style basis, a repeated-blocks synthetic corpus, and a
  no-duplicates regression control.

The new feature exposes only bench-only accessors
(`bithash_utilization`, `bithash_admits`, `tag_admits`) and the
prune toggle (`with_prune_matched`). It is never enabled by default,
never propagated to CLI/daemon, and there is no way to turn it on
from a release `oc-rsync` invocation.
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
…2067, #2071) (#4177)

Adds three Criterion harnesses under a new internal `bench-internal`
feature flag that exposes the minimum surface needed to measure the
zsync-inspired matching insertion points without affecting release
builds:

- `bithash_rejection` (#2063): measures the bithash prefilter
  rejection rate at 1/16/128 MiB basis sizes, on matching and random
  targets. Reports static utilization plus observed post-tag
  rejection rate.
- `seq_match_redundant` (#2067): measures `generate_delta` throughput
  on log-file, tar-archive, and random-control corpora with a target
  that is basis plus a handful of small mutations, exercising the
  `want_i` adjacent-match hint path.
- `prune_duplicate_heavy` (#2071): measures match throughput with
  the matched-block pruning bitmap on and off across a zero-heavy
  VM-disk-style basis, a repeated-blocks synthetic corpus, and a
  no-duplicates regression control.

The new feature exposes only bench-only accessors
(`bithash_utilization`, `bithash_admits`, `tag_admits`) and the
prune toggle (`with_prune_matched`). It is never enabled by default,
never propagated to CLI/daemon, and there is no way to turn it on
from a release `oc-rsync` invocation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant