Repository navigation
Conversation
Replace relative tolerance assertions with ULP difference assertions using `@stdlib/assert/is-almost-same-value`. Each assertion uses the minimum ULP bound which passes over the full set of test data. In order for the measured ULP bounds to be reproducible, pin the pseudorandom dataset seed, as previously done in the `stats/incr/mapcorr` and `stats/incr/nanmapcorr` migrations. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018DvFCXoqTpjUSaCsQzyyJB
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
This branch has not been deployed
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/incr/nanmpcorrfrom relative tolerance assertions to ULP difference assertions using@stdlib/assert/is-almost-same-value.delta/tolarithmetic (and the precedingactual === expectedfast paths) witht.strictEqual( isAlmostSameValue( actual, expected, <ulp> ), true, 'returns expected value' );.@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires.randu.seed→123456) so that the measured ULP bounds are reproducible, as previously done forstats/incr/mapcorrandstats/incr/nanmapcorr.Only
test/test.jsis modified; the package implementation is untouched.ULP bounds
Each bound is the measured minimum: the suite fails if the bound is lowered by one.
5.0e5 * EPS * abs( expected )24575.0e5 * EPS * abs( expected )02.0 * EPS * abs( expected )22.0 * EPS * abs( expected )0Bounds were found by starting high and tightening to the minimum passing integer over the full set of test data. The suite was run three times at the final bounds with identical results, and
make eslint-tests TESTS_FILTER=".*/stats/incr/nanmpcorr/.*"reports no lint errors.Related Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352Questions
2457ULP), mirroring the2457bound accepted for the siblingstats/incr/nanmapcorrpackage in test: migratestats/incr/nanmapcorrto ULP-based assertions #16163. Please let me know if a different dataset seed or a tighter budget is preferred.Other
The two bounds of
0are exact matches, soisAlmostSameValuereduces to a SameValue comparison there, which is the minimum permitted value and matches the prior art instats/incr/nanmapcorr.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This pull request was authored by Claude Code running as an unattended scheduled task. Claude selected the package, studied the already-merged migrations for
stats/incr/nanmapcorrandstats/incr/mcovarianceto match the established idiom, applied the test changes, measured the minimum passing ULP bound at each assertion site, and wrote this description.@stdlib-js/reviewers
Generated by Claude Code