Skip to content

test: migrate math/base/special/cscd to ULP-based testing - #13664

Draft
Planeshifter wants to merge 1 commit into
developfrom
philipp/ulp-cscd
Draft

test: migrate math/base/special/cscd to ULP-based testing#13664
Planeshifter wants to merge 1 commit into
developfrom
philipp/ulp-cscd

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Summary

Migrates math/base/special/cscd test cases from relative-tolerance (EPS-scaled delta/tol) comparisons to ULP-difference assertions using @stdlib/assert/is-almost-same-value, per the guidance in #11352.

  • test/test.js and test/test.native.js both updated (native tests are currently skipped in this environment as the native add-on could not be built, but mirror the same ULP value as the JS tests).
  • Final ULP constant: ULP = 2 for both the negative-value and positive-value fixture blocks.
  • This was determined empirically: ULP = 1 fails (59 assertion failures), ULP = 2 passes all 2009 assertions, confirmed deterministic across two consecutive runs. A direct computation of the exact ULP distance between actual and expected values over both fixture sets confirms a max distance of 2 ULPs.
  • No other files were changed.

Resolves a part of #11352.


Generated by Claude Code

Replaces relative-tolerance comparisons (EPS-scaled delta/tol) with
`isAlmostSameValue` ULP-difference assertions per #11352. The
tightest passing bound was determined empirically to be 2 ULPs for both
the negative- and positive-value fixture sets, and confirmed
deterministic across repeated runs.
@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 Jul 26, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/cscd $\\color{green}186/186$
$\\color{green}+100.00\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}186/186$
$\\color{green}+100.00\\%$

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

var y;
var i;

ULP = 2;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this variable. Just pass 2 directly to the isAlmostSameValue function. Applies here and for the other updated tests.

@kgryte kgryte added the Tests Pull requests specifically adding tests. label Jul 26, 2026
@kgryte

kgryte commented Jul 26, 2026

Copy link
Copy Markdown
Member

Please address the feedback in the comment above: #13664 (comment)

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.

4 participants