[bug]: Nested Iterate execution mixes values across outer iterations
Is there an existing issue for this problem?
- I have searched the existing issues and found no duplicate.
Install method
Manual (in-process graph test; no server installation used)
Describe your environment
- Operating system: Linux
- GPU vendor: None (CPU; not involved)
- Version number: main @ 13aff5c (in-process review reproduction)
What happened
A nested iteration graph leaks each outer iteration's values into the other result. With an outer Iterate over [1, 2], an inner Iterate selected through an If branch, and Add(outer.item, inner.item) collected to a sink, the two sink results are both [1, 2, 2, 3]. The same execution-scope problem is reachable on main through If -> Collect.collection -> Iterate.
What you expected to happen
Each outer iteration should retain its own inner results: [1, 2] for outer item 1 and [2, 3] for outer item 2.
How to reproduce the problem
- Create an outer Iterate over [1, 2].
- Create the reviewed Range(0, 2) -> If -> inner Iterate path.
- Add outer.item to inner.item and connect the result to Collect, then to a sink.
- Execute and inspect each sink collection.
Additional context
This is a pre-existing execution-scope bug reported during PR 343 review. The direct If -> Iterate shape became reachable through the graph-validation change, but this issue is about nested execution isolation and is deferred from PR 343.
Source: invoke-ai/InvokeAI