Repository navigation
test: migrate stats/incr/nanmae to ULP-based assertions - #15646
Conversation
Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D7SkX5Q68aKkZLrkpMaQ7v
|
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/nanmaefrom relative tolerance testing to ULP difference testing, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.@stdlib/constants/float64/epsimport with@stdlib/assert/is-almost-same-value, removes thedelta/tolscratch variables, and collapses the exact/within-tolerance branches into a singlet.strictEqual( isAlmostSameValue( actual, expected, 0 ), true, 'returns expected value' );assertion.Final ULP constant: 0.
This is the measured minimum. Starting from
64, the bound was lowered until the smallest integer which still passes over the full set of test values was found;0passes, and0is the floor. Every accumulated value exercised by the fixture (1.0,4.5,6.0) is exactly representable, so the accumulator reproduces the expected value bit-for-bit and no slack is required. The bound is not vacuous:isAlmostSameValue( 6.0, 6.0 + 2**-50, 0 )returnsfalse, so a one-ULP regression would still fail the suite.The suite was run twice at the final ULP value to confirm determinism (11 passing, 0 failing on both runs). There is no
test.native.jsfor this package, sotest/test.jsis the only file changed.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
stats/incr/maape(test: migratestats/incr/maapeto ULP-based assertions #15628), which likewise uses an inline ULP literal of0for its incremental accumulator loop.make test TESTS_FILTER=".*/stats/incr/nanmae/.*"passes (11/11) andmake lint-javascript-tests TESTS_FILTER=".*/stats/incr/nanmae/.*"is clean.make lint-editorconfig-filescould not run in this environment because theeditorconfig-checkerbinary download was blocked by network policy. The changed file was verified manually against.editorconfiginstead: LF line endings, UTF-8, tab indentation, no trailing whitespace, and a final newline.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 selected the package, mirrored the conversion idiom from already-merged ULP migration commits, searched for the minimum passing ULP bound by running the suite at decreasing values, and wrote this description. Opened as a draft for human review.
@stdlib-js/reviewers
Generated by Claude Code