Each superstep runs every ready task against the same committed ThreadState, then commits their updates and schedules the next frontier together:
Tasks run in frontier order (possibly concurrently); none sees another's writes.
If any task fails, the superstep commits nothing and the run fails with the first failure in frontier order.
Each command is checked: every update is to a key in the node's declared write set, every route targets a node and join of this graph, and a task fans out to a join at most once.
Updates apply task by task in frontier order, and in emission order within a task.
The next frontier is, for each task in order, its static edges (declaration order) then its routes (route order, fan-out payloads in item order); then the targets of joins this commit released - static joins in declaration order, then dynamic activations in the order they opened.
A task that returns NodeResult.Suspend parks a continuation; its update commits with the superstep, and the run pauses after that superstep (RunResult.Suspended). A continuation stands in for the suspended task: when it completes it makes that task's join arrivals. The suspended task itself makes no arrival and fires none of its node's static edges.
A run's static breakpoints (RunConfig.interruptBefore, RunConfig.interruptAfter) park a task the same way: before its node runs, it is parked instead of run; after it ran, its update commits and its routes, static edges and join arrivals wait in its continuation. Either way the run pauses after the superstep, and the task's interrupt is answered with Breakpoint.proceed.
When the frontier is empty the run completes - unless a join is still waiting. A join waiting only for arrivals that parked continuations can make keeps the run suspended; a join waiting for an arrival nothing can make fails the run with GraphError.UnsatisfiedJoin.
Rebuilds an execution from a snapshot, checking it against this graph first: the graph id; that the snapshot's graph has changed only in ways the restored run cannot observe (below); that every state value, pending input and parked question decodes with this graph's codec for it; that every join exists with the right kind and is partially arrived; that every parked continuation names a resume node; and that every arrival a dynamic join still expects will be made by a pending task or a parked continuation in its fan-out. Every problem is reported at once.
Rebuilds an execution from a snapshot, checking it against this graph first: the graph id; that the snapshot's graph has changed only in ways the restored run cannot observe (below); that every state value, pending input and parked question decodes with this graph's codec for it; that every join exists with the right kind and is partially arrived; that every parked continuation names a resume node; and that every arrival a dynamic join still expects will be made by a pending task or a parked continuation in its fan-out. Every problem is reported at once.
A snapshot is in flight when it holds a pending task, a parked continuation or a partially arrived join, and at rest otherwise. Against the GraphShape it records (design ยง4.29):
a key added reads its initial value; a key removed is refused if the snapshot holds a value for it;
no node is removed;
in flight, the version is unchanged, every stored node keeps its out-edges, every static join over a stored node is unchanged (none added, none removed), and every stored dynamic join keeps its target. So a node added is reachable only from other added nodes, and the restored run cannot reach it.
at rest, the version, edges, joins and entry node may change: the next run starts at the entry node.
A snapshot written before snapshots recorded a shape restores only into its own version, and only if this graph's fingerprint matches its own once keys the snapshot holds no value for are left out: the graph only gained keys.
Answers some of execution's parked continuations. Each answer is decoded with its resume node's answer codec; each answered continuation is scheduled after the ready frontier, in the order it was parked, with its suspended task's join slot. Unanswered continuations stay parked. A task a breakpoint holds takes Breakpoint.proceed (JSON null): held before it ran, its continuation runs it; held after, its continuation makes its routes and arrivals. Fails without changing anything if answers is empty, names an interrupt that is not parked, or holds an answer that does not decode, or a breakpoint answer that is not null.
Answers some of execution's parked continuations. Each answer is decoded with its resume node's answer codec; each answered continuation is scheduled after the ready frontier, in the order it was parked, with its suspended task's join slot. Unanswered continuations stay parked. A task a breakpoint holds takes Breakpoint.proceed (JSON null): held before it ran, its continuation runs it; held after, its continuation makes its routes and arrivals. Fails without changing anything if answers is empty, names an interrupt that is not parked, or holds an answer that does not decode, or a breakpoint answer that is not null.
Runs one superstep, or finishes or suspends the run if execution cannot advance. The superstep runs at most config.budgets.maxConcurrency tasks at a time. No superstep limit is checked: a caller driving step owns its loop. Outside a GraphRuntime, emit and progress are no-ops and each task's checkpointId is "". config's breakpoints hold tasks as in a runtime; one on a node this graph does not have fails the step with a ValidationError.
Runs one superstep, or finishes or suspends the run if execution cannot advance. The superstep runs at most config.budgets.maxConcurrency tasks at a time. No superstep limit is checked: a caller driving step owns its loop. Outside a GraphRuntime, emit and progress are no-ops and each task's checkpointId is "". config's breakpoints hold tasks as in a runtime; one on a node this graph does not have fails the step with a ValidationError.
The graph's declared structure as a Mermaid flowchart. Nodes and joins are ordered by id and a node's edges by declaration, so the text does not depend on the order nodes were declared in. Routes a node returns at run time are values, not declarations, and are not drawn; see MermaidExport.
The graph's declared structure as a Mermaid flowchart. Nodes and joins are ordered by id and a node's edges by declaration, so the text does not depend on the order nodes were declared in. Routes a node returns at run time are values, not declarations, and are not drawn; see MermaidExport.
The structural fingerprint a snapshot records: the hex SHA-256 of the graph's id, version, entry, nodes, edges, joins, resume nodes and keys. A snapshot written before snapshots recorded a shape is matched by it.
The structural fingerprint a snapshot records: the hex SHA-256 of the graph's id, version, entry, nodes, edges, joins, resume nodes and keys. A snapshot written before snapshots recorded a shape is matched by it.