Skip to content

test: migrate stats/base/dists/geometric/entropy to ULP-based assertions - #14674

Merged
kgryte merged 1 commit into
developfrom
kgryte/ulp-geometric-entropy
Aug 27, 2026
Merged

kgryte merged 1 commit into
developfrom
kgryte/ulp-geometric-entropy

Conversation

@kgryte

@kgryte kgryte commented Aug 27, 2026

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

  • migrates test/test.js and test/test.native.js of stats/base/dists/geometric/entropy from relative tolerance (EPS-based) assertions to ULP difference assertions via @stdlib/assert/is-almost-same-value.
  • replaces the delta/tol tolerance branch (previously tol = 1.0 * EPS * abs( expected[ i ] ) in test/test.js and tol = 2.0 * EPS * abs( expected[ i ] ) in test/test.native.js) with t.strictEqual( isAlmostSameValue( y, expected[ i ], 0 ), true, 'returns expected value' ).
  • removes the now-unused abs and EPS requires and the corresponding delta/tol variable declarations.

Final ULP constant: 0, for both test suites (main and native).

The bound was tightened empirically. Starting from a high value and searching downward via a per-case minimum-ULP computation over the full fixture set (test/fixtures/julia/data.json; 1000 fixture cases), the measured maximum ULP difference is 0 — every fixture value is reproduced bit-for-bit — so 0 is the minimum value at which the suites pass.

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 native add-on was built locally so that test/test.native.js actually executed rather than being skipped; the native implementation also matches the fixtures exactly (max ULP difference 0).
  • The package test suite was run twice at the final ULP value to confirm determinism: 1007/1007 assertions passing in test.js and 1007/1007 in test.native.js on both runs.
  • make eslint-tests TESTS_FILTER=".*/stats/base/dists/geometric/entropy/.*" is clean.
  • No files other than the two test files were 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

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.

This pull request was authored by an automated Claude Code agent running as a scheduled task, following the conventions established in previously merged ULP migration pull requests for this issue.


@stdlib-js/reviewers


Generated by Claude Code

…tions

Migrate the test suites for `stats/base/dists/geometric/entropy` from
relative tolerance (EPS-based) assertions to ULP difference assertions
via `@stdlib/assert/is-almost-same-value`.

The measured maximum ULP difference over the full fixture set is zero
for both the JavaScript and the native implementations, and thus the
minimum required ULP value is zero.

Ref: #11352
@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 Aug 27, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/geometric/entropy $\\color{green}176/176$
$\\color{green}+100.00\\%$
$\\color{green}9/9$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}176/176$
$\\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 27, 2026
@kgryte
kgryte marked this pull request as ready for review August 27, 2026 05:38
@kgryte
kgryte requested a review from a team August 27, 2026 05:38
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 27, 2026
@kgryte
kgryte merged commit 85b3a45 into develop Aug 27, 2026
82 checks passed
@kgryte
kgryte deleted the kgryte/ulp-geometric-entropy branch August 27, 2026 05:40
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Aug 27, 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