Skip to content

test: migrate stats/base/dists/pareto-type1/cdf to ULP-based assertions - #13941

Open
Planeshifter wants to merge 1 commit into
developfrom
philipp/ulp-pareto-type1-cdf
Open

test: migrate stats/base/dists/pareto-type1/cdf to ULP-based assertions#13941
Planeshifter wants to merge 1 commit into
developfrom
philipp/ulp-pareto-type1-cdf

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 stats/base/dists/pareto-type1/cdf test suite from the old computed-tolerance idiom (delta/tol derived from EPS) to ULP-based assertions using @stdlib/assert/is-almost-same-value, per [RFC]: Migrate math/base/special packages from relative tolerance testing to ULP difference testing (tracking issue) #11352.
  • Converted files: test/test.cdf.js, test/test.factory.js, test/test.native.js. test/test.js was left untouched (it only contains the exports smoke test; no tolerance comparisons).
  • ULP bound: isAlmostSameValue( y, expected[i], 1 ) across all three converted files.
  • The bound was found by computing the exact ULP difference (@stdlib/number/float64/base/ulp-difference) between actual and expected values across the full fixture set (large_alpha.json, large_beta.json, both_large.json; 3000 evaluations total, checked against both the direct cdf() export and the factory()-created function). The measured maximum ULP difference was 0 (every case is bit-exact against the Julia-generated fixtures in this environment). A bound of 1 was used rather than 0 to match the convention used throughout every other converted package in the codebase (no precedent package uses a bound of 0 for fixture-loop assertions) and to leave a minimal safety margin for the native (C) code path, which was not exercised in this sandboxed environment (see Other, below).
  • The full JS test suite was run twice at this bound to confirm deterministic results (no FMA/arch flakiness): 6055/6055 assertions passing both runs.

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.

  • test/test.native.js was converted to mirror the JS test files exactly, but the native addon could not be built in this sandboxed session, so the (skip-gated) native tests did not execute here.
  • Only test files were changed; package.json did not need updates, as @stdlib/assert/is-almost-same-value resolves via existing monorepo module resolution (consistent with other converted packages, none of which added an explicit devDependencies entry for it either).
  • npx eslint is clean on all three changed files.
  • The local pre-commit hook's EditorConfig check (make lint-editorconfig-files) could not run in this sandboxed session: it attempts to download the editorconfig-checker binary from github.com/editorconfig-checker/editorconfig-checker, a repository outside this session's permitted GitHub access scope, and fails with a 403. This is an environment/tooling limitation unrelated to this diff's content (reproduces identically for an unmodified file). The diff was manually checked for indentation (tabs, no space-indentation) and trailing-whitespace/EOF-newline consistency with the surrounding unmodified code.

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 end-to-end by an automated Claude Code agent running as a scheduled task on behalf of the repository owner, following the conventions established in prior merged ULP-migration PRs for this issue (e.g. #13847, #13868).


@stdlib-js/reviewers


Generated by Claude Code

…ions

Replaces the EPS-based relative-tolerance idiom (`delta`/`tol`) in
test.cdf.js, test.factory.js, and test.native.js with
`isAlmostSameValue` at a measured-minimum ULP bound of 1.

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

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/pareto-type1/cdf $\\color{green}323/323$
$\\color{green}+100.00\\%$
$\\color{green}25/25$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}323/323$
$\\color{green}+100.00\\%$

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

@Planeshifter
Planeshifter marked this pull request as ready for review August 5, 2026 13:31
@Planeshifter
Planeshifter requested review from a team and kgryte August 5, 2026 13:31
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 5, 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. Needs Review A pull request which needs code review. Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants