FLiT icon indicating copy to clipboard operation
FLiT copied to clipboard

Bisect is not tested with NaNs and infinity

Open mikebentley15 opened this issue 5 years ago • 0 comments

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:

  • Dan has code he wants to test with FLiT.
  • He has found when he compiles with -O3, he gets NaN values.
  • He uses FLiT Bisect to find out which function is causing the divergence (not necessarily where the NaN is generated)

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.

mikebentley15 avatar Feb 26 '20 20:02 mikebentley15