test: migrate stats/base/dists/frechet/stdev to ULP-based assertions - #15163
Merged
Conversation
Replace relative tolerance assertions with `isAlmostSameValue` ULP comparisons. The measured minimum ULP bound over the full Julia fixture set is 12 for both the JavaScript and native implementations. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVM4G3stpWkuj632fLHnYP
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
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/frechet/stdevfrom relative tolerance testing to ULP difference testing.delta/tolcomputations intest/test.jsandtest/test.native.jswitht.strictEqual( isAlmostSameValue( y, expected[ i ], 12 ), true, 'returns expected value' );.@stdlib/assert/is-almost-same-valueimport and removes the now unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsimports.The ULP bound was tightened to the measured minimum:
test/test.js12nullfixture cases is exactly 12; the suite fails at11(1 failing assertion) and passes at12.test/test.native.js12The previous assertions used a relative tolerance of
10.0 * EPS, which is consistent with the measured 12 ULP bound.Related 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
Verification notes:
test/test.jspasses (83/83 assertions), and the suite was run twice at the final ULP value to confirm determinism.number/float64/base/ulp-differencebetween the returned values and the Julia fixture values for every fixture case, and confirmed empirically by running the suite at11(fails) and12(passes).test/test.native.jsskips. To bound the native ULP value,src/main.cand its transitive C dependencies were compiled into a standalone harness and evaluated over the same fixture set at-O0,-O2, and-O3. In all three cases the C results were bit-for-bit identical to the JavaScript results and the maximum ULP difference versus the fixtures was 12, so no FMA/optimization-level sensitivity was observed.etc/eslint/.eslintrc.tests.js(0 errors). The only warnings are pre-existing@cspell"Unknown word: échet" warnings on the unchanged test description strings.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code. The test migration mirrors the idiom established in the already-merged conversion for the sibling package
stats/base/dists/frechet/median(#15123), and the ULP bound was measured rather than guessed.@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01NVM4G3stpWkuj632fLHnYP
Generated by Claude Code