Skip to content

test: migrate stats/base/dists/hypergeometric/stdev to ULP-based assertions - #14843

Draft
kgryte wants to merge 1 commit into
developfrom
kgryte/ulp-stats-base-dists-hypergeometric-stdev
Draft

test: migrate stats/base/dists/hypergeometric/stdev to ULP-based assertions#14843
kgryte wants to merge 1 commit into
developfrom
kgryte/ulp-stats-base-dists-hypergeometric-stdev

Conversation

@kgryte

@kgryte kgryte commented Aug 31, 2026

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

  • migrates the tests for stats/base/dists/hypergeometric/stdev from relative tolerance testing (delta <= EPS * abs( expected )) to ULP difference testing using @stdlib/assert/is-almost-same-value.

The following files are updated:

  • test/test.js: ULP bound of 2.
  • test/test.native.js: ULP bound of 1.

Each bound is the measured minimum over the full 100-case Julia fixture set (test/fixtures/julia/data.json); lowering test/test.js to 1 yields 4 failures, and lowering test/test.native.js to 0 yields 19 failures. The test suite was run twice at the final bounds to confirm the results are deterministic, and the native add-on was additionally compiled with CFLAGS="-ffp-contract=off" to confirm the C bound is not sensitive to FMA contraction.

Only the two test files are changed; no implementation, documentation, or fixture files are touched.

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 JavaScript and C implementations require different bounds (2 vs. 1) for the same fixtures. Per the FAQ, the bounds are reported as measured rather than unified. Happy to use a single bound of 2 in both files if that is preferred.

Other

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

Verification performed locally:

make test TESTS_FILTER=".*/stats/base/dists/hypergeometric/stdev/.*"
  test.js         120 passing
  test.native.js  108 passing

make lint-javascript-tests TESTS_FILTER=".*/stats/base/dists/hypergeometric/stdev/.*"
  clean

The native add-on was built locally so that test/test.native.js actually executed rather than being skipped.

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. The agent studied previously merged conversions under this tracking issue to match the established idiom, applied the migration, and determined the minimum ULP bounds empirically by bisecting on the fixture set and re-running the suite.


@stdlib-js/reviewers


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

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/hypergeometric/stdev $\\color{green}191/191$
$\\color{green}+100.00\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}191/191$
$\\color{green}+100.00\\%$

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

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