Skip to content

bug(graph): computed-condition If stalls when its branch reaches an empty Iterate through a For #9918

Open

Description

@lstein

Summary

A session stalls when an If has a computed condition and its branch reaches an empty Iterate only through a For's final output. next() returns None, is_complete() stays False, and no error is raised, so the queue item hangs.

Reproduction

Nodes (the test nodes are from tests/test_nodes.py):

  • src: CollectionConcatInvocation(first=[]) → A: IterateInvocation (empty)
  • A.item → for: ForInvocation.collection. Its body is for.item → body: Mark("b:") → ret: ForReturnInvocation, linked to for.
  • for.output_collection → mid: AnyTypeTestInvocation → if.true_input
  • fallback: AnyTypeTestInvocation(value="fb") → if.false_input
  • c: FixedCollectionTestInvocation(value=True), with c.condition → if.condition
  • if → collect: CollectInvocation

Run it with GraphExecutionState on main (seen at ac237a1, on both schedulers).

Observed: only src and c run, and then the session stalls with collect never produced.

Expected: the session completes and collect gets [], because the If's only frame axis is empty. Two close relatives also stall on main but complete this way once #9789 is merged: the same graph without the For (A.item → mid → if.true_input), and the literal-condition version with the For.

A variant stalls too, on main and with #9789: A.item additionally feeds c.value, so the condition is per item.

Notes

A fix tried in #9789 broke a shape that main completes, so the stall is documented there as a known limitation instead.

Found during review of #9789.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions