Repository navigation
Conversation
Migrate the tests for `stats/incr/nanmapcorr` from relative tolerance testing to ULP difference testing using `@stdlib/assert/is-almost-same-value`. Each ULP bound is tightened to the minimum integer which still passes over the full set of test cases. Additionally, switch the simulated datasets from the global PRNG seed (`randu.seed`) to a fixed seed (`123456`), as is required in order for a tightened ULP bound to be deterministic. This mirrors the already migrated `stats/incr/mapcorr`, which is the non-NaN analog of this package. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M1KYLesBsrREWPeaXVwgZ2
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/nanmapcorrfrom relative tolerance testing to ULP difference testing, replacing the computeddelta/tolcomparisons with@stdlib/assert/is-almost-same-value, following the idiom established in the already migratedstats/incr/mapcorr(the non-NaN analog of this package) andstats/incr/mpcorr.randu.seed) to a fixed seed (123456), which is required in order for a tightened ULP bound to be deterministic. This mirrorsstats/incr/mapcorr,stats/incr/mpcorr, andstats/incr/mpcorr2, which all use the same fixed seed.Files changed (tests only):
test/test.jsTests which already performed exact comparisons (
t.equalonnull,0, andNaNchecks viaisnan) were left untouched, as were theisnan( expected )branches guarding the NaN-skipping behavior.Measured ULP bounds
Each bound was tightened to the minimum integer that still passes over the full set of expected values in the corresponding test. The minima were measured programmatically (per-case ULP difference, maximized over the test's cases), and minimality was verified mechanically: decrementing a non-zero bound by one produces test failures.
Related Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352Questions
The change from
randu.seedto the fixed seed123456is strictly speaking beyond a mechanical tolerance-to-ULP substitution, but without it the datasets differ on every run and no tight ULP bound can be stated or relied upon. The already mergedstats/incr/mapcorr,stats/incr/mpcorr, andstats/incr/mpcorr2made the same change as part of their migrations, so this follows precedent; please flag if a different seed is preferred.Other
make test TESTS_FILTER=".*/stats/incr/nanmapcorr/.*"is green (2254 assertions passing). The suite was run twice at the final ULP values to confirm determinism.make lint-javascript-tests TESTS_FILTER=".*/stats/incr/nanmapcorr/.*"is clean.test/test.native.js.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code. The ULP bounds were measured programmatically rather than guessed, and each non-zero bound was verified to be minimal by confirming that one less ULP fails.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01M1KYLesBsrREWPeaXVwgZ2
Generated by Claude Code