Skip to content

Conversation

pzhan9
Copy link
Contributor

@pzhan9 pzhan9 commented Sep 17, 2025

Summary:
In Rust V1, we want to move the re-ordering buffer from comm actor to the actor side. The basic idea is:

  • client assigns the seq no for messages it sends to actors;
  • the (client_name, seq_no) tuple is added to the message's header.
    • for direct send, client will add that header;
    • for multicast, a actor->seq map is passed to comm actors, and comm actor will add that header before delivering the message to actors.
  • Each actor instance maintains its own re-ordering buffer, and use the seq_no to buffer and re-order the message, before passing the message to the actor loop.

This diff implements the last part, the re-ordering buffer in actor instance. Specifically, this diff wrap the re-ordering buffer under the OrderChannel abstraction, so it can fit to the current implementation seamlessly.

The change is currently disabled behind the ENABLE_CLIENT_SEQ_ASSIGNMENT gate.

Differential Revision: D82573932

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 17, 2025
@facebook-github-bot
Copy link
Contributor

@pzhan9 has exported this pull request. If you are a Meta employee, you can view the originating diff in D82573932.

pzhan9 added a commit to pzhan9/monarch-1 that referenced this pull request Sep 17, 2025
Summary:

In Rust V1, we want to move the re-ordering buffer from [comm actor](https://www.internalfb.com/code/fbsource/[aea72188b23ef1539c1a04996566a8f188e42644]/fbcode/monarch/hyperactor_mesh/src/comm.rs?lines=383-384) to the actor side. The basic idea is:

* client assigns the seq no for messages it sends to actors;
* the `(client_name, seq_no)` tuple is added to the message's header.
    * for direct send, client will add that header;
    * for multicast, a actor->seq map is passed to comm actors, and comm actor will add that header before delivering the message to actors.
* Each actor instance maintains its own re-ordering buffer, and use the `seq_no` to buffer and re-order the message, before passing the message to the actor loop.

This diff implements the last part, the re-ordering buffer in actor instance.  Specifically, this diff wrap the re-ordering buffer under the `OrderChannel` abstraction, so it can fit to the current implementation seamlessly.

The change is currently disabled behind the `ENABLE_CLIENT_SEQ_ASSIGNMENT` gate.

Differential Revision: D82573932
@facebook-github-bot
Copy link
Contributor

@pzhan9 has exported this pull request. If you are a Meta employee, you can view the originating diff in D82573932.

pzhan9 added a commit to pzhan9/monarch-1 that referenced this pull request Sep 20, 2025
Summary:

In Rust V1, we want to move the re-ordering buffer from [comm actor](https://www.internalfb.com/code/fbsource/[aea72188b23ef1539c1a04996566a8f188e42644]/fbcode/monarch/hyperactor_mesh/src/comm.rs?lines=383-384) to the actor side. The basic idea is:

* client assigns the seq no for messages it sends to actors;
* the `(client_name, seq_no)` tuple is added to the message's header.
    * for direct send, client will add that header;
    * for multicast, a actor->seq map is passed to comm actors, and comm actor will add that header before delivering the message to actors.
* Each actor instance maintains its own re-ordering buffer, and use the `seq_no` to buffer and re-order the message, before passing the message to the actor loop.

This diff implements the last part, the re-ordering buffer in actor instance.  Specifically, this diff wrap the re-ordering buffer under the `OrderChannel` abstraction, so it can fit to the current implementation seamlessly.

The change is currently disabled behind the `ENABLE_CLIENT_SEQ_ASSIGNMENT` gate.

Reviewed By: mariusae, shayne-fletcher

Differential Revision: D82573932
pzhan9 added a commit to pzhan9/monarch-1 that referenced this pull request Sep 22, 2025
Summary:

In Rust V1, we want to move the re-ordering buffer from [comm actor](https://www.internalfb.com/code/fbsource/[aea72188b23ef1539c1a04996566a8f188e42644]/fbcode/monarch/hyperactor_mesh/src/comm.rs?lines=383-384) to the actor side. The basic idea is:

* client assigns the seq no for messages it sends to actors;
* the `(client_name, seq_no)` tuple is added to the message's header.
    * for direct send, client will add that header;
    * for multicast, a actor->seq map is passed to comm actors, and comm actor will add that header before delivering the message to actors.
* Each actor instance maintains its own re-ordering buffer, and use the `seq_no` to buffer and re-order the message, before passing the message to the actor loop.

This diff implements the last part, the re-ordering buffer in actor instance.  Specifically, this diff wrap the re-ordering buffer under the `OrderChannel` abstraction, so it can fit to the current implementation seamlessly.

The change is currently disabled behind the `ENABLE_CLIENT_SEQ_ASSIGNMENT` gate.

Reviewed By: mariusae, shayne-fletcher

Differential Revision: D82573932
pzhan9 added a commit to pzhan9/monarch-1 that referenced this pull request Sep 22, 2025
Summary:

In Rust V1, we want to move the re-ordering buffer from [comm actor](https://www.internalfb.com/code/fbsource/[aea72188b23ef1539c1a04996566a8f188e42644]/fbcode/monarch/hyperactor_mesh/src/comm.rs?lines=383-384) to the actor side. The basic idea is:

* client assigns the seq no for messages it sends to actors;
* the `(client_name, seq_no)` tuple is added to the message's header.
    * for direct send, client will add that header;
    * for multicast, a actor->seq map is passed to comm actors, and comm actor will add that header before delivering the message to actors.
* Each actor instance maintains its own re-ordering buffer, and use the `seq_no` to buffer and re-order the message, before passing the message to the actor loop.

This diff implements the last part, the re-ordering buffer in actor instance.  Specifically, this diff wrap the re-ordering buffer under the `OrderChannel` abstraction, so it can fit to the current implementation seamlessly.

The change is currently disabled behind the `ENABLE_CLIENT_SEQ_ASSIGNMENT` gate.

Reviewed By: mariusae, shayne-fletcher

Differential Revision: D82573932
pzhan9 added a commit to pzhan9/monarch-1 that referenced this pull request Sep 22, 2025
Summary:

In Rust V1, we want to move the re-ordering buffer from [comm actor](https://www.internalfb.com/code/fbsource/[aea72188b23ef1539c1a04996566a8f188e42644]/fbcode/monarch/hyperactor_mesh/src/comm.rs?lines=383-384) to the actor side. The basic idea is:

* client assigns the seq no for messages it sends to actors;
* the `(client_name, seq_no)` tuple is added to the message's header.
    * for direct send, client will add that header;
    * for multicast, a actor->seq map is passed to comm actors, and comm actor will add that header before delivering the message to actors.
* Each actor instance maintains its own re-ordering buffer, and use the `seq_no` to buffer and re-order the message, before passing the message to the actor loop.

This diff implements the last part, the re-ordering buffer in actor instance.  Specifically, this diff wrap the re-ordering buffer under the `OrderChannel` abstraction, so it can fit to the current implementation seamlessly.

The change is currently disabled behind the `ENABLE_CLIENT_SEQ_ASSIGNMENT` gate.

Reviewed By: mariusae, shayne-fletcher

Differential Revision: D82573932
pzhan9 added a commit to pzhan9/monarch-1 that referenced this pull request Sep 22, 2025
Summary:

In Rust V1, we want to move the re-ordering buffer from [comm actor](https://www.internalfb.com/code/fbsource/[aea72188b23ef1539c1a04996566a8f188e42644]/fbcode/monarch/hyperactor_mesh/src/comm.rs?lines=383-384) to the actor side. The basic idea is:

* client assigns the seq no for messages it sends to actors;
* the `(client_name, seq_no)` tuple is added to the message's header.
    * for direct send, client will add that header;
    * for multicast, a actor->seq map is passed to comm actors, and comm actor will add that header before delivering the message to actors.
* Each actor instance maintains its own re-ordering buffer, and use the `seq_no` to buffer and re-order the message, before passing the message to the actor loop.

This diff implements the last part, the re-ordering buffer in actor instance.  Specifically, this diff wrap the re-ordering buffer under the `OrderChannel` abstraction, so it can fit to the current implementation seamlessly.

The change is currently disabled behind the `ENABLE_CLIENT_SEQ_ASSIGNMENT` gate.

Reviewed By: mariusae, shayne-fletcher

Differential Revision: D82573932
pzhan9 added a commit to pzhan9/monarch-1 that referenced this pull request Sep 22, 2025
Summary:

In Rust V1, we want to move the re-ordering buffer from [comm actor](https://www.internalfb.com/code/fbsource/[aea72188b23ef1539c1a04996566a8f188e42644]/fbcode/monarch/hyperactor_mesh/src/comm.rs?lines=383-384) to the actor side. The basic idea is:

* client assigns the seq no for messages it sends to actors;
* the `(client_name, seq_no)` tuple is added to the message's header.
    * for direct send, client will add that header;
    * for multicast, a actor->seq map is passed to comm actors, and comm actor will add that header before delivering the message to actors.
* Each actor instance maintains its own re-ordering buffer, and use the `seq_no` to buffer and re-order the message, before passing the message to the actor loop.

This diff implements the last part, the re-ordering buffer in actor instance.  Specifically, this diff wrap the re-ordering buffer under the `OrderChannel` abstraction, so it can fit to the current implementation seamlessly.

The change is currently disabled behind the `ENABLE_CLIENT_SEQ_ASSIGNMENT` gate.

Reviewed By: mariusae, shayne-fletcher

Differential Revision: D82573932
@facebook-github-bot
Copy link
Contributor

@pzhan9 has exported this pull request. If you are a Meta employee, you can view the originating diff in D82573932.

pzhan9 added a commit to pzhan9/monarch-1 that referenced this pull request Sep 22, 2025
Summary:

In Rust V1, we want to move the re-ordering buffer from [comm actor](https://www.internalfb.com/code/fbsource/[aea72188b23ef1539c1a04996566a8f188e42644]/fbcode/monarch/hyperactor_mesh/src/comm.rs?lines=383-384) to the actor side. The basic idea is:

* client assigns the seq no for messages it sends to actors;
* the `(client_name, seq_no)` tuple is added to the message's header.
    * for direct send, client will add that header;
    * for multicast, a actor->seq map is passed to comm actors, and comm actor will add that header before delivering the message to actors.
* Each actor instance maintains its own re-ordering buffer, and use the `seq_no` to buffer and re-order the message, before passing the message to the actor loop.

This diff implements the last part, the re-ordering buffer in actor instance.  Specifically, this diff wrap the re-ordering buffer under the `OrderChannel` abstraction, so it can fit to the current implementation seamlessly.

The change is currently disabled behind the `ENABLE_CLIENT_SEQ_ASSIGNMENT` gate.

Reviewed By: mariusae, shayne-fletcher

Differential Revision: D82573932
@facebook-github-bot
Copy link
Contributor

@pzhan9 has exported this pull request. If you are a Meta employee, you can view the originating diff in D82573932.

Summary:

In Rust V1, we want to move the re-ordering buffer from [comm actor](https://www.internalfb.com/code/fbsource/[aea72188b23ef1539c1a04996566a8f188e42644]/fbcode/monarch/hyperactor_mesh/src/comm.rs?lines=383-384) to the actor side. The basic idea is:

* client assigns the seq no for messages it sends to actors;
* the `(client_name, seq_no)` tuple is added to the message's header.
    * for direct send, client will add that header;
    * for multicast, a actor->seq map is passed to comm actors, and comm actor will add that header before delivering the message to actors.
* Each actor instance maintains its own re-ordering buffer, and use the `seq_no` to buffer and re-order the message, before passing the message to the actor loop.

This diff implements the last part, the re-ordering buffer in actor instance.  Specifically, this diff wrap the re-ordering buffer under the `OrderChannel` abstraction, so it can fit to the current implementation seamlessly.

The change is currently disabled behind the `ENABLE_CLIENT_SEQ_ASSIGNMENT` gate.

Reviewed By: mariusae, shayne-fletcher

Differential Revision: D82573932
@facebook-github-bot
Copy link
Contributor

@pzhan9 has exported this pull request. If you are a Meta employee, you can view the originating diff in D82573932.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 2a1e99a.

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. fb-exported Merged meta-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants