Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Runtime ownership

DataflowMonitor separates immutable meaning, persistent language state, mutable scheduling, and replaceable execution routing. State remains attached to semantic identities when order or physical execution changes.

Stable environment slots and output projection Input and computed values occupy stable EnvironmentSlot indices. The scheduler may change stream evaluation order without moving evaluator state, while the declared output order alert, scaled, total projects slots three, one, and two. Stable EnvironmentSlot layout (tick 2) producers environment_values output projection input[0]: x = 8 EnvironmentSlot(0): x = 8 scaled -> 16 EnvironmentSlot(1): scaled = 16 total -> 24 EnvironmentSlot(2): total = 24 alert -> true EnvironmentSlot(3): alert = true output[0]: alert output[1]: scaled output[2]: total The scheduler may reorder stream evaluation; state and slots do not move output slots = [3, 1, 2]

Reading rule. EnvironmentSlot identifies a current-row location. Output order and scheduler order are projections over stable identities; neither is the storage identity of evaluator state.

Immutable meaning

DataflowProgram owns the fixed definition: environment layout, stream programs, monitor plan, output projection, and definition fingerprint. A StreamProgram can be shared by several evaluator instances because it contains no mutable node history.

Persistent state

MonitorExecution owns one long-lived evaluator per logical computed stream. Each evaluator owns canonical node values and operator state, and nothing else: an Evaluator is an Rc<StreamProgram> and a Box<EvaluatorState>.

Accelerator state is deliberately not here. Quickened registers and native artifacts belong to the active ExecutionPlan's regions, held beside the arena in EvaluatorArena.region_states with a parallel authority array. That separation is what makes a route replaceable: a plan can be built, cached, or evicted without touching language state, because it never held any.

State includes delay rings, lifting state, branch evaluators, persistent calls, recursive frame pools, and active nested evaluators. The stable coordinate of top-level operation state is a stream identity plus graph-local NodeId, not a schedule index.

The current environment row is separate from persistent evaluator state. It is cleared or overwritten for a tick; delay history and other operator state survive.

Mutable scheduling

Scheduler combines fixed dependencies with exact dependencies of currently active nested expressions. It retains or repairs a dependency-valid order over stable stream identities. Replacing that order does not move evaluators, environment cells, or operation state.

For reconfigurable monitors, source-prerequisite streams form one range and the remaining streams form a disjoint main range. The scheduling architecture explains dirty detection, cycle rejection, range projection, and schedule-specific plan selection.

Replaceable routing

ScheduledExecutionPlan records the semantic order; ExecutionPlan partitions it into physical steps, and ExecutionEngine retains the active one for canonical graph evaluation, scalar regions, or native artifacts.

An ExecutionPlan routes a scheduled order into stable evaluators MonitorPlan metadata and the active Scheduler order produce a ScheduledExecutionPlan. The execution engine partitions that semantic plan into an ExecutionPlan of steps, and may retain four previous plans in its cache. For the running example the steps are a ScalarRegion for scaled, a Graph step for total because it carries temporal state, and a ScalarRegion for alert. These steps address the stable Evaluator owners for scaled, total, and alert. Each evaluator holds canonical state only; the quickened register state for a region sits beside the arena in the execution plan, not inside the evaluator, which is why replacing a route does not move language state. JIT coordination observes PlanId separately. Schedule-specific routing, stable evaluator ownership MonitorPlan metadataprograms, slots, effects, dependencies Scheduler ordersource range + main range ScheduledExecutionPlansemantic order + PlanId active ExecutionPlan plus at most four cached inactive plans ScalarRegion [scaled]complete one-node stream Graph [total]temporal state keeps it canonical ScalarRegion [alert]reads published total stable evaluator owners Evaluator(scaled)canonical state only Evaluator(total)delay, default, add state Evaluator(alert)canonical state only Region state lives with the plan, not the evaluator; JIT coordination observes PlanId separately

Reading rule. The scheduler and execution layout can be replaced or cached. Every step addresses stable evaluator owners in the fixed arena; histories and dynamic evaluators do not move into the route.

A PlanId identifies one schedule-specific route. It is not a state identity. Handing a region back to canonical execution must materialize its state first — whether the quickened region declined the row or a native artifact missed a guard.

Ownership table

ResponsibilityOwnerLifetime
compiled semantics and fixed layoutDataflowProgramdefinition
current row and monitor historyDataflowMonitoractive monitor
active dependency orderScheduleractive monitor; repairable
per-stream language stateEvaluatorArena in MonitorExecutionactive monitor or compatible transfer
nested expression body stateactive Evaluatoractivation
physical route and artifactsExecutionEngine, ScheduledExecutionPlan, and ExecutionPlanschedule-specific and replaceable
asynchronous batches and output writerDataflowRuntime and DirectDataflowEngineruntime run

Replacement consequence

Root context transfer moves compatible evaluator owners by semantic mapping. Nested expression replacement moves or resets only the nested owner. Schedule replacement moves neither. This is the basis for preserving history while changing dependencies, stream order, or execution tier.

Continue with tick execution for mutation order and replacement identity for cross-definition mappings.