Repository navigation
test: migrate stats/incr/apcorr to ULP-based assertions - #15978
Merged
Merged
Conversation
Replaces computed relative-tolerance comparisons in the `stats/incr/apcorr` test suite with `@stdlib/assert/is-almost-same-value` ULP-based assertions. The ULP bounds were tightened to the measured minimum which still passes over the full set of test values: 4 ULP for the unknown means test and 1 ULP for the known means test. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015maoYHf9sFNS4w6oCmCo5b
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 11, 2026 12:53
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/incr/apcorrfrom computed relative-tolerance assertions to ULP-based assertions using@stdlib/assert/is-almost-same-value.Specifically, in
test/test.js:@stdlib/assert/is-almost-same-valuerequire and drops the now-unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires.delta/tolvariables and theactual === expected[ i ]branch in the two accumulator fixture loops.t.strictEqual( isAlmostSameValue( actual, expected[ i ], <ULP> ), true, 'returns expected value' );.ULP bounds
Each bound was tightened to the measured minimum integer which still passes over the full set of test values. The minimum was measured per test value, and confirmed by re-running the suite with each bound decremented by one (which fails, 6 assertions):
the accumulator function incrementally computes a sample absolute correlation coefficient3.7 * EPS * abs( expected )4the accumulator function incrementally computes a sample absolute correlation coefficient (known means)EPS * abs( expected )1The suite was run twice at the final bounds to confirm determinism (96 passing, 0 failing on both runs).
No other assertions were changed; the existing exact
t.strictEqualcomparisons (null,0.0,NaN, and the two exactly-reproduced accumulator values) are left as-is, and no non-test files are touched.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=".*/@stdlib/stats/incr/apcorr/.*"→ 96 passing, 0 failing;eslint --config etc/eslint/.eslintrc.tests.json the changed file is clean.lint-editorconfig-filespre-commit step could not run in the authoring environment because theeditorconfig-checkerbinary download was blocked by network policy, so EditorConfig conformance (tabs, LF line endings, no trailing whitespace, final newline) was verified manually instead. CI should be treated as authoritative here.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code, running unattended as a scheduled task. Claude Code studied the already-migrated sibling packages under
stats/incrto mirror the established idiom, applied the mechanical substitution totest/test.js, and determined the minimum passing ULP bounds empirically.@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_015maoYHf9sFNS4w6oCmCo5b
Generated by Claude Code