-
Notifications
You must be signed in to change notification settings - Fork 166
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
C and interpreter test results do not match for this module. #1998
Comments
This looks like a bug in the tracking of size parameters in a complex case. Here is a simpler program that still produces different results with the interpreter and compiler:
Since the same type checker is used in both cases, the difference must lie in one of the frontend passes. It is the interpreter that produces the correct result. |
Yes, it is clear that monomorphisation cannot figure out which size argument to pass to |
@catvayor Do you have time to take a look at this? You're the last one to touch this code I think. Something nonobvious is going wrong in |
Note: sorry for the code snippet not being more concise, I was not able to shorten it anymore.
How to replicate the error
The following code results in the problem.
The module creates an array with a given size which is used as a bitset. To compute the complement I not every element in the array and I remove the leading bits using
set_front_bits_zero
. The test creates a full bitset and asserts that it matches the capacity of the bitset.When I test it using the c backend
futhark test --no-terminal error.fut
, I get the test result.While using the interpreter
futhark test --no-terminal -i error.fut
result in1/1 passed.
.I believe the problem arises at
set_front_bits_zero
, it ends up setting every bit 0 at the last index. Instead of only setting the bits that are not used to 0.Version
The text was updated successfully, but these errors were encountered: