Repository navigation
test: migrate stats/base/dists/planck/variance to ULP-based assertions - #15794
Merged
Merged
Conversation
Migrates unit tests from relative tolerance checks (`delta <= tol`) to ULP-based assertions using `@stdlib/assert/is-almost-same-value`. The measured maximum ULP difference over the 1000-element Python fixture set is 1, so the assertions use a bound of 1 ULP, which is the tightest integer bound which passes (a bound of 0 fails 103 of the 1000 cases). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017VFfQViBwsnjm37sqzyMF6
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:
@stdlib/stats/base/dists/planck/variancefrom relative tolerance checks (delta <= tol) to ULP-based assertions using@stdlib/assert/is-almost-same-value.The converted assertions use a bound of 1 ULP in both
test/test.jsandtest/test.native.js:1 ULP is the measured minimum. The bound was tightened empirically, starting from 64 and walking down over the full 1000-element Python fixture set (
64, 32, 16, 8, 4, 2, 1all pass;0fails 103 of the 1000 cases). Independently computingulpDifference( y, expected[ i ] )across the fixtures gives a maximum of1, attained atlambda = 13.503035075315534. The suite was run twice at the final bound to confirm determinism (no FMA/arch variability); both runs reported 1005/1005 passing.Only the two test files are changed; no source, documentation, or fixture files were touched. The native tests skip in this environment, as the C addon is not built locally, so the 1 ULP bound for
test.native.jsmirrors the JavaScript result and the convention already established by the converted sibling packages (planck/mean,planck/stdev,planck/cdf).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
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written entirely by Claude Code, running unattended as a scheduled task. Claude selected the package, studied the idiom used by already-converted sibling packages, performed the conversion, and determined the minimum ULP bound empirically.
@stdlib-js/reviewers
Generated by Claude Code