Repository navigation
test: migrate stats/base/dists/pareto-type1/pdf to ULP-based assertions - #14902
Merged
Merged
Conversation
…ions Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S7nbhyRgHU7XRP4odpVTw6 --- 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. |
Member
|
An automated check found potentially unrelated issue/PR references in this PR:
Why this matters: GitHub automatically closes issues referenced with What to do:
This assessment was generated by an AI model and is informational only. Generated by Claude Code |
kgryte
marked this pull request as ready for review
September 3, 2026 03:19
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/pareto-type1/pdffrom relative tolerance assertions to ULP-based assertions, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.delta/tolcomputations (previously40.0 * EPS * abs( expected[ i ] )and20.0 * EPS * abs( expected[ i ] )) intest/test.pdf.js,test/test.factory.js, andtest/test.native.jswitht.strictEqual( isAlmostSameValue( y, expected[ i ], N ), true, 'returns expected value' );.@stdlib/assert/is-almost-same-valuerequire and drops the now unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires.Only the three test files are changed; the implementation, fixtures, and documentation are untouched.
test/test.jsis unchanged, as it contains no tolerance-based assertions.Measured ULP bounds (identical in all three test files, one per fixture set):
fixtures/julia/both_large.json45fixtures/julia/large_alpha.json54fixtures/julia/large_beta.json29Each bound was tightened by measuring the ULP difference between the returned value and the expected value across the full fixture set (1000 cases per fixture). Starting from a loose bound of
64and lowering it, the values above are the minimum integers at which each fixture set passes: the maximum observed ULP differences are exactly45,54, and29, and re-running at44,53, and28respectively fails. The same maxima were measured independently for the JavaScript implementation, for the function returned byfactory, and for the compiled C add-on, so a single set of values applies to all three test files.Verification performed:
test/test.pdf.js: 3022/3022 assertions passing.test/test.factory.js: 3025/3025 assertions passing.test/test.native.js: 3022/3022 assertions passing against the compiled native add-on (built locally so the native suite actually executed rather than being skipped).test/test.js: 3/3 assertions passing (unchanged).etc/eslint/.eslintrc.tests.jsfor all three files.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
The JavaScript and C implementations evaluate the same closed-form Pareto (Type I) density expression using stdlib's own
pow, and the maximum deviation from the Julia reference fixtures is identical for both, so the same ULP values apply totest.pdf.js,test.factory.js, andtest.native.jsalike. The previous relative tolerances (40 * EPS≈ 180 ULP and20 * EPS≈ 90 ULP) were looser than the measured bounds, so the migration tightens the accuracy budget for every fixture set.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code as part of an automated batch migration of tolerance-based tests to ULP-based assertions. The ULP bounds were determined empirically by measuring ULP differences across the full fixture sets and confirming the test suites pass deterministically at the minimum values.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01S7nbhyRgHU7XRP4odpVTw6
Generated by Claude Code