Open rohitkulshreshtha opened 7 months ago
Source available here
Option: require defer_tick()
on all "backwards" edges (higher -> lower stratum number)
Current status: if we have a dataflow edge from a higher-numbered stratum to a lower one, the runtime effectively defers the dataflow until next tick. Unfortunately this hides correctness in our operational semantics and may be confusing for users.
Simple (inadequate) solution: require users to insert a defer_tick
operator between the output of stratum x
and the input of stratum k < x
. The problem with this solution is that they may have a defer_tick
elsewhere in the cycle (say from k+i
to k+i+1
) that already enforces the desired semantics.
Ideal solution: any cycle that spans two strata should be tested for having a defer_tick
anywhere along that cycle. Errors should be omitted only when there is no defer_tick
on the cycle. It makes sense to suggest that the defer_tick
be inserted on the dataflow edge that goes from a higher stratum to a lower one.
in general the bug is only one case, where the cycle thru negation doesn't happen to line up with where we check for missing defer_tick
In the code snippet below, I was expecting a defer_tick to be required at
EXPECTED A DEFER TICK HERE?
, but the code compiles without it. Unclear what the expected behavior is or if this is a bug.Link to mermaid graph