Skip to content

add gated PID routing and datagram switching (#4774) - #4774

Open
mariusae wants to merge 3 commits into
meta-pytorch:mainfrom
mariusae:export-D117242761
Open

add gated PID routing and datagram switching (#4774)#4774
mariusae wants to merge 3 commits into
meta-pytorch:mainfrom
mariusae:export-D117242761

Conversation

@mariusae

@mariusae mariusae commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary:

Route datagrams by the destination PID embedded in each QUIC connection ID. Routes reference lifecycle gates, so expiring one gate fences every derived destination without synchronously deleting a subtree of forwarding entries.

Walkthrough: Begin with route.rs: RouteGate supplies the shared fence, Route binds a destination to a next hop and gate, and Router performs forwarding. switch.rs then demultiplexes local PIDs and delegates every non-local datagram to that router without inspecting QUIC streams.

Design document: https://mdoc.internalmeta.com/doc/e6918c35-b3d1-4118-ac39-6308b0cb55ba

Walkthrough document: https://mdoc.internalmeta.com/doc/15fc8742-10cf-4dbd-af8d-70a218e2d8c7

Reviewed By: shayne-fletcher

Differential Revision: D117242761

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 2, 2026
@meta-codesync meta-codesync Bot changed the title add gated PID routing and datagram switching add gated PID routing and datagram switching (#4774) Sep 2, 2026
mariusae added a commit to mariusae/monarch that referenced this pull request Sep 2, 2026
Summary:

Route datagrams by the destination PID embedded in each QUIC connection ID. Routes reference lifecycle gates, so expiring one gate fences every derived destination without synchronously deleting a subtree of forwarding entries.

Walkthrough: Begin with `route.rs`: `RouteGate` supplies the shared fence, `Route` binds a destination to a next hop and gate, and `Router` performs forwarding. `switch.rs` then demultiplexes local PIDs and delegates every non-local datagram to that router without inspecting QUIC streams.

Design document: https://mdoc.internalmeta.com/doc/e6918c35-b3d1-4118-ac39-6308b0cb55ba

Walkthrough document: https://mdoc.internalmeta.com/doc/15fc8742-10cf-4dbd-af8d-70a218e2d8c7

Reviewed By: shayne-fletcher

Differential Revision: D117242761
mariusae added a commit to mariusae/monarch that referenced this pull request Sep 2, 2026
Summary:
Pull Request resolved: meta-pytorch#4774

Route datagrams by the destination PID embedded in each QUIC connection ID. Routes reference lifecycle gates, so expiring one gate fences every derived destination without synchronously deleting a subtree of forwarding entries.

Walkthrough: Begin with `route.rs`: `RouteGate` supplies the shared fence, `Route` binds a destination to a next hop and gate, and `Router` performs forwarding. `switch.rs` then demultiplexes local PIDs and delegates every non-local datagram to that router without inspecting QUIC streams.

Design document: https://mdoc.internalmeta.com/doc/e6918c35-b3d1-4118-ac39-6308b0cb55ba

Walkthrough document: https://mdoc.internalmeta.com/doc/15fc8742-10cf-4dbd-af8d-70a218e2d8c7

Reviewed By: shayne-fletcher

Differential Revision: D117242761
mariusae added a commit to mariusae/monarch that referenced this pull request Sep 4, 2026
Summary:

Route datagrams by the destination PID embedded in each QUIC connection ID. Routes reference lifecycle gates, so expiring one gate fences every derived destination without synchronously deleting a subtree of forwarding entries.

Walkthrough: Begin with `route.rs`: `RouteGate` supplies the shared fence, `Route` binds a destination to a next hop and gate, and `Router` performs forwarding. `switch.rs` then demultiplexes local PIDs and delegates every non-local datagram to that router without inspecting QUIC streams.

Design document: https://mdoc.internalmeta.com/doc/e6918c35-b3d1-4118-ac39-6308b0cb55ba

Walkthrough document: https://mdoc.internalmeta.com/doc/15fc8742-10cf-4dbd-af8d-70a218e2d8c7

Reviewed By: shayne-fletcher

Differential Revision: D117242761
mariusae added a commit to mariusae/monarch that referenced this pull request Sep 4, 2026
Summary:

Route datagrams by the destination PID embedded in each QUIC connection ID. Routes reference lifecycle gates, so expiring one gate fences every derived destination without synchronously deleting a subtree of forwarding entries.

Walkthrough: Begin with `route.rs`: `RouteGate` supplies the shared fence, `Route` binds a destination to a next hop and gate, and `Router` performs forwarding. `switch.rs` then demultiplexes local PIDs and delegates every non-local datagram to that router without inspecting QUIC streams.

Design document: https://mdoc.internalmeta.com/doc/e6918c35-b3d1-4118-ac39-6308b0cb55ba

Walkthrough document: https://mdoc.internalmeta.com/doc/15fc8742-10cf-4dbd-af8d-70a218e2d8c7

Reviewed By: shayne-fletcher

Differential Revision: D117242761
mariusae added a commit to mariusae/monarch that referenced this pull request Sep 4, 2026
Summary:

Route datagrams by the destination PID embedded in each QUIC connection ID. Routes reference lifecycle gates, so expiring one gate fences every derived destination without synchronously deleting a subtree of forwarding entries.

Walkthrough: Begin with `route.rs`: `RouteGate` supplies the shared fence, `Route` binds a destination to a next hop and gate, and `Router` performs forwarding. `switch.rs` then demultiplexes local PIDs and delegates every non-local datagram to that router without inspecting QUIC streams.

Design document: https://mdoc.internalmeta.com/doc/e6918c35-b3d1-4118-ac39-6308b0cb55ba

Walkthrough document: https://mdoc.internalmeta.com/doc/15fc8742-10cf-4dbd-af8d-70a218e2d8c7

Reviewed By: shayne-fletcher

Differential Revision: D117242761
Summary:

Introduce the dependency-free wire types at the base of Chrysalis and document the architecture and review sequence. PIDs name process incarnations, while fixed-width QUIC connection IDs embed the destination PID and a process-local demultiplexing suffix.

Walkthrough: Start in `chrysalis-core`, where `Pid` defines process identity and `ConnectionId` defines the routable QUIC wire layout. Then read `chrysalis/DESIGN.md` for the complete model and `chrysalis/WALKTHROUGH.md` for the order in which the stack assembles it.

Design document: https://mdoc.internalmeta.com/doc/e6918c35-b3d1-4118-ac39-6308b0cb55ba

Walkthrough document: https://mdoc.internalmeta.com/doc/58f98269-78c5-42b3-a1a4-6e9a7a1adaf2

Reviewed By: shayne-fletcher

Differential Revision: D117242759
Summary:

Add the carrier layer that moves atomic datagrams without interpreting QUIC. A common socket contract supports UDP, Unix datagrams, and in-process channels, while `DatagramSocketSet` selects a carrier from an opaque destination address.

Walkthrough: Read `datagram.rs` for the transport-independent address, receive, and transmit contracts. Then follow the concrete implementations in `udp.rs`, `unix.rs`, and `inproc.rs`; `socket_set.rs` composes those carriers behind one socket and `shutdown.rs` provides structured teardown.

Design document: https://mdoc.internalmeta.com/doc/e6918c35-b3d1-4118-ac39-6308b0cb55ba

Walkthrough document: https://mdoc.internalmeta.com/doc/aebf6303-aaad-470c-ae40-e0a0f60550bf

Reviewed By: shayne-fletcher

Differential Revision: D117242760
Summary:

Route datagrams by the destination PID embedded in each QUIC connection ID. Routes reference lifecycle gates, so expiring one gate fences every derived destination without synchronously deleting a subtree of forwarding entries.

Walkthrough: Begin with `route.rs`: `RouteGate` supplies the shared fence, `Route` binds a destination to a next hop and gate, and `Router` performs forwarding. `switch.rs` then demultiplexes local PIDs and delegates every non-local datagram to that router without inspecting QUIC streams.

Design document: https://mdoc.internalmeta.com/doc/e6918c35-b3d1-4118-ac39-6308b0cb55ba

Walkthrough document: https://mdoc.internalmeta.com/doc/15fc8742-10cf-4dbd-af8d-70a218e2d8c7

Reviewed By: shayne-fletcher

Differential Revision: D117242761
mariusae added a commit to mariusae/monarch that referenced this pull request Sep 4, 2026
Summary:
Pull Request resolved: meta-pytorch#4774

Route datagrams by the destination PID embedded in each QUIC connection ID. Routes reference lifecycle gates, so expiring one gate fences every derived destination without synchronously deleting a subtree of forwarding entries.

Walkthrough: Begin with `route.rs`: `RouteGate` supplies the shared fence, `Route` binds a destination to a next hop and gate, and `Router` performs forwarding. `switch.rs` then demultiplexes local PIDs and delegates every non-local datagram to that router without inspecting QUIC streams.

Design document: https://mdoc.internalmeta.com/doc/e6918c35-b3d1-4118-ac39-6308b0cb55ba

Walkthrough document: https://mdoc.internalmeta.com/doc/15fc8742-10cf-4dbd-af8d-70a218e2d8c7

Reviewed By: shayne-fletcher

Differential Revision: D117242761
mariusae added a commit to mariusae/monarch that referenced this pull request Sep 4, 2026
Summary:
Pull Request resolved: meta-pytorch#4774

Route datagrams by the destination PID embedded in each QUIC connection ID. Routes reference lifecycle gates, so expiring one gate fences every derived destination without synchronously deleting a subtree of forwarding entries.

Walkthrough: Begin with `route.rs`: `RouteGate` supplies the shared fence, `Route` binds a destination to a next hop and gate, and `Router` performs forwarding. `switch.rs` then demultiplexes local PIDs and delegates every non-local datagram to that router without inspecting QUIC streams.

Design document: https://mdoc.internalmeta.com/doc/e6918c35-b3d1-4118-ac39-6308b0cb55ba

Walkthrough document: https://mdoc.internalmeta.com/doc/15fc8742-10cf-4dbd-af8d-70a218e2d8c7

Reviewed By: shayne-fletcher

Differential Revision: D117242761
mariusae added a commit to mariusae/monarch that referenced this pull request Sep 4, 2026
Summary:
Pull Request resolved: meta-pytorch#4774

Route datagrams by the destination PID embedded in each QUIC connection ID. Routes reference lifecycle gates, so expiring one gate fences every derived destination without synchronously deleting a subtree of forwarding entries.

Walkthrough: Begin with `route.rs`: `RouteGate` supplies the shared fence, `Route` binds a destination to a next hop and gate, and `Router` performs forwarding. `switch.rs` then demultiplexes local PIDs and delegates every non-local datagram to that router without inspecting QUIC streams.

Design document: https://mdoc.internalmeta.com/doc/e6918c35-b3d1-4118-ac39-6308b0cb55ba

Walkthrough document: https://mdoc.internalmeta.com/doc/15fc8742-10cf-4dbd-af8d-70a218e2d8c7

Reviewed By: shayne-fletcher

Differential Revision: D117242761
mariusae added a commit to mariusae/monarch that referenced this pull request Sep 4, 2026
Summary:
Pull Request resolved: meta-pytorch#4774

Route datagrams by the destination PID embedded in each QUIC connection ID. Routes reference lifecycle gates, so expiring one gate fences every derived destination without synchronously deleting a subtree of forwarding entries.

Walkthrough: Begin with `route.rs`: `RouteGate` supplies the shared fence, `Route` binds a destination to a next hop and gate, and `Router` performs forwarding. `switch.rs` then demultiplexes local PIDs and delegates every non-local datagram to that router without inspecting QUIC streams.

Design document: https://mdoc.internalmeta.com/doc/e6918c35-b3d1-4118-ac39-6308b0cb55ba

Walkthrough document: https://mdoc.internalmeta.com/doc/15fc8742-10cf-4dbd-af8d-70a218e2d8c7

Reviewed By: shayne-fletcher

Differential Revision: D117242761
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant