diamond-recursion deeper scan: CLEAN for pytorch/tensorflow/sklearn/ray/prefect/luigi/numpy
This commit is contained in:
parent
60cd7aa41c
commit
36b07aa1f4
7 changed files with 93 additions and 0 deletions
18
defects/pytorch/pytorch-diamond-recursion-CLEAN.md
Normal file
18
defects/pytorch/pytorch-diamond-recursion-CLEAN.md
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
## Diamond Recursion Scan (pytorch) — CLEAN (deeper scan)
|
||||
|
||||
**Scan date:** 2026-03-29
|
||||
**Pattern:** Recursive cycle/dependency check without visited set (CWE-407 diamond recursion, O(2^D))
|
||||
|
||||
### Files examined
|
||||
|
||||
- `torch/_inductor/scheduler.py:topological_sort_schedule` — uses `seen = OrderedSet()` — CLEAN
|
||||
- `torch/_inductor/memory.py:topological_sort_lpmf` — uses `seen` OrderedSet — CLEAN
|
||||
- `torch/_inductor/memory.py:dfs_visit` — uses `color` dict (WHITE/GRAY/BLACK) — CLEAN
|
||||
- `torch/_inductor/augmented_graph_helper.py:_get_all_ancestors` — iterative with `ancestors` set — CLEAN
|
||||
- `torch/_inductor/fx_passes/overlap_scheduling.py:_collect_node_ancestors` — iterative DP — CLEAN
|
||||
- `torch/_dynamo/graph_deduplication.py:_has_cycle` — delegates to topological sort — CLEAN
|
||||
- `torch/package/_digraph.py` — uses networkx DiGraph — CLEAN
|
||||
- `torch/utils/data/graph.py:traverse_dps` — no DAG traversal without visited — CLEAN
|
||||
- `torch/autograd/` — engine is C++, Python wrappers don't do DAG traversal — CLEAN
|
||||
|
||||
### Verdict: CLEAN — no diamond recursion CWE-407 found beyond existing pytorch-0001..0003
|
||||
Loading…
Add table
Add a link
Reference in a new issue