Skip to content

test: migrate math/base/special/cflipsignf to ULP-based assertions - #14414

Merged
kgryte merged 1 commit into
developfrom
kgryte/ulp-cflipsignf
Aug 20, 2026
Merged

test: migrate math/base/special/cflipsignf to ULP-based assertions#14414
kgryte merged 1 commit into
developfrom
kgryte/ulp-cflipsignf

Conversation

@kgryte

@kgryte kgryte commented Aug 19, 2026

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

  • migrates test/test.js and test/test.native.js of math/base/special/cflipsignf from relative-tolerance (EPS-based) assertions to ULP-difference assertions via @stdlib/number/float32/base/assert/is-almost-same-value, following the precedent of previously merged single-precision complex packages (e.g., math/base/special/csignumf, math/base/special/cinvf).
  • removes the delta/tol computations, along with the now unused absf and EPS requires, and replaces the exact/tolerance branch in the fixture loop with t.strictEqual( isAlmostSameValue( ..., 1 ), true, 'returns expected value' ) for the real and imaginary components.
  • uses a minimum required ULP value of 1 for both the JavaScript and native implementations. The value was measured by computing, for every fixture pair in test/fixtures/julia/data.json (2003 cases; 4006 component assertions), the smallest ULP argument for which isAlmostSameValue returns true, and taking the maximum. The measured minimum is 1; at 0, 4000 of the 4006 component assertions fail (with maxULP = 0, the assertion reduces to exact SameValue equality against the double-precision fixture values), so 1 cannot be tightened further.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

  • The native add-on was built locally (make install-node-addons NODE_ADDONS_PATTERN=math/base/special/cflipsignf) so that test/test.native.js was actually exercised rather than skipped, and the native implementation was independently confirmed to require the same minimum of 1 ULP.
  • make test TESTS_FILTER=".*/math/base/special/cflipsignf/.*" was run twice at the final ULP value to confirm determinism: 4038/4038 assertions passing in test/test.js and 4038/4038 in test/test.native.js on both runs.
  • ESLint is clean for both changed files using the project's test configuration (etc/eslint/.eslintrc.tests.js).
  • No files other than the two test files were changed. The remaining assertions in these files (signed zeros, infinities, NaN) were exact comparisons already and are left untouched.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

This pull request was authored by an automated Claude Code agent running as a scheduled task, mirroring the conventions established in prior merged ULP-migration pull requests for #11352.


@stdlib-js/reviewers


Generated by Claude Code

@stdlib-bot stdlib-bot added Math Issue or pull request specific to math functionality. Good First PR A pull request resolving a Good First Issue. labels Aug 19, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/cflipsignf $\\color{green}149/149$
$\\color{green}+100.00\\%$
$\\color{green}7/7$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}149/149$
$\\color{green}+100.00\\%$

The above coverage report was generated for the changes in this PR.

@kgryte kgryte added the Tests Pull requests specifically adding tests. label Aug 20, 2026
@kgryte
kgryte marked this pull request as ready for review August 20, 2026 01:55
@kgryte
kgryte requested a review from a team August 20, 2026 01:56
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 20, 2026
@kgryte
kgryte merged commit f7a98db into develop Aug 20, 2026
82 checks passed
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Aug 20, 2026
@kgryte
kgryte deleted the kgryte/ulp-cflipsignf branch August 20, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Good First PR A pull request resolving a Good First Issue. Math Issue or pull request specific to math functionality. Tests Pull requests specifically adding tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants