Expand description
infer_peer_classes - stamp every NodeProto with the class of
Node it runs on.
Runs in runner::run_pipeline
after expand_ops and before synthesize_wire_recvs. The result feeds
partition_by_wire_ops - partitions
are now defined by home_class, not by module_instance chains.
§Algorithm
- Seed every function input’s
hometoSELF_CLASS. - Walk nodes in declaration order. For each NodeProto:
wire.Sendre-homes itsdataoutput to the destination class (taken from the peer input’speer_classtag). The send itself runs on its payload’s home class; thehandleoutput stays with the sender. Self-send case (dest_class == payload_home) is just a value ofdest_class.- Every other op inherits its home from its data inputs. All
data inputs (i.e. inputs that aren’t PEER_ID values) must
agree on a home; otherwise
CompileError::CrossClassDataflow. Peer-id inputs are ambient - they don’t constrain the consuming op’s home class.
- The home is stamped on the NodeProto as
HOME_CLASS_KEYmetadata for downstream passes.
§Self-send semantics
When a wire.Send’s destination class equals its sender’s home
class, both the send and the synthesized recv land in the same
partition at the partition pass. The runtime side is N physical
instances of one class talking to each other (e.g. gossip peers).
Functions§
- infer_
peer_ classes - Walk
graph.nodeand stampHOME_CLASS_KEYon each NodeProto. Pure.