Skip to content

test: Do not assert which NaN mean returns - #213

Merged
nalimilan merged 1 commit into
JuliaStats:masterfrom
maleadt:nan-canonicalization
Sep 2, 2026
Merged

test: Do not assert which NaN mean returns#213
nalimilan merged 1 commit into
JuliaStats:masterfrom
maleadt:nan-canonicalization

Conversation

@maleadt

@maleadt maleadt commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

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.

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
maleadt force-pushed the nan-canonicalization branch from 11a75cf to dfd23b6 Compare September 2, 2026 08:13
@maleadt

maleadt commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Included a version bump because this matters for Julia Base CI on RISC-V.

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.43%. Comparing base (1bb9f77) to head (dfd23b6).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maleadt

maleadt commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

I don't have permissions on here, so I'd appreciate if somebody could merge and tag.

@nalimilan
nalimilan merged commit e7bf7a4 into JuliaStats:master Sep 2, 2026
18 checks passed
@nalimilan

Copy link
Copy Markdown
Member

Done: JuliaRegistries/General#166901

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)
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 this pull request may close these issues.

2 participants