Repository navigation
test: migrate stats/base/dists/frechet/logcdf to ULP-based assertions - #14720
Merged
Merged
Conversation
Replace relative tolerance (`EPS`/`delta`/`tol`) assertions with ULP difference assertions using `@stdlib/assert/is-almost-same-value`. The ULP bounds are the measured minimums over the full fixture sets: `large_shape` (24), `large_scale` (2), and `both_large` (20). The JavaScript and C implementations return bit-identical results for every fixture value, so `test/test.native.js` uses the same bounds. Ref: #11352 Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QNXbmetYcbrxtMYbT4hMtS
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/frechet/logcdffrom relative tolerance (EPS/delta/tol) assertions to ULP difference assertions using@stdlib/assert/is-almost-same-value.test/test.logcdf.js,test/test.factory.js, andtest/test.native.js. No other files are changed.The ULP bound was tightened agentically: starting from a high bound and lowering to the minimum integer which still passes over the full fixture set (
large_shape,large_scale,both_large; 1000 cases each, 3000 total per file).Measured minimum ULP bounds:
test/test.logcdf.jslarge_shape24test/test.logcdf.jslarge_scale2test/test.logcdf.jsboth_large20test/test.factory.jslarge_shape24test/test.factory.jslarge_scale2test/test.factory.jsboth_large20test/test.native.jslarge_shape24test/test.native.jslarge_scale2test/test.native.jsboth_large20Each bound is the exact maximum observed ULP difference over its fixture: lowering
24to23fails one assertion,20to19fails one assertion, and2to1fails twenty-nine assertions. The JavaScript and C implementations returned bit-identical results for every fixture value, so the same bounds apply intest/test.native.jsas in the JavaScript tests.For reference, the previous relative tolerances were
20.0 * EPS(large_shape,both_large) and10.0 * EPS(large_scale), which correspond to looser accuracy budgets than the ULP bounds above, so this is a tightening rather than a relaxation.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
test/test.js(3 assertions),test/test.logcdf.js(3025 assertions),test/test.factory.js(3022 assertions), andtest/test.native.js(3025 assertions) all pass. The native add-on was built locally so thattest/test.native.jswas actually exercised rather than skipped.etc/eslint/.eslintrc.tests.js) is clean for all changed files.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, mechanical migration of existing test assertions to ULP-based assertions, following the idiom established in previously merged PRs referencing #11352. The ULP bounds were determined empirically by running the fixtures and minimizing the accepted bound.
@stdlib-js/reviewers
Generated by Claude Code