julia icon indicating copy to clipboard operation
julia copied to clipboard

inference: fix too conservative effects for recursive cycles

Open aviatesk opened this issue 1 year ago • 3 comments

The :terminates effect bit must be conservatively tainted unless recursion cycle has been fully resolved. As for other effects, there's no need to taint them at this moment because they will be tainted as we try to resolve the cycle.

  • fixes #52938
  • xref #51092

aviatesk avatar May 01 '24 13:05 aviatesk

Added a TODO comment, and I'm planning to merge this soon.

aviatesk avatar May 23 '24 03:05 aviatesk

How did you end up addressing the correctness problem Keno noted in his review?

vtjnash avatar May 23 '24 04:05 vtjnash

I plan to address that in the future. Practically I don't think any issues will arise with this commit as it is.

aviatesk avatar May 23 '24 06:05 aviatesk

This PR breaks one of the test cases in #49119, but that case might not be very important in reality. That is because if function f calls Core.Compiler.return_type(g, ...), it is likely to actually call g, so if there is a cycle between f and g, :terminates will eventually be tainted anyway. This PR fixes many other broken test cases and actually solves issues in the GPUCompiler stack, so I want to move forward with it once CI succeeds.

aviatesk avatar Jun 04 '24 06:06 aviatesk