Fix nested collector iteration scope#9343
Open
JPPhoto wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes nested collector scoping in graph execution.
Collectors nested under iterators now group prepared parent exec nodes by iteration path. A collector collapses the immediate iterator feeding its
iteminput while preserving enclosing iterator paths, preventing collections from unrelated outer iterations from being mixed before downstream consumers run.This fixes workflows where an outer item is decomposed into a per-item collection, that collection is iterated, and the results are collected again. The observed case was an XYImage tiling workflow where tiles from separate source images could be combined into the same collected input.
Also updates the execution engine README to document collector grouping, preserved iteration paths, runtime rehydration, and ready queue ordering.
Related Issues / Discussions
N/A
QA Instructions
I verified this fix against current
main(9152232189c02d0a3807e18af682e0fc2bccaffa) by applying only the updatedtests/test_graph_execution_state.pyto a temporarymainworktree and running the new tests.Key failures:
The
test_graph_collector_nested_under_three_iterators_preserves_outer_iteration_pathstest also fails in similar fashion.The helper-level test also fails on
mainbecause_get_collect_iteration_mapping_groups()does not exist before this branch.Manual QA, if the XYGrid community node pack is available:
Configure tiling so each source image produces multiple tiles.
Run the workflow before and after this fix.
Before this fix:
Collectcan mixXYImage Collectoutputs from different source images.XYImage Tiles To Imagemay receive tiles from more than one source image at once.After this fix:
XYImage Tiles To Imageruns separately per source image.Note: I checked simpler built-in-only primitive and built-in tile workflows, and they did not reproduce the pre-fix issue. The manual repro needs a workflow shape where a node under the outer iterator produces a fresh per-outer-item collection that is then iterated and collected downstream.
Merge Plan
Checklist
What's Newcopy (if doing a release after this PR)