Skip to main content

compile_stream

Function compile_stream 

Source
pub fn compile_stream(
    graph: &Graph,
    registry: &dyn NodeRegistry,
    chunk_size: usize,
) -> Result<CompileResult>
Expand description

Compile a graph for streaming execution.

Produces an ExecutionPlan::Stream wrapping the topologically sorted node chain, which the runtime executes chunk by chunk through the same primitives run_node uses.

Streaming executes a single linear chain of filters — it used to accept any DAG and silently run it as a chain, which for a diamond is simply the wrong answer. So this validates what the executor can honour:

  • every node has at most one predecessor and one successor;
  • no node is a step (the effect journal keys by (run, node, turn), so chunk 2 would replay chunk 1’s effects — no defensible semantics);
  • chunk_size > 0.