`SubgraphFusion` crashes with `IndexError: list index out of range` error on certain graphs.
- Dominant language
- Python
- Stars
- 593
- Forks
- 163
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 60
Description
**Describe the bug**
This came up as I was working with #1673 (i.e. fixing some sub-optimal behaviour of `MapFusion` causes an unrelated test to break through `SubgraphFusion`.
While I'd like to fix it myself already, I cannot tell from the subgraph fusion code what it was _trying_ to do here. So, here is an issue for longer-term tracking. In general, the subgraph fusion code looks quite untested and unmaintained. If that's really the case, is it worth to keep `SubgraphFusion` in the default optimization routine?
**To Reproduce**
Use this SDFG: https://polybox.ethz.ch/index.php/s/pMlKv8jkJ3B1SdR/download?path=%2F&files=nbody-subgraphfusion-bug.sdfg
With the this code:
```python
import dace
from dace import SDFG
from dace.transformation.auto.auto_optimize import auto_optimize
g = SDFG.from_file('nbody-subgraphfusion-bug.sdfg')
g.validate()
auto_optimize(g, device=dace.dtypes.DeviceType.CPU, validate_all=True)
```
**Expected behavior**
It wouldn't crash, and be successful with the fusion.
Contributor guide
Assessment
This issue has not been assessed yet.