Repository navigation
test: migrate stats/base/dists/cosine/logcdf to ULP-based assertions - #14645
Conversation
Ref: #11352 --- 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 ---
|
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/cosine/logcdffrom relative tolerance (EPS/delta/tol) assertions to ULP difference assertions using@stdlib/assert/is-almost-same-value.test/test.logcdf.js,test/test.factory.js, andtest/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 (
positive_mean,negative_mean,large_variance; 1000 cases each, 3000 total per file).Measured minimum ULP bounds:
test/test.logcdf.jspositive_mean513test/test.logcdf.jsnegative_mean513test/test.logcdf.jslarge_variance1025test/test.factory.jspositive_mean513test/test.factory.jsnegative_mean513test/test.factory.jslarge_variance1025test/test.native.jspositive_mean513test/test.native.jsnegative_mean513test/test.native.jslarge_variance1025Each bound is the exact maximum observed ULP difference over its fixture: lowering any of them by one (
512/1024) fails three assertions per file. The JavaScript and C implementations returned bit-identical results for every fixture value, so the same bounds apply intest/test.native.jsas in the JavaScript tests.For reference, the previous relative tolerances were
600.0 * EPS(positive_mean,negative_mean) and800.0 * EPS(large_variance), which correspond to looser accuracy budgets than the ULP bounds above, so this is a tightening rather than a relaxation.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
test/test.js(3 assertions),test/test.logcdf.js(3016 assertions),test/test.factory.js(3019 assertions), andtest/test.native.js(3016 assertions) all pass. The native add-on was built locally so thattest/test.native.jswas actually exercised rather than skipped.etc/eslint/.eslintrc.tests.js) is clean for all changed files.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, mechanical migration of existing test assertions to ULP-based assertions, following the idiom established in previously merged PRs referencing #11352. The ULP bounds were determined empirically by running the fixtures and minimizing the accepted bound.
@stdlib-js/reviewers
Generated by Claude Code