Repository navigation
test: migrate stats/incr/nanmpcorr2 to ULP-based assertions - #16123
Conversation
Replaces relative tolerance comparisons (`5.0e5 * EPS * abs( expected )`) with `@stdlib/assert/is-almost-same-value` ULP difference assertions. Each ULP bound was tightened to the measured minimum which still passes over the full fixture set. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H1a4NdkAZ2r2TeEPDzDx6Z
|
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/incr/nanmpcorr2from relative tolerance testing to ULP difference testing.delta = abs( actual - expected ); tol = 5.0e5 * EPS * abs( expected );comparisons withisAlmostSameValue( actual, expected, <ULP> )assertions, adding the@stdlib/assert/is-almost-same-valuerequire and dropping the now unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires.Only
test/test.jsis modified; the package has notest/test.native.js.ULP bounds
Each bound was found by measuring the maximum observed ULP difference over the full fixture set and was verified to be the minimum passing integer (decrementing any one of them fails the suite):
The larger bounds for the first two tests are consistent with the already migrated sibling package
stats/incr/mpcorr2(10425 and 3415), which exercises the same windowed accumulator over the same seeded datasets.The test data is generated from a seeded PRNG, and the suite was run twice at the final bounds with identical results (2254 assertions, all passing).
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
Linting the modified file reports the same set of findings before and after this change (all pre-existing and in untouched regions), so no new lint issues are introduced.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code, which performed the migration, measured the minimum ULP bounds empirically, and verified the test suite.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01H1a4NdkAZ2r2TeEPDzDx6Z
Generated by Claude Code