test: migrate stats/base/dists/frechet/mean to ULP-based assertions - #14651
Conversation
Migrate the tests for `stats/base/dists/frechet/mean` from relative tolerance assertions to ULP difference assertions using `@stdlib/assert/is-almost-same-value`. Ref: #11352 Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014VYisWJoAMK8fVxSCKwkg6
|
Hello! 👋 We've noticed that you've been opening a number of PRs addressing good first issues. Thank you for your interest and enthusiasm! Now that you've made a few contributions, we suggest no longer working on good first issues. Instead, we encourage you to prioritize cleaning up any PRs which have yet to be merged and then proceed to work on more involved tasks. Not only does this ensure that other new contributors can work on things and get ramped up on all things stdlib, it also ensures that you can spend your time on more challenging problems. 🚀 For ideas for future PRs, feel free to search the codebase for TODOs and FIXMEs and be sure to check out other open issues on the issue tracker. Cheers! |
Coverage Report
The above coverage report was generated for the changes in this PR. |
Resolves a part of #11352.
Description
This pull request:
stats/base/dists/frechet/meanfrom relative-tolerance assertions (delta <= tol, withdelta = abs( y - expected[ i ] )andtol = 2.0 * EPS * abs( expected[ i ] )) to ULP-difference assertions using@stdlib/assert/is-almost-same-value.test/test.jsandtest/test.native.js.NaNparameters, nonpositivealpha, and nonpositives) and theexpected[ i ] !== nullfixture guard.The ULP bound used is:
test/test.jsfixtures/julia/data.json(81 non-nullcases)test/test.native.jsfixtures/julia/data.json(81 non-nullcases)3is the measured minimum: starting fromN = 64and tightening,N = 3passes over the full fixture set whileN = 2fails (one fixture entry,alpha = 3.988247436421993,s = 2.814258823431831, differs from the Julia expected value by exactly 3 ULP). The suite was run twice at the finalNto confirm deterministic passing (96 assertions, all passing on both runs).Because the native add-on is not built in this environment,
test/test.native.jsis skipped locally and its bound could not be measured by running that file directly. Instead, the C implementation was compiled standalone against its resolved C dependency closure (math/base/special/gamma,math/base/assert/is-nan,constants/float64/pinf) and evaluated over all 100 fixture inputs: its results are bit-for-bit identical to the JavaScript implementation for every input, so the same bound of3applies to both files.Linting was checked before and after the change and is unchanged (0 errors; the same 2 pre-existing
@cspell/spellcheckerwarnings for "Fréchet" in the test descriptions, which this PR does not touch). The only files changed are the two test files.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
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code: the assistant mechanically converted the tolerance-based assertions to
isAlmostSameValue, agentically searched for the minimum ULP bound, verified that the C implementation matches the JavaScript implementation bit-for-bit over the fixture set, confirmed determinism across two full runs, and ran the local lint and test suites before submitting.@stdlib-js/reviewers
Generated by Claude Code