Repository navigation
test: migrate stats/base/dists/weibull/logcdf to ULP-based assertions - #14109
Merged
Merged
Conversation
Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NiaAxgddCqSgfcmwYtzNo
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/weibull/logcdffrom relative tolerance testing to ULP difference testing, replacing thedelta/tolcomparisons intest/test.logcdf.js,test/test.factory.js, andtest/test.native.jswithisAlmostSameValue.@stdlib/assert/is-almost-same-valueimport and removes the now unused@stdlib/constants/float64/epsand@stdlib/math/base/special/absimports.Final ULP constant:
0for every fixture group, in all three test files.The ULP bound was tightened by measuring the maximum ULP difference over the full fixture set (3 fixture groups × 1000 values per test file) rather than by guessing: starting from a high bound and bisecting down to the minimum integer which still passes. Both the JavaScript and C implementations reproduce every Julia fixture value exactly, so the measured minimum is
0ULP for all of:both_large1.0*EPSlarge_shape1.0*EPSlarge_scale1.0*EPStest/test.native.jswas verified against a locally compiled add-on (not skipped), so the0ULP bound is measured for the C implementation as well, not merely inherited from the JavaScript results. Each suite was run twice at the final bound to confirm determinism; all assertions pass on every run (test.logcdf.js: 3021,test.factory.js: 3026,test.native.js: 3021,test.js: 3).Only the three test files are changed; the implementation and fixtures are untouched.
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
Opened as a draft pending maintainer review of the
0ULP bound. A bound of0requires bit-for-bit agreement with the fixtures; there is existing precedent for this in the repo (e.g.stats/base/dists/uniform/entropy,math/base/special/covercos,math/base/special/asecall use0for fixture groups which match exactly), and the JavaScript results are deterministic IEEE-754. If maintainers would prefer a1ULP margin intest/test.native.jsas a hedge against compiler/architecture variation in the C build, that is a one-character change.Note: the
editorconfig-checkerstage of the local pre-commit hook could not run in this environment because it downloads its binary from GitHub releases, which was blocked. EditorConfig conformance was instead verified manually for the changed files (LF line endings, UTF-8, tab indentation, no trailing whitespace, final newline present), andmake lint-javascript-testspasses cleanly for the package.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written by Claude Code running as an unattended scheduled task: it selected the package, studied prior conversions in the repo to match the established idiom, applied the test migration, measured the minimum ULP bound empirically, and verified tests and linting locally.
@stdlib-js/reviewers
Generated by Claude Code