Skip to content

feat(transfer): force-parallel env override + interop scenario crossing parallel threshold (PIP-4) - #4720

Merged
oferchen merged 2 commits into
masterfrom
feat/pip-4-force-parallel-and-interop-scenario
May 22, 2026
Merged

oferchen merged 2 commits into
masterfrom
feat/pip-4-force-parallel-and-interop-scenario

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

Closes the PIP-4 validation gap for the parallel-receive-delta dispatch path (#2567) by adding two complementary mechanisms that, together, give the parallel apply path both an interactive debug switch and permanent CI coverage.

  • Runtime override: OC_RSYNC_FORCE_PARALLEL=<non-empty> short-circuits ReceiverContext::dispatch_receiver_strategy and unconditionally selects ReceiverStrategy::Parallel. When the parallel-receive-delta feature is compiled out the override logs parallel_unavailable under GENR and falls back to Sequential so telemetry never claims a path the binary cannot take. The toggle is intentionally not surfaced on the CLI; it is a runtime/debug knob only.
  • Interop scenario: new parallel-threshold-trip case in tools/ci/run_interop.sh augments the source tree with 120 tiny files (above PARALLEL_RECEIVE_FILE_COUNT_THRESHOLD = 100, well under the 64 MiB byte cutoff, total payload < 1 MB) and validates a byte-identical destination. The existing comprehensive payload (~260 KB / 19 files) never tripped the threshold, so the parallel branch ran in zero interop transfers prior to this change.

Both pieces ship together because the env knob enables interactive debugging of the path the scenario permanently exercises in CI - one without the other leaves PIP-4 only half-validated.

Why one PR

The env override and the interop scenario both serve the same goal: making the parallel-receive-delta dispatch path observable. The override lets engineers reproduce the path on any workload size; the scenario guarantees CI never silently regresses the path. Shipping them in a single commit keeps the validation story coherent.

Notes

  • Thresholds (PARALLEL_RECEIVE_FILE_COUNT_THRESHOLD, PARALLEL_RECEIVE_BYTES_THRESHOLD) are unchanged - PIP-4 validates the existing tuning, it does not retune.
  • The new scenario validates byte-identical destination only. Internal dispatch is an oc-rsync concern; upstream's behaviour for 120 small files is identical to ours regardless of the internal pipeline choice, so no upstream-vs-oc comparison is performed.
  • Unit tests use the shared platform::env::EnvGuard fixture (added as a dev-dependency of the transfer crate) plus a module-local mutex to serialise every test that touches the env var.

Test plan

  • CI: fmt+clippy clean
  • CI: nextest (stable) green - new unit tests in receiver_strategy.rs
  • CI: Windows / macOS / Linux musl matrices green
  • CI: Interop Validation - new parallel-threshold-trip scenario passes in both directions across all upstream versions

@github-actions github-actions Bot added the enhancement New feature or request label May 22, 2026
oferchen added 2 commits May 22, 2026 10:30
…ng parallel threshold (PIP-4)

Validates the parallel-receive-delta dispatch path through two complementary
mechanisms (PIP-4 / #2567):

Runtime override (Part A): `OC_RSYNC_FORCE_PARALLEL=<non-empty>` now
short-circuits `ReceiverContext::dispatch_receiver_strategy` and
unconditionally selects `ReceiverStrategy::Parallel`, enabling ad-hoc
debugging of the parallel apply path without crossing the file-count /
total-bytes thresholds. When the `parallel-receive-delta` feature is
compiled out, the override logs `parallel_unavailable` under GENR and
falls back to Sequential so telemetry never claims a path the binary
cannot take. The toggle is intentionally not surfaced on the CLI.

Interop coverage (Part B): adds the `parallel-threshold-trip` scenario
to the comprehensive interop matrix. The scenario augments the source
tree with 120 tiny files (well above `PARALLEL_RECEIVE_FILE_COUNT_THRESHOLD`
= 100, well under the 64 MiB byte cutoff and tiny in absolute size so CI
time stays low) and validates a byte-identical destination. The new
scenario gives the parallel path permanent CI coverage that the existing
~260 KB / 19-file comprehensive payload never exercised.

Unit tests use the shared `platform::env::EnvGuard` fixture with a
module-local mutex to serialise every test that touches the env var.
@oferchen
oferchen force-pushed the feat/pip-4-force-parallel-and-interop-scenario branch from c8ebce6 to 4ac67ac Compare May 22, 2026 07:30
@oferchen
oferchen merged commit bc1476c into master May 22, 2026
64 of 65 checks passed
@oferchen
oferchen deleted the feat/pip-4-force-parallel-and-interop-scenario branch May 22, 2026 07:55
oferchen added a commit that referenced this pull request May 22, 2026
… receiver corruption) (#4725)

PIP-4 (#4720) added the `parallel-threshold-trip` interop scenario that
crosses `PARALLEL_RECEIVE_FILE_COUNT_THRESHOLD = 100` and exposed a real
corruption bug: the receiver writes wrong bytes for the first dispatched
file (`parallel_threshold/file_1.txt`) whenever a transfer trips the
parallel-receive-delta dispatch path. The bug reproduces on stock
`cargo build --release` because PIP-5 (#4666) flipped the feature into
the default set across the workspace.

This PR ships the immediate mitigation so default builds are safe again
while PIP-7 investigates the receiver-side corruption:

1. Remove `parallel-receive-delta` from `default = [...]` in the
   workspace `Cargo.toml`, `crates/transfer/Cargo.toml`, and
   `crates/engine/Cargo.toml`. The feature stays defined and remains
   opt-in via `--features parallel-receive-delta` for testing.
2. Remove the `parallel-threshold-trip` matrix entry from
   `tools/ci/run_interop.sh` along with its setup, cleanup, and verify
   branches. The threshold constants in `receiver/mod.rs` stay in place.
3. Add `docs/design/pip-7-parallel-receive-delta-receiver-corruption-2026-05-22.md`
   tracking the open investigation, suspected locations
   (`crates/engine/src/concurrent_delta/parallel_apply.rs` and
   `crates/transfer/src/delta_pipeline/parallel.rs`), reproduction
   recipe, and acceptance criteria for re-promotion.
4. Flag the deferred-pending-PIP-7 status in `README.md`,
   `CHANGELOG.md`, `docs/design/parallel-receive-delta-default-on.md`,
   `docs/design/pip-4-closure-2026-05-21.md`, and
   `docs/design/br-6-sign-off-check-in-2026-05-21.md` so the shipped
   claims no longer read as if default builds exercise the parallel
   receive-delta path.

The `ParallelDeltaApplier`, `dispatch_receiver_strategy()`,
`enable_parallel_receive_delta()`, and the `OC_RSYNC_FORCE_PARALLEL`
debug env knob from PIP-4 are intentionally retained; they remain
reachable when the feature is opted into so the PIP-7 investigation can
iterate against them.
oferchen added a commit that referenced this pull request May 22, 2026
…dentity assertion (PIP-9.c)

Reintroduce the parallel-threshold-trip regression coverage that PR #4725
removed when it reverted the parallel-receive-delta default-on flip after
PIP-4 (#4720) surfaced receiver corruption on file_1.txt under dist-profile
builds (LTO + panic=abort).

The new tests/parallel_threshold_trip.rs runs a local-mode recursive
transfer of 120 deterministically seeded 16 KiB files under
parallel_threshold/file_N.txt (the same shape the deleted scenario used in
tools/ci/run_interop.sh) and asserts byte identity via SHA-256 on every
file, with file_1.txt called out explicitly first so a future regression
of the original corruption is unambiguous.

The test passes on master HEAD because the sequential receiver path is
correct; once PIP-9.b wires the parallel applier into production it will
catch any regression of the PIP-4 corruption. Test name starts with
parallel_threshold_ so the dist-profile CI cell from PIP-9.d can filter
via nextest -E 'test(parallel_threshold)'.

Payload generation uses an inline xorshift64* PRNG seeded by a fixed
constant XORed with the file index, mirroring the existing pattern in
tests/inc_recurse_sender_fuzz_1863.rs. No new external dependencies; the
checksums dev-dep already exposes a Sha256 helper used by other workspace
tests.

Refs: docs/design/pip-9-parallel-receive-delta-wire-up-2026-05-22.md
oferchen added a commit that referenced this pull request May 22, 2026
…dentity assertion (PIP-9.c) (#4738)

Reintroduce the parallel-threshold-trip regression coverage that PR #4725
removed when it reverted the parallel-receive-delta default-on flip after
PIP-4 (#4720) surfaced receiver corruption on file_1.txt under dist-profile
builds (LTO + panic=abort).

The new tests/parallel_threshold_trip.rs runs a local-mode recursive
transfer of 120 deterministically seeded 16 KiB files under
parallel_threshold/file_N.txt (the same shape the deleted scenario used in
tools/ci/run_interop.sh) and asserts byte identity via SHA-256 on every
file, with file_1.txt called out explicitly first so a future regression
of the original corruption is unambiguous.

The test passes on master HEAD because the sequential receiver path is
correct; once PIP-9.b wires the parallel applier into production it will
catch any regression of the PIP-4 corruption. Test name starts with
parallel_threshold_ so the dist-profile CI cell from PIP-9.d can filter
via nextest -E 'test(parallel_threshold)'.

Payload generation uses an inline xorshift64* PRNG seeded by a fixed
constant XORed with the file index, mirroring the existing pattern in
tests/inc_recurse_sender_fuzz_1863.rs. No new external dependencies; the
checksums dev-dep already exposes a Sha256 helper used by other workspace
tests.

Refs: docs/design/pip-9-parallel-receive-delta-wire-up-2026-05-22.md
oferchen added a commit that referenced this pull request Aug 24, 2026
…ng parallel threshold (PIP-4) (#4720)

* feat(transfer): force-parallel env override + interop scenario crossing parallel threshold (PIP-4)

Validates the parallel-receive-delta dispatch path through two complementary
mechanisms (PIP-4 / #2567):

Runtime override (Part A): `OC_RSYNC_FORCE_PARALLEL=<non-empty>` now
short-circuits `ReceiverContext::dispatch_receiver_strategy` and
unconditionally selects `ReceiverStrategy::Parallel`, enabling ad-hoc
debugging of the parallel apply path without crossing the file-count /
total-bytes thresholds. When the `parallel-receive-delta` feature is
compiled out, the override logs `parallel_unavailable` under GENR and
falls back to Sequential so telemetry never claims a path the binary
cannot take. The toggle is intentionally not surfaced on the CLI.

Interop coverage (Part B): adds the `parallel-threshold-trip` scenario
to the comprehensive interop matrix. The scenario augments the source
tree with 120 tiny files (well above `PARALLEL_RECEIVE_FILE_COUNT_THRESHOLD`
= 100, well under the 64 MiB byte cutoff and tiny in absolute size so CI
time stays low) and validates a byte-identical destination. The new
scenario gives the parallel path permanent CI coverage that the existing
~260 KB / 19-file comprehensive payload never exercised.

Unit tests use the shared `platform::env::EnvGuard` fixture with a
module-local mutex to serialise every test that touches the env var.

* chore(transfer): sync Cargo.lock with platform dev-dependency added in PIP-4
oferchen added a commit that referenced this pull request Aug 24, 2026
… receiver corruption) (#4725)

PIP-4 (#4720) added the `parallel-threshold-trip` interop scenario that
crosses `PARALLEL_RECEIVE_FILE_COUNT_THRESHOLD = 100` and exposed a real
corruption bug: the receiver writes wrong bytes for the first dispatched
file (`parallel_threshold/file_1.txt`) whenever a transfer trips the
parallel-receive-delta dispatch path. The bug reproduces on stock
`cargo build --release` because PIP-5 (#4666) flipped the feature into
the default set across the workspace.

This PR ships the immediate mitigation so default builds are safe again
while PIP-7 investigates the receiver-side corruption:

1. Remove `parallel-receive-delta` from `default = [...]` in the
   workspace `Cargo.toml`, `crates/transfer/Cargo.toml`, and
   `crates/engine/Cargo.toml`. The feature stays defined and remains
   opt-in via `--features parallel-receive-delta` for testing.
2. Remove the `parallel-threshold-trip` matrix entry from
   `tools/ci/run_interop.sh` along with its setup, cleanup, and verify
   branches. The threshold constants in `receiver/mod.rs` stay in place.
3. Add `docs/design/pip-7-parallel-receive-delta-receiver-corruption-2026-05-22.md`
   tracking the open investigation, suspected locations
   (`crates/engine/src/concurrent_delta/parallel_apply.rs` and
   `crates/transfer/src/delta_pipeline/parallel.rs`), reproduction
   recipe, and acceptance criteria for re-promotion.
4. Flag the deferred-pending-PIP-7 status in `README.md`,
   `CHANGELOG.md`, `docs/design/parallel-receive-delta-default-on.md`,
   `docs/design/pip-4-closure-2026-05-21.md`, and
   `docs/design/br-6-sign-off-check-in-2026-05-21.md` so the shipped
   claims no longer read as if default builds exercise the parallel
   receive-delta path.

The `ParallelDeltaApplier`, `dispatch_receiver_strategy()`,
`enable_parallel_receive_delta()`, and the `OC_RSYNC_FORCE_PARALLEL`
debug env knob from PIP-4 are intentionally retained; they remain
reachable when the feature is opted into so the PIP-7 investigation can
iterate against them.
oferchen added a commit that referenced this pull request Aug 24, 2026
…dentity assertion (PIP-9.c) (#4738)

Reintroduce the parallel-threshold-trip regression coverage that PR #4725
removed when it reverted the parallel-receive-delta default-on flip after
PIP-4 (#4720) surfaced receiver corruption on file_1.txt under dist-profile
builds (LTO + panic=abort).

The new tests/parallel_threshold_trip.rs runs a local-mode recursive
transfer of 120 deterministically seeded 16 KiB files under
parallel_threshold/file_N.txt (the same shape the deleted scenario used in
tools/ci/run_interop.sh) and asserts byte identity via SHA-256 on every
file, with file_1.txt called out explicitly first so a future regression
of the original corruption is unambiguous.

The test passes on master HEAD because the sequential receiver path is
correct; once PIP-9.b wires the parallel applier into production it will
catch any regression of the PIP-4 corruption. Test name starts with
parallel_threshold_ so the dist-profile CI cell from PIP-9.d can filter
via nextest -E 'test(parallel_threshold)'.

Payload generation uses an inline xorshift64* PRNG seeded by a fixed
constant XORed with the file index, mirroring the existing pattern in
tests/inc_recurse_sender_fuzz_1863.rs. No new external dependencies; the
checksums dev-dep already exposes a Sha256 helper used by other workspace
tests.

Refs: docs/design/pip-9-parallel-receive-delta-wire-up-2026-05-22.md
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