test: migrate stats/base/dists/gumbel/pdf to ULP-based assertions - #14942
Merged
Conversation
Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U5hkgpAq7yZHbDyNf71eS8 --- 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 ---
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
marked this pull request as ready for review
September 4, 2026 02:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves a part of #11352.
Description
This pull request:
stats/base/dists/gumbel/pdffrom relative tolerance testing (delta <= EPS * abs( expected )) to ULP difference testing using@stdlib/assert/is-almost-same-value.The following test files were updated:
test/test.pdf.jstest/test.factory.jstest/test.native.jsIn each file, the
@stdlib/math/base/special/absand@stdlib/constants/float64/epsimports were removed, the@stdlib/assert/is-almost-same-valueimport was added, and eachif ( y === expected[i] ) { ... } else { ... }tolerance block was replaced with a singlet.strictEqual( isAlmostSameValue( y, expected[ i ], N ), true, 'returns expected value' );assertion. The pre-existingexpected[i] !== nullfixture guards were left intact.ULP bounds
The ULP bound was tightened to the measured minimum over the full fixture set. For every fixture (
positive_mean,negative_mean,large_variance) and for both the main and factory entry points, the maximum observed ULP difference is 1, so1ULP is used throughout:positive_meannegative_meanlarge_varianceAt
0ULPs, 548 of the 3015 assertions intest/test.pdf.jsand 548 of the 3018 assertions intest/test.factory.jsfail, confirming that1is the tightest bound which still passes. The suite was run twice at the final bound with identical results.test/test.native.jsuses the same1ULP bound, matching the convention in previously migrated packages in this family (e.g.,stats/base/dists/gumbel/cdf,stats/base/dists/pareto-type1/pdf). The C implementation insrc/main.cis a direct transliteration oflib/main.jsand delegates to the sameexproutine.Related Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352Questions
No.
Other
Only test files are changed; no implementation, documentation, or fixture files were touched.
Note on verification: in the environment used to author this PR,
make install-node-modulescould not complete (es-object-atoms@^1.1.2is not resolvable from the registry), so the native add-on could not be built andtest/test.native.jswas skipped locally, as it is whenever the add-on is absent. The JavaScript test files were run directly (twice, green) and linted with the repository's ownetc/eslint/.eslintrc.tests.jsconfiguration via the pre-commit hook, which reported no issues.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code, which studied previously merged migrations in this family, applied the mechanical conversion, and measured the minimum ULP bound over the full fixture set.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01U5hkgpAq7yZHbDyNf71eS8
Generated by Claude Code