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

Tick execution

One DataflowMonitor tick computes one current row. Scheduled evaluators publish current values during the row, then staged temporal state becomes historical at one shared commit boundary.

Tick and source barriers

The tick barrier is the logical end of scheduled evaluator execution. At this boundary, MonitorExecution::commit_active_plan commits staged evaluator temporal state, making it readable by later ticks. Output projection and the DataflowMonitor's HistoryStore commit follow successful evaluator execution; they are not part of the evaluator temporal commit itself.

The source barrier is an internal boundary used only by ticks containing dynamic or unsealed defer. MonitorExecution first evaluates the source range. The monitor then resolves nested bodies, collects their exact active dependencies, and asks Scheduler to retain or repair the order before the disjoint main range runs. This boundary changes the active body and execution order, not logical time.

Tick barrier and source barrier within logical ticks Two sparse timelines run left to right. In the static tick, all scheduled computed streams evaluate between tick n input and the tick barrier. Temporal writes are staged during evaluation and commit together at the tick barrier, becoming readable only by a later tick. In the split tick, a source range ends at the source barrier. Nested bodies are resolved, exact dependencies are collected, and the schedule is repaired there; no temporal state commits and no new logical tick begins. A disjoint main range then evaluates before the same end-of-tick barrier commits temporal state. Source and main ranges together evaluate every computed stream once. Two barriers, one logical-tick contract Static tick: the tick barrier commits staged temporal state logical time tick n input tick barrier later tick computed streams dependency-valid evaluation · each stream once temporal state writes staged; old history still readable commit new history visible later end of scheduled evaluation Split tick: the source barrier changes the active body and order, not time same logical tick tick n input source barrier tick barrier later tick execution range source range disjoint main range barrier effect resolve nested bodies collect edges · repair order commit temporal writes staged across both ranges · no commit at source barrier visible later

Reading rule. Time runs left to right. Work on both sides of the source barrier belongs to one logical tick: no new tick begins and no temporal write commits there. Source and main ranges are disjoint and together evaluate every computed stream exactly once; current values published in the source range remain visible to the main range. Temporal writes may be staged in either range, but only the later tick barrier commits them. Root reconfiguration control barriers, input-window boundaries, and output delivery boundaries are separate concepts.

Static tick

#PhaseResponsible entityEffect and visibility
1Prepare current rowDataflowMonitorValidate widths, clear the environment, and load all input slots.
2Evaluate computed streamsMonitorExecution and each EvaluatorRun once per stream in the dependency order supplied by Scheduler; publish current values to stable slots.
3Stage temporal writesstateful Evaluator operationsRecord samples that may become historical without exposing them yet.
4Commit temporal stateMonitorExecutionPush every staged sample at one shared post-row boundary.
5Project outputsDataflowMonitorRead the complete output projection from stable environment slots.
6Commit monitor historyHistoryStoreRetain the successful row only after output projection succeeds.

Phases 3 and 4 are distinct visibility boundaries. Staging records future historical samples; only phase 4 makes them readable by the next tick.

Tick with nested reconfiguration

#PhaseResponsible entityEffect and visibility
1Prepare current and retained rowsDataflowMonitorLoad current inputs and the sparse retained environment needed by nested expressions.
2Evaluate source prerequisitesMonitorExecutionRun only the fixed streams needed to obtain each dynamic or defer source value.
3Resolve nested programsnested Evaluator ownersRetain, compile, select, transfer, or initialize the active nested body.
4Repair active orderSchedulerMerge exact active dependencies with fixed dependencies and produce a valid main-range order.
5Evaluate the main rangeMonitorExecutionRun the disjoint remaining stream set exactly once.
6Commit temporal stateMonitorExecutionMake staged samples visible to the next tick at the same boundary used by a static tick.
7Apply defer sealingnested reconfiguration stateRetain the first active defer body and release source-only prerequisites for later ticks.
8Project and retain the rowDataflowMonitor and HistoryStoreProject outputs and commit monitor history after successful execution.

Phases 2 and 5 are disjoint and together cover every computed stream exactly once. There is no temporal commit between them; phase 6 remains the single commit boundary.

The interaction view shows which owner controls each boundary while one evaluate call remains active:

sequenceDiagram
    accTitle: One reconfigurable DataflowMonitor evaluation
    accDescr: A caller asks DataflowMonitor to evaluate one row. MonitorExecution evaluates the source range through stable Evaluator owners. DataflowMonitor resolves nested bodies and asks Scheduler to validate or repair the active order. MonitorExecution then evaluates the disjoint main range and commits evaluator temporal state. Only after that success does DataflowMonitor project outputs and commit HistoryStore values. A dynamic cycle aborts the tick and makes the monitor terminal.

    participant monitor as DataflowMonitor
    participant execution as MonitorExecution
    participant evaluator as Evaluator owners
    participant scheduler as Scheduler
    participant history as HistoryStore

    Note over monitor,history: DataflowMonitor::evaluate(input, output) is active
    monitor->>execution: evaluate_source_prelude_with_history()
    loop Source-range StreamId values
        execution->>evaluator: evaluate and publish current value
        evaluator-->>execution: published source prerequisite
    end
    execution-->>monitor: source range complete
    loop Reconfigurable expressions in resolution order
        monitor->>execution: expression_requires_reconfiguration()
        execution->>evaluator: inspect active source value
        evaluator-->>execution: changed or retained
        execution-->>monitor: resolution requirement
        opt active body changes
            monitor->>execution: reconfigure_expression()
            execution->>evaluator: compile and install nested body
            evaluator-->>execution: activation and dependency slots
            execution-->>monitor: activation and exact dependencies
        end
    end
    monitor->>scheduler: update_schedule(dependencies, source streams)
    alt dependency-valid order exists
        scheduler-->>monitor: retained or repaired order
        opt source or main order changed
            monitor->>execution: select_schedule_ranges()
            execution-->>monitor: active ExecutionPlan selected
        end
        monitor->>execution: evaluate_main_and_commit_with_history()
        loop Main-range StreamId values
            execution->>evaluator: evaluate, publish, and stage temporal writes
            evaluator-->>execution: current value published
        end
        loop Scheduled commit streams
            execution->>evaluator: commit_temporal_state_with_history()
        end
        execution-->>monitor: tick barrier complete
        monitor->>monitor: write_outputs(output)
        monitor->>history: commit_histories()
        history-->>monitor: row retained
        monitor->>monitor: return Ok
    else active dependency cycle
        scheduler-->>monitor: DynamicDependencyCycle
        monitor->>execution: abort_tick()
        monitor->>monitor: failed = true, return error
    end

Reading rule. Solid arrows are calls or state-changing requests; dashed arrows are returned values, completed ranges, or outcomes. The source-range return is the source barrier, not a temporal commit. The main-range return follows commit_active_plan at the tick barrier; output projection and HistoryStore retention occur afterward. A source-resolution or evaluator error follows the same abort-and-terminal-monitor path shown for DynamicDependencyCycle. Lifeline spacing is interaction order, not a second logical-time scale.

Current-row publication

Before execution, the monitor validates input and output widths, clears the current environment, and loads the supplied row. Omitted sparse updates have already become NoVal at the runtime adapter.

Each Evaluator publishes its result once to its assigned environment slot. A current consumer therefore reads a value produced earlier in the active order. Output projection reads completed slots after all computed streams have run.

Temporal and monitor commits

Evaluator operations stage ordinary-delay captures or recursive-delay outputs during the forward pass. The post-row temporal commit pushes those samples into their rings. The DataflowMonitor commits its HistoryStore only after output projection succeeds.

These are visibility boundaries rather than a general transaction over every internal mutation. If evaluation fails, the monitor is marked failed, no output row is published, and monitor history is not committed. The failed monitor accepts no later tick.

Reconfiguration work within a tick

Nested source values may compile or select a new body. Active dependencies are extracted from that body and merged with fixed dependencies before the main range runs. Earlier nested activations in the same resolution pass are not rolled back if a later activation fails; the resulting tick failure makes the monitor terminal.

A newly sealed defer body no longer needs its source prerequisites on later ticks. Their release occurs after the successful execution boundary so the activation tick still observes a complete valid schedule.

Execution routes

Canonical, quickened, and native routes all enter the same tick phases and must preserve publication, temporal commit, output projection, and failure boundaries. A declined region and a missed native guard both hand work to canonical evaluation; neither creates a second logical evaluation of a stream.

Continue with scheduling for dependency order and source/main range construction, temporal state, dynamic properties, or execution tiers.