Expand description
Graph-level node fusion optimization pass.
Recognizes subgraph patterns in the Polydat DAG and replaces them with semantically equivalent fused nodes that are computationally cheaper. Runs during assembly after wiring resolution, before dead code elimination and topological sort.
See graph_compiler.md §Node Fusion for the full design.
Structs§
- Decomposed
Graph - A mini-DAG used for equivalence testing.
- Fusion
Rule - A graph rewrite rule: a subgraph pattern and its replacement.
- Fusion
Rule Registration - A fusion rule a node crate contributes: the node library registers
its rules through
inventory, so the compiler knows no node by name (polydat_nodes::hash,polydat_nodes::lerp). Rules apply in ascendingpriority, then by name, so the order is the same however the crates link. - Match
Result - The result of a successful pattern match against a subgraph.
Enums§
- Decomposed
Wire - Wire source within a
DecomposedGraph. - Fusion
Pattern - A structural pattern that matches a subgraph of the Polydat DAG.
Traits§
- Fused
Node - Trait for fused nodes that carry an equivalence contract.
Functions§
- apply_
fusions - Apply all fusion rules to the node graph, returning the number of fusions applied.
- default_
rules - The fusion rules applied during assembly: every registered rule, in priority order. Each rule’s correctness is verified by the equivalence tests beside the nodes it names.