Skip to content

Incomplete check for write-write hazard in state fusion #2267

@edopao

Description

@edopao

Describe the bug
There seems to be a problem in state fusion, related to the check for write-write hazards. This issue results in an SDFG with non-deterministic code generation, depending on the order of execution of different write edges.

To Reproduce
A reproducer is provided in #2256. The SDFG on the left is the start SDFG, provided by the new unit test, the one on the right is the result of state fusion on main:
image

The check for connecting path between two nodes, one in first state and and the other one in second state, is not checking if this is the only path writing to the second node. If other edges write to the node in the second state, state fusion cannot always rely on the sequencing assumption provided by a connecting path.

Solution
The check introduced in #2256 is very conservative, and restricts state fusion to a subset of all valid cases. By only allowing a single writing edge on the second node, this PR blocks state fusion in the durbin_kernel SDFG, which contains two write edges to __return in the second state, but is indeed a valid case:
image

The proper solution requires to check for valid cases, and prohibit state fusion only for real write-write hazards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions