Repository navigation
Conversation
Replace computed relative tolerance comparisons with `@stdlib/assert/is-almost-same-value` checks using the minimum required ULP bounds, as measured over the existing R fixtures. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ViMiodafCBgA7gPyrVsJ4p
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/pcorrtesttests from computed relative tolerance comparisons to ULP-based assertions using@stdlib/assert/is-almost-same-value.@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires, along with thedeltaandtollocals.Only
test/test.jsis modified; the package has no native test file, andtest/test.validate.jscontains no tolerance-based assertions.ULP bounds
Each assertion site uses the measured minimum ULP difference (computed via
@stdlib/number/float64/base/ulp-differenceagainst the existing R fixtures, then confirmed to fail atN-1):alternative)pValue1e-6 * abs( expected )167809046statistic10.0 * EPS * abs( expected )0ci[ i ]20.0 * EPS * abs( expected[ i ] )1lesspValue100 * EPS * abs( expected )0lessstatistic10.0 * EPS * abs( expected )0lessci[ i ]10.0 * EPS * abs( expected[ i ] )3greaterpValue100 * EPS * abs( expected )0greaterstatistic10.0 * EPS * abs( expected )2greaterci[ i ]10.0 * EPS * abs( expected[ i ] )3The confidence interval assertions remain inside their existing
forloops, so each loop's bound is the maximum of its two elements (less:ci[0]needs0,ci[1]needs3;greater:ci[0]needs3,ci[1]needs0).The large bound for the two-sided
pValuereflects the pre-existing looseness of that one assertion: the fixture value1.8577967705803216e-9and the computed value1.857796805282419e-9agree to only ~1.9e-8 relative error (the prior tolerance was1e-6relative, i.e. roughly4.5e9ULP), so the migration tightens that assertion by ~27x while remaining honest about the JS/R disagreement at that magnitude.Verification:
make test TESTS_FILTER=".*/stats/pcorrtest/.*"→ 133 assertions passing, 0 failing. Run twice at the final bounds with identical results (no FMA/arch-dependent flakiness).make lint-javascript-tests TESTS_FILTER=".*/stats/pcorrtest/.*"→ clean.Related Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352Questions
ci[0]/ci[1]so that each element can carry its own tighter bound (as instats/ttest2andstats/vartest, whose fixtures expose separatelower/upperfields)? The loop was kept here to minimize the diff.Other
No.
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. The ULP bounds were measured empirically against the existing fixtures and each was confirmed to be the minimum passing integer.
@stdlib-js/reviewers
Generated by Claude Code