Repository navigation
test: migrate stats/strided/dsemtk to ULP-based assertions - #15619
Merged
Merged
Conversation
Replaces the relative-tolerance (EPS-based) floating-point comparisons in the test suite with `isAlmostSameValue` ULP-difference checks, per the migration described in #11352. The minimum ULP tolerance was determined empirically (starting at a high value and lowering until failures occurred): ULP=0 fails, ULP=1 passes deterministically across repeated runs, so ULP=1 is used. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GfhKkXU78VTa7ZEDFn21v7
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
approved these changes
Sep 28, 2026
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/strided/dsemtkfrom relative-tolerance (EPS-based) floating-point comparisons to ULP-difference based assertions using@stdlib/assert/is-almost-same-value, per the tracking issue [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.test/test.dsemtk.js,test/test.dsemtk.native.js,test/test.ndarray.js, andtest/test.ndarray.native.js. Each file had two floating-point comparisons using the olddelta <= tolidiom (tol = 1.0 * EPS * abs( expected )), which are nowt.strictEqual( isAlmostSameValue( v, expected, 1 ), true, 'returns expected value' ).absandEPSrequires (and thedelta/tollocal variable declarations) from each test file.t.strictEqual/isnanchecks) were touched, consistent with the migration guidance in [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.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
Final ULP constant:
1(measured minimum;0fails,1passes deterministically across repeated runs). No named ULP constant was introduced, matching the pattern already used in this package family's converted tests (e.g.stats/strided/dsem,stats/strided/dsempn), which pass the literal ULP value directly toisAlmostSameValue.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written by Claude Code, which studied prior-art conversions in the same package family (
stats/strided/dsem,stats/strided/dsempn) and the tracking issue #11352 before authoring the change, and empirically determined the minimum ULP tolerance by running the test suite.@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01GfhKkXU78VTa7ZEDFn21v7
Generated by Claude Code