Repository navigation
test: migrate stats/base/dists/logistic/cdf to ULP-based assertions - #14607
Conversation
Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013LWUd3exr9mXw1egAc6XQF --- 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/logistic/cdffrom relative tolerance testing to ULP difference testing, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.Changes are confined to the package's test files (
test/test.cdf.js,test/test.factory.js,test/test.native.js):@stdlib/assert/is-almost-same-valuerequire and removes the now unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires.delta/toldeclarations and theif ( y === expected[i] ) { ... } else { ... }tolerance branch.t.strictEqual( isAlmostSameValue( y, expected[ i ], 0 ), true, 'returns expected value' );.No implementation, fixture, or documentation files are touched, and no test cases were added, removed, or otherwise altered.
ULP bound
All nine converted assertion loops use an ULP value of
0, which is the tightest bound possible.The bound was measured rather than guessed: computing
@stdlib/number/float64/base/ulp-differencebetween each computed value and its expected fixture value across the full fixture set (positive_mean.json,negative_mean.json,large_variance.json; 1000 values each, 3000 total) yields a maximum observed ULP difference of0for the main export, for the function returned byfactory, and for the native C implementation. In other words, every fixture value is reproduced exactly.Verification:
test/test.cdf.js— 3016 assertions, all passing.test/test.factory.js— 3019 assertions, all passing.test/test.native.js— 3016 assertions, all passing. The native add-on was built locally so that these tests actually executed rather than being skipped.etc/eslint/.eslintrc.tests.js) reports no problems for the three changed files.This mirrors the bound used by the already-merged sibling packages
stats/base/dists/weibull/cdf(#14281) andstats/base/dists/normal/cdf(#14274).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
Opened as a draft.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code running as an unattended scheduled task. It studied the previously merged ULP migrations (in particular the sibling packages
stats/base/dists/weibull/cdfandstats/base/dists/normal/cdf) to match the established idiom, applied the mechanical test conversion, and empirically measured the minimum ULP bound and ran the test suite to verify it.@stdlib-js/reviewers
Generated by Claude Code