Skip to content

Fix memlet propagation out of nested SDFGs#1176

Merged
tbennun merged 3 commits into
masterfrom
nsdfg_memlet_prop_fix
Dec 13, 2022
Merged

Fix memlet propagation out of nested SDFGs#1176
tbennun merged 3 commits into
masterfrom
nsdfg_memlet_prop_fix

Conversation

@phschaad
Copy link
Copy Markdown
Collaborator

@phschaad phschaad commented Dec 8, 2022

Closes #1174.

@phschaad phschaad enabled auto-merge (squash) December 8, 2022 12:50
@phschaad phschaad requested a review from tbennun December 8, 2022 12:50
@tbennun tbennun disabled auto-merge December 13, 2022 00:15
@tbennun tbennun merged commit ed59326 into master Dec 13, 2022
@tbennun tbennun deleted the nsdfg_memlet_prop_fix branch December 13, 2022 00:15
ThrudPrimrose added a commit that referenced this pull request May 20, 2026
validate_state's dimensionality-mismatch check dereferenced
sdfg.arrays[src_node.data].veclen / sdfg.arrays[dst_node.data].veclen
on every edge with other_subset set, assuming both endpoints were
AccessNodes. Any edge whose src/dst is a NestedSDFG / MapEntry /
MapExit / ConsumeEntry / ConsumeExit raised
"AttributeError: 'NestedSDFG' object has no attribute 'data'" because
scope nodes do not expose .data -- they route data via connectors,
and any per-side packing lives on the inner descriptor.

The crash blocked a 2nd/3rd canonicalize() call on the guarded
imperfect-nest repro (a top-level guard above an outer map with a
nested map and an extra-statement tail): the multi-pass pipeline
eventually produces a deeper NSDFG whose inner NSDFG -> MapExit edge
carries both src_subset and dst_subset, and validation aborts before
the pipeline can reach a fixed point.

Fix: read each side's veclen only when its endpoint is an AccessNode;
default to 1 for scope nodes. The two View-exception branches had the
same latent assumption -- guarded them with the same isinstance check.

Closes the canonicalize idempotence crash: with this guard the repro
reaches a stable fixed point (1x->(1,2), 2x=3x=4x=(2,2)) with no
warnings, and the original "_it_X leaks into outer subsets" path is
unaffected (those forms were the intentional WCR running-union
encoding from PR #1176 -- the iterator IS in scope on the inner-out
edge, so the SDFG is well-formed; the only thing missing was a
validator that survives non-AccessNode endpoints).

CORE_BUGFIXES.md: mark #3 (preserve_minima fabrication) as NOT-A-BUG
(intentional WCR semantics); mark #4 (canonicalize idempotence) as
RESOLVED by this fix; add #9 describing the validation guard with the
sweep verification.

Sweep: tests/transformations + tests/canonicalize + propagation +
tests/passes -- 2074 passed, 25 failed (all pre-existing: 5
offset_loop_and_maps TODO-raise, 1 perf_loop_nesting refusal,
1 branch_elimination test-bug, plus environmental cache/import
errors). One fewer failure than baseline (the canonicalize idem path
now survives validation). Zero net regressions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

State propagation fails for multi-dimensional access with sparse dimensions

2 participants