pub struct Plan {
pub nodes: Vec<Node>,
pub constants: BTreeMap<OpId, Core>,
pub root: OpId,
pub state: OpId,
pub session: OpId,
pub presence: OpId,
pub signals: Vec<(Arc<str>, OpId)>,
}Expand description
The view as a dataflow.
Nodes are in dependency order — every input’s index is less than its consumer’s — so the engine is one forward pass with no scheduling.
Fields§
§nodes: Vec<Node>§constants: BTreeMap<OpId, Core>Constants, in the same index space as nodes, for the ones whose op is Op::Const.
root: OpId§state: OpId§session: OpId§presence: OpId§signals: Vec<(Arc<str>, OpId)>The declared signals that survived as nodes, so a report can use the program’s own names.
Implementations§
Source§impl Plan
impl Plan
Sourcepub fn counts(&self) -> (usize, usize)
pub fn counts(&self) -> (usize, usize)
How many operators are maintained by delta, and how many are recomputed.
Sources and constants are neither: the accumulator, the session and a string literal are inputs to the dataflow rather than steps in it, and counting them as “recomputed” would make every program look worse than it is by a fixed amount.
The nodes that do not read the session: §5.3’s shared dataflow.
Sourcepub fn compile(placed: &Placed) -> Plan
pub fn compile(placed: &Placed) -> Plan
Compile the view of a sliced program, and fuse it.
Everything downstream — the engine, the read models, both reports — reads the fused plan,
so there is one plan a program has rather than two that could disagree.
Plan::unfused is what the differential gate compares against.
Sourcepub fn unfused(placed: &Placed) -> Plan
pub fn unfused(placed: &Placed) -> Plan
The plan as the decomposition produced it, before crate::fuse rewrites it.
Works from the graph rather than from crate::split::Roles::view, for the reason
23 built the graph in the first place: the
sliced expression has already lost which signal each part came from, and a plan whose nodes
cannot be named is a plan no report can explain.