Repository navigation
Conversation
Replace the relative tolerance comparisons in the `blas/base/dspmv` tests with ULP difference testing via `@stdlib/assert/is-almost-same-value`. The `isApprox` test helper now accepts a maximum allowed ULP difference, and each affected test declares the minimum required ULP value. Across the full fixture set, every returned element matches its expected value exactly, and so the measured minimum ULP bound is zero. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L18jqCswnBquJvPsWGZHnB
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
commented
Oct 14, 2026
kgryte
commented
Oct 14, 2026
Co-authored-by: Athan <kgryte@gmail.com> Signed-off-by: Athan <kgryte@gmail.com>
kgryte
commented
Oct 14, 2026
kgryte
left a comment
Member
Author
There was a problem hiding this comment.
All the ULP values need to be inlined.
This branch has not been deployed
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:
blas/base/dspmvtests from relative tolerance testing to ULP difference testing.isApproxhelper'srtol(relative tolerance) parameter with aulp(maximum allowed ULP difference) parameter, backed by@stdlib/assert/is-almost-same-value, and drops the now unused@stdlib/constants/float64/epsand@stdlib/math/base/special/absrequires.10affected test cases in each oftest/test.dspmv.jsandtest/test.ndarray.js(20call sites in total) to assertt.strictEqual( isAlmostSameValue( actual[ i ], expected[ i ], ulp ), true, 'returns expected value' ).Final ULP constant:
ULP = 0in all20converted test cases.The bound was tightened empirically. Starting from
ULP = 64and stepping down, the suite remains green all the way toULP = 0, which is the floor. Instrumenting the comparison with@stdlib/number/float64/base/ulp-differenceconfirms why: across the complete fixture set (both row-major and column-major fixtures, all stride and offset access patterns), every returned element is bit-for-bit equal to its expected value, so the measured maximum ULP difference is0. No fixture element pairs-0with+0, so the stricter signed-zero semantics ofisAlmostSameValuedo not change any outcome relative to the previousactual[ i ] === expected[ i ]fast path.The full package suite (
make test TESTS_FILTER=".*/blas/base/dspmv/.*") was run twice at the final bound with identical results (97,97, and5passing assertions), confirming the bound is deterministic rather than architecture-dependent. The package has no native tests, so no JS/C divergence applies here.make eslint-tests TESTS_FILTER=".*/blas/base/dspmv/.*"reports the same single pre-existingstdlib/no-empty-lines-between-requireserror thatdevelopalready reports for these files, and no new lint problems. 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
ULPconstant idiom follows the existing converted packages in this family (e.g.,blas/base/drot,blas/base/drotm,blas/base/dzasum), which likewise declarevar ULP;per test case and assign the minimum required value.ULP = 0also matches established precedent, being already used in76converted test files across the repository.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. It selected the package, studied already-converted packages to mirror the project's idiom, applied the migration, measured the minimum ULP bound empirically, and verified tests and linting.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01L18jqCswnBquJvPsWGZHnB
Generated by Claude Code