Repository navigation
test: migrate stats/base/dists/erlang/stdev to ULP-based assertions - #14439
Merged
Merged
Conversation
Ref: #11352 Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019jRBPgcXrkE2Agd5NAdifj
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 20, 2026 10:22
3 of 7 tasks
3 of 7 tasks
5 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.
Description
This pull request:
@stdlib/stats/base/dists/erlang/stdevfrom computed EPS-based relative tolerance assertions to ULP-based assertions using@stdlib/assert/is-almost-same-value, as described in [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.if ( y === expected[i] ) { ... } else { delta/tol ... }idiom intest/test.jsandtest/test.native.jswitht.strictEqual( isAlmostSameValue( y, expected[ i ], 2 ), true, 'returns expected value' );.@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires.Only test files are modified; no implementation changes.
ULP bounds
Both
test/test.jsandtest/test.native.jsuse a bound of 2 ULP, which is the measured minimum over the full Julia fixture set:test/test.js2k = 19,lambda = 18.453885592489083); a bound of1failstest/test.native.js21failsVerification performed:
N = 64, then tightened to the measured minimum by computing, for every fixture value, the smallestNfor whichisAlmostSameValuereturnstrue.N = 1fails in bothtest/test.jsandtest/test.native.js, andN = 2passes.N = 2for both files with identical results (217/217 and 215/215 passing), confirming determinism.make install-node-addons) so thetest.native.jsassertions actually executed rather than being skipped. This is expected, since both implementations computesqrt( k ) / lambdawith a correctly rounded square root and division, leaving no room for FMA-related divergence.eslint(tests configuration) is clean for both 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
Note that
make lint-editorconfig-filescould not be run in this environment, as it attempts to download theeditorconfig-checkerbinary from a GitHub release which is not reachable here. The changed files were instead checked manually for tab indentation, absence of trailing whitespace, LF line endings, UTF-8 encoding, and a final newline.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code running as an unattended task. The test conversion mirrors the idiom already established in previously converted packages (e.g.
stats/base/dists/erlang/skewness), and the ULP bound was determined empirically by measuring the maximum ULP difference across the fixture set.@stdlib-js/reviewers
Generated by Claude Code