Skip to content

stree: consider read-after-write when calculating input_memlets of tree nodes#2419

Open
romanc wants to merge 2 commits into
spcl:mainfrom
romanc:romanc/stree-input-memlets-raw
Open

stree: consider read-after-write when calculating input_memlets of tree nodes#2419
romanc wants to merge 2 commits into
spcl:mainfrom
romanc:romanc/stree-input-memlets-raw

Conversation

@romanc

@romanc romanc commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Every tree node has functions to calculate input and output memlets of that node. Tree scopes have a default implementation to gather all inputs/outputs of their children. That default implementation for scopes didn't consider read after write (within the same scope). This caused "too many inputs" to be returned, which - in turn - caused the dependency analysis of the state boundary inserter to generate wrong results, which - in the end - generated wrong SDFGs from a given schedule tree.

This PR changes the default implementation of _gather_memlets_in_scope() to account for read-after-write memlets and adds a test.

This PR is part of a series of commits to bring back the fixes from the June push (i.e. #2364) into main as clean commits with test cases.

romanc added 2 commits July 2, 2026 09:59
Every tree node has functions to calculate input and output memlets (of
that node). Tree scopes have a default implementation to gather all
inputs/outputs of their children. That default implementation for scopes
didn't consider read after write (within the same scope). This caused "too
many inputs" to be returned, which - in turn - caused the dependency
analysis of the state boundary inserter to generate wrong results. This
could lead to **missing** state boundaries. We saw write/write races in
D2A2C_Vect of pyFV3.
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.

1 participant