test: migrate stats/incr/pcorrdistmat to ULP-based assertions - #14927
Merged
Conversation
Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B1SNYoWzDxPfm4UmswRuZE
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
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/pcorrdistmatfrom relative tolerance testing to ULP difference testing, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.delta/tol(3.0 * EPS * abs( e )) comparisons intest/test.jswitht.strictEqual( isAlmostSameValue( v, e, N ), true, 'returns expected value' );, adding the@stdlib/assert/is-almost-same-valueimport and removing the now unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsimports.Final ULP constants:
...correlation distance matrix (order)0...correlation distance matrix (distance matrix)0...correlation distance matrix (order, means)1...correlation distance matrix (distance matrix, means)1These are the measured minimums. Starting from a high bound and tightening, the maximum ULP difference over the full set of hard-coded Julia-derived expected values is exactly
0,0,1, and1, respectively. The two unknown-means tests are exact matches (0is the floor), and the two known-means bounds were verified to be minimal: lowering either from1to0produces failing assertions (8 failures in total).The test data is fully deterministic (hard-coded
Float64Arrayinputs, no PRNG), and the suite was run twice at the final bounds with identical results:test/test.js: 212 passing, 0 failingmake lint-javascript-tests TESTS_FILTER=".*/stats/incr/pcorrdistmat/.*"is clean. This package has notest/test.native.js, sotest/test.jsis the only changed file.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 conversion mirrors the sibling package
stats/incr/pcorrmat, which has the same four-block test structure and per-block ULP bounds.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 automated task. The tolerance-to-ULP conversion, the search for the minimum ULP bounds, and the local test/lint verification were all performed by Claude Code.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01B1SNYoWzDxPfm4UmswRuZE
Generated by Claude Code