Repository navigation
test: migrate stats/base/dists/f/quantile to ULP-based assertions - #14554
Merged
Merged
Conversation
Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UzWD5xwuqcJFAKukLxoEsZ
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/f/quantilefrom relative tolerance (EPS-scaleddelta <= tol) assertions to ULP difference assertions using@stdlib/assert/is-almost-same-value.Both
test/test.quantile.jsandtest/test.factory.jsare updated. The package has notest/test.native.js. TheabsandEPSimports are no longer needed and have been removed, along with the now unuseddeltaandtollocals. Only test files are changed; no source or fixture changes.Each fixture-driven test block now asserts
The following ULP bounds are used, corresponding to the previous relative tolerances:
cpp/both_large.jsond1andd220.0 * EPS23cpp/large_d1.jsond130.0 * EPS20cpp/large_d2.jsond220.0 * EPS14The same bounds apply to the corresponding
test.factory.jsblocks, as the measured maximum ULP difference is identical for the main and factory code paths.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
The ULP bounds above are the measured minimums over the full fixture sets (1000 values each), determined by computing, for every fixture value and for both the
quantileandfactorycode paths, the smallestNfor whichisAlmostSameValue( actual, expected, N )returnstrue, and taking the maximum over each fixture set. Each bound was confirmed to be tight:N - 1fails for at least one value in the corresponding fixture set (worst-case index 431 forboth_large, 419 forlarge_d1, 429 forlarge_d2).The test suite was run twice at the final bounds; both runs pass identically (3021 assertions in
test.quantile.js, 3024 intest.factory.js), so the bounds are not sensitive to run-to-run nondeterminism on this machine.eslint(usingetc/eslint/.eslintrc.tests.js) reports no problems for either changed file.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code as part of an automated batch migration for #11352. The conversion mirrors the idiom established in previously merged migration PRs (e.g. #14543, #14373), and the ULP bounds were measured empirically as described above rather than guessed.
@stdlib-js/reviewers
Generated by Claude Code