Repository navigation
test: migrate stats/fligner-test to ULP-based assertions - #14908
Merged
Merged
Conversation
Migrate the tests for `stats/fligner-test` from relative tolerance assertions to ULP-based assertions. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LBvGJrk19aLUPaxjUULWkE
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 |
kgryte
marked this pull request as ready for review
September 3, 2026 03:03
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/fligner-testfrom relative tolerance assertions to ULP-based assertions, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.delta/tolcomputations (previously20.0 * EPS * abs( expected )for both the p-value and the test statistic) intest/test.jswitht.strictEqual( isAlmostSameValue( actual, expected, N ), true, 'returns expected value' );.@stdlib/assert/is-almost-same-valuerequire and drops the now unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires.Only
test/test.jsis changed; the implementation, fixtures, and documentation are untouched.test/test.validate.jsis unchanged, as it contains no tolerance-based assertions. The package has notest/test.native.js, as it has no C implementation.Measured ULP bounds (both assertions are against the R reference fixtures in
test/fixtures/r/fixtures.json):out.pValuevsfixtures.pValue11out.statisticvsfixtures.statistic9Each bound was tightened by measuring the ULP difference between the returned value and the expected value. Starting from a loose bound of
64and lowering it, the values above are the minimum integers at which each assertion passes: re-running at10and8, respectively, fails both assertions.Verification performed:
test/test.js: 61/61 assertions passing.test/test.validate.js: 30/30 assertions passing (unchanged).etc/eslint/.eslintrc.tests.js, and license-header lint clean.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
The previous relative tolerance (
20 * EPS) corresponded to roughly 25 ULP for the p-value and roughly 23 ULP for the test statistic at those magnitudes, so the migration tightens the accuracy budget for both assertions. The residual difference from the R reference values reflects accumulated rounding in the Fligner-Killeen rank/normal-score computation and the chi-square upper-tail evaluation, and is deterministic for the pure JavaScript implementation.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code as part of an automated batch migration of tolerance-based tests to ULP-based assertions. The ULP bounds were determined empirically by measuring ULP differences against the reference fixtures and confirming the test suites pass deterministically at the minimum values.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01LBvGJrk19aLUPaxjUULWkE
Generated by Claude Code