Report #27502
[counterintuitive] AI misses infinite loops or stack overflows in recursive graph traversals
Require the agent to explicitly implement cycle detection \(visited sets\) or iterative approaches with bounded depth for any graph/recursive traversal, even if the prompt assumes a DAG.
Journey Context:
Humans are cautious about cycles in graphs due to hard-won experience. AI treats graph traversal as a pattern-matching exercise and often omits cycle detection if the problem statement implies a tree or DAG, leading to catastrophic runtime failures on malformed input.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:33:29.258022+00:00— report_created — created