You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug]: Long node chains into an If branch raise RecursionError #9821
main at aa46003 (7.0.0-alpha.2-post); also on #9789
What happened
A chain of about 480 or more ordinary nodes between an Iterate and an If branch input makes GraphExecutionState.next() raise RecursionError: maximum recursion depth exceeded. The chain below uses 1000 nodes; 400 completes.
What you expected to happen
Graph length should not be limited by the Python recursion limit.
The recursion is in graph_if_runtime._get_effective_iteration_paths_for_edge. It recurses once per unprepared upstream node while inferring an If's frames.
Under the real session processor the caller stack is deeper, so the practical limit is somewhat lower than in tests. An iterative walk (or memoising in topological order, as _get_frame_depths in #9789 does) would remove the limit.
Resolved in PR #9843. Ordinary dependency traversal into an If branch is iterative, so the reported long AnyType chain completes. The exact 1,000-node regression test passed locally in the current main checkout (1 passed); CI also includes a lower-recursion-depth guard.
Activity
test(graph): add failing regressions for open If review findings
JPPhoto commentedon Oct 18, 2026
Resolved in PR #9843. Ordinary dependency traversal into an If branch is iterative, so the reported long AnyType chain completes. The exact 1,000-node regression test passed locally in the current main checkout (1 passed); CI also includes a lower-recursion-depth guard.