Repository navigation
test: migrate stats/base/dists/binomial/skewness to ULP-based assertions - #15427
Merged
Merged
Conversation
…tions Replace relative tolerance assertions with ULP difference assertions via `@stdlib/assert/is-almost-same-value` in both the JavaScript and native test suites. The ULP bound was tightened to the measured minimum of `2` over the full Julia fixture set for both implementations. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LLbKJQpVk4hTAzm9CC4zmr
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
marked this pull request as ready for review
September 23, 2026 06:25
4 of 7 tasks
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/binomial/skewnessfrom relative tolerance assertions to ULP difference assertions using@stdlib/assert/is-almost-same-value.test/test.jsandtest/test.native.js, replacing thedelta/tolcomparison against2.0 * EPS * abs( expected[i] )witht.strictEqual( isAlmostSameValue( y, expected[ i ], 2 ), true, 'returns expected value' );and dropping the now-unusedabsandEPSrequires.ULP bound
The ULP constant for both test files is
2, which is the measured minimum over the full Julia fixture set (200 cases):N = 0N = 1N = 2The JavaScript and C implementations return bit-identical results for all 200 fixture cases, so a single bound applies to both test files. The worst case is
n = 41,p = 0.21346557492605323, where the returned value0.21841983899845177differs from the expected0.21841983899845172by 2 ULP.The native addon was compiled locally so that
test/test.native.jsexecuted against the C implementation rather than being skipped. The suite was run twice atN = 2to confirm determinism (423 passing assertions across both test files on each run, 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
Only the two test files are changed.
make test TESTS_FILTER=".*/stats/base/dists/binomial/skewness/.*"is green, and both files lint cleanly underetc/eslint/.eslintrc.tests.js. The EditorConfig linter could not be run in this environment because its binary could not be downloaded, so EditorConfig compliance (LF line endings, UTF-8, tab indentation, no trailing whitespace, final newline) was verified manually instead.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written primarily by Claude Code, which also measured the minimum ULP bound empirically against the fixture set and ran the test suite.
@stdlib-js/reviewers
Generated by Claude Code