ScalarToSymbolPromotion: replace the `0`-assignment fallback with guard-aware read/write analysis
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 42/100
Research direction
Read the #2712 branch analysis in dace/sdfg/state.py (lines 4333–4373) and the 0 fallback in dace/transformation/passes/scalar_to_symbol.py (lines 879–890). Use the repro and expected behavior in tests/passes/scalar_to_symbol_test.py (lines 902–944) to understand the case. Done when guarded reads are recognized so defined transients stay out of free_symbols, the fallback is removed, and genuinely unassigned reads still warn or remain free.
Written by the indexing model from the issue text.
Description
ScalarToSymbolPromotion: replace the 0-assignment fallback with guard-aware read/write analysis
Is your feature request related to a problem? Please describe.
A transient written and read under the same condition (e.g. if c: s = ... then if c and s > 1: ...) promotes to a free symbol since #2712. #2744 works around this by silently initializing such symbols to 0 in a new start block (scalar_to_symbol.py L879–L890), turning what used to be a loud "Missing program argument" into silent 0-based behavior.
Describe the solution you'd like
Make the #2712 branch analysis (state.py L4333–L4373) guard-aware: if every read of the promoted transient is guarded by a condition that implies the write's guard, treat it as defined and keep it out of free_symbols — then drop the 0 initialization. Genuinely unassigned reads should warn or stay free instead.
Describe alternatives you've considered
Keeping the 0 fallback but emitting a warning when it triggers; requiring the caller to pass the symbol (pre-#2744 behavior that broke working programs).
Additional context
Repro and expected behavior in the #2744 test (tests/passes/scalar_to_symbol_test.py L902–L944). Follow-up agreed in the #2744 review.
- Dominant language
- Python
- Stars
- 602
- Forks
- 171
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 43
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from spcl/dace
-
Difficulty 3/5 Half a day Newbie friendliness 55/100
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Maintainers usually reply within 2 days
-
Operational intensity raises TypeError on any library nodePossibly taken @abhinav-phi claimed this 4 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 2 days
-
Difficulty 4/5 1-2 days Newbie friendliness 48/100
Maintainers usually reply within 2 days
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
software-mansion-labs/Diplomat#20 ·
Maintainers usually reply within 1 day
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPossibly taken @lijy91 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainers usually reply within 1 day
-
View Counts discarded due to field name mismatchPossibly taken @rsiva0400 claimed this today. Opensite-bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Model version publishes the new UK firm entity as a personPossibly taken @vahid-ahmadi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PolicyEngine/policyengine.py#764 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
spcl/HPCAgent-Bench#264 ·
Maintainers usually reply within 1 day