Skip to content

test: migrate stats/base/dists/weibull/entropy to ULP-based assertions - #14543

Merged
kgryte merged 1 commit into
developfrom
kgryte/ulp-stats-base-dists-weibull-entropy
Aug 22, 2026
Merged

kgryte merged 1 commit into
developfrom
kgryte/ulp-stats-base-dists-weibull-entropy

Conversation

@kgryte

@kgryte kgryte commented Aug 22, 2026

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

ULP bound: 0 (both test/test.js and test/test.native.js), the measured minimum over the fixture set.

The bound was determined empirically rather than assumed: for every fixture, the minimum admissible bound was found by searching upward over isAlmostSameValue, and the maximum over the full Julia fixture set (all 500 values are compared) is exactly 0 — every returned value is bit-identical to the Julia reference, so the previous else branch computing delta/tol was never exercised. 0 is the floor of the allowed range, so the bound cannot be tightened further. The suite was then run twice at the final bound with identical results (514/514 passing in each run), so the bound is not sensitive to run-to-run variation.

The previous relative tolerance was 1.0 * EPS, so this is a tightening rather than a loosening of the prior accuracy budget.

To confirm that 0 is also correct for the C implementation, the native addon was compiled locally via node-gyp rebuild and test/test.native.js was executed against the real addon: it likewise passes all 514 assertions at 0 ULP, twice. This matches the sibling conversions in this family (weibull/stdev, weibull/cdf, weibull/logcdf), which likewise use a single bound across both suites.

Only the two test files are modified; no implementation, fixture, or documentation changes are included.

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.

Note on local verification: make install-node-modules initially failed in this environment because a transitive dependency requests es-object-atoms@^1.1.2, a version which does not exist on the registry (1.1.1 is the latest published). Installation was completed locally with a temporary overrides entry pinning es-object-atoms to 1.1.1; package.json was restored afterwards and is not part of this diff. Separately, make lint-editorconfig-files could not run because the editorconfig-checker binary download is blocked in this environment; the changed files were instead checked manually for indentation, trailing whitespace, line endings, and final newline, and match the surrounding files exactly. eslint was run against etc/eslint/.eslintrc.tests.js and reports no problems for either file.

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 authored by Claude Code running as an unattended scheduled task. It studied previously merged conversions under #11352 (including the weibull/stdev sibling) to match the established idiom, applied the migration, measured the minimum ULP bound empirically against the fixtures for both the JavaScript and the locally compiled C implementation, and verified that the tests pass and that the files lint cleanly.


@stdlib-js/reviewers


Generated by Claude Code

@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Aug 22, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/weibull/entropy $\\color{green}197/197$
$\\color{green}+100.00\\%$
$\\color{green}10/10$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}197/197$
$\\color{green}+100.00\\%$

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

@stdlib-bot stdlib-bot added the Good First PR A pull request resolving a Good First Issue. label Aug 22, 2026
@kgryte kgryte added the Tests Pull requests specifically adding tests. label Aug 22, 2026
@kgryte
kgryte marked this pull request as ready for review August 22, 2026 22:53
@kgryte
kgryte requested a review from a team August 22, 2026 22:53
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 22, 2026
@kgryte
kgryte merged commit efb4fd2 into develop Aug 22, 2026
82 checks passed
@kgryte
kgryte deleted the kgryte/ulp-stats-base-dists-weibull-entropy branch August 22, 2026 22:54
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Aug 22, 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