OPEN-59
An outer tail that continues a nested loop's round merges the two loops.
What was open
With a→b→c→d and loopback edges c to a and d to b, the second loop is nested in the first, yet c, a tail of the outer loop, lies inside the inner body. When c completes it both starts the outer loop's next round, which resets the inner loop, and continues the inner loop's current round towards d, so the two rounds race. SG-18 let such loops stand as nested. Its examples also used overlapping shapes that the body definition of OPEN-58 changes, and it left open the order of several merges and which loopback edges turn a merged loop.
Decision
A loop with a tail inside the body of a loop nested within it is merged with that loop when the tail has a forward edge to another node of the nested body and is not one of its heads, like loops that overlap without one containing the other, and the merge is reported as a static diagnostic. Only such a tail continues the nested round partway while the outer loop resets it. A tail with no forward edge into the nested body only loops back, so the loops stay nested: with a→p→b→d and loopback edges from d to a ("restart") and to b ("retry"), each edge works as drawn, and where both are followed the outer loop goes round first and the edge into b, leaving a job whose round has ended, is not followed. A head of a merged loop is any head of the loops merged into it. Where one job takes several nested loops round, the outermost goes round first. Merging proceeds in steps, each merging every linked set of loops at once until no pair calls for a merge, so the result does not depend on the order pairs are found in. The merged loop is keyed by the head of the largest body, ties going to the head that sorts first by code point, and every loopback edge of the merged loops advances its one round. One job following several of them goes round once, with a job for each head. The merge diagnostic names each loopback edge whose head needs a source in the merged body that none of the heads its tail takes round again on the same branch can reach, since such an edge cannot turn the merged loop: in the shape above, d to b. A ForEach inside a ForEach still nests, because its outer tail lies after the inner loop, and so does an inner ForEach whose completed port is wired straight into the outer loopback edge: a nested head that is an outer tail starts or ends a nested round rather than interrupting one. Whenever a job takes a loop round again, that loop goes round first and resets the loops nested in it before the job's other edges are followed, so the job's other edges lead into a round that has ended. The examples move to shapes that merge under OPEN-58: a cycle entered at two nodes, and the shape above.