Repository navigation
test: migrate stats/base/dists/erlang/quantile to ULP-based assertions - #15753
Conversation
Replace the computed `delta`/`tol` comparisons in the fixture loops of `test/test.quantile.js` and `test/test.factory.js` with `isAlmostSameValue` assertions using the measured minimum ULP bound of 7. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012bYe5QJPN9wJxUADzW1a6S --- 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: na - 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 ---
|
Hello! 👋 We've noticed that you've been opening a number of PRs addressing good first issues. Thank you for your interest and enthusiasm! Now that you've made a few contributions, we suggest no longer working on good first issues. Instead, we encourage you to prioritize cleaning up any PRs which have yet to be merged and then proceed to work on more involved tasks. Not only does this ensure that other new contributors can work on things and get ramped up on all things stdlib, it also ensures that you can spend your time on more challenging problems. 🚀 For ideas for future PRs, feel free to search the codebase for TODOs and FIXMEs and be sure to check out other open issues on the issue tracker. Cheers! |
Coverage Report
The above coverage report was generated for the changes in this PR. |
Resolves a part of #11352.
Description
This pull request:
stats/base/dists/erlang/quantilefrom relative tolerance testing to ULP difference testing, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.The computed
delta/tolcomparisons in the fixture loops oftest/test.quantile.jsandtest/test.factory.jsare replaced withisAlmostSameValue( y, expected[ i ], 7 )assertions, and the now-unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires are dropped in favor of@stdlib/assert/is-almost-same-value. No other test cases were touched; the exact comparisons elsewhere in these files are unchanged.test/test.jscontains no tolerance-based assertions and is therefore unmodified. This package has notest/test.native.js.The ULP bound is the measured minimum over each full fixture set, confirmed by observing failures at
N-1:fixtures/julia/both_large.jsonfixtures/julia/large_shape.jsonfixtures/julia/large_rate.jsonEach fixture set contains 1000 cases. The same minimum of 7 holds for both implementations under test (
lib/main.jsandlib/factory.js), sotest.factory.jsuses the same bound astest.quantile.js. AtN = 6the suite reports 4 failing assertions, so 7 is the tightest integer bound. The suite was run twice at the final bound, with identical results both times (3022 + 3021 + 3 assertions passing).Note that the previous bounds were expressed as
20.0 * EPSforboth_large.jsonand10.0 * EPSfor the other two fixtures; the uniform 7 ULP bound is tighter than all three.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
make lint-javascript-tests TESTS_FILTER=".*/stats/base/dists/erlang/quantile/.*"is clean.stats/base/dists/betaprime/logpdfandstats/base/dists/beta/logpdf.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written by Claude Code, which also measured the minimum ULP bound empirically and ran the tests and linter.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_012bYe5QJPN9wJxUADzW1a6S
Generated by Claude Code