Imath icon indicating copy to clipboard operation
Imath copied to clipboard

Test failure on Fedora i686

Open hobbes1069 opened this issue 4 years ago • 18 comments

Interestingly the arm 32 bit build passes and all 64 bit platforms pass, but on i686 I get the following:

24/36 Test #20: Imath.testFun ...........................Subprocess aborted***Exception:   0.09 sec
Testing functions in ImathFun.h
floor
ceil
trunc
divs / mods
divp / modp
successor, predecessor
f 0
sf 1.40129846e-45
pf -1.40129846e-45
spf -0
psf 0
f -0
sf 1.40129846e-45
pf -1.40129846e-45
spf -0
psf 0
f 1
sf 1.00000012
pf 0.99999994
spf 1
psf 1
f -1
sf -0.99999994
pf -1.00000012
spf -1
psf -1
f 16
sf 16.0000019
pf 15.999999
spf 16
psf 16
f 7
sf 7.00000048
pf 6.99999952
spf 7
psf 7
f 0.699999988
sf 0.700000048
pf 0.699999928
spf 0.699999988
psf 0.699999988
f inf
sf inf
pf inf
spf inf
psf inf
f -inf
sf -inf
pf -inf
spf -inf
psf -inf
f nan
sf nan
pf nan
spf nan
psf nan
ImathTest: /builddir/build/BUILD/Imath-3.0.2/src/ImathTest/testFun.cpp:70: void testf(float, bool): Assertion `bit_cast<unsigned> (pf) == bit_cast<unsigned> (f)' failed.

Full log here: https://kojipkgs.fedoraproject.org//work/tasks/9350/68939350/build.log

hobbes1069 avatar May 29 '21 02:05 hobbes1069

32 bits test are failing here too with for example:

ImathTest: /home/elrick/Temp/Imath/src/ImathTest/testInterval.cpp:189: void {anonymous}::testExtendByPoint(const char*) [with T = float]: Assertion `b.min == min && b.max == max' failed.

Is 32 bits i686 supported at all? I'm just a packager and I'd like to know if it's worth building the 32 bits version.

patlefort avatar Sep 03 '21 01:09 patlefort

Well for Fedora there are discussions about limiting 32bit support. Currently there is no installer for 32bit but some libraries are maintained for programs that are not available for 64bit, like Steam. While that particular one doesn't apply here it's hard to make assumptions on what 3rd party software end users need.

hobbes1069 avatar Sep 03 '21 01:09 hobbes1069

It appears the NaN isn't being detected correctly by predf(). Maybe it would be safer to use isinff(f) || isnanf(f) here and here. I wonder if this is related to AcademySoftwareFoundation/openexr#346. Compiling with -ffloat-store may also fix this.

peterhillman avatar Sep 03 '21 03:09 peterhillman

An explicit isnan and isinf would get my vote.

meshula avatar Sep 05 '21 17:09 meshula

Does #209 fix it?

cary-ilm avatar Sep 07 '21 17:09 cary-ilm

Hmm... no change for me.

hobbes1069 avatar Sep 07 '21 19:09 hobbes1069

That's a head-scratcher. I just pushed another commit to #209 with some extra debugging info. @hobbes1069, could you try it again, and post the contents of LastTest.log? Thanks.

cary-ilm avatar Sep 07 '21 20:09 cary-ilm

Trying now. I was surprised as well, I triple checked that the patch was being applied in the spec file.

hobbes1069 avatar Sep 07 '21 22:09 hobbes1069

Hopefully this helps but it doesn't look any different.

https://hobbes1069.fedorapeople.org/LastTest.log

hobbes1069 avatar Sep 07 '21 23:09 hobbes1069

That does provide some clues, although it is quite strange. Both predf(0x7f800001) and succf(0x7f800001) return 0x7fc00001.

cary-ilm avatar Sep 08 '21 00:09 cary-ilm

That's a great clue Cary. The successor and predecessor of NAN is NAN. 0x7f800001 is a signaling NAN, and 0x7fc00001 is a Quiet NAN. (c.f. https://developer.arm.com/documentation/dui0475/g/BABFGDBH) An implementation is allowed to convert a signaling nan to a quiet nan, if signaling nans are not supported, and that seems to be what's happening here. (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1011.htm). The standards committee recommended, in that document, not supporting signaling nans in language implementations, and also recommended a macro to indicate if they are supported.

