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
- Readdress #1456: disallow NaNs in testOptimizedInterleavePatterns unless both writing and reading as half Signed-off-by: Peter Hillman <peterh@wetafx.co.nz> — committed to peterhillman/openexr by peterhillman a year ago
- Readdress #1456: disallow NaNs in testOptimizedInterleavePatterns ... (#1490) * Readdress #1456: disallow NaNs in testOptimizedInterleavePatterns unless both writing and reading as half Signed-off... — committed to AcademySoftwareFoundation/openexr by peterhillman a year ago
- Readdress #1456: disallow NaNs in testOptimizedInterleavePatterns ... (#1490) * Readdress #1456: disallow NaNs in testOptimizedInterleavePatterns unless both writing and reading as half Signed-off-b... — committed to cary-ilm/openexr by peterhillman a year ago
- Readdress #1456: disallow NaNs in testOptimizedInterleavePatterns ... (#1490) * Readdress #1456: disallow NaNs in testOptimizedInterleavePatterns unless both writing and reading as half Signed-off-b... — committed to AcademySoftwareFoundation/openexr by peterhillman a year ago
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.