Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

docs(execution): align nested For migration boundary

JPPhoto470835c04862
diff --git a/docs/src/content/docs/contributing/loop-nodes.md b/docs/src/content/docs/contributing/loop-nodes.md
index c3334be495..f01e6f34b7 100644
--- a/docs/src/content/docs/contributing/loop-nodes.md
+++ b/docs/src/content/docs/contributing/loop-nodes.md
@@ -107,7 +107,7 @@ successor node ID. The compatibility continuation bridge is retained only for un
legacy-loaded snapshots. Empty input-driven shapes outside the exact four-node/four-edge bounded topology, unsupported
input-driven outer collections, five-level-or-deeper or unsupported sibling nested loops, and unsupported mixed control flow remain on the
compatibility scheduler; the exact fresh two-sibling `For`/`ForReturn` `CollectionConcat` fan-in shape, the narrow canonical two-level, and exact fresh three-level and four-level serial nested-`For` shapes
-(one literal outer collection, one direct child at each level, no continuation nodes) and the exact
+(one literal outer collection, or the exact statically non-empty `CollectionConcat` producer for the three-level case, one direct child at each level, no continuation nodes) and the exact
bounded outer-`For`/`Iterate`/`Collect` shape are now generic-routed. This additive effect seam does not claim generic
scheduling for the remaining shapes. `Iterate` records ordered item tokens in
a closed `StreamBuffer`; an empty `Iterate` records an
@@ -204,7 +204,7 @@ lowerings, legacy snapshots, and unsupported mixed loop shapes. No activation or
graph JSON.
Exact fresh serial nested-`Iterate` chains through eight levels use the generic planner for ordered frame expansion,
empty-stream closure, checkpoint rehydration, source completion, and failure parity. Nine-level or deeper chains,
-five-level-or-deeper or unsupported sibling nested loops, and unsupported mixed shapes remain compatibility-owned. The exact fresh two-sibling `For`/`ForReturn` `CollectionConcat` fan-in shape and the exact fresh four-level serial nested-`For` shape are generic-routed. This migration does not modify any file under `invokeai/frontend/...`, including generated schemas; the existing
+five-level-or-deeper or unsupported sibling nested loops, and unsupported mixed shapes remain compatibility-owned. The exact fresh two-sibling `For`/`ForReturn` `CollectionConcat` fan-in shape, the exact fresh three-level serial nested-`For` shape with its bounded static `CollectionConcat` producer, and the exact fresh four-level serial nested-`For` shape are generic-routed. This migration does not modify any file under `invokeai/frontend/...`, including generated schemas; the existing
frontend/backend external interface remains frozen. Branch-membership analysis remains internal, while fresh execution
no longer creates skipped-state projection and old snapshots retain it for compatibility.
diff --git a/tests/app/services/shared/test_execution_engine_differential.py b/tests/app/services/shared/test_execution_engine_differential.py
index 13dabe6e3a..f733e5d261 100644
--- a/tests/app/services/shared/test_execution_engine_differential.py
+++ b/tests/app/services/shared/test_execution_engine_differential.py
@@ -672,6 +672,12 @@ def _input_driven_three_level_nested_for_graph_with_collection(
return graph
+def _input_driven_three_level_nested_for_graph_with_extra_node() -> Graph:
+ graph = _input_driven_three_level_nested_for_graph()
+ graph.add_node(AnyTypeTestInvocation(id="extra"))
+ return graph
+
+
def _input_driven_nested_for_graph(*, outer_collection: list[list[str]] | None = None) -> Graph:
graph = _nested_for_graph(outer_collection=outer_collection)
graph.get_node("outer_for").collection = []
@@ -2517,6 +2523,11 @@ def test_input_driven_three_level_nested_for_failure_matches_compatibility() ->
[
pytest.param(_sibling_nested_for_graph, id="sibling"),
pytest.param(_malformed_three_level_nested_for_graph, id="malformed-link"),
+ pytest.param(
+ lambda: _input_driven_three_level_nested_for_graph_with_collection([]),
+ id="empty-outer-producer",
+ ),
+ pytest.param(_input_driven_three_level_nested_for_graph_with_extra_node, id="extra-node"),
],
)
def test_three_level_nested_for_gate_falls_back_for_unsupported_shapes(graph_factory: Any) -> None: