Skip to main content

expand_anytime_steps

Function expand_anytime_steps 

Source
pub fn expand_anytime_steps(plan: &mut CuExecutionLoop) -> CuResult<()>
Expand description

Expands every foreground anytime node of an already-computed plan into its chunked steps.

The node’s single Whole step becomes an CuStepPhase::AnytimeBase step at its topological position, and max_refines CuStepPhase::AnytimeRefine steps (one refine() quantum each) are woven between it and the earliest step consuming the node’s output: one immediately after the base step, one after each subsequent independent step, and the remainder contiguously before the consumer. If max_refines is smaller than the gap, later gap steps get no quantum between them; if the node has no consumer in this plan, every refine step sits right after the base step.

The refine count must be known here — the emission count is the iteration bound — which is why max_refines is mandatory for foreground anytime nodes. How many quanta run and where they sit between other steps is entirely this compile-time scheduling decision; the generated code carries no counter.