meshula avatar Sep 08 '21 06:09 meshula

OK, this is almost certainly a mistaken assumption in the test, assuming that the bits don't change when in fact, the system may convert the signalling NaN to a quiet NaN by simply copying the value. I pushed another commit that changes the test to simply confirm that if isnan(f), then isnan(sf) and isnan(pf), which seems to validate the behavior even if the bits are different.

@hobbes1069, could you try it again? And thanks for your patience in doing the testing.

cary-ilm avatar Sep 08 '21 14:09 cary-ilm

So we need unit tests for the unit tests? :)

Still bombed, I just pushed the file to the same link above.

hobbes1069 avatar Sep 08 '21 15:09 hobbes1069

Gah, it made it past the float tests but failed on the doubles because I made a copy/paste typo between testf() and testd(). Can you try it once more?

cary-ilm avatar Sep 08 '21 18:09 cary-ilm

Completed!

hobbes1069 avatar Sep 08 '21 18:09 hobbes1069

I put some further debugging info in there to better understand what's happening, could you repost the LastTest.log? Thanks again.

cary-ilm avatar Sep 08 '21 18:09 cary-ilm

Re-uploaded.

hobbes1069 avatar Sep 08 '21 18:09 hobbes1069

I can confirm that the following tests are failling on i686 (void-linux here):

The following tests FAILED:
          1 - PyImath.PyImathTest_Python3 (Failed)
         18 - Imath.testMatrix (Subprocess aborted)
         23 - Imath.testInterval (Subprocess aborted)
         32 - Imath.testBoxAlgo (Subprocess aborted)
         33 - Imath.testBox (Subprocess aborted)

Test1:

Running testV2Array
V2iArray
ok
V2fArray
Traceback (most recent call last):
  File "/builddir/Imath-3.1.5/src/python/PyImathTest/pyImathTest.in", line 10137, in <module>
    test[1]()
  File "/builddir/Imath-3.1.5/src/python/PyImathTest/pyImathTest.in", line 2619, in testV2Array
    testV2xArray (V2fArray, V2f, FloatArray)
  File "/builddir/Imath-3.1.5/src/python/PyImathTest/pyImathTest.in", line 2588, in testV2xArray
    assert (l[0] == v0.length())
AssertionError
18/38 Test #18: Imath.testMatrix ........................Subprocess aborted***Exception:   0.00 sec
Testing functions in ImathMatrix.h
Imath::M22f constructors and equality operators
M22d constructors and equality operators
M22f inversion operators
ImathTest: /builddir/Imath-3.1.5/src/ImathTest/testMatrix.cpp:116: void testMatrix(): Assertion `m3 == m2' failed.
32/38 Test #32: Imath.testBoxAlgo .......................Subprocess aborted***Exception:   2.35 sec
Testing box algorithms
  ray-box entry and exit, random rays
    box = ((-1 -1 -1) (1 1 1))
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((10 20 30) (1010 21 31))
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((10 20 30) (11 1020 31))
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((10 20 30) (11 21 1030))
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((-1e+10 -2e+10 -3e+10) (5e+15 6e+15 7e+15))
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((1 1 1) (2 1 1))
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((1 1 1) (1 2 1))
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((1 1 1) (1 1 2))
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((1 1 1) (1 2 3))
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((1 1 1) (2 3 1))
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((1 1 1) (2 1 3))
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((-1 -2 1) (-1 -2 1))
    single-point box, ray intersects
    single-point box, ray does not intersect
    box = ((1 1 1) (1 1 1))
    single-point box, ray intersects
    single-point box, ray does not intersect
    box = ((0 0 0) (0 0 0))
    single-point box, ray intersects
    single-point box, ray does not intersect
    empty box, no rays intersect
  ray-box entry and exit, nearly axis-parallel rays
    dir ~ (1 0 0), result = 1
    dir ~ (-1 0 0), result = 1
    dir ~ (1 0 0), result = 0
    dir ~ (-1 0 0), result = 0
    dir ~ (0 1 0), result = 1
    dir ~ (0 -1 0), result = 1
    dir ~ (0 1 0), result = 0
    dir ~ (0 -1 0), result = 0
    dir ~ (0 0 1), result = 1
    dir ~ (0 0 -1), result = 1
    dir ~ (0 0 1), result = 0
    dir ~ (0 0 -1), result = 0
  ray-box intersection, random rays
    box = ((-1 -1 -1) (1 1 1))
    ray starts inside box
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((10 20 30) (1010 21 31))
    ray starts inside box
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((10 20 30) (11 1020 31))
    ray starts inside box
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((10 20 30) (11 21 1030))
    ray starts inside box
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((-1e+10 -2e+10 -3e+10) (5e+15 6e+15 7e+15))
    ray starts inside box
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((1 1 1) (2 1 1))
    ray starts inside box
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((1 1 1) (1 2 1))
    ray starts inside box
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((1 1 1) (1 1 2))
    ray starts inside box
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((1 1 1) (1 2 3))
    ray starts inside box
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((1 1 1) (2 3 1))
    ray starts inside box
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((1 1 1) (2 1 3))
    ray starts inside box
    ray starts outside box, intersects
    ray starts outside box, does not intersect
    box = ((-1 -2 1) (-1 -2 1))
    single-point box, ray intersects
    single-point box, ray does not intersect
    box = ((1 1 1) (1 1 1))
    single-point box, ray intersects
    single-point box, ray does not intersect
    box = ((0 0 0) (0 0 0))
    single-point box, ray intersects
    single-point box, ray does not intersect
    empty box, no rays intersect
  ray-box intersection, nearly axis-parallel rays
    dir ~ (1 0 0), result = 1
    dir ~ (-1 0 0), result = 1
    dir ~ (1 0 0), result = 0
    dir ~ (-1 0 0), result = 0
    dir ~ (0 1 0), result = 1
    dir ~ (0 -1 0), result = 1
    dir ~ (0 1 0), result = 0
    dir ~ (0 -1 0), result = 0
    dir ~ (0 0 1), result = 1
    dir ~ (0 0 -1), result = 1
    dir ~ (0 0 1), result = 0
    dir ~ (0 0 -1), result = 0
  transform box by matrix
ImathTest: /builddir/Imath-3.1.5/src/ImathTest/testBoxAlgo.cpp:816: void {anonymous}::boxMatrixTransform(): Assertion `b21 == b2' failed.

      Start 33: Imath.testBox
33/38 Test #33: Imath.testBox ...........................Subprocess aborted***Exception:   0.00 sec
Testing box methods
    constructors for type V2s
    constructors for type V2i
    constructors for type V2i64
    constructors for type V2f
    constructors for type V2d
    constructors for type V3s
    constructors for type V3i
    constructors for type V3i64
    constructors for type V3f
    constructors for type V3d
    constructors for type V4s
    constructors for type V4i
    constructors for type V4i64
    constructors for type V4f
    constructors for type V4d
    makeEmpty() for type V2s
    makeEmpty() for type V2i
    makeEmpty() for type V2i64
    makeEmpty() for type V2f
    makeEmpty() for type V2d
    makeEmpty() for type V3s
    makeEmpty() for type V3i
    makeEmpty() for type V3i64
    makeEmpty() for type V3f
    makeEmpty() for type V3d
    makeEmpty() for type V4s
    makeEmpty() for type V4i
    makeEmpty() for type V4i64
    makeEmpty() for type V4f
    makeEmpty() for type V4d
    makeInfinite() for type V2s
    makeInfinite() for type V2i
    makeInfinite() for type V2i64
    makeInfinite() for type V2f
    makeInfinite() for type V2d
    makeInfinite() for type V3s
    makeInfinite() for type V3i
    makeInfinite() for type V3i64
    makeInfinite() for type V3f
    makeInfinite() for type V3d
    makeInfinite() for type V4s
    makeInfinite() for type V4i
    makeInfinite() for type V4i64
    makeInfinite() for type V4f
    makeInfinite() for type V4d
    extendBy() point for type V2s
    extendBy() point for type V2i
    extendBy() point for type V2i64
    extendBy() point for type V2f
ImathTest: /builddir/Imath-3.1.5/src/ImathTest/testBox.cpp:257: void {anonymous}::testExtendByPoint(const char*) [with T = Imath_3_1::Vec2<float>]: Assertion `b.min == min && b.max == max' failed.

motorto avatar Oct 18 '22 09:10 motorto