@@ -92,26 +92,26 @@ fn _distribute_plan(
9292 let d_cfg = DistributedConfig :: from_config_options ( cfg) ?;
9393 // In-process mode: a custom WorkerTransport is registered, meaning the
9494 // entire pipeline is running inside one process with a single consumer
95- // task (the leader) and N producer tasks (the PG parallel workers).
95+ // task (the leader) and N producer tasks (the parallel workers).
9696 //
9797 // Two stage shapes need different `(consumer_task_count, input_task_count)`:
9898 //
9999 // - **Outer boundary** (worker → leader): the OUTERMOST `NetworkBoundary`
100- // straddles the PG worker / leader split. Its producers ARE separate
101- // processes (PG workers each holding a 1/N slice via `parallel_state`).
102- // So `consumer_task_count = 1` (single in-process leader), and
103- // `input_task_count = N` (N real remote producers via shm_mq ).
100+ // straddles the worker/ leader split. Its producers ARE separate
101+ // processes (each holding a 1/N slice of the input). So
102+ // `consumer_task_count = 1` (single in-process leader), and
103+ // `input_task_count = N` (N real remote producers).
104104 //
105- // - **Nested boundaries** (inside one PG worker's producer fragment):
106- // when `HashJoinExec(Partitioned)` or similar is chosen, the planner
105+ // - **Nested boundaries** (inside one worker's producer fragment): when
106+ // `HashJoinExec(Partitioned)` or similar is chosen, the planner
107107 // inserts shuffles on each side. These are *all* in-process within
108- // the same PG worker — there is exactly ONE local producer per nested
108+ // the same worker — there is exactly ONE local producer per nested
109109 // boundary (the inner `RepartitionExec`). For these, both
110110 // `consumer_task_count = 1` AND `input_task_count = 1`. Otherwise
111111 // `NetworkShuffleExec.execute` would open `input_task_count`
112112 // connections via `WorkerTransport` and `select_all`-merge them; the
113- // in-process `LocalExecWorkerTransport` would then re-execute the
114- // same `RepartitionExec` for each call and panic on the second call
113+ // in-process transport would then re-execute the same
114+ // `RepartitionExec` for each call and panic on the second call
115115 // ("partition not used yet" — `RepartitionExec.execute(p)` is
116116 // single-shot per partition).
117117 //
@@ -123,9 +123,9 @@ fn _distribute_plan(
123123 . get :: < DistributedConfig > ( )
124124 . map ( |c| c. is_in_process ( ) )
125125 . unwrap_or ( false ) ;
126- // Track A — peer -mesh shuffle gate. When the embedder (ParadeDB pg_search)
127- // sets `in_process_peer_shuffle = true`, in-process mode emits a two-
128- // boundary plan: the OUTER `Coalesce` arm produces a worker→leader gather
126+ // Peer -mesh shuffle gate. When the embedder sets
127+ // `in_process_peer_shuffle = true`, in-process mode emits a two-boundary
128+ // plan: the OUTER `Coalesce` arm produces a worker→leader gather
129129 // (`NetworkShuffleExec(consumer_tc=1, input_tc=N)`) and the NESTED
130130 // `Shuffle` arm produces a peer-mesh shuffle
131131 // (`NetworkShuffleExec(consumer_tc=N, input_tc=N)`). When false,
@@ -189,11 +189,11 @@ fn _distribute_plan(
189189 PlanOrNetworkBoundary :: Plan ( plan) => plan. with_new_children ( new_children) ,
190190 // This is a shuffle, so inject a NetworkShuffleExec here in the plan.
191191 PlanOrNetworkBoundary :: Shuffle => {
192- // Track A — nested in-process Shuffle: when the peer-shuffle flag
193- // is on, EVERY nested Shuffle below the OUTER Coalesce gather
194- // becomes a real cross-worker boundary (`consumer_tc=N, input_tc=N`)
195- // — the embedder is responsible for allocating one peer mesh per
196- // such stage (counted by walking the produced physical plan).
192+ // Nested in-process Shuffle: when the peer-shuffle flag is on,
193+ // EVERY nested Shuffle below the OUTER Coalesce gather becomes a
194+ // real cross-worker boundary (`consumer_tc=N, input_tc=N`) — the
195+ // embedder is responsible for allocating one peer mesh per such
196+ // stage (counted by walking the produced physical plan).
197197 let nested_peer = nested_in_process && peer_shuffle;
198198 let consumer_task_count = if nested_peer {
199199 max_child_task_count. unwrap_or ( 1 )
@@ -227,10 +227,10 @@ fn _distribute_plan(
227227 // DataFusion is trying to coalesce multiple partitions into one, so we should do the
228228 // same with tasks.
229229 PlanOrNetworkBoundary :: Coalesce => {
230- // Track A — in -process peer-shuffle path: emit a worker→leader
231- // gather as `NetworkShuffleExec(consumer_tc=1, input_tc=N)`.
232- // This positions the gather as the OUTER boundary, with the
233- // descendant `Shuffle` becoming a nested peer-mesh boundary.
230+ // In -process peer-shuffle path: emit a worker→leader gather as
231+ // `NetworkShuffleExec(consumer_tc=1, input_tc=N)`. This positions
232+ // the gather as the OUTER boundary, with the descendant `Shuffle`
233+ // becoming a nested peer-mesh boundary.
234234 if peer_shuffle && in_process && multi_task_below {
235235 let input_task_count = max_child_task_count. unwrap_or ( 1 ) ;
236236 let node = Arc :: new ( NetworkShuffleExec :: try_new (
@@ -270,11 +270,10 @@ fn _distribute_plan(
270270 PlanOrNetworkBoundary :: Broadcast => {
271271 // Same outer-vs-nested logic as Shuffle. Outer broadcast (worker
272272 // → leader for the whole HashJoin's build side) needs
273- // input_task_count = N because each PG worker runs the
274- // broadcast subtree locally and contributes a stream. Nested
275- // broadcast (inside one worker's producer fragment) has only
276- // ONE local producer of the broadcast subtree, so
277- // input_task_count = 1.
273+ // input_task_count = N because each worker runs the broadcast
274+ // subtree locally and contributes a stream. Nested broadcast
275+ // (inside one worker's producer fragment) has only ONE local
276+ // producer of the broadcast subtree, so input_task_count = 1.
278277 let consumer_tc = if in_process { 1 } else { task_count } ;
279278 let input_tc = if nested_in_process {
280279 1
@@ -1051,8 +1050,8 @@ mod tests {
10511050 }
10521051 }
10531052
1054- /// Track A + Track B: with `in_process_peer_shuffle = true` the planner
1055- /// must emit a TWO-boundary plan for an aggregate-on-join shape:
1053+ /// With `in_process_peer_shuffle = true` the planner must emit a
1054+ /// TWO-boundary plan for an aggregate-on-join shape:
10561055 /// 1. an OUTER `NetworkShuffleExec` emitted by the `Coalesce` arm (the
10571056 /// worker→leader gather; `consumer_tc=1`).
10581057 /// 2. a NESTED `NetworkShuffleExec` emitted by the `Shuffle` arm with
0 commit comments