openexr: Test suite fails with on x86-64 if F16C intrinsics used

Jakub Jelinek points out that Imath/half.h does not guarantee bit-wise identical results for manual conversion and F16C-based conversion. However, testOptimizedInterleavePatterns.cpp expects identical results. This leads to a test failure:

Running testOptimizedInterleavePatterns
Testing SSE optimisation with different interleave patterns (large images) ... 
 0, 0: RGBHalf read as RGBHalf...                            OK OPTIMISED 
 0, 1: RGBHalf read as RGBAHalf...                           OK OPTIMISED 
 0, 2: RGBHalf read as ABGRHalf...                           OK 
 0, 3: RGBHalf read as RGBFloat...                          

error reading back channel B pixel 21,-76 got -nan expected -nan
OpenEXRTest: /builddir/build/BUILD/openexr-3.1.7/src/test/OpenEXRTest/testOptimizedInterleavePatterns.cpp:233: bool {anonymous}::compare(const Imf_3_1::FrameBuffer&, const Imf_3_1::FrameBuffer&, const Imath_3_1::Box2i&, bool): Assertion `writtenHalf.bits()==readHalf.bits()' failed.

Adding some instrumentation, things start going wrong already with the half-to-float conversion:

imath_half_to_float(0xfd26): -nan (0xffa4c000) != -nan (0xffe4c000)

And the value then isn’t round-tripped correctly:

imath_float_to_half(-nan [0xffa4c000]): 0xfd26 != 0xff26

error reading back channel B pixel 21,-76 got -nan (65318) expected -nan (64806)

If canonicalization of NaNs is not desired, OpenEXR cannot use Imath/half.h for conversion.

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 1
  • Comments: 20 (10 by maintainers)

Commits related to this issue

Most upvoted comments

3.2.126 wasn’t a legit release, a test script went haywire and created it by mistake. But I’ll investigate a little further to see if your result here still indicates a problem, thanks.

I don’t care what is it. commit belonging to that version are in repo. That version test suite FAILS. All that is only FTR … and I’m only messenger.