PRUNERS / FLiT

A project to quickly detect discrepancies in floating point computation across hardware, compilers, libraries and software.
Other
36 stars 6 forks source link

Bisect is not tested with NaNs and infinity #323

Open mikebentley15 opened 4 years ago

mikebentley15 commented 4 years ago

Bug Report

Describe the problem It is unclear if FLiT Bisect works with NaN and infinity return values. For this reason, we should have automated regression tests. It may be that it is not currently handled correctly.

This is not a fringe feature. Imagine the following user story:

I think it's handled properly, but it might not be. We have actually seen a situation where NaNs were generated from the code. I believe at that point, we checked for NaN in the compare() function and returned a canned 12345 value. But that is a kludge that should be designed away.

Suggested Fix Create an automated test that has NaN as an output from the optimized code. Perhaps this can be added to that already existing FLiT Bisect example. We'd also want to consider NaN as a larger comparison value than any other finite value, because it is such a bad thing in code.

Once we have a test, we can identify if the code does the right thing, and if not, fix it.