Skip to content

Conversation

@mariusae
Copy link
Member

@mariusae mariusae commented Nov 11, 2025

Stack from ghstack (oldest at bottom):

This adds a macro that asserts an actor's behavior; we use it to test the mesh behavior:

hyperactor::assert_behaves!(TestMeshController as Controller<TestMesh>);

It is implemented by statically validating that the actor type can bind to the defined behavior. This then provide a way to both document the intended behavior of an actor, and also to statically validate at the definition site that the behavior is implemented correctly.

(We already statically validate this at the use site, but then the errors are already "at a distance".)

Differential Revision: D86786231

NOTE FOR REVIEWERS: This PR has internal Meta-specific changes or comments, please review them on Phabricator!

This adds a macro that asserts an actor's behavior; we use it to test the mesh behavior:

```
hyperactor::assert_behaves!(TestMeshController as Controller<TestMesh>);
```

It is implemented by statically validating that the actor type can bind to the defined behavior. This then provide a way to both document the intended behavior of an actor, and also to statically validate at the definition site that the behavior is implemented correctly.

(We already statically validate this at the *use* site, but then the errors are already "at a distance".)

Differential Revision: [D86786231](https://our.internmc.facebook.com/intern/diff/D86786231/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D86786231/)!

[ghstack-poisoned]
mariusae added a commit that referenced this pull request Nov 11, 2025
This adds a macro that asserts an actor's behavior; we use it to test the mesh behavior:

```
hyperactor::assert_behaves!(TestMeshController as Controller<TestMesh>);
```

It is implemented by statically validating that the actor type can bind to the defined behavior. This then provide a way to both document the intended behavior of an actor, and also to statically validate at the definition site that the behavior is implemented correctly.

(We already statically validate this at the *use* site, but then the errors are already "at a distance".)

Differential Revision: [D86786231](https://our.internmc.facebook.com/intern/diff/D86786231/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D86786231/)!

ghstack-source-id: 322480874
Pull Request resolved: #1826
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 11, 2025
This adds a macro that asserts an actor's behavior; we use it to test the mesh behavior:

```
hyperactor::assert_behaves!(TestMeshController as Controller<TestMesh>);
```

It is implemented by statically validating that the actor type can bind to the defined behavior. This then provide a way to both document the intended behavior of an actor, and also to statically validate at the definition site that the behavior is implemented correctly.

(We already statically validate this at the *use* site, but then the errors are already "at a distance".)

Differential Revision: [D86786231](https://our.internmc.facebook.com/intern/diff/D86786231/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D86786231/)!

[ghstack-poisoned]
mariusae added a commit that referenced this pull request Nov 12, 2025
Pull Request resolved: #1826

This adds a macro that asserts an actor's behavior; we use it to test the mesh behavior:

```
hyperactor::assert_behaves!(TestMeshController as Controller<TestMesh>);
```

It is implemented by statically validating that the actor type can bind to the defined behavior. This then provide a way to both document the intended behavior of an actor, and also to statically validate at the definition site that the behavior is implemented correctly.

(We already statically validate this at the *use* site, but then the errors are already "at a distance".)

Differential Revision: [D86786231](https://our.internmc.facebook.com/intern/diff/D86786231/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D86786231/)!
ghstack-source-id: 322613843
This adds a macro that asserts an actor's behavior; we use it to test the mesh behavior:

```
hyperactor::assert_behaves!(TestMeshController as Controller<TestMesh>);
```

It is implemented by statically validating that the actor type can bind to the defined behavior. This then provide a way to both document the intended behavior of an actor, and also to statically validate at the definition site that the behavior is implemented correctly.

(We already statically validate this at the *use* site, but then the errors are already "at a distance".)

Differential Revision: [D86786231](https://our.internmc.facebook.com/intern/diff/D86786231/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D86786231/)!

[ghstack-poisoned]
mariusae added a commit that referenced this pull request Nov 12, 2025
Pull Request resolved: #1826

This adds a macro that asserts an actor's behavior; we use it to test the mesh behavior:

```
hyperactor::assert_behaves!(TestMeshController as Controller<TestMesh>);
```

It is implemented by statically validating that the actor type can bind to the defined behavior. This then provide a way to both document the intended behavior of an actor, and also to statically validate at the definition site that the behavior is implemented correctly.

(We already statically validate this at the *use* site, but then the errors are already "at a distance".)
ghstack-source-id: 322730453

Differential Revision: [D86786231](https://our.internmc.facebook.com/intern/diff/D86786231/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D86786231/)!
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 meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants