NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/51427: libm issues triggered by py-numpy



>Number:         51427
>Category:       lib
>Synopsis:       libm issues triggered by py-numpy
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 19 18:05:00 +0000 2016
>Originator:     Thomas Klausner
>Release:        NetBSD 7.99.35
>Organization:
Curiosity is the very basis of education and if you tell me that 
curiosity killed the cat, I say only that the cat died nobly.
- Arnold Edinborough
>Environment:
	
	
Architecture: x86_64
Machine: amd64
>Description:
When running the py-numpy tests (current version as of writing this PR 1.11.1)
on NetBSD there are 19 problems, 18 of which upstream claims are libm problems.
>How-To-Repeat:
cd /usr/pkgsrc/math/py-numpy
make test

gives:

======================================================================
FAIL: test_umath.TestComplexFunctions.test_branch_cuts(<ufunc 'sqrt'>, -0.5, 1j, 1, -1, True)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1889, in _check_branch_cut
    assert_(np.all(np.absolute(y0[ji].imag - ym.imag*im_sign) < atol), (y0[ji], ym))
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 75, in assert_
    raise AssertionError(smsg)
AssertionError: (array([ 0.+0.70710678j]), array([ 0.+0.70710678j]))

======================================================================
FAIL: test_umath.TestComplexFunctions.test_branch_cuts(<ufunc 'arcsin'>, [-2, 2], [1j, 1j], 1, -1, True)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1869, in _check_branch_cut
    assert_(np.all(np.absolute(y0.imag - yp.imag) < atol), (y0, yp))
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 75, in assert_
    raise AssertionError(smsg)
AssertionError: (array([-1.57079633+1.3169579j,  1.57079633-1.3169579j]), array([-1.57079633+1.3169579j,  1.57079633+1.3169579j]))

======================================================================
FAIL: test_umath.TestComplexFunctions.test_branch_cuts(<ufunc 'arccos'>, [-2, 2], [1j, 1j], 1, -1, True)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1869, in _check_branch_cut
    assert_(np.all(np.absolute(y0.imag - yp.imag) < atol), (y0, yp))
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 75, in assert_
    raise AssertionError(smsg)
AssertionError: (array([ 3.14159265-1.3169579j,  0.00000000+1.3169579j]), array([  3.14159265e+00-1.3169579j,   2.56239474e-13-1.3169579j]))

======================================================================
FAIL: test_umath.TestComplexFunctions.test_branch_cuts(<ufunc 'arctan'>, [-2j, 2j], [1, 1], -1, 1, True)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1868, in _check_branch_cut
    assert_(np.all(np.absolute(y0.real - yp.real) < atol), (y0, yp))
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 75, in assert_
    raise AssertionError(smsg)
AssertionError: (array([ -1.57079633e+000 -5.49306144e-001j,
         1.79769313e+308 +1.79769313e+308j]), array([ 1.57079633-0.54930614j,  1.57079633+0.54930614j]))

======================================================================
FAIL: test_umath.TestComplexFunctions.test_branch_cuts(<ufunc 'arcsinh'>, [-2j, 2j], [1, 1], -1, 1, True)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1868, in _check_branch_cut
    assert_(np.all(np.absolute(y0.real - yp.real) < atol), (y0, yp))
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 75, in assert_
    raise AssertionError(smsg)
AssertionError: (array([-1.3169579-1.57079633j,  1.3169579+1.57079633j]), array([ 1.3169579-1.57079633j,  1.3169579+1.57079633j]))

======================================================================
FAIL: test_umath.TestComplexFunctions.test_branch_cuts(<ufunc 'arccosh'>, [-1, 0.5], [1j, 1j], 1, -1, True)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1889, in _check_branch_cut
    assert_(np.all(np.absolute(y0[ji].imag - ym.imag*im_sign) < atol), (y0[ji], ym))
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 75, in assert_
    raise AssertionError(smsg)
AssertionError: (array([  0.00000000e+00+3.14159265j,  -1.11022302e-16+1.04719755j]), array([  0.00000000e+00+3.14159265j,  -1.11022302e-16+1.04719755j]))

======================================================================
FAIL: test_umath.TestComplexFunctions.test_branch_cuts(<ufunc 'arctanh'>, [-2, 2], [1j, 1j], 1, -1, True)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1868, in _check_branch_cut
    assert_(np.all(np.absolute(y0.real - yp.real) < atol), (y0, yp))
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 75, in assert_
    raise AssertionError(smsg)
AssertionError: (array([ -5.49306144e-001 -1.57079633e+000j,
         1.79769313e+308 -1.79769313e+308j]), array([-0.54930614+1.57079633j,  0.54930614+1.57079633j]))

