Skip to content

test: migrate stats/incr/mmpe to ULP-based assertions - #14931

Merged
kgryte merged 1 commit into
developfrom
kgryte/ulp-mmpe
Sep 4, 2026
Merged

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

Conversation

@kgryte

@kgryte kgryte commented Sep 3, 2026

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

Details:

  • test/test.js is the only test file in the package containing computed-tolerance assertions; no test.native.js exists.
  • Replaced the abs/EPS delta <= tol comparison (and the associated delta/tol locals and requires) with t.strictEqual( isAlmostSameValue( actual, expected[i], N ), true, 'returns expected value' );.
  • The package contains a single computed-tolerance assertion, whose ULP bound was tightened to the measured minimum by starting from N = 64 and lowering N until the smallest integer which still passes across every fixture value:
    • the accumulator function computes a moving mean percentage error incrementally: 1 ULP (passes at 1; fails at 0 with 3 failing assertions; previous tolerance was 1.0 * EPS).
  • The suite was run twice at the final bound to confirm determinism: 98/98 passing on both runs.
  • make lint-javascript-tests TESTS_FILTER=".*/stats/incr/mmpe/.*" is clean, and the only changed file is lib/node_modules/@stdlib/stats/incr/mmpe/test/test.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 authored by Claude Code, which studied prior ULP migrations in this repository (including the sibling package stats/incr/mpe), applied the same idiom here, and empirically searched for the minimum passing ULP bound.


@stdlib-js/reviewers

🤖 Generated with Claude Code

https://claude.ai/code/session_01AmuE4qxqzr54jsqv5pq1rk


Generated by Claude Code

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

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/incr/mmpe $\\color{green}142/142$
$\\color{green}+100.00\\%$
$\\color{green}8/8$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}142/142$
$\\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 4, 2026
@kgryte
kgryte marked this pull request as ready for review September 4, 2026 05:09
@kgryte
kgryte requested a review from a team September 4, 2026 05:09
@kgryte
kgryte merged commit 69005b6 into develop Sep 4, 2026
66 checks passed
@kgryte
kgryte deleted the kgryte/ulp-mmpe branch September 4, 2026 05:10
@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. and removed Needs Review A pull request which needs code review. labels Sep 4, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants