Skip to content

test: migrate stats/incr/nanmmeanstdev to ULP-based assertions - #15959

Draft
kgryte wants to merge 1 commit into
developfrom
kgryte/ulp-stats-incr-nanmmeanstdev
Draft

kgryte wants to merge 1 commit into
developfrom
kgryte/ulp-stats-incr-nanmmeanstdev

Conversation

@kgryte

@kgryte kgryte commented Oct 7, 2026

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

  • migrates the tests for stats/incr/nanmmeanstdev from relative tolerance testing to ULP difference testing, replacing the computed delta/tol comparison with isAlmostSameValue.
  • uses a ULP bound of 0 for the converted assertion, which is the measured minimum: the accumulated moving corrected sample standard deviation is bit-for-bit equal to the expected value, so no non-zero ULP budget is required. Starting from a bound of 64 and tightening, 0 is the smallest integer for which the full fixture set passes, and the suite was run twice at 0 to confirm determinism.
  • removes the now unused @stdlib/math/base/special/abs and @stdlib/constants/float64/eps requires from the test file.

Only test/test.js is modified; the package has no test/test.native.js. Existing exact comparisons (e.g., the t.deepEqual fixture checks, the t.strictEqual mean check, and the NaN/null checks) are left untouched.

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.

  • Final ULP constant: 0 (measured minimum). The ULP distance was measured directly via @stdlib/number/float64/base/ulp-difference: the returned mean is 0 ULP from 5.0 and the returned corrected sample standard deviation is 0 ULP from sqrt( 19.0 ).
  • make test TESTS_FILTER=".*/stats/incr/nanmmeanstdev/.*" is green on two consecutive runs, 448/448 assertions passing.
  • make lint-javascript-tests TESTS_FILTER=".*/stats/incr/nanmmeanstdev/.*" is clean.

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 authored by Claude Code running as an unattended scheduled task: it selected the package, performed the test migration, measured the minimum ULP bound, and ran the tests and linter.


@stdlib-js/reviewers

🤖 Generated with Claude Code

https://claude.ai/code/session_013YxL644SUL6UDUhBovNN5d


Generated by Claude Code

Migrate the tests for `stats/incr/nanmmeanstdev` from relative tolerance
testing to ULP difference testing by replacing the computed `delta`/`tol`
comparison with `@stdlib/assert/is-almost-same-value`.

The ULP bound is `0`, which is the measured minimum: the accumulated
moving corrected sample standard deviation is bit-for-bit equal to the
expected value.

Ref: #11352

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013YxL644SUL6UDUhBovNN5d
@stdlib-bot stdlib-bot added Statistics Issue or pull request related to statistical functionality. Good First PR A pull request resolving a Good First Issue. labels Oct 7, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/incr/nanmmeanstdev $\\color{green}144/144$
$\\color{green}+100.00\\%$
$\\color{green}10/10$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}144/144$
$\\color{green}+100.00\\%$

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

This branch has not been deployed

No deployments
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. Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants