test: migrate stats/base/dists/bradford/cdf to ULP-based assertions - #14401
Merged
Conversation
Ref: #11352 Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014Qmdp14mg1MuorqHmJKW1w
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 19, 2026 07:22
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.
Description
This pull request:
stats/base/dists/bradford/cdffrom EPS-scaled relative tolerance comparisons to ULP-based assertions using@stdlib/assert/is-almost-same-value, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires fromtest/test.cdf.js,test/test.factory.js, andtest/test.native.js.Details:
Package converted:
stats/base/dists/bradford/cdf(test/test.cdf.js,test/test.factory.js, andtest/test.native.js;test/test.jscontains no tolerance math and is unchanged).Final ULP constants, one per fixture set, identical across all three test files:
small_c3.0 * EPS4medium_c2.2 * EPS4large_c1.9 * EPS3Measured minimum: starting from a loose bound and tightening, the values above are the smallest integers under which the full 1000-value fixture set passes for each set. Lowering any of them by one produces 4 failures in that fixture set in each test file, so none can be tightened further. Of the 1000 values per set, 644 / 739 / 909 respectively are already bit-for-bit exact.
Determinism: the suite was run twice at the final bounds, with the native add-on compiled locally so
test/test.native.jsactually executed rather than being skipped. Both runs: 3015 / 3018 / 3 / 3015 assertions acrosstest.cdf.js,test.factory.js,test.js, andtest.native.js, all passing.Linting is clean for all three files under
etc/eslint/.eslintrc.tests.js, and the only changed files are the three test files.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 conversion mirrors the idiom already used in the same family (e.g.,
stats/base/dists/negative-binomial/cdf): the fixture loop drops the exact-vs-tolerance branch entirely in favor of a singlet.strictEqual( isAlmostSameValue( y, expected[ i ], N ), true, 'returns expected value' );assertion. Theexpected[i] !== nullguard intest/test.native.jsis left in place.The same bounds apply to
test/test.native.jsbecause the JavaScript and C implementations return bit-identical results at every one of the 3000 fixture points, which was verified directly before choosing the bounds.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code, running unattended as a scheduled task, which selected the package, mirrored the conversion idiom from previously merged conversions, and empirically determined and verified the minimum ULP bounds.
@stdlib-js/reviewers
Generated by Claude Code