Skip to content

test: migrate stats/base/dists/weibull/cdf to ULP-based assertions - #14281

Merged
kgryte merged 1 commit into
developfrom
claude/great-brahmagupta-mwmk63
Aug 15, 2026
Merged

kgryte merged 1 commit into
developfrom
claude/great-brahmagupta-mwmk63

Conversation

@kgryte

@kgryte kgryte commented Aug 15, 2026

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

Changes are confined to the package's test files (test/test.cdf.js, test/test.factory.js, test/test.native.js):

  • adds the @stdlib/assert/is-almost-same-value require and removes the now unused @stdlib/math/base/special/abs and @stdlib/constants/float64/eps requires.
  • removes the delta/tol declarations and the if ( y === expected[i] ) { ... } else { ... } tolerance branch.
  • replaces each fixture-loop assertion with t.strictEqual( isAlmostSameValue( y, expected[ i ], 0 ), true, 'returns expected value' );.

No implementation, fixture, or documentation files are touched, and no test cases were added, removed, or otherwise altered.

ULP bound

All nine converted assertion loops use an ULP value of 0, which is the tightest bound possible.

The bound was measured rather than guessed: computing @stdlib/number/float64/base/ulp-difference between each computed value and its expected fixture value across the full fixture set (both_large.json, large_shape.json, large_scale.json; 1000 values each, 3000 total) yields a maximum observed ULP difference of 0 for the main export, for the function returned by factory, and for the native C implementation. In other words, every fixture value is reproduced exactly.

Verification:

  • test/test.cdf.js — 3021 assertions, all passing.
  • test/test.factory.js — 3026 assertions, all passing.
  • test/test.native.js — 3021 assertions, all passing. The native add-on was built locally so that these tests actually executed rather than being skipped.
  • The full suite was run twice at the final ULP value with identical results, to confirm the bound is not sensitive to FMA/architecture-dependent rounding.
  • ESLint (etc/eslint/.eslintrc.tests.js) reports no problems for the three changed files.

This mirrors the bound used by the already-merged sibling package stats/base/dists/weibull/logcdf (#14109), which likewise settled on 0.

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.

Opened as a draft.

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 unattended scheduled task. It studied the previously merged ULP migrations (in particular the sibling package stats/base/dists/weibull/logcdf) to match the established idiom, applied the mechanical test conversion, and empirically measured the minimum ULP bound and ran the test suite to verify it.


@stdlib-js/reviewers


Generated by Claude Code

@stdlib-bot stdlib-bot added Good First PR A pull request resolving a Good First Issue. Statistics Issue or pull request related to statistical functionality. labels Aug 15, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Hello! 👋

We've noticed that you've been opening a number of PRs addressing good first issues. Thank you for your interest and enthusiasm!

Now that you've made a few contributions, we suggest no longer working on good first issues. Instead, we encourage you to prioritize cleaning up any PRs which have yet to be merged and then proceed to work on more involved tasks.

Not only does this ensure that other new contributors can work on things and get ramped up on all things stdlib, it also ensures that you can spend your time on more challenging problems. 🚀

For ideas for future PRs, feel free to search the codebase for TODOs and FIXMEs and be sure to check out other open issues on the issue tracker. Cheers!

@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/weibull/cdf $\\color{green}298/298$
$\\color{green}+100.00\\%$
$\\color{green}25/25$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}298/298$
$\\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 Aug 15, 2026
@kgryte
kgryte marked this pull request as ready for review August 15, 2026 10:44
@kgryte
kgryte requested a review from a team August 15, 2026 10:44
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 15, 2026
@kgryte
kgryte merged commit 295bef4 into develop Aug 15, 2026
82 checks passed
@kgryte
kgryte deleted the claude/great-brahmagupta-mwmk63 branch August 15, 2026 10:45
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Aug 15, 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