Skip to content

test: migrate stats/base/dists/pareto-type1/quantile to ULP-based assertions - #14129

Merged
kgryte merged 1 commit into
developfrom
kgryte/ulp-pareto-type1-quantile
Aug 10, 2026
Merged

test: migrate stats/base/dists/pareto-type1/quantile to ULP-based assertions#14129
kgryte merged 1 commit into
developfrom
kgryte/ulp-pareto-type1-quantile

Conversation

@kgryte

@kgryte kgryte commented Aug 10, 2026

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

Converted files:

  • test/test.quantile.js
  • test/test.factory.js
  • test/test.native.js

test/test.js only performs exact export checks and was left unchanged.

ULP bounds

All three fixture loops (both_large.json, large_alpha.json, large_beta.json) use:

t.strictEqual( isAlmostSameValue( y, expected[ i ], 0 ), true, 'returns expected value' );
File Previous tolerance ULP constant Measured minimum
test.quantile.js 1.0 * EPS * abs( expected[i] ) 0 0
test.factory.js 1.0 * EPS * abs( expected[i] ) 0 0
test.native.js 1.0 * EPS * abs( expected[i] ) 0 0

The bound was determined empirically: the minimum ULP distance was computed for every fixture value in all three fixture files, and the maximum observed distance was 0 — i.e., every returned value is bit-identical to the Julia reference value, so 0 is the tightest possible bound. The suite was run twice at the final value to confirm determinism.

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 native add-on was not compiled in the environment used to measure the bound, so test/test.native.js was skipped locally and its 0 ULP bound is inferred rather than directly measured. The inference is that src/main.c computes beta / stdlib_base_pow( 1.0-p, 1.0/alpha ) using stdlib's own pow port — the same expression and same algorithm as lib/main.js — so results are expected to be bit-identical. Please confirm against a build with add-ons enabled; if native results diverge, the native bound will need to be raised.

Other

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

  • Only test files are modified; no source, docs, or benchmark changes.
  • Linting was verified with etc/eslint/.eslintrc.tests.js (clean). The editorconfig-checker pre-commit step could not download its binary in this environment; EditorConfig compliance (LF, tab indentation, no trailing whitespace, final newline) was verified manually instead.

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 PR was written primarily by Claude Code, which studied the prior ULP migrations in this family (e.g. stats/base/dists/chi/quantile, stats/base/dists/pareto-type1/kurtosis), applied the same idiom, and measured the minimum ULP bound over the full fixture set.


@stdlib-js/reviewers


Generated by Claude Code

…ssertions

Ref: #11352

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019vL4WsqC1a6DU6VewVmvx5
@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 10, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

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

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

Copy link
Copy Markdown
Member

⚠️ Issue Reference Review

An automated check found potentially unrelated issue/PR references in this PR:

Reference Assessment Reasoning
#11352 suspicious PR migrates stats/base/dists/pareto-type1/quantile tests to ULP-based assertions, but #11352 is an RFC/tracking issue explicitly scoped to migrating math/base/special packages only (per its title and instructions), not stats/base/dists

Why this matters: GitHub automatically closes issues referenced with
closing keywords (Resolves, Closes, Fixes) when the PR is merged. Incorrect
references can accidentally close unrelated issues.

What to do:

  • If the reference is correct, no action needed. This check may produce
    false positives.
  • If the reference is incorrect, please update your PR description.

This assessment was generated by an AI model and is informational only.


Generated by Claude Code

@kgryte kgryte added the Tests Pull requests specifically adding tests. label Aug 10, 2026
@kgryte
kgryte marked this pull request as ready for review August 10, 2026 12:27
@kgryte
kgryte requested a review from a team August 10, 2026 12:27
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 10, 2026
@kgryte
kgryte merged commit 476cf1d into develop Aug 10, 2026
82 checks passed
@kgryte
kgryte deleted the kgryte/ulp-pareto-type1-quantile branch August 10, 2026 12:28
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Aug 10, 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