Skip to content

test: migrate stats/base/dists/gamma/skewness to ULP-based assertions - #14918

Merged
kgryte merged 1 commit into
developfrom
kgryte/ulp-gamma-skewness
Sep 3, 2026
Merged

test: migrate stats/base/dists/gamma/skewness to ULP-based assertions#14918
kgryte merged 1 commit into
developfrom
kgryte/ulp-gamma-skewness

Conversation

@kgryte

@kgryte kgryte commented Sep 2, 2026

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

Final ULP constant: 0 for both test/test.js and test/test.native.js.

This is the measured minimum. Starting from a high bound and tightening, the maximum ULP difference over the full 200-case Julia fixture set (test/fixtures/julia/data.json) is 0 for both the JavaScript and native implementations: all 200 cases are bit-for-bit exact, so the bound cannot be tightened further. The suite was run twice at the final bound with identical results, and the native addon was compiled locally so that test/test.native.js actually executed rather than being skipped:

  • test/test.js: 214 passing, 0 failing
  • test/test.native.js: 214 passing, 0 failing

This matches the sibling package stats/base/dists/gamma/kurtosis, which also uses a bound of 0.

Only the two test files are changed.

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 JavaScript and native implementations agree exactly here, so the same ULP bound applies to both files.

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

This PR was authored by Claude Code running as an automated task. The tolerance-to-ULP conversion, the search for the minimum ULP bound, and the local test/lint verification were all performed by Claude Code.


@stdlib-js/reviewers

🤖 Generated with Claude Code

https://claude.ai/code/session_01F98j9sSCh3XzoRpXNvsPc6


Generated by Claude Code

Replace the relative tolerance comparisons in `test/test.js` and
`test/test.native.js` with `isAlmostSameValue` ULP difference
assertions. The measured minimum ULP bound is `0` for both the
JavaScript and native implementations, as every fixture value is
returned bit-for-bit exactly.

Ref: #11352

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

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/gamma/skewness $\\color{green}196/196$
$\\color{green}+100.00\\%$
$\\color{green}10/10$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}196/196$
$\\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 testing to ULP-difference testing, but this PR modifies tests in stats/base/dists/gamma/skewness, a different package tree not covered by that RFC'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

@kgryte kgryte added the Tests Pull requests specifically adding tests. label Sep 3, 2026
@kgryte
kgryte marked this pull request as ready for review September 3, 2026 03:13
@kgryte
kgryte requested a review from a team September 3, 2026 03:13
@kgryte
kgryte merged commit e134bfc into develop Sep 3, 2026
66 checks passed
@kgryte
kgryte deleted the kgryte/ulp-gamma-skewness branch September 3, 2026 03:14
@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 3, 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. Needs Review A pull request which needs code review. 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.

4 participants