======================================================================
FAIL: test_umath.TestComplexFunctions.test_branch_cuts_complex64(<ufunc 'sqrt'>, -0.5, 1j, 1, -1, True, <class 'numpy.complex64'>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1889, in _check_branch_cut
    assert_(np.all(np.absolute(y0[ji].imag - ym.imag*im_sign) < atol), (y0[ji], ym))
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 75, in assert_
    raise AssertionError(smsg)
AssertionError: (array([ 0.+0.70710677j], dtype=complex64), array([ 0.+0.70710677j], dtype=complex64))

======================================================================
FAIL: test_umath.TestComplexFunctions.test_branch_cuts_complex64(<ufunc 'arcsin'>, [-2, 2], [1j, 1j], 1, -1, True, <class 'numpy.complex64'>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1869, in _check_branch_cut
    assert_(np.all(np.absolute(y0.imag - yp.imag) < atol), (y0, yp))
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 75, in assert_
    raise AssertionError(smsg)
AssertionError: (array([-1.57079637+1.31695783j,  1.57079637-1.31695795j], dtype=complex64), array([-1.57078254+1.31695783j,  1.57078254+1.31695783j], dtype=complex64))

======================================================================
FAIL: test_umath.TestComplexFunctions.test_branch_cuts_complex64(<ufunc 'arccos'>, [-2, 2], [1j, 1j], 1, -1, True, <class 'numpy.complex64'>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1869, in _check_branch_cut
    assert_(np.all(np.absolute(y0.imag - yp.imag) < atol), (y0, yp))
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 75, in assert_
    raise AssertionError(smsg)
AssertionError: (array([ 3.14159274-1.31695783j,  0.00000000+1.31695795j], dtype=complex64), array([  3.14157891e+00-1.31695783j,   1.38282776e-05-1.31695783j], dtype=complex64))

======================================================================
FAIL: test_umath.TestComplexFunctions.test_branch_cuts_complex64(<ufunc 'arctan'>, [-2j, 2j], [1, 1], -1, 1, True, <class 'numpy.complex64'>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1868, in _check_branch_cut
    assert_(np.all(np.absolute(y0.real - yp.real) < atol), (y0, yp))
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 75, in assert_
    raise AssertionError(smsg)
AssertionError: (array([ -1.57079625e+00 -5.49306154e-01j,   3.40282347e+38 +3.40282347e+38j], dtype=complex64), array([ 1.57078838-0.54930615j,  1.57078838+0.54930615j], dtype=complex64))

======================================================================
FAIL: test_umath.TestComplexFunctions.test_branch_cuts_complex64(<ufunc 'arcsinh'>, [-2j, 2j], [1, 1], -1, 1, True, <class 'numpy.complex64'>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1868, in _check_branch_cut
    assert_(np.all(np.absolute(y0.real - yp.real) < atol), (y0, yp))
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 75, in assert_
    raise AssertionError(smsg)
AssertionError: (array([-1.31695795-1.57079637j,  1.31695783+1.57079637j], dtype=complex64), array([ 1.31695783-1.57078254j,  1.31695783+1.57078254j], dtype=complex64))

======================================================================
FAIL: test_umath.TestComplexFunctions.test_branch_cuts_complex64(<ufunc 'arccosh'>, [-1, 0.5], [1j, 1j], 1, -1, True, <class 'numpy.complex64'>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1889, in _check_branch_cut
    assert_(np.all(np.absolute(y0[ji].imag - ym.imag*im_sign) < atol), (y0[ji], ym))
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 75, in assert_
    raise AssertionError(smsg)
AssertionError: (array([ 0.+3.14159274j,  0.+1.04719758j], dtype=complex64), array([ 0.+3.14159274j,  0.+1.04719758j], dtype=complex64))

======================================================================
FAIL: test_umath.TestComplexFunctions.test_branch_cuts_complex64(<ufunc 'arctanh'>, [-2, 2], [1j, 1j], 1, -1, True, <class 'numpy.complex64'>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1868, in _check_branch_cut
    assert_(np.all(np.absolute(y0.real - yp.real) < atol), (y0, yp))
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 75, in assert_
    raise AssertionError(smsg)
AssertionError: (array([ -5.49306154e-01 -1.57079625e+00j,   3.40282347e+38 -3.40282347e+38j], dtype=complex64), array([-0.54930615+1.57078838j,  0.54930615+1.57078838j], dtype=complex64))

======================================================================
FAIL: test_umath.TestComplexFunctions.test_loss_of_precision(<class 'numpy.complex64'>,)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1755, in check_loss_of_precision
    check(x_series, 2.1*eps)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1726, in check
    'arcsinh'))
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 75, in assert_
    raise AssertionError(smsg)
AssertionError: (0, 9.9999997e-21, inf, 'arcsinh')

======================================================================
FAIL: test_umath.TestComplexFunctions.test_loss_of_precision(<class 'numpy.complex128'>,)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1755, in check_loss_of_precision
    check(x_series, 2.1*eps)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 1726, in check
    'arcsinh'))
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 75, in assert_
    raise AssertionError(smsg)
AssertionError: (0, 1.0000000000000001e-20, inf, 'arcsinh')

======================================================================
FAIL: test_ldexp_overflow (test_umath.TestLdexp)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/core/tests/test_umath.py", line 750, in test_ldexp_overflow
    assert_equal(ncu.ldexp(2., imax), np.inf)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 367, in assert_equal
    raise AssertionError(msg)
AssertionError:
Items are not equal:
 ACTUAL: 0.0
 DESIRED: inf

======================================================================
FAIL: test_scripts.test_f2py
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/decorators.py", line 147, in skipper_func
    return f(*args, **kwargs)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/tests/test_scripts.py", line 99, in test_f2py
    assert_(success, msg)
  File "/scratch/math/py-numpy/work/.destdir/usr/pkg/lib/python3.5/site-packages/numpy/testing/utils.py", line 75, in assert_
    raise AssertionError(smsg)
AssertionError: Warning: neither f2py nor f2py3 nor f2py3.5 found in path

----------------------------------------------------------------------
Ran 6125 tests in 112.629s

FAILED (KNOWNFAIL=8, SKIP=9, errors=1, failures=18)

The last one is not libm related, the others are according to upstream, see
https://github.com/numpy/numpy/issues/7948

>Fix:
Please!

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index