Skip to content

test: migrate stats/incr/pcorrmat to ULP-based assertions - #14861

Merged
kgryte merged 1 commit into
developfrom
kgryte/ulp-stats-incr-pcorrmat
Sep 1, 2026
Merged

test: migrate stats/incr/pcorrmat to ULP-based assertions#14861
kgryte merged 1 commit into
developfrom
kgryte/ulp-stats-incr-pcorrmat

Conversation

@kgryte

@kgryte kgryte commented Aug 31, 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/pcorrmat from relative tolerance assertions to ULP-based assertions using @stdlib/assert/is-almost-same-value.
  • replaces the if ( v === e ) { ... } else { delta/tol ... } branches in the four accumulator test cases with t.strictEqual( isAlmostSameValue( v, e, N ), true, 'returns expected value' );.
  • removes the now unused @stdlib/math/base/special/abs and @stdlib/constants/float64/eps requires, along with the delta and tol declarations.

The previous assertions used a 3.0 * EPS * abs( e ) relative tolerance. The ULP bounds below are the minimum values which pass over the full set of fixture values:

Test case ULP
incrementally computes a sample Pearson product-moment correlation matrix (order) 3
incrementally computes a sample Pearson product-moment correlation matrix (correlation matrix) 3
incrementally computes a sample Pearson product-moment correlation matrix (order, means) 1
incrementally computes a sample Pearson product-moment correlation matrix (correlation matrix, means) 1

Minimality was verified by lowering each bound by one ULP and confirming test failures (32 fails; 10 fails). The suite was run twice at the final bounds, with all 212 assertions passing in both runs (make test TESTS_FILTER=".*/stats/incr/pcorrmat/.*"). Only the test file is changed; the package has no test.native.js.

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.

No.

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

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was written by Claude Code, which performed the test migration and empirically determined the minimum ULP bounds.


@stdlib-js/reviewers

@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 Aug 31, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/incr/pcorrmat $\\color{green}545/545$
$\\color{green}+100.00\\%$
$\\color{green}47/47$
$\\color{green}+100.00\\%$
$\\color{green}6/6$
$\\color{green}+100.00\\%$
$\\color{green}545/545$
$\\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 Sep 1, 2026
@kgryte
kgryte marked this pull request as ready for review September 1, 2026 10:03
@kgryte
kgryte requested a review from a team September 1, 2026 10:03
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Sep 1, 2026
@kgryte
kgryte merged commit 5bf9238 into develop Sep 1, 2026
86 checks passed
@kgryte
kgryte deleted the kgryte/ulp-stats-incr-pcorrmat branch September 1, 2026 10:04
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Sep 1, 2026
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. Tests Pull requests specifically adding tests.

3 participants