Skip to content

test: migrate stats/base/dists/levy/logpdf to ULP-based assertions - #14393

Merged
kgryte merged 3 commits into
developfrom
philipp/ulp-stats-base-dists-levy-logpdf
Aug 19, 2026
Merged

test: migrate stats/base/dists/levy/logpdf to ULP-based assertions#14393
kgryte merged 3 commits into
developfrom
philipp/ulp-stats-base-dists-levy-logpdf

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

  • migrates the fixture-based value tests for stats/base/dists/levy/logpdf from relative-tolerance (delta/tol) comparisons to ULP-based assertions using @stdlib/assert/is-almost-same-value, per the tracking issue [RFC]: Migrate math/base/special packages from relative tolerance testing to ULP difference testing (tracking issue) #11352.
  • updates test/test.logpdf.js, test/test.factory.js, and test/test.native.js.
  • the tightest ULP bound was determined agentically by running the full fixture suite; the measured minimum required bound was 0 ULP (i.e., exact bit-for-bit agreement) across all three fixture sets (positive_mean, negative_mean, large_variance) in every test body, matching the precedent set in already-converted, same-family packages such as stats/base/dists/uniform/logpdf.
  • pre-existing edge-case skip guards (e.g., expected[i] === 0.0 && y < EPS in the JS tests, expected[i] === NINF && y === NINF in the native tests) were left untouched, since they guard against known JS-vs-C divergence at specific fixture points rather than being part of the tolerance idiom being migrated.
  • the now-unused abs (and, where applicable, EPS) requires were removed accordingly.

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.

Full fixture suite (test.js, test.logpdf.js, test.factory.js) run twice at the final ULP bound to confirm determinism; all assertions passed both times. test.native.js is skipped locally (no built native addon in this environment) but was updated to mirror the same idiom.

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, run as an automated, scheduled task on behalf of the repository maintainer (@Planeshifter) to work through the ULP migration tracking issue (#11352) package by package, following the pattern established by prior merged PRs against this same issue.


@stdlib-js/reviewers


Generated by Claude Code

Replaces the relative-tolerance delta/tol checks in the fixture-based
value tests with `isAlmostSameValue` at the minimum required ULP bound
(0, i.e. exact match, for all three fixture sets).
@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 18, 2026
@stdlib-bot

stdlib-bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/levy/logpdf $\\color{green}291/291$
$\\color{green}+0.00\\%$
$\\color{green}23/23$
$\\color{green}+0.00\\%$
$\\color{green}4/4$
$\\color{green}+0.00\\%$
$\\color{green}291/291$
$\\color{green}+0.00\\%$

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

@Planeshifter
Planeshifter marked this pull request as ready for review August 19, 2026 00:24
@Planeshifter
Planeshifter requested review from a team and kgryte August 19, 2026 00:24
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 19, 2026
@kgryte kgryte added the Tests Pull requests specifically adding tests. label Aug 19, 2026
Comment thread lib/node_modules/@stdlib/stats/base/dists/levy/logpdf/test/test.factory.js Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/levy/logpdf/test/test.factory.js Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/levy/logpdf/test/test.logpdf.js Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/levy/logpdf/test/test.logpdf.js Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/stats/base/dists/levy/logpdf/test/test.native.js Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/levy/logpdf/test/test.native.js Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
@kgryte
kgryte merged commit 5f6d169 into develop Aug 19, 2026
12 checks passed
@kgryte
kgryte deleted the philipp/ulp-stats-base-dists-levy-logpdf branch August 19, 2026 07:15
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Aug 19, 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