Skip to content

Conversation

@vksnk
Copy link
Member

@vksnk vksnk commented Aug 27, 2025

This is adressing a following error which we started to get after updating Halide internally:

“Error: Min of (uint16)lerp((uint16)0, uint16((max(min((float32)scale_fine, 1.000000f), 0.000000f)*16384.000000f) + 0.500000f), (uint8)mask_im(x, y)) should have been a scalar of type uint16: (uint8)0” 

I think the issue is that when handle_const_arg_call returns false, the Call visitor just exits instead of hitting the else branch. This is problematic, because handle_const_arg_call will visit each of the arguments and each of their visitors will set interval, so in the end interval will be set to the interval of the last argument of the Call. In this case, it has a different type causing the error above.

@vksnk vksnk requested a review from abadams August 27, 2025 00:25
@vksnk
Copy link
Member Author

vksnk commented Aug 27, 2025

I think there are many unrelated test failures, but the failed correctness_bounds_of_pure_intrinsics on halide-testbranch-main-llvm_main-x86-64-windows-cmake does seem to be relevant. It fails on every target (host, host-cuda, host-opencl, etc) in that run, not sure what's wrong with it? Maybe this is because the test now needs too much stack?

@abadams
Copy link
Member

abadams commented Aug 27, 2025

Merged with main to see if I can get some of the unrelated failures to go away

@abadams abadams merged commit 0653b82 into main Aug 29, 2025
16 of 19 checks passed
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