test: migrate math/base/special/csignum to ULP-based assertions - #14080
Draft
kgryte wants to merge 1 commit into
Draft
test: migrate math/base/special/csignum to ULP-based assertions#14080kgryte wants to merge 1 commit into
math/base/special/csignum to ULP-based assertions#14080kgryte wants to merge 1 commit into
Conversation
Migrate the `math/base/special/csignum` test suites from computed `EPS`-based relative tolerances to ULP-based assertions using `@stdlib/assert/is-almost-same-value`. Ref: #11352
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.
Progresses #11352.
Description
This pull request:
math/base/special/csignumfrom computedEPS-based relative tolerances to ULP-based assertions using@stdlib/assert/is-almost-same-value, per the idiom described in [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires, along with thedelta/tollocals and theif ( actual === expected ) { ... } else { ... }branching, in bothtest/test.jsandtest/test.native.js.ULP constants
The single Julia fixture block (2003 values × 2 components = 4006 comparisons) was measured directly against
@stdlib/number/float64/base/ulp-difference:test/test.jsdata00test/test.native.jsdata00Measured minimum was
0for both the JavaScript and the native implementation — every fixture value matched bit-for-bit on this machine (linux/x86_64, gcc), including the±0entries, for whichisAlmostSameValuefalls back to SameValue semantics at0ULP. Both files therefore use the measured minimum of0.One note for reviewers: the native path reaches
stdlib_base_hypot(viastdlib_base_cabs), which evaluates1.0 + ( b * b )— an FMA-contraction candidate. That did not produce any divergence here, sotest/test.native.jscarries the measured minimum rather than headroom, but I'm happy to raise the native constant to1(with an explanatoryNOTE, as inmath/base/special/cinv) if reviewers would prefer insulation against architectures where the contraction fires.Related Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352Questions
Yes — see the note above: should
test/test.native.jskeep the measured minimum of0, or carry1ULP of headroom for potential FMA contraction insidehypot?Other
test/test.jsandtest/test.native.jsare modified; no fixtures, source, or documentation changed.node-gyp rebuild) so thattest/test.native.jsactually executed rather than being skipped; the run reports zeroSKIPdirectives. Both suites pass (4018 assertions each), and both were run twice at the final constants with identical results. The locally builtbuild/andsrc/addon.nodeartifacts were removed before committing.eslint --config etc/eslint/.eslintrc.tests.jsreports zero problems for both files.make lint-editorconfig-filescould not run in this environment (theeditorconfig-checkerbinary download is blocked); formatting was instead verified manually against.editorconfig(LF endings, tab indentation, no trailing whitespace, final newline).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 on my account. It surveyed already-merged ULP migrations to match the established idiom, applied the mechanical test conversion, measured the ULP distances empirically, and drafted this description. Opened as a draft pending my own review.
@stdlib-js/reviewers
Generated by Claude Code