Skip to content

test: migrate stats/incr/covmat to ULP-based assertions - #15342

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

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

Conversation

@kgryte

@kgryte kgryte commented Sep 19, 2026

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

Details:

  • Converted test/test.js. The package has no test/test.native.js, so only a single test file changed.
  • Removed the @stdlib/math/base/special/abs and @stdlib/constants/float64/eps requires, along with the delta/tol declarations and computations, replacing each if ( v === e ) { ... } else { ... } tolerance block with a single t.strictEqual( isAlmostSameValue( v, e, N ), true, 'returns expected value' ); assertion.
  • Final ULP constants: 3 for the two unbiased sample covariance matrix (order) and (covariance matrix) tests, and 0 for the two (means) tests.
  • Measured minimum: the maximum observed ULP difference over the full fixture set of each test was measured directly by instrumenting the comparison loops with @stdlib/number/float64/base/ulp-difference, giving 3, 3, 0, and 0 respectively. Each constant is the tightest possible bound: at 2, the two 3 ULP tests fail (4 assertions), and 0 is the floor for the remaining two, where every value matches the Julia fixtures exactly. The previous relative tolerance was 3.0 * EPS in all four blocks, which is consistent with a 3 ULP bound and was simply looser than necessary for the two (means) tests.
  • The assertion count is unchanged at 212, matching the pre-migration suite, so no test case was dropped or collapsed.
  • The test suite was run twice at the final ULP values to confirm determinism (no FMA/architecture-dependent variation); both runs pass 212/212, as does make test TESTS_FILTER=".*/stats/incr/covmat/.*".
  • Linting is clean: the file passes ESLint using the project's test configuration (etc/eslint/.eslintrc.tests.js) with 0 errors and 0 warnings.
  • No non-test files were modified.

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 authored by Claude Code, which studied previously merged ULP migrations in the same package family (stats/incr/mse, stats/incr/me), applied the same idiom here, and empirically measured and verified the minimum ULP bound for each assertion site.


@stdlib-js/reviewers

🤖 Generated with Claude Code

https://claude.ai/code/session_01Phb6AirZLtqkmNsnamnQya


Generated by Claude Code

Migrate the tests for `stats/incr/covmat` from relative tolerance
(`EPS`-based) assertions to ULP difference assertions using
`@stdlib/assert/is-almost-same-value`.

Ref: #11352

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

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/incr/covmat $\\color{green}432/432$
$\\color{green}+100.00\\%$
$\\color{green}41/41$
$\\color{green}+100.00\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{green}432/432$
$\\color{green}+100.00\\%$

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

Copy link
Copy Markdown
Member

⚠️ Issue Reference Review

An automated check found potentially unrelated issue/PR references in this PR:

Reference Assessment Reasoning
#11352 suspicious Issue #11352 is an RFC explicitly scoped to migrating math/base/special packages from relative-tolerance to ULP-based testing (its own instructions say to search for a package "in math/base/special"). This PR migrates tests for stats/incr/covmat, which is outside the issue's stated scope.

Why this matters: GitHub automatically closes issues referenced with
closing keywords (Resolves, Closes, Fixes) when the PR is merged. Incorrect
references can accidentally close unrelated issues.

What to do:

  • If the reference is correct, no action needed. This check may produce
    false positives.
  • If the reference is incorrect, please update your PR description.

This assessment was generated by an AI model and is informational only.


Generated by Claude Code

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.

4 participants