Skip to content

test: migrate stats/base/dists/erlang/mgf to ULP-based assertions - #15632

Merged
kgryte merged 4 commits into
developfrom
philipp/ulp-stats-base-dists-erlang-mgf
Sep 28, 2026
Merged

kgryte merged 4 commits into
developfrom
philipp/ulp-stats-base-dists-erlang-mgf

Conversation

@Planeshifter

@Planeshifter Planeshifter commented Sep 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 stats/base/dists/erlang/mgf tests (test.mgf.js, test.factory.js, test.native.js) from EPS-scaled tolerance checks to isAlmostSameValue ULP-based assertions.
  • uses a named ULP constant per test, tightened to the measured minimum that passes over the full fixture set (verified deterministic over two runs; ULP - 1 fails):
    • large k and lambda (both_large): 734
    • large k (large_shape): 2050
    • large lambda (large_rate): 851

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 bounds were measured against the JavaScript implementation (main and factory). The native addon could not be built in the authoring environment, so the same bounds were applied to test.native.js without being run. The native implementation uses the same pow algorithm, but please verify. eslint could also not be run (dependency install failed), though the files pass node --check.

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


@stdlib-js/reviewers

🤖 Generated with Claude Code

https://claude.ai/code/session_01KwbNRSFvk4SqKZUY9iZBX7


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

stdlib-bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/erlang/mgf $\\color{green}312/312$
$\\color{green}+0.00\\%$
$\\color{green}21/21$
$\\color{green}+0.00\\%$
$\\color{green}4/4$
$\\color{green}+0.00\\%$
$\\color{green}312/312$
$\\color{green}+0.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 28, 2026
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
@kgryte
kgryte marked this pull request as ready for review September 28, 2026 21:58
@kgryte
kgryte requested a review from a team September 28, 2026 21:58
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Sep 28, 2026

@kgryte kgryte left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Planeshifter Fairly consistently, your Claude routines are much more likely to make mistakes and necessitate PR clean-up. Not clear why.

@kgryte
kgryte merged commit 9b56db6 into develop Sep 28, 2026
30 checks passed
@kgryte
kgryte deleted the philipp/ulp-stats-base-dists-erlang-mgf branch September 28, 2026 22:08
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Sep 28, 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.

4 participants