Skip to content

feat(cli): add missing server-side flag parser options - #2511

Merged
oferchen merged 1 commit into
masterfrom
feat/server-side-flag-parser
Feb 27, 2026
Merged

oferchen merged 1 commit into
masterfrom
feat/server-side-flag-parser

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Add 9 new server-side flags: --write-devices, --trust-sender, --qsort, --checksum-seed, --checksum-choice, --min-size, --max-size, --stop-at, --stop-after
  • Extract flag parsing into ServerLongFlags struct with dedicated parse_server_long_flags() function
  • Add parse helpers for checksum seed validation, size limit parsing, and stop time parsing
  • Wire all new flags through to ServerConfig fields
  • Add 39 unit tests covering all new flags, edge cases, and error paths

Test plan

  • Verify cargo fmt --all -- --check passes
  • Verify cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings passes
  • Verify cargo nextest run --workspace --all-features passes
  • Verify server-mode flag parsing matches upstream rsync 3.4.1

- Add 9 new server-side flags: --write-devices, --trust-sender, --qsort,
  --checksum-seed, --checksum-choice, --min-size, --max-size, --stop-at,
  --stop-after
- Extract flag parsing into ServerLongFlags struct with dedicated parser
- Add parse helpers for checksum seed, size limits, and stop times
- Add 39 unit tests covering all new flags and edge cases
@oferchen
oferchen force-pushed the feat/server-side-flag-parser branch from ac13b39 to 8ada890 Compare February 27, 2026 03:39
@oferchen
oferchen merged commit 758d03c into master Feb 27, 2026
7 checks passed
@github-actions github-actions Bot added the enhancement New feature or request label Feb 27, 2026
@oferchen
oferchen deleted the feat/server-side-flag-parser branch February 27, 2026 09:46
oferchen added a commit that referenced this pull request May 1, 2026
feat(cli): add missing server-side flag parser options
oferchen added a commit that referenced this pull request May 5, 2026
feat(cli): add missing server-side flag parser options
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