Skip to content

Stabilize run_client delete test timestamps#2065

Merged
oferchen merged 1 commit into
masterfrom
fix-test-failure-in-client-delete-functionality
Nov 8, 2025
Merged

Stabilize run_client delete test timestamps#2065
oferchen merged 1 commit into
masterfrom
fix-test-failure-in-client-delete-functionality

Conversation

@oferchen
Copy link
Copy Markdown
Owner

@oferchen oferchen commented Nov 8, 2025

Summary

  • ensure run_client_delete_removes_extraneous_entries pins source and destination mtimes so the fresh content is always recopied before pruning extraneous files

Testing

  • cargo test -p oc-rsync-core client::tests::run_client_delete_removes_extraneous_entries -- --exact --nocapture

Codex Task

@oferchen oferchen merged commit d8cd429 into master Nov 8, 2025
@oferchen oferchen deleted the fix-test-failure-in-client-delete-functionality branch November 8, 2025 13:08
oferchen added a commit that referenced this pull request May 6, 2026
* feat(match): add zsync-inspired seq-match extend-run

Coalesces consecutive matched basis blocks at the DeltaScript layer into
a single fat `DeltaToken::Copy { len = run * block_length }`, mirroring
zsync's `next_match` shortcut from `librcksum/rsum.c:262`. The wire
layer (`script_to_wire_delta`) expands fat Copy tokens back into one
DeltaOp per basis block, so the wire byte stream stays byte-identical
to the no-coalesce baseline (closes #2065).

Adds `DeltaSignatureIndex::extend_run(start_block_index, target,
max_blocks)` as the public helper and pins the post-coalesce token
stream with a golden-byte regression test in
`crates/match/tests/seq_match_golden.rs` (closes #2066). Updates
shifted-insertion and sparse-match fixtures to expand fat Copy runs
before asserting per-block contiguity.

Wire-compat invariants from `docs/design/zsync-seq-match.md`:
- One write_int(-(block_index + 1)) per basis block on the wire.
- CPRES_ZLIB dictionary sync still feeds one block per match call.
- `apply_delta` and `compute_file_checksum` already honour `len`,
  no semantic changes downstream.

* fix(match): pad extend_run test data to multiple of DEFAULT_BLOCK_SIZE

* fix(test): assert copied bytes instead of token count for repeated blocks

The seq-match extend_run helper coalesces consecutive matching blocks
into a single COPY token, so the prior token-count assertion no longer
holds. Asserting that all input bytes are covered by COPY tokens (and
zero literal bytes) preserves the test's intent without depending on
the internal coalescing strategy.

* fix(test): size synthetic basis to exact multiple of DEFAULT_BLOCK_SIZE

Both seq_match_emits_single_fat_copy_for_full_basis_run and
seq_match_matched_bytes_match_baseline assume every basis block is
full-length so that extend_run can walk the whole basis in a single
fat-copy and matched bytes equal block_count * block_length. With
65 536-byte input and 700-byte blocks, the trailing 536-byte partial
block defeated those invariants. Sizing to 700 * 94 = 65 800 bytes
keeps the basis well under the < 700^2 byte threshold (so the layout
still picks 700) and removes the partial trailing block.
oferchen added a commit that referenced this pull request May 18, 2026
* feat(match): add zsync-inspired seq-match extend-run

Coalesces consecutive matched basis blocks at the DeltaScript layer into
a single fat `DeltaToken::Copy { len = run * block_length }`, mirroring
zsync's `next_match` shortcut from `librcksum/rsum.c:262`. The wire
layer (`script_to_wire_delta`) expands fat Copy tokens back into one
DeltaOp per basis block, so the wire byte stream stays byte-identical
to the no-coalesce baseline (closes #2065).

Adds `DeltaSignatureIndex::extend_run(start_block_index, target,
max_blocks)` as the public helper and pins the post-coalesce token
stream with a golden-byte regression test in
`crates/match/tests/seq_match_golden.rs` (closes #2066). Updates
shifted-insertion and sparse-match fixtures to expand fat Copy runs
before asserting per-block contiguity.

Wire-compat invariants from `docs/design/zsync-seq-match.md`:
- One write_int(-(block_index + 1)) per basis block on the wire.
- CPRES_ZLIB dictionary sync still feeds one block per match call.
- `apply_delta` and `compute_file_checksum` already honour `len`,
  no semantic changes downstream.

* fix(match): pad extend_run test data to multiple of DEFAULT_BLOCK_SIZE

* fix(test): assert copied bytes instead of token count for repeated blocks

The seq-match extend_run helper coalesces consecutive matching blocks
into a single COPY token, so the prior token-count assertion no longer
holds. Asserting that all input bytes are covered by COPY tokens (and
zero literal bytes) preserves the test's intent without depending on
the internal coalescing strategy.

* fix(test): size synthetic basis to exact multiple of DEFAULT_BLOCK_SIZE

Both seq_match_emits_single_fat_copy_for_full_basis_run and
seq_match_matched_bytes_match_baseline assume every basis block is
full-length so that extend_run can walk the whole basis in a single
fat-copy and matched bytes equal block_count * block_length. With
65 536-byte input and 700-byte blocks, the trailing 536-byte partial
block defeated those invariants. Sizing to 700 * 94 = 65 800 bytes
keeps the basis well under the < 700^2 byte threshold (so the layout
still picks 700) and removes the partial trailing block.
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