Skip to content

TST: Fix test_numeric on riscv64#25618

Merged
charris merged 1 commit intonumpy:maintenance/1.26.xfrom
charris:backport-25430
Jan 18, 2024
Merged

TST: Fix test_numeric on riscv64#25618
charris merged 1 commit intonumpy:maintenance/1.26.xfrom
charris:backport-25430

Conversation

@charris
Copy link
Copy Markdown
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
@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.

2 participants