Function collect_commactor_routing_tree

Source
pub fn collect_commactor_routing_tree(
    selection: &Selection,
    slice: &Slice,
) -> CommActorRoutingTree
Expand description

collect_commactor_routing_tree simulates how messages propagate through a mesh of CommActors during multicast, reconstructing the full logical routing tree.

This function mirrors the behavior of CommActor::handle_message and CommActor::forward, using the shared resolve_routing logic to determine delivery and forwarding at each step. Starting from the root frame, it simulates how the message would be forwarded peer-to-peer through the system.

The returned CommActorRoutingTree includes:

  • delivered: ranks where the message would be delivered (i.e., post called)
  • visited: all ranks that received or forwarded the message
  • forwards: frames forwarded from each rank to peers

This model is used in tests to validate routing behavior, especially invariants like path determinism and delivery coverage.