Conversation
…rtions Replace relative tolerance comparisons with `isAlmostSameValue` ULP difference assertions, using the minimum required ULP value. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QG7gEdBDDNd41avDBtd3ge
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
Member
|
An automated check found potentially unrelated issue/PR references in this PR:
Why this matters: GitHub automatically closes issues referenced with What to do:
This assessment was generated by an AI model and is informational only. Generated by Claude Code |
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/geometric/skewnessfrom relative tolerance testing to ULP difference testing, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.y === expected[i]/delta <= tolbranch in the Julia fixture loops oftest/test.jsandtest/test.native.jswitht.strictEqual( isAlmostSameValue( y, expected[ i ], 0 ), true, 'returns expected value' );.@stdlib/assert/is-almost-same-valuerequire and drops the now unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires.Final ULP constant:
0(used in bothtest/test.jsandtest/test.native.js).This is the measured minimum. The bound was found by measuring the per-fixture ULP difference with
@stdlib/number/float64/base/ulp-differenceacross the full 1000-element Julia fixture set: the largest observed difference is0, i.e., every returned value is bit-identical to its expected value, so no smaller bound exists. Starting from a high bound and lowering it therefore terminates at0. The suite was run twice at the final value with identical results (1007/1007 passing), so there is no FMA/arch variation here.A bound of
0is consistent with already-migrated sibling packages whose fixtures also match exactly — e.g.stats/base/dists/binomial/kurtosis(a464e88), which likewise migrated toisAlmostSameValue( y, expected[ i ], 0 )in both its JS and native test files. The implementation is a single expression,( 2.0-p ) / sqrt( 1.0-p ), andsrc/main.cevaluates the identical expression with the same operation order, so the native add-on is expected to return the same values; the same bound is therefore used in the native test file.Only the two test files are changed.
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
make test TESTS_FILTER=".*/stats/base/dists/geometric/skewness/.*"→ 1007 passing, 0 failing fortest/test.js;test/test.native.jsskips, as the native add-on is not built in this environment. Run twice at the final ULP value to confirm determinism.make install-node-modulesfails here becausees-object-atoms@^1.1.2is not published (the reachable registry has at most1.1.1). This is a pre-existing dependency-resolution failure unrelated to this change; the dependency tree was installed with that transitive version pinned to1.1.1so that the project's ownmake testand ESLint configuration could be used.editorconfig-checkerstep could not execute (its binary is downloaded from GitHub releases, which is unavailable here); both files were verified manually against.editorconfig(LF line endings, UTF-8, tab indentation, no trailing whitespace, 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 scheduled task. Claude studied #11352 and the already-migrated sibling packages to mirror the established idiom, applied the migration, and determined the ULP bound empirically by measuring the per-fixture ULP difference rather than guessing it.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01QG7gEdBDDNd41avDBtd3ge
Generated by Claude Code