Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lower saturating_cast in bounds inference #6970

Merged
merged 3 commits into from
Aug 24, 2022
Merged

Conversation

rootjalex
Copy link
Member

This should revert bounds inference on saturating_cast to the behavior of pre - #6900 .

@steven-johnson could you test to see if this fixes things?

The issues detected were not a direct result of #6900 - before that PR, there was still signed_integer_overflow inside of Bounds.cpp, but it was being hidden by complex Cast handling inside the bounds visitor. @abadams and I are discussing a fix to the underlying issue, but it is incredibly involved and requires possibly using infinite-precision integers in some parts of the compiler.

@steven-johnson
Copy link
Contributor

Should this be applied in addition to #6961, or instead of?

@rootjalex
Copy link
Member Author

Sorry for the lack of clarification - this is instead of #6961

@steven-johnson
Copy link
Contributor

OK, looks like this one is passing -- Let's just insert that fix for OpenGLCompute too; I monkey-patched it for my testing

@steven-johnson steven-johnson self-requested a review August 23, 2022 23:51
Copy link
Contributor

@steven-johnson steven-johnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending the fix to OpenGLCompute as well

@abadams
Copy link
Member

abadams commented Aug 24, 2022

A proper fix seems intractable without getting some sort of repro for the harder failure cases. AJ's earlier attempt at a fix really should have worked.

@abadams
Copy link
Member

abadams commented Aug 24, 2022

Maybe we need a test-case reducer like bugpoint

@steven-johnson
Copy link
Contributor

A proper fix seems intractable without getting some sort of repro for the harder failure cases

I can try to devote more time to the other repro case, but don't rely on it, it may be hard to disentangle

@rootjalex
Copy link
Member Author

LGTM pending the fix to OpenGLCompute as well

Just added.

AJ's earlier attempt at a fix really should have worked.

To clarify for @steven-johnson , Andrew and I both think that 129b464 really should have worked, and cannot figure out what could have changed by #6900 that was not solved by that commit. It's very understandable if you can't disentangle that, but I think looking at that change would probably be easier than looking at the entire #6961 change.

@rootjalex
Copy link
Member Author

The only failure on the buildbots appears unrelated, I think we should merge this in as a temporary fix for now. I've opened #6974 to track the fundamental issue.

@rootjalex rootjalex merged commit 4877b9f into main Aug 24, 2022
@rootjalex rootjalex deleted the rootjalex/fix-sat-overflow2 branch August 24, 2022 16:21
ardier pushed a commit to ardier/Halide-mutation that referenced this pull request Mar 3, 2024
* lower saturating_cast in bounds inference

* openGL fix to saturating_cast
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.

3 participants