Repository navigation
test: migrate stats/base/dists/gumbel/median to ULP-based assertions - #14649
Merged
Merged
Conversation
Migrate the JavaScript and native test suites from relative tolerance assertions to ULP difference assertions using `@stdlib/assert/is-almost-same-value`. The measured maximum ULP difference across the fixture set is `0` for both the JavaScript and native implementations, so the tests assert a maximum allowed difference of `0` ULP. Resolves a part of #11352. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M4tVv8pEgy2wh9DZoqWqFp
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
marked this pull request as ready for review
August 26, 2026 10:51
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:
test/test.jsandtest/test.native.jsofstats/base/dists/gumbel/medianfrom relative tolerance (EPS-based) assertions to ULP difference assertions via@stdlib/assert/is-almost-same-value.delta/toltolerance branch (previouslytol = 2.0 * EPS * abs( expected[ i ] )) witht.strictEqual( isAlmostSameValue( y, expected[ i ], 0 ), true, 'returns expected value' ), retaining the existingexpected[ i ] !== nullguard.absandEPSrequires and the correspondingdelta/tolvariable declarations.Final ULP constant:
0, for both the JavaScript and the native test suites.The bound was tightened empirically. Starting from a high value and searching downward via a per-case minimum-ULP computation over the full fixture set (
test/fixtures/julia/data.json, 100 fixture cases), the measured maximum ULP difference is0— every fixture value is reproduced bit-for-bit — so0is the minimum value at which the suites pass.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
make install-node-addons NODE_ADDONS_PATTERN="stats/base/dists/gumbel/median") so thattest/test.native.jsactually executed rather than being skipped; the native implementation also matches the fixtures exactly (max ULP difference0).test.jsand 110/110 intest.native.json both runs.make lint-javascript-tests TESTS_FILTER=".*/stats/base/dists/gumbel/median/.*"is clean.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This pull request was authored by an automated Claude Code agent running as a scheduled task, following the conventions established in previously merged ULP migration pull requests for this issue.
@stdlib-js/reviewers
Generated by Claude Code