Skip to content

Respect last occurrence for tri-state toggles - #2079

Merged
oferchen merged 1 commit into
masterfrom
decompose-source-files-over-500-lines
Nov 8, 2025
Merged

oferchen merged 1 commit into
masterfrom
decompose-source-files-over-500-lines

Conversation

@oferchen

@oferchen oferchen commented Nov 8, 2025 •

Copy link
Copy Markdown
Owner

Summary

  • ensure the CLI tri-state helpers compare argument indices so the last toggle wins, matching rsync
  • add regression coverage that mixes --perms/--no-perms and --dirs/--no-dirs to lock down the precedence

Testing

  • cargo test -p oc-rsync-cli parse_args_prefers_last_perms_toggle -- --nocapture
  • cargo test -p oc-rsync-cli parse_args_prefers_last_dirs_toggle -- --nocapture
  • cargo test -p oc-rsync-cli parse_args_recognises_perms_and_times_flags -- --nocapture

[Codex Task](

@oferchen
oferchen merged commit 3f6b509 into master Nov 8, 2025
@oferchen
oferchen deleted the decompose-source-files-over-500-lines branch November 8, 2025 19:18
oferchen added a commit that referenced this pull request May 5, 2026
#3723)

Add design note for the canonical zsync-style insertion adversary at
docs/design/zsync-shifted-insertion-test.md, pinning the public-API
guard for the four pipeline optimizations enumerated in
docs/design/zsync-inspired-matching.md (#2053). Documents the
fixture parameters, expected match output for aligned vs unaligned
regimes, the upstream rsync --stats comparison oracle, CI integration
gated by SIMD parity (#2077), and the failure modes (signed-byte
regression #2076 class, off-by-one in seek, bithash false negative
#2061-#2063 class, want_i hint off-by-one, rolling-window reset bugs,
strong-checksum truncation drift, ring-buffer wrap bugs).

Cites the existing fixture at crates/match/tests/shifted_insertion_fixture.rs,
the sibling rsum-collision fixture from #2078, and the rolling
sign-extension fix from PR #3560 (commit 723a0a0).
oferchen added a commit that referenced this pull request May 16, 2026
…2079 #2080)

Combine the two zsync-prefilter adversarial regression gates the
optimisation tracker calls out in project_zsync_optimizations.md:

- #2079 shifted-insertion: extend the existing 32 KiB fixture with a
  1 MiB-basis case driven by a deterministic xorshift64* PRNG. Asserts
  that the delta references basis blocks on both sides of the insertion
  for a parameterised (N, M) vector covering aligned, sub-block,
  sub-word, and tail-edge insert positions. Lost-block tolerance is one
  block (the boundary block of an unaligned insert).

- #2080 sparse-match: new internal unit test sitting inside src/index/
  so it can probe the otherwise private bithash field without enlarging
  the public API. Builds a 100 MiB basis + 100 MiB target whose only
  overlap is a single 4 KiB planted region, then drives the rolling
  window over the full target asserting (a) exactly one block-aligned
  match per basis block in the planted region, (b) the match's offset
  and length, and (c) a >= 70 % bithash rejection rate over the
  non-planted region. The 100 MiB case is marked #[ignore] so the
  default nextest run stays fast; stress runs invoke it explicitly via
  --run-ignored.

Both tests use deterministic xorshift PRNGs so the inputs are
reproducible without committing binary fixtures to the test tree.

Files:
- crates/matching/tests/shifted_insertion_fixture.rs (+234)
- crates/matching/src/index/sparse_match_tests.rs (new, +312)
- crates/matching/src/index/mod.rs (+2, register submodule)
oferchen added a commit that referenced this pull request May 16, 2026
…2079 #2080)

Combine the two zsync-prefilter adversarial regression gates the
optimisation tracker calls out in project_zsync_optimizations.md:

- #2079 shifted-insertion: extend the existing 32 KiB fixture with a
  1 MiB-basis case driven by a deterministic xorshift64* PRNG. Asserts
  that the delta references basis blocks on both sides of the insertion
  for a parameterised (N, M) vector covering aligned, sub-block,
  sub-word, and tail-edge insert positions. Lost-block tolerance is one
  block (the boundary block of an unaligned insert).

- #2080 sparse-match: new internal unit test sitting inside src/index/
  so it can probe the otherwise private bithash field without enlarging
  the public API. Builds a 100 MiB basis + 100 MiB target whose only
  overlap is a single 4 KiB planted region, then drives the rolling
  window over the full target asserting (a) exactly one block-aligned
  match per basis block in the planted region, (b) the match's offset
  and length, and (c) a >= 70 % bithash rejection rate over the
  non-planted region. The 100 MiB case is marked #[ignore] so the
  default nextest run stays fast; stress runs invoke it explicitly via
  --run-ignored.

Both tests use deterministic xorshift PRNGs so the inputs are
reproducible without committing binary fixtures to the test tree.

Files:
- crates/matching/tests/shifted_insertion_fixture.rs (+234)
- crates/matching/src/index/sparse_match_tests.rs (new, +312)
- crates/matching/src/index/mod.rs (+2, register submodule)
oferchen added a commit that referenced this pull request May 16, 2026
…2079 #2080)

Combine the two zsync-prefilter adversarial regression gates the
optimisation tracker calls out in project_zsync_optimizations.md:

- #2079 shifted-insertion: extend the existing 32 KiB fixture with a
  1 MiB-basis case driven by a deterministic xorshift64* PRNG. Asserts
  that the delta references basis blocks on both sides of the insertion
  for a parameterised (N, M) vector covering aligned, sub-block,
  sub-word, and tail-edge insert positions. Lost-block tolerance is one
  block (the boundary block of an unaligned insert).

- #2080 sparse-match: new internal unit test sitting inside src/index/
  so it can probe the otherwise private bithash field without enlarging
  the public API. Builds a 100 MiB basis + 100 MiB target whose only
  overlap is a single 4 KiB planted region, then drives the rolling
  window over the full target asserting (a) exactly one block-aligned
  match per basis block in the planted region, (b) the match's offset
  and length, and (c) a >= 70 % bithash rejection rate over the
  non-planted region. The 100 MiB case is marked #[ignore] so the
  default nextest run stays fast; stress runs invoke it explicitly via
  --run-ignored.

Both tests use deterministic xorshift PRNGs so the inputs are
reproducible without committing binary fixtures to the test tree.

Files:
- crates/matching/tests/shifted_insertion_fixture.rs (+234)
- crates/matching/src/index/sparse_match_tests.rs (new, +312)
- crates/matching/src/index/mod.rs (+2, register submodule)
oferchen added a commit that referenced this pull request May 16, 2026
…2079 #2080) (#4164)

Combine the two zsync-prefilter adversarial regression gates the
optimisation tracker calls out in project_zsync_optimizations.md:

- #2079 shifted-insertion: extend the existing 32 KiB fixture with a
  1 MiB-basis case driven by a deterministic xorshift64* PRNG. Asserts
  that the delta references basis blocks on both sides of the insertion
  for a parameterised (N, M) vector covering aligned, sub-block,
  sub-word, and tail-edge insert positions. Lost-block tolerance is one
  block (the boundary block of an unaligned insert).

- #2080 sparse-match: new internal unit test sitting inside src/index/
  so it can probe the otherwise private bithash field without enlarging
  the public API. Builds a 100 MiB basis + 100 MiB target whose only
  overlap is a single 4 KiB planted region, then drives the rolling
  window over the full target asserting (a) exactly one block-aligned
  match per basis block in the planted region, (b) the match's offset
  and length, and (c) a >= 70 % bithash rejection rate over the
  non-planted region. The 100 MiB case is marked #[ignore] so the
  default nextest run stays fast; stress runs invoke it explicitly via
  --run-ignored.

Both tests use deterministic xorshift PRNGs so the inputs are
reproducible without committing binary fixtures to the test tree.

Files:
- crates/matching/tests/shifted_insertion_fixture.rs (+234)
- crates/matching/src/index/sparse_match_tests.rs (new, +312)
- crates/matching/src/index/mod.rs (+2, register submodule)
oferchen added a commit that referenced this pull request May 18, 2026
#3723)

Add design note for the canonical zsync-style insertion adversary at
docs/design/zsync-shifted-insertion-test.md, pinning the public-API
guard for the four pipeline optimizations enumerated in
docs/design/zsync-inspired-matching.md (#2053). Documents the
fixture parameters, expected match output for aligned vs unaligned
regimes, the upstream rsync --stats comparison oracle, CI integration
gated by SIMD parity (#2077), and the failure modes (signed-byte
regression #2076 class, off-by-one in seek, bithash false negative
#2061-#2063 class, want_i hint off-by-one, rolling-window reset bugs,
strong-checksum truncation drift, ring-buffer wrap bugs).

Cites the existing fixture at crates/match/tests/shifted_insertion_fixture.rs,
the sibling rsum-collision fixture from #2078, and the rolling
sign-extension fix from PR #3560 (commit 723a0a0).
oferchen added a commit that referenced this pull request May 18, 2026
…2079 #2080) (#4164)

Combine the two zsync-prefilter adversarial regression gates the
optimisation tracker calls out in project_zsync_optimizations.md:

- #2079 shifted-insertion: extend the existing 32 KiB fixture with a
  1 MiB-basis case driven by a deterministic xorshift64* PRNG. Asserts
  that the delta references basis blocks on both sides of the insertion
  for a parameterised (N, M) vector covering aligned, sub-block,
  sub-word, and tail-edge insert positions. Lost-block tolerance is one
  block (the boundary block of an unaligned insert).

- #2080 sparse-match: new internal unit test sitting inside src/index/
  so it can probe the otherwise private bithash field without enlarging
  the public API. Builds a 100 MiB basis + 100 MiB target whose only
  overlap is a single 4 KiB planted region, then drives the rolling
  window over the full target asserting (a) exactly one block-aligned
  match per basis block in the planted region, (b) the match's offset
  and length, and (c) a >= 70 % bithash rejection rate over the
  non-planted region. The 100 MiB case is marked #[ignore] so the
  default nextest run stays fast; stress runs invoke it explicitly via
  --run-ignored.

Both tests use deterministic xorshift PRNGs so the inputs are
reproducible without committing binary fixtures to the test tree.

Files:
- crates/matching/tests/shifted_insertion_fixture.rs (+234)
- crates/matching/src/index/sparse_match_tests.rs (new, +312)
- crates/matching/src/index/mod.rs (+2, register submodule)
oferchen added a commit that referenced this pull request May 18, 2026
…2079 #2080) (#4164)

Combine the two zsync-prefilter adversarial regression gates the
optimisation tracker calls out in project_zsync_optimizations.md:

- #2079 shifted-insertion: extend the existing 32 KiB fixture with a
  1 MiB-basis case driven by a deterministic xorshift64* PRNG. Asserts
  that the delta references basis blocks on both sides of the insertion
  for a parameterised (N, M) vector covering aligned, sub-block,
  sub-word, and tail-edge insert positions. Lost-block tolerance is one
  block (the boundary block of an unaligned insert).

- #2080 sparse-match: new internal unit test sitting inside src/index/
  so it can probe the otherwise private bithash field without enlarging
  the public API. Builds a 100 MiB basis + 100 MiB target whose only
  overlap is a single 4 KiB planted region, then drives the rolling
  window over the full target asserting (a) exactly one block-aligned
  match per basis block in the planted region, (b) the match's offset
  and length, and (c) a >= 70 % bithash rejection rate over the
  non-planted region. The 100 MiB case is marked #[ignore] so the
  default nextest run stays fast; stress runs invoke it explicitly via
  --run-ignored.

Both tests use deterministic xorshift PRNGs so the inputs are
reproducible without committing binary fixtures to the test tree.

Files:
- crates/matching/tests/shifted_insertion_fixture.rs (+234)
- crates/matching/src/index/sparse_match_tests.rs (new, +312)
- crates/matching/src/index/mod.rs (+2, register submodule)
oferchen added a commit that referenced this pull request Aug 24, 2026
#3723)

Add design note for the canonical zsync-style insertion adversary at
docs/design/zsync-shifted-insertion-test.md, pinning the public-API
guard for the four pipeline optimizations enumerated in
docs/design/zsync-inspired-matching.md (#2053). Documents the
fixture parameters, expected match output for aligned vs unaligned
regimes, the upstream rsync --stats comparison oracle, CI integration
gated by SIMD parity (#2077), and the failure modes (signed-byte
regression #2076 class, off-by-one in seek, bithash false negative
#2061-#2063 class, want_i hint off-by-one, rolling-window reset bugs,
strong-checksum truncation drift, ring-buffer wrap bugs).

Cites the existing fixture at crates/match/tests/shifted_insertion_fixture.rs,
the sibling rsum-collision fixture from #2078, and the rolling
sign-extension fix from PR #3560 (commit 723a0a0).
oferchen added a commit that referenced this pull request Aug 24, 2026
…2079 #2080) (#4164)

Combine the two zsync-prefilter adversarial regression gates the
optimisation tracker calls out in project_zsync_optimizations.md:

- #2079 shifted-insertion: extend the existing 32 KiB fixture with a
  1 MiB-basis case driven by a deterministic xorshift64* PRNG. Asserts
  that the delta references basis blocks on both sides of the insertion
  for a parameterised (N, M) vector covering aligned, sub-block,
  sub-word, and tail-edge insert positions. Lost-block tolerance is one
  block (the boundary block of an unaligned insert).

- #2080 sparse-match: new internal unit test sitting inside src/index/
  so it can probe the otherwise private bithash field without enlarging
  the public API. Builds a 100 MiB basis + 100 MiB target whose only
  overlap is a single 4 KiB planted region, then drives the rolling
  window over the full target asserting (a) exactly one block-aligned
  match per basis block in the planted region, (b) the match's offset
  and length, and (c) a >= 70 % bithash rejection rate over the
  non-planted region. The 100 MiB case is marked #[ignore] so the
  default nextest run stays fast; stress runs invoke it explicitly via
  --run-ignored.

Both tests use deterministic xorshift PRNGs so the inputs are
reproducible without committing binary fixtures to the test tree.

Files:
- crates/matching/tests/shifted_insertion_fixture.rs (+234)
- crates/matching/src/index/sparse_match_tests.rs (new, +312)
- crates/matching/src/index/mod.rs (+2, register submodule)
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