For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo struct
EdgeRule
struct EdgeRule
Declarative edge derivation rule.
Each rule describes a class of dependency edges: for every (producer, consumer) pair whose OpDesc fields satisfy the predicates, emit a DepEdge with the given kind and loop distance.
The evaluator (apply_edge_rules) pre-classifies ops by role, then for
each rule scans only relevant (producer_role, consumer_role) pairs and
checks the predicate fields. This replaces the hand-coded 4-phase
double-buffer logic and 8-rule single-buffer logic in
derive_edges_from_ops with inspectable data.
Fields fall into five groups:
-
Core β producer/consumer roles, dependency kind, loop distance.
loop_distance = -1means "derive from producer.k_offset": K_PREV β d=0 (current-iteration load), otherwise d=1 (prefetch). -
Field matching β require same channel / stage / subtile between the producer and consumer ops.
use_config_matchactivates thePipelineConfig.compute_match_key()logic (Phase 1 register-FLOW). -
Half predicates (double-buffer) β
same_half/cross_half/producer_halfconstrain which half each op lives in. -
K-offset filter β 0=any, 1=K_PREV only, 2=non-K_PREV only. Applied to the consumer for LDS-ANTI rules, to the producer for LDS-FLOW distance derivation.
-
Single-buffer predicates β
lc_producer/lc_consumer(loop- carried status),producer_ordinal/consumer_ordinal(Nth op of that role),first_match_only(break after first consumer match).
Fieldsβ
- βproducer_role (
OpRole): - βconsumer_role (
OpRole): - βdep_kind (
DepKind): - βloop_distance (
Int): - βmatch_channel (
Bool): - βmatch_stage (
Bool): - βmatch_subtile (
Bool): - βuse_config_match (
Bool): - βsame_half (
Bool): - βcross_half (
Bool): - βproducer_half (
Int): - βk_offset_filter (
Int): - βlc_producer (
Int): - βlc_consumer (
Int): - βproducer_ordinal (
Int): - βconsumer_ordinal (
Int): - βfirst_match_only (
Bool):
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDestructible,
Movable
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!