32. Keep loops and nested calls bounded
The runner stops one graph after 4096 visited nodes. It also yields a frame every 64 visited nodes and rejects graph nesting at depth 24. These limits keep a broken graph from running forever, but they do not make an unbounded design correct.
| Limit / behavior | Practical consequence |
|---|---|
| 4096 node visits | Repeated visits count. A loop body of several nodes consumes several steps per iteration. |
| Yield every 64 visits | The editor/game can get a frame during heavy graph work. This is not a cinematic delay. |
| Nesting depth 24 | A graph calling another graph repeatedly, or calling itself, must have a proper stop condition. |
| Loop body back-edge | A missing return wire prevents repetition. |
| Shared index/result variables | Two overlapping calls can overwrite the same runtime destination. |
1. Use a small count while building a loop.
2. Test zero, one and several iterations.
3. Check the exit path and its cleanup.
4. Keep long-running polling loops slow enough to observe and easy to stop.
5. For large data processing or complex algorithms, consider a text helper with a narrow parameter/result contract.
If the log says the graph stopped after 4096 steps, repair the graph. Increasing delays or hiding the message does not fix the route that keeps repeating.
