Skip to content

feat: add the dispatch and routing extension points a push transport needs#31

Open
mdashti wants to merge 3 commits into
moe/protocol-grpc-shmfrom
moe/transport-extension-points
Open

feat: add the dispatch and routing extension points a push transport needs#31
mdashti wants to merge 3 commits into
moe/protocol-grpc-shmfrom
moe/transport-extension-points

Conversation

@mdashti

@mdashti mdashti commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

What

This PR adds the two dispatch-side extension points a push-based transport needs: DispatchPlanSource and NetworkBoundary::route_partition.

Why

Split out of the transport-completion PR (#27) at review, since neither is exercised by the in-process transport itself. Both exist for a transport that places produced partitions before any consumer asks and serializes plans with its own codec, like our shared-memory mesh (#28).

How

  • DispatchPlanSource: the coordinator hands over the TaskKey and the ready-to-run per-task plan, and the embedder serializes it with its own codec; returning None falls back to the coordinator's encode.
  • NetworkBoundary::route_partition + PartitionRoute: the consumer-slice layout, readable from the produce side, instead of re-deriving it from node properties and drifting when the layout changes. NetworkCoalesceExec refuses with an error, since its consumers read per-producer-task groups, not slices.

Tests

The dispatch source's contract is pinned from all three sides: consultation once per dispatched task with nested stages already Remote, source-provided bytes running the query, and a source error failing the dispatch. The routing test pins the sliced formula on planner-built boundaries and the coalesce refusal. The shared-memory transport (#28) exercises both end to end.

mdashti and others added 3 commits July 9, 2026 20:12
A transport that returns worker metrics out-of-band, rather than over the
coordinator_channel return stream, needs its driver to decode the frames
and file them into the executed plan's store before the per-task EXPLAIN
rewrite reads it: metrics_store() with a public insert, a no-gRPC
decode_task_metrics, and the frame builders collect_plan_metrics_protos
and set_received_time. The metrics codec moves out from behind grpc with
them, and the gRPC client drops its private copy of the decode. The test
pins the frame-to-store path.

Co-authored-by: Stu Hood <stuhood@gmail.com>
An embedder whose plan nodes the coordinator's codec cannot represent, or
whose serialization needs embedder-side handling the codec extension point
cannot express, serializes the dispatch bytes itself. The coordinator hands
it the TaskKey and the ready-to-run per-task plan it would otherwise
encode; returning None falls back to the coordinator's own encode. The
tests pin the contract from all three sides: consultation with nested
stages already Remote, source-provided bytes running the query, and a
source error failing the dispatch.

Co-authored-by: Stu Hood <stuhood@gmail.com>
A pull-based transport never places a produced partition: the consumer
computes its own slice inside the boundary's execute. A push-based
transport places every partition before any consumer asks, so it reads
the boundary's consumer layout through route_partition instead of
re-deriving it from node properties and drifting when the layout changes.
NetworkCoalesceExec overrides it with an error: its consumers read whole
per-producer-task groups, not slices.

Co-authored-by: Stu Hood <stuhood@gmail.com>
@mdashti mdashti marked this pull request as ready for review July 10, 2026 03:36
@stuhood stuhood force-pushed the moe/protocol-grpc-shm branch from 0dfe291 to 36af89b Compare July 10, 2026 23:50
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