A source from another round does not satisfy an edge
Inside a loop, a completed node is not necessarily a current one. Without this, a consumer on round N happily reads the value its source produced on round N-1, or, when it runs late, on round N+1.
The rule
- A completed source MUST NOT satisfy a trigger, error or data edge unless it is on the consumer's round: on every loop the two share, the source's round equals the consumer's.
- A source behind the consumer carries an earlier round's answer and a source ahead of it a later round's, and neither is current for the consumer's round.
- Where the two share no loop the source MUST count as on the consumer's round: a source outside every loop the consumer is in will never fire again, its value is the current one forever, and gating it would hang the consumer on a round that cannot arrive.
- More generally, a job is on a round when its stamp (SG-17) equals that round on every loop both name.
- One round is behind another when, comparing the loops both name lexicographically, outermost loop first, the first loop on which they differ has the lower round there; nothing nested inside that loop can overturn the verdict.
- Loopback edges create no execution dependency (DATA-5), so this test never applies to them; SG-8 says what a
loop_backport reads. - A gated trigger or error edge MUST leave the consumer waiting, to be skipped when its round ends (SG-21) or when the run ends.
- A gated data port MUST leave the consumer waiting likewise.
- A consumer that can never be filled is not failed: it ends skipped with the reason
SUPERSEDED_ROUNDwhen its round ends (SG-21), so an author still sees it.
What it means
Inside a loop, a completed source is not automatically a current one. A consumer on round two that reads a source's value from round one is reading last round's answer as if it were this round's. A consumer on round two that runs late, after the loop has already gone round again, and reads the source's round-three value is making the same mistake in the other direction. The rule stops both: a completed source satisfies a trigger, error or data edge only when it is on the consumer's round, equal to it on every loop the two share.
Only the loops the two share are compared. A source in an inner loop that the consumer is not in has several executions on the consumer's round, one per inner pass, and all of them count; SG-8 picks the newest. A source outside every loop the consumer is in shares none, and always counts: it will never fire again on its own terms, so its value is the current one forever, and gating it on a round that cannot arrive would hang the consumer permanently.
Where two rounds have to be put in order, as SG-21 does, they are compared lexicographically, outermost loop first. The first shared loop where the two differ settles the question, and nothing nested inside that loop can overturn the verdict, even if the inner numbers alone would point the other way.
A gated edge leaves the consumer waiting. When its round ends, SG-21 skips it
with the reason SUPERSEDED_ROUND if its inputs can no longer come, so a
consumer that can never be filled is never failed and never hangs, and an
author still sees why it did not run.
Example
{"source": {"loop_a": 0}, "consumer": {"loop_a": 1}}{"source": {"loop_a": 2}, "consumer": {"loop_a": 1}}{"source": {}, "consumer": {"loop_a": 3}}{"source": {"outer": 1, "inner": 4}, "consumer": {"outer": 1}}Ordering two rounds, as SG-21 does to decide that a round has ended:
{"round": {"outer": 2, "inner": 0}, "than": {"outer": 1, "inner": 5}}{"round": {"outer": 1, "inner": 0}, "than": {"outer": 1, "inner": 2}}The outermost shared loop always decides first: ahead on the outer loop outweighs behind on the inner one, and only once the outer rounds match does the inner comparison get a say. Either way, neither of those two pairs is on the same round, so neither source would satisfy the edge.