Repository navigation
test: migrate stats/base/dists/beta/quantile to ULP-based assertions - #14710
Merged
Merged
Conversation
Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014Cv2JMqyGWr6vf5Yd2aGyH
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
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/base/dists/beta/quantilefrom relative tolerance testing (delta <= tol, wheretol = 20.0 * EPS * abs( expected )) to ULP difference testing using@stdlib/assert/is-almost-same-value.if ( y === expected[i] ) { ... } else { ... }tolerance branches witht.strictEqual( isAlmostSameValue( y, expected[ i ], N ), true, 'returns expected value' );.@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires, along with thedeltaandtolvariable declarations.Only
test/test.quantile.jsandtest/test.factory.jsare modified; the package has notest/test.native.js.test/test.jswas left untouched, as it contains no tolerance-based assertions.ULP bounds
Each fixture set is asserted against the measured minimum ULP bound for that fixture set, and the same bound is used for the corresponding test in both
test.quantile.jsandtest.factory.js:both_large.json1818(fails at17)large_alpha.json99(fails at8)large_beta.json2929(fails at28)The bounds were determined by starting from a high ULP value and lowering to the smallest integer which still passes over the full fixture set (1000 values per fixture). Decrementing any of the three bounds by one causes failures (1, 3, and 1 assertions, respectively), confirming the bounds are tight. The full suite was run twice at the final values with identical results (
3023+3021+3assertions passing, no 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
No.
Other
Verification performed locally:
make test TESTS_FILTER=".*/stats/base/dists/beta/quantile/.*"— passing (run twice).etc/eslint/.eslintrc.tests.js— 0 errors, 0 warnings.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, mirroring the idiom established by previously merged ULP migration PRs. The ULP bounds were measured empirically, and the tests and linter were run locally.
@stdlib-js/reviewers
Generated by Claude Code