Skip to content

test: migrate stats/base/snanstdevch to ULP-based assertions - #16070

Closed
Planeshifter wants to merge 1 commit into
developfrom
philipp/ulp-stats-base-snanstdevch
Closed

Planeshifter wants to merge 1 commit into
developfrom
philipp/ulp-stats-base-snanstdevch

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Resolves #{{TODO: add issue number}}.

Description

What is the purpose of this pull request?

This pull request:

  • migrates the tests for stats/base/snanstdevch (test.ndarray.js, test.ndarray.native.js, test.snanstdevch.js, test.snanstdevch.native.js) from EPS-based tolerance checks to ULP-based assertions using @stdlib/number/float32/base/assert/is-almost-same-value.
  • defines a single named constant ULP = 1 in each test file. This is the measured minimum: ULP = 0 fails 2 assertions per file in both the JS and native tests, and ULP = 1 passes all 36 assertions per file. The result was identical across two runs.

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.

Only test files are changed. The idiom mirrors the earlier stats/base/snanstdevyc migration, except that the ULP value is a named constant instead of an inline literal.

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 PR was written primarily by Claude Code as an unattended scheduled task. The ULP bound was found by running the tests at decreasing values.


@stdlib-js/reviewers

🤖 Generated with Claude Code

https://claude.ai/code/session_01AtqS3EoAjWia2i1d1JYGDD


Generated by Claude Code

Ref: #11352

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AtqS3EoAjWia2i1d1JYGDD
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Oct 11, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/snanstdevch $\\color{green}365/365$
$\\color{green}+100.00\\%$
$\\color{green}14/14$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}365/365$
$\\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 Oct 12, 2026
@kgryte
kgryte marked this pull request as ready for review October 12, 2026 00:27
@kgryte
kgryte requested a review from a team October 12, 2026 00:27

@kgryte kgryte left a comment

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.

ULP values need to be inlined.

@kgryte kgryte added the Needs Changes Pull request which needs changes before being merged. label Oct 12, 2026
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Oct 12, 2026
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Oct 12, 2026
@stdlib-bot stdlib-bot added the Merge Conflicts Pull request which has merge conflicts. label Oct 14, 2026
@kgryte kgryte added the autoclose: Already Resolved Pull request which should be auto-closed due proposed changes duplicating already included changes. label Oct 14, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Thank you for working on this pull request. However, we cannot accept your contribution as the issue this pull request seeks to resolve has already been addressed in a different pull request or commit.

Thank you again for your interest in stdlib, and we look forward to reviewing your future contributions.

@stdlib-bot stdlib-bot closed this Oct 14, 2026
@kgryte
kgryte deleted the philipp/ulp-stats-base-snanstdevch branch October 14, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autoclose: Already Resolved Pull request which should be auto-closed due proposed changes duplicating already included changes. Merge Conflicts Pull request which has merge conflicts. Needs Changes Pull request which needs changes before being merged. Statistics Issue or pull request related to statistical functionality. Tests Pull requests specifically adding tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants