test: Do not assert which NaN mean returns - #213
Merged
Conversation
Julia does not specify the sign or payload of a NaN produced by floating-point arithmetic, and LLVM explicitly permits both to vary. RISC-V canonicalizes NaN results from ordinary arithmetic, so the exact-equality assertions fail there even though `mean` correctly returns a NaN (JuliaLang/julia#56672). Check only that the negative-NaN inputs produce a NaN, consistent with the existing positive-NaN coverage. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
maleadt
force-pushed
the
nan-canonicalization
branch
from
September 2, 2026 08:13
11a75cf to
dfd23b6
Compare
Contributor
Author
|
Included a version bump because this matters for Julia Base CI on RISC-V. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #213 +/- ##
=======================================
Coverage 96.43% 96.43%
=======================================
Files 2 2
Lines 449 449
=======================================
Hits 433 433
Misses 16 16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
nalimilan
approved these changes
Sep 2, 2026
Contributor
Author
|
I don't have permissions on here, so I'd appreciate if somebody could merge and tag. |
Member
maleadt
added a commit
to JuliaLang/julia
that referenced
this pull request
Sep 2, 2026
Stdlib: Statistics URL: https://github.com/JuliaStats/Statistics.jl.git Stdlib branch: master Julia branch: tb/statistics_bump Old commit: 1bb9f77 New commit: e7bf7a4 Julia version: 1.14.0-DEV Statistics version: 1.11.5 (Does not match) Diff: JuliaStats/Statistics.jl@1bb9f77...e7bf7a4 ``` $ git log --oneline 1bb9f77..e7bf7a4 e7bf7a4 test: Do not assert which NaN `mean` returns (#213) ``` Picks up JuliaStats/Statistics.jl#213, which stops the tests from asserting which NaN `mean` returns; they failed on RISC-V, where arithmetic yields the canonical NaN. Assisted-by: Claude Code (Fable 5.1)
maleadt
added a commit
to JuliaLang/julia
that referenced
this pull request
Sep 3, 2026
Stdlib: Statistics URL: https://github.com/JuliaStats/Statistics.jl.git Stdlib branch: master Julia branch: tb/statistics_bump Old commit: 1bb9f77 New commit: e7bf7a4 Julia version: 1.14.0-DEV Statistics version: 1.11.5 (Does not match) Diff: JuliaStats/Statistics.jl@1bb9f77...e7bf7a4 ``` $ git log --oneline 1bb9f77..e7bf7a4 e7bf7a4 test: Do not assert which NaN `mean` returns (#213) ``` Picks up JuliaStats/Statistics.jl#213, which stops the tests from asserting which NaN `mean` returns; they failed on RISC-V, where arithmetic yields the canonical NaN. Assisted-by: Claude Code (Fable 5.1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Julia does not specify the sign or payload of a NaN produced by floating-point arithmetic, and LLVM explicitly permits both to vary. RISC-V canonicalizes NaN results from ordinary arithmetic, so the exact-equality assertions fail there even though
meancorrectly returns a NaN (JuliaLang/julia#56672).Check only that the negative-NaN inputs produce a NaN, consistent with the existing positive-NaN coverage.