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

Context transfer

Context transfer moves compatible semantic state from an active DataflowMonitor into a prepared target DataflowMonitor. Validation and target construction happen first; state movement is destructive and has no rollback path.

flowchart TB
    accTitle: Dataflow context transfer phases
    accDescr: The active monitor and a cold target are compared to create a semantic mapping. Preparation validates evaluator compatibility, scheduler viability, retained environment, and history requirements. Application materializes physical state, moves mapped owners, resets unmapped owners, transfers compatible histories, installs prepared control state, and selects a route.

    active["Active monitor"] --> mapping["Validated semantic mapping"]
    target["Cold target monitor"] --> mapping
    mapping --> prepare["Prepare evaluator, scheduler, environment, and history state"]
    prepare --> move["Destructively move mapped owners"]
    move --> reset["Reset unmapped target owners"]
    reset --> install["Install target control state and route"]

Reading rule. Nothing moves before preparation succeeds. After destructive movement begins, the architecture provides no reverse transfer to reconstruct the donor.

Preparation

Preparation requires both monitors to be outside a tick. It validates execution structure, stream and environment mappings, target Evaluator compatibility, dynamic-expression projections, candidate Scheduler viability, retained-environment layout, and effective history requirements.

A preparation failure leaves the donor's semantic owners intact. In the root runtime, earlier input or output cutover effects may already have occurred because monitor application is later in the overall sequence.

Application

Application materializes optimized/native state in both source and target where necessary, moves exact evaluator owners, resets unmapped target evaluators, transfers compatible retained-environment values, recomputes history requirements, transfers matching variable histories, installs prepared scheduling and nested-reconfiguration state, clears the target current row, and selects its execution route.

With ContextTransferPolicy::None, the target uses initialized evaluator state and empty target histories.

Context transfer moves compatible state, not the current row Read left to right on one shared time baseline. Old ticks n−1 and n precede a physical replacement interval with no ordinary logical tick, followed by the first target tick n+1. A compatible Evaluator(total) plus DelayState moves destructively to the target. The donor history cells older, 8, and 24 yield only the target-required suffix 8 and 24; the older value is not taken. An unmapped target owner starts cold. The completed old current row is not transferred, and the target row is cleared before its first evaluation. Dashed vertical guides bound the replacement interval and do not denote logical ticks; the single solid arrow marks destructive owner movement. Context transfer moves compatible state, not the current row OLD monitor state replacement interval no ordinary logical tick TARGET monitor state old tick n−1 old tick n first target tick n+1 time logical tick old n−1 old n target n+1 mapped owner Evaluator(total) + DelayState compatible donor destructive move same mapped owner in target monitor history donor history target-required suffix older not taken 8 24 8 24 destructive take suffix only unmapped owner target owner: cold current row old current row × not transferred target row: cleared before first eval

Reading rule. The shared time axis contains two old logical ticks and the first target tick; the dashed replacement interval is physical application work, not another tick. The compact mapping rows show a compatible Evaluator moving with its DelayState and monitor history being restricted to the target-required suffix. An unmapped target owner starts cold. The completed old current row does not cross the interval—the target row is cleared before its first evaluation.

State categories

StateTransfer rule
evaluator node and operator statemoved with mapped compatible stream owner
delay rings and call statepart of evaluator owner; otherwise cold
monitor variable historytransferred for matching compatible variables and target requirements
retained sparse environmenttransferred through compatible environment mapping
current rownot transferred; target row is cleared
scheduler and nested controlprepared for the target definition
quickened/native representationmaterialized back to canonical before transfer; never moved
schedule route/cache entryselected or rebuilt; not semantic context

The retained sparse environment is not temporal history and does not seed a newly created delay ring.

Nested transfer

Nested activation follows its own rules, described under dynamic properties; the part that matters at a root transfer is that a nested body is a state owner like any other. The first defer activation has no donor, and after sealing its evaluator remains active across the replacement if the enclosing stream maps.

Nested and monitor history across dynamic replacement Before replacement, evaluator A owns a local x indexed-by-two DelayState ring, while the enclosing monitor owns HistoryStore storage used by a direct downstream z indexed-by-one read. During replacement, compatible local evaluator state may move from A to B; otherwise B starts with an empty ring and its positive delay returns Deferred while filling. The monitor HistoryStore remains with the unchanged enclosing monitor and continues recording z. Only the immediately previous active evaluator can donate compatible state. Dynamic replacement changes nested owners, not enclosing monitor history active body A replacement body B current x Evaluator A local DelayStatex[2] ring z HistoryStore(z)direct downstream z[1] current x Evaluator B local DelayStatemoved if compatible; else cold z same HistoryStorecontinues with enclosing monitor replace transfer only from A when compatible unchanged owner A cold local positive delay returns Value::Deferred until enough activation-local samples have committed.

Reading rule. Dynamic properties reads this figure for the nested activation; read it here for the two different owners it puts side by side. The local DelayState ring belongs to the nested body, so it is subject to that body's lifetime. The downstream z[1] read uses monitor HistoryStore, which belongs to the enclosing monitor and survives anything that happens to the body. A root transfer moves the second by variable identity and leaves the first to the activation rules — which is why the same figure answers two questions.

Semisynchronous transfer

The separate ReconfSemiSyncRuntime transfers variable histories rather than dataflow evaluator owners. It retains the opened input and output sessions, filters history by variables in the target, gives missing variables empty history, and left-pads retained histories with NoVal to align lengths before starting the replacement monitor generation.

Implementation mapping

The implementation mapping leads through the monitor and evaluator reconfiguration modules, src/dataflow/reconfiguration_mapping.rs, monitor history code, and src/runtime/reconfigurable_semi_sync.rs.

Continue with failure and termination.