FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: migrate `stats/base/dists/betaprime/kurtosis` to ULP-based assertions by kgryte · Pull Request #14750 · stdlib-js/stdlib · GitHub

test: migrate stats/base/dists/betaprime/kurtosis to ULP-based assertions - #14750

Merged
kgryte merged 1 commit into
developfrom
claude/great-brahmagupta-sdbphg
Aug 28, 2026
Merged

test: migrate stats/base/dists/betaprime/kurtosis to ULP-based assertions#14750
kgryte merged 1 commit into
developfrom
claude/great-brahmagupta-sdbphg

Conversation

kgryte commented Aug 28, 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/base/dists/betaprime/kurtosis from relative tolerance assertions to ULP difference assertions.

Specifically, in both test/test.js and test/test.native.js, the fixture loop previously branched on exact equality and otherwise compared a computed delta against a computed tol (320.0 * EPS * abs( expected[ i ] )). That branch is replaced with a single

t.strictEqual( isAlmostSameValue( y, expected[ i ], 369 ), true, 'returns expected value' );

assertion, @stdlib/assert/is-almost-same-value is added as a dependency of the tests, and the now unused @stdlib/math/base/special/abs and @stdlib/constants/float64/eps requires (along with the delta and tol locals) are removed.

ULP bound: 369 (both test/test.js and test/test.native.js).

The bound was tightened empirically. Measuring ulpdiff( y, expected[ i ] ) over the full 100-case Python fixture set yields a maximum ULP difference of 369, attained at alpha = 19.971069118488785, beta = 18.29265599414557. Sweeping the bound upwards from 0 confirms 369 is the minimum admissible value: running the suite at 368 fails exactly that one case, while 369 passes all of them. The JavaScript and C implementations were measured independently and both require the same bound of 369.

Verification:

  • make test TESTS_FILTER=".*/stats/base/dists/betaprime/kurtosis/.*" — 119 passing in test/test.js.
  • The native add-on was built locally (node-gyp rebuild) so that test/test.native.js was not skipped — 119 passing.
  • Both suites were run twice at the final bound to confirm the result is deterministic (no FMA/architecture-dependent variation).
  • make eslint-tests TESTS_FILTER=".*/stats/base/dists/betaprime/kurtosis/.*" — clean.

Only the two test files are changed; no source, fixture, benchmark, or documentation files were touched.

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.

The editorconfig pre-commit hook could not run in this environment because it attempts to download the editorconfig-checker binary from GitHub releases, which is not reachable here. The two changed files were instead checked manually for the relevant .editorconfig rules (LF line endings, UTF-8, tab indentation, no trailing whitespace, final newline).

Checklist

Please ensure the following tasks are completed before submitting this pull request.

  • Read, understood, and followed the [contributing guidelines][contributing].

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 running as an unattended scheduled task. Claude selected the package, mirrored the conversion idiom from previously merged ULP migration commits, measured the minimum ULP bound against the fixture set, and ran the tests and test linter locally.


@stdlib-js/reviewers


Generated by Claude Code

…rtions

Replace the relative tolerance assertions in the fixture loops of
`test/test.js` and `test/test.native.js` with `isAlmostSameValue`
ULP difference assertions. The ULP bound was tightened to the
measured minimum of 369 for both the JavaScript and C
implementations.

Ref: #11352

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

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/betaprime/kurtosis $\\color{green}211/211$
$\\color{green}+100.00\\%$
$\\color{green}10/10$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}211/211$
$\\color{green}+100.00\\%$

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

kgryte added the Tests Pull requests specifically adding tests. label Aug 28, 2026
kgryte marked this pull request as ready for review August 28, 2026 22:52
kgryte requested a review from a team August 28, 2026 22:52
stdlib-bot added the Needs Review A pull request which needs code review. label Aug 28, 2026
kgryte merged commit 89776d1 into develop Aug 28, 2026
82 checks passed
kgryte deleted the claude/great-brahmagupta-sdbphg branch August 28, 2026 22:53
stdlib-bot removed the Needs Review A pull request which needs code review. label Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL