A node executed more than once keys its results by occurrence
The rule
- A node's first execution in a run MUST be reported under its bare node identifier.
- Each later execution MUST be reported under
{nodeId}:{n}, wherenis that node's zero-based count of prior executions in the run. - The payload of a stop raised by the node MUST use the same key.
- Partial results reported for an interrupted run MUST use an equivalent scheme.
- A skipped job is not an execution: it MUST NOT take a key, and MUST NOT count towards
n, so keys are the same whichever jobs an implementation creates and skips. - Each completed execution MUST be stamped with a higher execution order than the one before it.
- A port MUST resolve to the newest of its sources' executions that are on the consumer's round (SG-19), so a job reads its own round's values even where it runs after its loop has gone round again (SG-21).
- The one exception is the reserved
loop_backport of a job created by following a loopback edge: it MUST resolve to the tail job whose followed edge created the job, which belongs to the round before.
What it means
Only the first execution of a node keeps its bare identifier. Every later
execution — a body running again as its loop goes round — is reported under
{nodeId}:{n}, counting from zero, so the second execution is :1 and the
third :2, not :2 and :3. A reader who assumes the suffix counts the
execution itself, rather than how many came before it, will look for the
wrong key. Only executions count: a job that was skipped, on a round where
the node's branch was not taken, has no key and moves no suffix, so two
implementations that create and skip different jobs still report the same
keys.
The same ordering decides what a port sees, within one round. A port reads the newest of its sources' executions that are on the consumer's round (SG-19), never simply the newest overall. A job that runs late, after its loop has already gone round again (SG-21), still reads the values of its own round, not the ones the next round has since produced. Where a source sits in an inner loop the consumer is not in, several of its executions share the consumer's round, and the newest of those, the inner loop's last pass, is the one read.
A loopback edge is the one place a value crosses from one round to the next:
the tail runs on round N and the head's new job on round N+1. A head's
loop_back port therefore reads the tail job whose loopback edge created it,
not an execution on its own round, which could never exist.
Example
A node that runs three times in one run reports its results under these keys, first pass bare:
["loop_node", "loop_node:1", "loop_node:2"]