Skip to content

test_Normalize fails on aarch64/ppc64le/s390x #23707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
QuLogic opened this issue Aug 22, 2022 · 2 comments · Fixed by #23708
Closed

test_Normalize fails on aarch64/ppc64le/s390x #23707

QuLogic opened this issue Aug 22, 2022 · 2 comments · Fixed by #23708
Milestone

Comments

@QuLogic
Copy link
Member

QuLogic commented Aug 22, 2022

# This returns exactly 0.5 when longdouble is extended precision (80-bit),
# but only a value close to it when it is quadruple precision (128-bit).
np.testing.assert_array_almost_equal_nulp(norm(1 + 50 * eps), 0.5)

This seems to be a bit too strict now, as it is failing on aarch64, ppc64le, and s390x, where the result is 0.50096339.

Also, on my 64-bit AMD system, which is apparently using np.float128 for np.longdouble (though I don't know if that means 80-bit internally), it seems to return 0.5 exactly, which seems the opposite of the comment.

Originally posted by @QuLogic in #21634 (comment)

@QuLogic QuLogic added this to the v3.6.0 milestone Aug 22, 2022
@QuLogic
Copy link
Member Author

QuLogic commented Aug 22, 2022

On my (64-bit AMD) system, we have this precision info:

>>> np.finfo(np.longdouble)
finfo(resolution=1e-18, min=-1.189731495357231765e+4932, max=1.189731495357231765e+4932, dtype=float128)

On aarch64, ppc64le, and s390x, it is:

>>> np.finfo(np.longdouble)
finfo(resolution=1e-33, min=-1.189731495357231765085759326628007e+4932, max=1.189731495357231765085759326628007e+4932, dtype=float128)

So I guess that resolution difference explains the comment at least.

But that means the test needs some loosening. However, I'm not sure why the nightly tests precipitated this change, @greglucas.

@QuLogic QuLogic changed the title test_Normalize fails on ppc64le/s390x test_Normalize fails on arch64/ppc64le/s390x Aug 22, 2022
@QuLogic QuLogic changed the title test_Normalize fails on arch64/ppc64le/s390x test_Normalize fails on aarch64/ppc64le/s390x Aug 22, 2022
@greglucas
Copy link
Contributor

I think that the necessary change was above that update and I was updating the area and saw that we were only testing that was between 0 < x < 1 which seemed way too loose to me. So, it seems fine to loosen this back up again if it is causing issues on other platforms.

QuLogic added a commit to QuLogic/matplotlib that referenced this issue Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants