Skip to content

test: migrate stats/base/dists/uniform/quantile to ULP-based assertions - #14626

Merged
kgryte merged 1 commit into
developfrom
kgryte/ulp-uniform-quantile
Aug 26, 2026
Merged

kgryte merged 1 commit into
developfrom
kgryte/ulp-uniform-quantile

Conversation

@kgryte

@kgryte kgryte commented Aug 25, 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 test suite for stats/base/dists/uniform/quantile from relative tolerance (EPS/delta/tol) assertions to ULP difference assertions using @stdlib/assert/is-almost-same-value.
  • updates test/test.quantile.js, test/test.factory.js, and test/test.native.js. No other files are changed.

The ULP bound was tightened agentically: starting from a high bound and lowering to the minimum integer which still passes over the full fixture set (small_range, medium_range, large_range; 1000 cases each, 3000 total per file).

Measured minimum ULP bound:

File Fixture ULP
test/test.quantile.js small_range, medium_range, large_range 0
test/test.factory.js small_range, medium_range, large_range 0
test/test.native.js small_range, medium_range, large_range 0

Both the JavaScript and C implementations compute a + ( p * ( b - a ) ), and every fixture value matches bit-for-bit, so 0 is the tightest possible bound in all three files.

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.

  • Verification: test/test.js, test/test.quantile.js (3011 assertions), test/test.factory.js (3014 assertions), and test/test.native.js (3011 assertions) all pass. The native add-on was built locally (make install-node-addons NODE_ADDONS_PATTERN="stats/base/dists/uniform/quantile") so that test/test.native.js was actually exercised rather than skipped.
  • The full suite was run twice at the final bound of 0 to confirm determinism (no FMA/architecture-dependent variation).
  • ESLint (tests configuration) is clean for all changed files.

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 PR was authored by Claude Code as part of an automated, mechanical migration of existing test assertions to ULP-based assertions, following the idiom established in previously merged PRs referencing #11352. The ULP bound was determined empirically by running the fixtures and minimizing the accepted bound.


@stdlib-js/reviewers


Generated by Claude Code

…ions

Replace relative tolerance assertions with `isAlmostSameValue` ULP
difference assertions in the `stats/base/dists/uniform/quantile` test
suite. All fixture values match exactly, so the minimum required ULP
bound is `0` for the JavaScript, factory, and native test files.

Ref: #11352

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NbeWLyp2YBanmPrDdD2hsX

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: skipped
  - task: lint_markdown_pkg_readmes
    status: na
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@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 25, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/uniform/quantile $\\color{green}291/291$
$\\color{green}+100.00\\%$
$\\color{green}24/24$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}291/291$
$\\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 26, 2026
@kgryte
kgryte marked this pull request as ready for review August 26, 2026 00:55
@kgryte
kgryte requested a review from a team August 26, 2026 00:55
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 26, 2026
@kgryte
kgryte merged commit d17005a into develop Aug 26, 2026
82 checks passed
@kgryte
kgryte deleted the kgryte/ulp-uniform-quantile branch August 26, 2026 00:56
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Aug 26, 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