Repository navigation
test: migrate stats/base/dists/geometric/kurtosis to ULP-based assertions - #15915
Merged
Merged
Conversation
…rtions Replace relative tolerance comparisons with `isAlmostSameValue` ULP difference assertions in both the JavaScript and native test suites. The measured minimum ULP bound over the full 1000-element Julia fixture set is `0` for both the JavaScript and C implementations. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UKXg9xt5vVqACoGUcUUVdh
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
marked this pull request as ready for review
October 12, 2026 12:56
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:
stats/base/dists/geometric/kurtosisfrom relative tolerance testing to ULP difference testing, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.Changes are confined to
test/test.jsandtest/test.native.js:@stdlib/assert/is-almost-same-valueimport.@stdlib/math/base/special/absand@stdlib/constants/float64/epsimports, along with thedeltaandtollocals.y === expected[i]/t.ok( delta <= tol, ... )branch witht.strictEqual( isAlmostSameValue( y, expected[ i ], 0 ), true, 'returns expected value' );.ULP bound:
0(bothtest/test.jsandtest/test.native.js).This is the measured minimum. Over the full 1000-element
test/fixtures/julia/data.jsonset, the maximum ULP difference between the returned value and the expected value is0for both the JavaScript and the C implementation — i.e. both implementations reproduce the fixtures bit-for-bit, so no ULP slack is required. Starting from a loose bound and tightening,0is the smallest integer that passes, and0is also the floor, so no further tightening is possible.Verification performed:
make test TESTS_FILTER=".*/stats/base/dists/geometric/kurtosis/.*"— 1007 passing, 0 failing, fortest.jsand fortest.native.js. The native add-on was compiled locally so thattest.native.jsactually executed rather than being skipped.src/main.c) against the fixtures outside of the test harness, compiled both at-O2and at-O3 -march=native -ffp-contract=fast; output was bit-identical in both cases and0ULP from the fixtures.make lint-javascript-tests TESTS_FILTER=".*/stats/base/dists/geometric/kurtosis/.*"— clean.Related Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.Questions
No.
Other
Because the JavaScript and C implementations agree exactly here (identical expression,
6.0 + ( ( p*p ) / ( 1.0-p ) ), with no fusable multiply-add), both test files use the same bound of0; the JS-vs-C divergence handling described in the FAQ was not needed.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written by Claude Code, running unattended as a scheduled task. It mirrored the idiom from previously merged conversions in this family (e.g. #15801, #15799) and determined the ULP bound empirically as described above.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01UKXg9xt5vVqACoGUcUUVdh
Generated by Claude Code