Skip to content

bench(engine): scaffold PIP-6 end-to-end parallel-vs-sequential bench harness - #4679

Merged
oferchen merged 1 commit into
masterfrom
bench/pip-6-end-to-end
May 21, 2026
Merged

oferchen merged 1 commit into
masterfrom
bench/pip-6-end-to-end

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

Adds the design doc plus criterion harness scaffold for PIP-6 - the end-to-end production-path bench for parallel-receive-delta. This is the third bench in the parallel-receive-delta chain: BR-3i.f (#2502, completed) covers the apply-loop scheduling layer with in-memory sinks, BR-3j.f (#2508, pending) is the post-DashMap re-bench, and PIP-6 measures the receiver dispatch + apply through the full production pipeline against a real oc-rsync daemon over rsync:// loopback.

The Path B heuristic landed via PIP-3+5 (PR #4666 merged): file_count > 100 || total_size > 64 MiB dispatches the receiver to the parallel apply path. The promotion table in docs/design/parallel-receive-delta-default-on.md section 4 still has TBD cells; PIP-6 produces the numbers that fill them.

Workload matrix

Five shapes calibrated to the dispatch boundary. Each annotated with the production heuristic's decision.

Shape Files Per-file size Total Heuristic
single_large_file 1 1 GiB 1 GiB parallel (size)
many_small_files 10,000 4 KiB 40 MiB parallel (count)
boundary_under 50 ~655 KiB 32 MiB sequential (control)
boundary_over 200 160 KiB 32 MiB parallel (count)
mixed_directory 1,000 4 KiB - 4 MiB ~600 MiB parallel (both)

boundary_under is the control - both builds dispatch sequential there, so wall-clock should agree within +/-3%.

Comparison shape

Same workload, two oc-rsync binaries:

  • target/release/oc-rsync - default features; parallel-receive-delta available.
  • target/release-no-parallel/oc-rsync - built with --no-default-features --features 'zstd lz4 xattr iconv'; dispatcher logs parallel_unavailable per crates/transfer/src/receiver/mod.rs:480-494 and always picks sequential.

Paths resolved via OC_RSYNC_BIN_PARALLEL / OC_RSYNC_BIN_SEQUENTIAL. Missing binary triggers a eprintln! skip rather than a panic.

Decision criteria

  • Win. parallel_wall / sequential_wall <= 0.9 on at least 2 of 5 shapes.
  • Regression budget. No shape regresses by more than 5%.
  • Boundary control. boundary_under wall-clock agrees within +/-3% between the two builds.

Bench placement

The scaffold lives in crates/core/benches/pip_6_end_to_end_parallel_vs_sequential.rs (not the engine crate) because the harness drives oc-rsync as a subprocess and core/benches/ already hosts the daemon-driven transfer_benchmark.rs pattern this scaffold mirrors. The engine crate's deps cannot reach the daemon or the full transfer pipeline.

Follow-up

Bench execution + numbers capture is intentionally not in this PR (hardware-sensitive, container-bound). The design doc section 9 lists the four follow-up items before publishable numbers can land:

  1. Two-variant cargo build script / xtask.
  2. Run on both rsync-profile (NVMe + xxh3) and oc-rsync-bench (HDD-ish + aarch64 software MD5) containers.
  3. Sidecar metric collector for RSS / CPU% / IOPS.
  4. docs(design): commit that fills section 4 of docs/design/parallel-receive-delta-default-on.md.

Files

  • docs/design/pip-6-end-to-end-parallel-vs-sequential-bench-2026-05-21.md - design doc (295 lines).
  • crates/core/benches/pip_6_end_to_end_parallel_vs_sequential.rs - criterion bench scaffold (490 lines).
  • crates/core/Cargo.toml - bench target registration.

Test plan

  • CI green on fmt+clippy, nextest (stable), Windows, macOS, Linux musl.
  • cargo build -p core --benches compiles the scaffold without warnings.
  • Manual sanity: bench skips cleanly when neither binary is present.

References

Adds the end-to-end production-path bench harness for the parallel-
receive-delta promotion chain. PIP-6 is the third bench in the
sequence after BR-3i.f (#2502, apply-loop) and BR-3j.f (#2508,
post-DashMap re-bench).

Scope: drives a real oc-rsync client against a real oc-rsync daemon
over rsync:// loopback, on workload shapes calibrated to the Path B
dispatch boundary (file_count > 100 || total_size > 64 MiB) that
PIP-3+5 (PR #4666) wired into ReceiverContext::dispatch_receiver_strategy.

Comparison shape: same workload, two oc-rsync binaries (default-features
build vs --no-default-features --features 'zstd lz4 xattr iconv').
The no-parallel build trips the parallel_unavailable fallback path
in crates/transfer/src/receiver/mod.rs and always picks sequential.

Workload matrix:
- single_large_file (1x1 GiB, parallel by byte threshold)
- many_small_files (10_000x4 KiB, parallel by count)
- boundary_under (50 files, 32 MiB, sequential control)
- boundary_over (200 files, 32 MiB, parallel above count)
- mixed_directory (1_000 files, ~600 MiB, parallel)

Decision criteria:
- Win on >= 2 of 5 shapes (parallel_wall / sequential_wall <= 0.9)
- No shape regresses by more than 5%
- boundary_under within +/-3% (harness control)

Bench compiles; numbers capture is the follow-up. The section-4 table
in docs/design/parallel-receive-delta-default-on.md is the target for
the wall-clock data.
@oferchen
oferchen force-pushed the bench/pip-6-end-to-end branch from c1005db to 11e4fa9 Compare May 21, 2026 15:50
@oferchen
oferchen merged commit f842dfd into master May 21, 2026
104 of 106 checks passed
@oferchen
oferchen deleted the bench/pip-6-end-to-end branch May 22, 2026 06:40
oferchen added a commit that referenced this pull request Aug 24, 2026
…#4679)

Adds the end-to-end production-path bench harness for the parallel-
receive-delta promotion chain. PIP-6 is the third bench in the
sequence after BR-3i.f (#2502, apply-loop) and BR-3j.f (#2508,
post-DashMap re-bench).

Scope: drives a real oc-rsync client against a real oc-rsync daemon
over rsync:// loopback, on workload shapes calibrated to the Path B
dispatch boundary (file_count > 100 || total_size > 64 MiB) that
PIP-3+5 (PR #4666) wired into ReceiverContext::dispatch_receiver_strategy.

Comparison shape: same workload, two oc-rsync binaries (default-features
build vs --no-default-features --features 'zstd lz4 xattr iconv').
The no-parallel build trips the parallel_unavailable fallback path
in crates/transfer/src/receiver/mod.rs and always picks sequential.

Workload matrix:
- single_large_file (1x1 GiB, parallel by byte threshold)
- many_small_files (10_000x4 KiB, parallel by count)
- boundary_under (50 files, 32 MiB, sequential control)
- boundary_over (200 files, 32 MiB, parallel above count)
- mixed_directory (1_000 files, ~600 MiB, parallel)

Decision criteria:
- Win on >= 2 of 5 shapes (parallel_wall / sequential_wall <= 0.9)
- No shape regresses by more than 5%
- boundary_under within +/-3% (harness control)

Bench compiles; numbers capture is the follow-up. The section-4 table
in docs/design/parallel-receive-delta-default-on.md is the target for
the wall-clock data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant