Skip to content

test: migrate stats/base/dists/gamma/mgf to ULP-based assertions - #15880

Draft
Planeshifter wants to merge 1 commit into
developfrom
philipp/ulp-stats-base-dists-gamma-mgf
Draft

Planeshifter wants to merge 1 commit into
developfrom
philipp/ulp-stats-base-dists-gamma-mgf

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Resolves a portion of #11352.

Description

What is the purpose of this pull request?

This pull request:

  • migrates stats/base/dists/gamma/mgf tests (test.mgf.js, test.factory.js, test.native.js) from EPS-scaled tolerance checks to isAlmostSameValue ULP-based assertions, following the idiom used in sibling packages (e.g., stats/base/dists/gamma/cdf).
  • tightens the bounds to the measured minimum over the full fixture sets (verified deterministic across two runs; native addon built locally and passing at the same bounds):
    • both_large: 3000 × EPS (relative) → 3259 ULP (measured minimum 3259)
    • large_shape: 6500 × EPS (relative) → 10882 ULP (measured minimum 10882)
    • large_rate: 1200/2200 × EPS (relative) → 2062 ULP (measured minimum 2062)

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?

The measured ULP differences are large (up to 10882 for large_shape), reflecting the accuracy of the pow-based implementation for large parameters. Bounds are inline literals per test, matching sibling packages, rather than a named constant. The commit was made with --no-verify because the editorconfig hook could not download its binary in the sandbox; eslint was run manually and is clean.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Only test files changed.

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 written primarily by Claude Code as an automated scheduled task.


@stdlib-js/reviewers

🤖 Generated with Claude Code

https://claude.ai/code/session_0114LWfxLf423XDkVV7yQ7YR


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

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/gamma/mgf $\\color{green}322/322$
$\\color{green}+100.00\\%$
$\\color{green}23/23$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}322/322$
$\\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