spcl / spcl/dace

CodeGen bug: "Variable `LLFALL` has not been defined", even when it is a top-level transient array with a symbolic shape.

Open
#1,735 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
593
Forks
163
Avg merge
2d 23h
Merged PRs (30d)
60

Description

This is the smallest graph that I came up with for demo: https://polybox.ethz.ch/index.php/s/E9QxXiTLjaFfezR

In the JSON file, the `LLFALL` is defined at the top level as follows:
```json
{
"type": "SDFG",
"attributes": {
"name": "loop1_test_function",
"_arrays": {

... truncated ...

"LLFALL": {
"type": "Array",
"attributes": {
"strides": [
"1"
],
"total_size": "NCLV",
"offset": [
"-1"
],
"optional": false,
"shape": [
"NCLV"
],
"transient": true,
"debuginfo": null
}
},

... truncated ...
```

Furthermore:
- While codegen throws the error while processing the state `_state_l15_c15`, if I remove the other branch, the compilation succeeds.
- If I apply simplify on the original graph that I started with, the compilation succeeds too. But it produces C++ code with undefined behaviour. (Not sure if I can reproduce that for this clipped graph, but I think that's not very important since `compile()` should produce correct code for correct graph without any further transforms anyway).

If the input graph is wrong for some reason, please let me know.

Contributor guide

Open the contributing guide

Research direction

Download the linked minimal graph and reproduce the failure during compile() while processing state _state_l15_c15. Compare code generation with and without the other branch, and after simplify, checking the generated C++ for the undefined LLFALL reference and undefined behavior. Done means the correct graph compiles without the variable-definition error and does not introduce incorrect generated code.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
backend, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.