test: migrate stats/base/dists/rayleigh/pdf to ULP-based assertions - #14267
Merged
Conversation
Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011WxgQeo8ZNdRy5X9gvUWhG
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
Planeshifter
approved these changes
Aug 14, 2026
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.
Resolves a part of #11352.
Description
This pull request:
stats/base/dists/rayleigh/pdffrom relative tolerance testing (delta <= tol, wheretol = 3.0 * EPS * abs( expected[ i ] )) to ULP difference testing using@stdlib/assert/is-almost-same-value.test/test.pdf.js,test/test.factory.js, andtest/test.native.js. Theexpected[i] !== nullfixture guards are left in place, and no fixtures, implementations, or other test cases were modified.2for every fixture loop (small_scale,medium_scale,large_scale) in all three test files. This is the measured minimum: the maximum observed ULP difference over the full fixture set (1000 values per fixture file, 3000 per test file) is exactly2for the JavaScript implementation, the factory-created function, and the C implementation alike. Tests fail at a bound of1(58 failing assertions) and pass at2, and the full suite was run twice at the final bound to confirm determinism.Test results for the package (per test file):
test/test.pdf.js: 3014 passing, 0 failingtest/test.factory.js: 3014 passing, 0 failingtest/test.native.js: 3014 passing, 0 failing (native add-on built locally, so these did not skip)test/test.js: 3 passing, 0 failingRelated Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352Questions
No.
Other
The JavaScript and C implementations agree on the measured maximum ULP difference (
2), so a single bound is used acrosstest.pdf.js,test.factory.js, andtest.native.js.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code running as an unattended scheduled task. It studied previously merged ULP migrations in the same family (e.g.
stats/base/dists/gamma/pdf,stats/base/dists/laplace/pdf,stats/base/dists/uniform/logpdf) to mirror the established idiom, measured the minimum ULP bound empirically via@stdlib/number/float64/base/ulp-differenceover the full fixture set, and verified the result by running the package test suite.@stdlib-js/reviewers
Generated by Claude Code