Repository navigation
refactor(engine): rename apply_chunk_parallel to apply_one_chunk for clarity (RJN-2) - #4660
Merged
Merged
Conversation
Per RJN-1 audit (PR #4656): the name `apply_chunk_parallel` was misleading. The function uses `rayon::join(verify, || ())` with a no-op second closure - it schedules a single chunk's verify on a rayon worker but does NOT parallelize across chunks. The actual multi-chunk parallelism lives in `apply_batch_parallel` via `chunks.into_par_iter()`. Rename to `apply_one_chunk` to reflect actual semantics. Update all 17 call sites (per RJN-1: 1 definition + 12 unit tests in parallel_apply.rs + 2 stress tests in parallel_apply_concurrent.rs + 1 drop-ordering test in arc_drain_panic_recovery.rs + 1 test in chunk_builder.rs). Add rustdoc paragraph clarifying that it is a single-chunk scheduling primitive, not cross-chunk parallelism, and direct callers wanting multi-chunk parallel verify to `apply_batch_parallel(Vec<DeltaChunk>)`. RJN-3 (batched fan-out at the receiver) deferred until receiver wiring exists - currently zero production callers per audit. No semantic code changes. Pure rename + rustdoc edit.
3 tasks done
oferchen
added a commit
that referenced
this pull request
May 21, 2026
…-2 rename (#4676) RJN-2 (PR #4660, merged) chose the rename path over the fanout-refactor path, discharging the RJN-1 audit (PR #4656, merged) with apply_chunk_parallel -> apply_one_chunk plus a rustdoc redirect to apply_batch_parallel. RJN-3 (implement fanout) and RJN-4 (bench scheduler shape) were the "if RJN-2 chose refactor" branch that did not get taken; this doc closes both. - RJN-3 stays closed: zero production callers of apply_one_chunk; the real multi-chunk win sits in apply_batch_parallel, where ABW-1 (PR #4670) already recommended deferring per its quantified 1.03x-1.50x speedup range; the ABW-2/3/4 closure doc defers that track pending BR-3j.f (#2508) bench data. - RJN-4 is N/A: with RJN-3 deferred there is no "after" cell to measure; the production-weighted scheduler-shape bench effort belongs in parallel_receive_delta_perf via BR-3j.f, not at the per-chunk entry point. - Re-open conditions: a production caller of apply_one_chunk ships AND profiling shows the per-chunk path is hot. Project memory references project_rayon_join_per_chunk_noop.md and project_apply_batch_write_serial.md - both observations remain accurate under the renamed function.
3 tasks done
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…-2) (#4660) Per RJN-1 audit (PR #4656): the name `apply_chunk_parallel` was misleading. The function uses `rayon::join(verify, || ())` with a no-op second closure - it schedules a single chunk's verify on a rayon worker but does NOT parallelize across chunks. The actual multi-chunk parallelism lives in `apply_batch_parallel` via `chunks.into_par_iter()`. Rename to `apply_one_chunk` to reflect actual semantics. Update all 17 call sites (per RJN-1: 1 definition + 12 unit tests in parallel_apply.rs + 2 stress tests in parallel_apply_concurrent.rs + 1 drop-ordering test in arc_drain_panic_recovery.rs + 1 test in chunk_builder.rs). Add rustdoc paragraph clarifying that it is a single-chunk scheduling primitive, not cross-chunk parallelism, and direct callers wanting multi-chunk parallel verify to `apply_batch_parallel(Vec<DeltaChunk>)`. RJN-3 (batched fan-out at the receiver) deferred until receiver wiring exists - currently zero production callers per audit. No semantic code changes. Pure rename + rustdoc edit.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…-2 rename (#4676) RJN-2 (PR #4660, merged) chose the rename path over the fanout-refactor path, discharging the RJN-1 audit (PR #4656, merged) with apply_chunk_parallel -> apply_one_chunk plus a rustdoc redirect to apply_batch_parallel. RJN-3 (implement fanout) and RJN-4 (bench scheduler shape) were the "if RJN-2 chose refactor" branch that did not get taken; this doc closes both. - RJN-3 stays closed: zero production callers of apply_one_chunk; the real multi-chunk win sits in apply_batch_parallel, where ABW-1 (PR #4670) already recommended deferring per its quantified 1.03x-1.50x speedup range; the ABW-2/3/4 closure doc defers that track pending BR-3j.f (#2508) bench data. - RJN-4 is N/A: with RJN-3 deferred there is no "after" cell to measure; the production-weighted scheduler-shape bench effort belongs in parallel_receive_delta_perf via BR-3j.f, not at the per-chunk entry point. - Re-open conditions: a production caller of apply_one_chunk ships AND profiling shows the per-chunk path is hot. Project memory references project_rayon_join_per_chunk_noop.md and project_apply_batch_write_serial.md - both observations remain accurate under the renamed function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Per the RJN-1 audit (#4656), the name `apply_chunk_parallel` was misleading: the function uses `rayon::join(verify, || ())` with a no-op second closure, which schedules a single chunk's verify on a rayon worker but does NOT parallelize across chunks. Real multi-chunk parallelism lives in `apply_batch_parallel`.
This PR renames to `apply_one_chunk` and adds a rustdoc paragraph clarifying the semantics. RJN-3 (batched fan-out at the receiver) is deferred until receiver wiring exists - per RJN-1, there are zero production callers today.
Scope
Test plan