Skip to content
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

TST: Fix test_numeric on riscv64 #25618

Merged
merged 1 commit into from Jan 18, 2024

Conversation

charris
Copy link
Member

@charris charris commented Jan 18, 2024

Backport of #25430.

Modify test_numeric so that it passes on riscv64. The subtest TestBoolCmp::test_float currently fails on riscv64 as it assumes that the sign of -np.nan is retained when stored to and read back from an array. This is not always the case on riscv64. Many RISC-V instructions that produce NaNs return a canonical NaN, as defined by the RISC-V specification. The canonical NaNs are always positive. In this particular test the negative sign of the -np.nan is lost when it is converted from a double to a float before being stored in self.signf. We disable the float32 sign tests for -np.nan on riscv64 allowing test_numeric to pass.

Modify test_numeric so that it passes on riscv64.  The subtest
TestBoolCmp::test_float currently fails on riscv64 as it assumes that
the sign of -np.nan is retained when stored to and read back from an
array.  This is not always the case on riscv64.  Many RISC-V
instructions that produce NaNs return a canonical NaN, as defined by
the RISC-V specification. The canonical NaNs are always positive.  In
this particular test the negative sign of the -np.nan is lost when it
is converted from a double to a float before being stored in
self.signf.  We disable the float32 sign tests for -np.nan on
riscv64 allowing test_numeric to pass.
@charris charris added 05 - Testing 08 - Backport Used to tag backport PRs labels Jan 18, 2024
@charris charris added this to the 1.26.4 release milestone Jan 18, 2024
@charris charris merged commit 59c97a0 into numpy:maintenance/1.26.x Jan 18, 2024
60 of 63 checks passed
@charris charris deleted the backport-25430 branch January 18, 2024 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
05 - Testing 08 - Backport Used to tag backport PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants