-
Notifications
You must be signed in to change notification settings - Fork 51
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
Find counter-examples without nan
while performing diffbehavior
#325
Comments
Ah. Yes, I agree with your assessment. I've got a few options for handling this, but will need to do some experimentation. The case you mention is easy to handle, but more generally we need to be able to detect nans that are nested inside containers and other objects, so it's not as easy a fix as you might expect. More soon. |
I agree that this is a very trivial example. I also tried patching PreciseIeeeSymbolicFloat, to make nans equal, but that didn't fully work. |
Good catch!
Ha, you are in the weeds already! Yeah, first, concrete NaNs could still be generated and returned, so patching the symbolics is insufficient, and second, we don't want to universally change the NaN equality behavior, because that may be important for correctly analyzing user code - we only want to change the behavior when comparing the returns (and arguments) for diff_behavior. I spent some time today investigating a fully correct implementation, and ... it's difficult. It looks like many equality checks are done at the C level - |
I've released an initial revision addressing this in v0.0.79! |
Awesome! Thank you |
While performing
diffbehavior
with float arguments, crosshair finds some funny counter-examples.Crosshair reports a counter-example while comparing the below functions:
Crosshair output:
This is happening because python itself treats
nan
to be unequal.The text was updated successfully, but these errors were encountered: