Skip to content

test: migrate stats/incr/pcorr2 to ULP-based assertions - #15413

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

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

Conversation

@kgryte

@kgryte kgryte commented Sep 21, 2026

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

Only test/test.js is modified; the package has no test/test.native.js. No implementation, fixture, documentation, or benchmark changes are included.

ULP bounds

Each bound was tightened to the measured minimum over the full set of test cases in its respective test block:

Test ULP Measured minimum
the accumulator function incrementally computes a square sample correlation coefficient 8 8 (worst case at i = 3 and i = 4)
the accumulator function incrementally computes a squared sample correlation coefficient (known means) 3 3 (worst case at i = 1)

Lowering either bound by one (7 and 2, respectively) fails three assertions, so both values are minimal. The suite was run twice at the final bounds, passing 96/96 both times, and eslint against etc/eslint/.eslintrc.tests.js reports no findings.

For reference, the sibling package stats/incr/pcorr (which shares the same input data and expected values, unsquared) settled on 4 and 1; squaring roughly doubles the relative error, which is consistent with the 8 and 3 measured here.

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.

Verified locally with make test TESTS_FILTER=".*/stats/incr/pcorr2/.*".

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 authored by Claude Code, which selected the package, studied already-migrated packages to match the established idiom, performed the migration, and searched for the minimum passing ULP bounds by measurement.


@stdlib-js/reviewers

🤖 Generated with Claude Code

https://claude.ai/code/session_01Nn38mo1ttDvdih4R3d2yTA


Generated by Claude Code

Ref: #11352

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nn38mo1ttDvdih4R3d2yTA
@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 Sep 21, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/incr/pcorr2 $\\color{green}148/148$
$\\color{green}+100.00\\%$
$\\color{green}15/15$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}148/148$
$\\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