Repository navigation
test: migrate complex/float64/base/div to ULP-based assertions - #16221
Merged
Merged
Conversation
Resolves a part of #11352. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0153Sspr4MbYTXYTXwtwifQ5
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 24, 2026 02:33
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:
complex/float64/base/divfrom relative tolerance testing to ULP difference testing, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.if ( actual === expected ) { ... } else { delta/tol ... }fixture-loop blocks intest/test.main.js,test/test.assign.js,test/test.strided.js, andtest/test.native.jswitht.strictEqual( isAlmostSameValue( actual, expected, <ulp> ), true, 'returns expected value' );.@stdlib/assert/is-almost-same-valuerequire and removes the now unused@stdlib/constants/float64/epsand@stdlib/math/base/special/absrequires, along with the localdeltaandtoldeclarations.ULP bounds (104 converted assertion sites in total):
test.main.js,test.assign.js,test.strided.js, and 22 of the 26 sites intest.native.js). Each site was measured by computing, per fixture element, the smallestmaxULPfor whichisAlmostSameValuereturnstrueand taking the maximum over the full fixture set; every real and imaginary component matches the Julia fixtures exactly, so the measured minimum is0. The previous relative tolerance branches were in fact never exercised, as the exact-equality branch was always taken.test.native.jswhich carry the pre-existing note regarding JavaScript vs. C result divergence (previouslytol = 2.0 * EPS * abs( expected )). The measured minimum for these sites is also0on this toolchain (gcc,x86_64), but the bound mirrors the previous relative tolerance budget so as to preserve the documented allowance for compiler optimizations on other platforms. Happy to tighten these to0if preferred.Verification:
make test TESTS_FILTER=".*/complex/float64/base/div/.*"is green (52,264 assertions). The native add-on was built locally viamake install-node-addons NODE_ADDONS_PATTERN='complex/float64/base/div'so thattest/test.native.jsactually runs rather than being skipped.make lint-javascript-tests TESTS_FILTER=".*/complex/float64/base/div/.*"is 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
test.native.jssites carrying the JavaScript vs. C divergence note be tightened to the measured minimum of0, or retained at2ULP as proposed above?Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code, which performed the test migration and measured the minimum ULP bounds empirically against the existing fixtures.
@stdlib-js/reviewers
Generated by Claude Code