Skip to content

Comments

mesh admin runtime ports refactor#2708

Open
shayne-fletcher wants to merge 2 commits intometa-pytorch:mainfrom
shayne-fletcher:export-D93864958
Open

mesh admin runtime ports refactor#2708
shayne-fletcher wants to merge 2 commits intometa-pytorch:mainfrom
shayne-fletcher:export-D93864958

Conversation

@shayne-fletcher
Copy link
Contributor

Differential Revision: D93864958

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Feb 20, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 20, 2026

@shayne-fletcher has exported this pull request. If you are a Meta employee, you can view the originating Diff in D93864958.

shayne-fletcher added a commit to shayne-fletcher/monarch-1 that referenced this pull request Feb 20, 2026
Summary:

this refactor moves actor introspection off the actor message loop and into a dedicated runtime task per instance, served via a pre-registered message port. IntrospectMessage no longer goes through handler dispatch; the introspect task reads InstanceCell directly and replies via the mailbox. this eliminates the heisenberg artifact (introspection showing itself as the last handler) and allows wedged actors to remain introspectable.

the blanket Handler<IntrospectMessage> and Actor::handle_introspect override path are removed. structural data now comes from live cell state (live_actor_payload), and domain-specific metadata is provided via published properties and an optional query_child callback stored on InstanceCell. the pre-dispatch snapshot fields and related plumbing are deleted since they are no longer needed.

Instance::new now pre-registers the introspect port with its own receiver, and Instance::start (and actor_instance) spawn the introspect task. this keeps routing unchanged while ensuring introspect messages do not produce WorkCells or interfere with handler ordering. a new InstanceReceivers struct threads the actor loop, work queue, and introspect receiver to their respective consumers, and ActorInstance groups the return values from Proc::actor_instance.

Host and proc mesh agents are updated to publish properties instead of overriding introspection handlers, and to register query_child callbacks for non-addressable children. NodePayload now includes an as_of timestamp propagated through the stack and surfaced in the TUI.

tests are updated to target the runtime path and new invariants, including wedged actor introspection and non-perturbation guarantees.

Differential Revision: D93864958
shayne-fletcher added a commit to shayne-fletcher/monarch-1 that referenced this pull request Feb 20, 2026
Summary:

this refactor moves actor introspection off the actor message loop and into a dedicated runtime task per instance, served via a pre-registered message port. IntrospectMessage no longer goes through handler dispatch; the introspect task reads InstanceCell directly and replies via the mailbox. this eliminates the heisenberg artifact (introspection showing itself as the last handler) and allows wedged actors to remain introspectable.

the blanket Handler<IntrospectMessage> and Actor::handle_introspect override path are removed. structural data now comes from live cell state (live_actor_payload), and domain-specific metadata is provided via published properties and an optional query_child callback stored on InstanceCell. the pre-dispatch snapshot fields and related plumbing are deleted since they are no longer needed.

Instance::new now pre-registers the introspect port with its own receiver, and Instance::start (and actor_instance) spawn the introspect task. this keeps routing unchanged while ensuring introspect messages do not produce WorkCells or interfere with handler ordering. a new InstanceReceivers struct threads the actor loop, work queue, and introspect receiver to their respective consumers, and ActorInstance groups the return values from Proc::actor_instance.

Host and proc mesh agents are updated to publish properties instead of overriding introspection handlers, and to register query_child callbacks for non-addressable children. NodePayload now includes an as_of timestamp propagated through the stack and surfaced in the TUI.

tests are updated to target the runtime path and new invariants, including wedged actor introspection and non-perturbation guarantees.

Differential Revision: D93864958
…ta-pytorch#2698)

Summary:

this diff adds the data plumbing needed for runtime introspection without changing behavior yet: introduces PublishedProperties{ published_at, kind: Host|Proc } in introspect.rs, adds published_properties and query_child_handler slots to InstanceCellState in proc.rs with accessors (set_published_properties, published_properties, set_query_child_handler, query_child), and exposes Instance::publish_properties() / Instance::set_query_child_handler() as the public API. it also adds an is_system: bool field to NodeProperties::Actor (defaulted to false in default_actor_payload) and updates the TUI actor-detail match to ignore the new field. two unit tests validate properties round-trip and callback round-trip at the cell level.

Differential Revision: D93768689
Summary:

this refactor moves actor introspection off the actor message loop and into a dedicated runtime task per instance, served via a pre-registered message port. IntrospectMessage no longer goes through handler dispatch; the introspect task reads InstanceCell directly and replies via the mailbox. this eliminates the heisenberg artifact (introspection showing itself as the last handler) and allows wedged actors to remain introspectable.

the blanket Handler<IntrospectMessage> and Actor::handle_introspect override path are removed. structural data now comes from live cell state (live_actor_payload), and domain-specific metadata is provided via published properties and an optional query_child callback stored on InstanceCell. the pre-dispatch snapshot fields and related plumbing are deleted since they are no longer needed.

Instance::new now pre-registers the introspect port with its own receiver, and Instance::start (and actor_instance) spawn the introspect task. this keeps routing unchanged while ensuring introspect messages do not produce WorkCells or interfere with handler ordering. a new InstanceReceivers struct threads the actor loop, work queue, and introspect receiver to their respective consumers, and ActorInstance groups the return values from Proc::actor_instance.

Host and proc mesh agents are updated to publish properties instead of overriding introspection handlers, and to register query_child callbacks for non-addressable children. NodePayload now includes an as_of timestamp propagated through the stack and surfaced in the TUI.

tests are updated to target the runtime path and new invariants, including wedged actor introspection and non-perturbation guarantees.

Differential Revision: D93864958
shayne-fletcher added a commit to shayne-fletcher/monarch-1 that referenced this pull request Feb 20, 2026
Summary:

this refactor moves actor introspection off the actor message loop and into a dedicated runtime task per instance, served via a pre-registered message port. IntrospectMessage no longer goes through handler dispatch; the introspect task reads InstanceCell directly and replies via the mailbox. this eliminates the heisenberg artifact (introspection showing itself as the last handler) and allows wedged actors to remain introspectable.

the blanket Handler<IntrospectMessage> and Actor::handle_introspect override path are removed. structural data now comes from live cell state (live_actor_payload), and domain-specific metadata is provided via published properties and an optional query_child callback stored on InstanceCell. the pre-dispatch snapshot fields and related plumbing are deleted since they are no longer needed.

Instance::new now pre-registers the introspect port with its own receiver, and Instance::start (and actor_instance) spawn the introspect task. this keeps routing unchanged while ensuring introspect messages do not produce WorkCells or interfere with handler ordering. a new InstanceReceivers struct threads the actor loop, work queue, and introspect receiver to their respective consumers, and ActorInstance groups the return values from Proc::actor_instance.

Host and proc mesh agents are updated to publish properties instead of overriding introspection handlers, and to register query_child callbacks for non-addressable children. NodePayload now includes an as_of timestamp propagated through the stack and surfaced in the TUI.

tests are updated to target the runtime path and new invariants, including wedged actor introspection and non-perturbation guarantees.

Differential Revision: D93864958
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.

1 participant