Skip to content

feat(transfer): implement MSG_NO_SEND support for protocol >= 30 - #2512

Merged
oferchen merged 1 commit into
masterfrom
feat/msg-no-send-support
Feb 27, 2026
Merged

oferchen merged 1 commit into
masterfrom
feat/msg-no-send-support

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • When the sender cannot open a file, sends MSG_NO_SEND with the file index (protocol >= 30) instead of silently skipping
  • Receiver accumulates MSG_NO_SEND indices via MultiplexReader so it can skip waiting for delta data
  • Sets appropriate io_error flags (IOERR_VANISHED for NotFound, IOERR_GENERAL otherwise)

Changes

  • generator.rs: Handle file-open errors by sending MSG_NO_SEND via ServerWriter (both delta and whole-file paths)
  • reader.rs: Add no_send_indices field to MultiplexReader, handle MSG_NO_SEND frames, expose via take_no_send_indices() on ServerReader
  • writer.rs: Add send_no_send() method on ServerWriter

Upstream Reference

  • sender.c:354-369: sender sends MSG_NO_SEND when file open fails and protocol_version >= 30
  • io.c:1618-1627: receiver-side MSG_NO_SEND handling

Test plan

  • 4 new unit tests for MultiplexReader MSG_NO_SEND handling
  • All 946 transfer crate tests pass
  • CI: fmt, clippy, nextest

When the sender cannot open a file it was asked to transfer, it now
sends MSG_NO_SEND with the file index instead of silently skipping.
The receiver accumulates these indices via the multiplex reader so it
can skip waiting for delta data for those files.

Upstream: sender.c:354-369, io.c:1618-1627
@oferchen
oferchen force-pushed the feat/msg-no-send-support branch from fa781c0 to a1fa644 Compare February 27, 2026 03:49
@github-actions github-actions Bot added the enhancement New feature or request label Feb 27, 2026
@oferchen
oferchen merged commit 8c2aa9f into master Feb 27, 2026
29 checks passed
@oferchen
oferchen deleted the feat/msg-no-send-support branch February 27, 2026 09:46
oferchen added a commit that referenced this pull request May 1, 2026
feat(transfer): implement MSG_NO_SEND support for protocol >= 30
oferchen added a commit that referenced this pull request May 5, 2026
feat(transfer): implement MSG_NO_SEND support for protocol >= 30
oferchen added a commit that referenced this pull request May 21, 2026
…SO-5)

Adds the ZSO-5 (task #2513) regression suite at
crates/matching/tests/zsync_wire_parity.rs. For each ZSO-1..4
optimization, constructs a basis + source pair designed to exercise
that optimization's code path, runs generate_delta, serialises the
DeltaScript through the production wire-format encoder
(protocol::wire::write_token_stream), and pins the resulting bytes
against (a) determinism across repeated runs and (b) round-trip
reconstruction of the source via apply_delta.

Active tests:
- bithash_optimization_preserves_wire_bytes (ZSO-1, task #2510, shipped
  in PR #3737) - 16 KiB random basis + disjoint random source so every
  rolling probe walks the bithash reject path. Asserts all-literal
  script and deterministic wire bytes.
- seq_match_optimization_preserves_wire_bytes (ZSO-2, task #2510,
  landing on PR #4624) - 84-block basis used as its own source so
  every adjacent-block hint fires. Asserts single fat Copy token and
  deterministic wire bytes. Test was authored to remain green on
  master (extend_run + script-level coalescing already produce the
  pinned shape) and stays green when PR #4624 swaps the probe path.
- all_active_zso_fixtures_are_deterministic - cross-cutting check that
  signals "matching pipeline became non-deterministic" as a single
  failure.

Stub tests (#[ignore]):
- hash_chain_prune_preserves_wire_bytes (ZSO-3, task #2511)
- compact_rolling_key_preserves_wire_bytes (ZSO-4, task #2512)

The stubs are structured so the only step required when those
optimizations land is to drop #[ignore] and swap the placeholder
basis/source for the duplicate-heavy / small-basis corpora documented
in the test rustdoc.

Complements the protocol-layer golden tests at
crates/protocol/tests/golden_protocol_v28_mplex_delta_stats.rs which
pin the token frame format but do not synthesize ZSO-specific basis
fixtures.

No production code changes. No new dependencies (uses a small in-test
LCG to keep the corpus deterministic). All 321 matching tests pass;
407 protocol golden tests pass.
oferchen added a commit that referenced this pull request May 21, 2026
…SO-5) (#4627)

Adds the ZSO-5 (task #2513) regression suite at
crates/matching/tests/zsync_wire_parity.rs. For each ZSO-1..4
optimization, constructs a basis + source pair designed to exercise
that optimization's code path, runs generate_delta, serialises the
DeltaScript through the production wire-format encoder
(protocol::wire::write_token_stream), and pins the resulting bytes
against (a) determinism across repeated runs and (b) round-trip
reconstruction of the source via apply_delta.

Active tests:
- bithash_optimization_preserves_wire_bytes (ZSO-1, task #2510, shipped
  in PR #3737) - 16 KiB random basis + disjoint random source so every
  rolling probe walks the bithash reject path. Asserts all-literal
  script and deterministic wire bytes.
- seq_match_optimization_preserves_wire_bytes (ZSO-2, task #2510,
  landing on PR #4624) - 84-block basis used as its own source so
  every adjacent-block hint fires. Asserts single fat Copy token and
  deterministic wire bytes. Test was authored to remain green on
  master (extend_run + script-level coalescing already produce the
  pinned shape) and stays green when PR #4624 swaps the probe path.
- all_active_zso_fixtures_are_deterministic - cross-cutting check that
  signals "matching pipeline became non-deterministic" as a single
  failure.

Stub tests (#[ignore]):
- hash_chain_prune_preserves_wire_bytes (ZSO-3, task #2511)
- compact_rolling_key_preserves_wire_bytes (ZSO-4, task #2512)

The stubs are structured so the only step required when those
optimizations land is to drop #[ignore] and swap the placeholder
basis/source for the duplicate-heavy / small-basis corpora documented
in the test rustdoc.

Complements the protocol-layer golden tests at
crates/protocol/tests/golden_protocol_v28_mplex_delta_stats.rs which
pin the token frame format but do not synthesize ZSO-specific basis
fixtures.

No production code changes. No new dependencies (uses a small in-test
LCG to keep the corpus deterministic). All 321 matching tests pass;
407 protocol golden tests pass.
oferchen added a commit that referenced this pull request Aug 24, 2026
…SO-5) (#4627)

Adds the ZSO-5 (task #2513) regression suite at
crates/matching/tests/zsync_wire_parity.rs. For each ZSO-1..4
optimization, constructs a basis + source pair designed to exercise
that optimization's code path, runs generate_delta, serialises the
DeltaScript through the production wire-format encoder
(protocol::wire::write_token_stream), and pins the resulting bytes
against (a) determinism across repeated runs and (b) round-trip
reconstruction of the source via apply_delta.

Active tests:
- bithash_optimization_preserves_wire_bytes (ZSO-1, task #2510, shipped
  in PR #3737) - 16 KiB random basis + disjoint random source so every
  rolling probe walks the bithash reject path. Asserts all-literal
  script and deterministic wire bytes.
- seq_match_optimization_preserves_wire_bytes (ZSO-2, task #2510,
  landing on PR #4624) - 84-block basis used as its own source so
  every adjacent-block hint fires. Asserts single fat Copy token and
  deterministic wire bytes. Test was authored to remain green on
  master (extend_run + script-level coalescing already produce the
  pinned shape) and stays green when PR #4624 swaps the probe path.
- all_active_zso_fixtures_are_deterministic - cross-cutting check that
  signals "matching pipeline became non-deterministic" as a single
  failure.

Stub tests (#[ignore]):
- hash_chain_prune_preserves_wire_bytes (ZSO-3, task #2511)
- compact_rolling_key_preserves_wire_bytes (ZSO-4, task #2512)

The stubs are structured so the only step required when those
optimizations land is to drop #[ignore] and swap the placeholder
basis/source for the duplicate-heavy / small-basis corpora documented
in the test rustdoc.

Complements the protocol-layer golden tests at
crates/protocol/tests/golden_protocol_v28_mplex_delta_stats.rs which
pin the token frame format but do not synthesize ZSO-specific basis
fixtures.

No production code changes. No new dependencies (uses a small in-test
LCG to keep the corpus deterministic). All 321 matching tests pass;
407 protocol golden tests pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant