Skip to content

feat: port the shared-memory transport onto the WorkerChannel abstraction#28

Open
mdashti wants to merge 2 commits into
moe/transport-extension-pointsfrom
moe/shm-on-protocol-grpc
Open

feat: port the shared-memory transport onto the WorkerChannel abstraction#28
mdashti wants to merge 2 commits into
moe/transport-extension-pointsfrom
moe/shm-on-protocol-grpc

Conversation

@mdashti

@mdashti mdashti commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

This PR ports our shared-memory ("shm") transport onto the WorkerChannel abstraction.

It stacks on the transport-completion PR (#27). The base is that branch, so the diff is only src/shm/* plus the mod shm declaration and its two Cargo deps. The transport plugs in with no core changes, which is the point.

What

src/shm/* (rings, DSM, mesh, framing) moves over verbatim. The old ShmMqWorkerTransport: WorkerTransport + ShmMqWorkerConnection: WorkerConnection become ShmChannelResolver: ChannelResolver + a ShmWorkerChannel: WorkerChannel: execute_task reads the rings keyed off the task; coordinator_channel routes each SetPlanRequest to the destination worker's inbox over the mesh, so the coordinator's dispatch is the plan-delivery path.

Workers are passive executors, same as the gRPC model: they run the ready-to-run per-task plans the coordinator dispatches (task-specialized, nested stages Remote), whose boundary leaves read the mesh. Nothing on the worker re-plans, converts, or dispatches.

Verified

The in-crate in_process test runs real distributed queries through the shm rings (gather, shuffle, early-cancel, producer-loss), green in both feature configs, under the no-gRPC CI job inherited from #27. It exercises #27's extension points end to end: the dispatch handoff through DispatchPlanSource, the push-side placement through route_partition, and the metrics drain through metrics_store + decode_task_metrics. self_hosted is deferred and gated out; its no-gRPC-default role is the in-process transport's and its ring safety-net role is this test.

Consumed by

pg_search runs its MPP on this transport (paradedb#5516), which is what exercises it end to end.

@mdashti mdashti force-pushed the moe/shm-on-protocol-grpc branch from 5b1d213 to 9e7210d Compare June 30, 2026 01:50
@mdashti mdashti changed the base branch from moe/protocol-grpc-shm to moe/embedder-api June 30, 2026 01:51
@mdashti mdashti force-pushed the moe/embedder-api branch from 1728fb5 to 328e142 Compare June 30, 2026 02:12
@mdashti mdashti force-pushed the moe/shm-on-protocol-grpc branch from 9e7210d to 992673d Compare June 30, 2026 02:12
@mdashti mdashti force-pushed the moe/embedder-api branch from 328e142 to 3439f34 Compare July 1, 2026 23:15
@mdashti mdashti force-pushed the moe/shm-on-protocol-grpc branch from 992673d to ea63b5e Compare July 1, 2026 23:15
@stuhood stuhood force-pushed the moe/embedder-api branch from 3439f34 to 23e256a Compare July 6, 2026 22:17
@stuhood stuhood force-pushed the moe/shm-on-protocol-grpc branch from ea63b5e to aa130c2 Compare July 6, 2026 22:22
@mdashti mdashti force-pushed the moe/shm-on-protocol-grpc branch from aa130c2 to 3f1137b Compare July 9, 2026 21:32
@mdashti mdashti force-pushed the moe/embedder-api branch from 23e256a to 5f0b6a8 Compare July 9, 2026 21:32
@mdashti mdashti force-pushed the moe/embedder-api branch from 5f0b6a8 to 65c4505 Compare July 9, 2026 22:57
@mdashti mdashti force-pushed the moe/shm-on-protocol-grpc branch from 3f1137b to 57188a1 Compare July 9, 2026 22:57
@mdashti mdashti force-pushed the moe/embedder-api branch from 65c4505 to 903cd33 Compare July 9, 2026 23:03
@mdashti mdashti force-pushed the moe/shm-on-protocol-grpc branch 2 times, most recently from 6a488c9 to 34dd3f8 Compare July 9, 2026 23:13
Base automatically changed from moe/embedder-api to moe/protocol-grpc-shm July 9, 2026 23:13
@mdashti mdashti force-pushed the moe/shm-on-protocol-grpc branch from 34dd3f8 to c85e6dd Compare July 9, 2026 23:34
@mdashti mdashti force-pushed the moe/protocol-grpc-shm branch from 903cd33 to 9270c0f Compare July 9, 2026 23:34
@mdashti mdashti force-pushed the moe/shm-on-protocol-grpc branch from c85e6dd to eea4f1c Compare July 10, 2026 00:17
@mdashti mdashti force-pushed the moe/protocol-grpc-shm branch 2 times, most recently from 9940349 to be44b9c Compare July 10, 2026 00:27
@mdashti mdashti force-pushed the moe/shm-on-protocol-grpc branch from eea4f1c to bc12d49 Compare July 10, 2026 00:28
@mdashti mdashti force-pushed the moe/protocol-grpc-shm branch from be44b9c to 0dfe291 Compare July 10, 2026 03:24
mdashti added 2 commits July 9, 2026 20:27
The shm ring/DSM/mesh/framing core moves verbatim from the fork; the old
WorkerTransport umbrella is gone, so the resolver hands out a channel and
execute_task reads the rings per partition. The mesh is the no-gRPC
transport, so it builds in both the grpc-on and grpc-off configs.

Workers are passive executors: a fragment arrives with its nested stages
already Remote, so the worker runs it as-is and its boundary leaves read
the mesh; nothing on the worker converts or dispatches. collect_task_metrics
reports an empty task-level metric set instead of a missing one, since one
failed decode starves the whole store.
ShmWorkerChannel::coordinator_channel now ships each stage's
SetPlanRequest to the worker proc that owns its task, as a SetPlan frame
the worker takes with take_set_plan, so the embedder no longer routes
plans out of band.
@mdashti mdashti changed the base branch from moe/protocol-grpc-shm to moe/transport-extension-points July 10, 2026 03:27
@mdashti mdashti marked this pull request as ready for review July 10, 2026 03:36
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