test: migrate stats/base/dists/rayleigh/entropy to ULP-based assertions - #15162
test: migrate stats/base/dists/rayleigh/entropy to ULP-based assertions#15162Planeshifter wants to merge 1 commit into
stats/base/dists/rayleigh/entropy to ULP-based assertions#15162Conversation
Replaces the relative-tolerance (EPS/delta/tol) comparison in the fixture-driven test with `@stdlib/assert/is-almost-same-value`, matching the idiom used in previously converted sibling packages (e.g., stats/base/dists/rayleigh/pdf, rayleigh/cdf). Applies to both test/test.js and test/test.native.js. The minimum required ULP bound was measured empirically by computing the ULP distance between actual and expected values across the full fixture set for both the JavaScript and native implementations: max observed diff is 1 ULP for both. Verified that a bound of 0 fails (6 assertions) and 1 passes deterministically across repeated runs. Resolves a part of #11352. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HPZpFvV75WUR79qSe8Katc --- 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:
@stdlib/stats/base/dists/rayleigh/entropyfrom relative-tolerance testing to ULP (units in the last place) based assertions, per the migration described in [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.delta/tolrelative-tolerance comparison (and the now-dead exact-match branch) in the fixture-driven test with a singlet.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );assertion, mirroring the idiom used in already-converted sibling packages (e.g.stats/base/dists/rayleigh/pdf,rayleigh/cdf,rayleigh/logcdf,rayleigh/quantile,rayleigh/variance).test/test.jsandtest/test.native.js. No other files are changed.1, for both the JavaScript implementation and the native C implementation (built locally vianode-gyp rebuildsotest/test.native.jswas actually exercised rather than skipped). A bound of0fails 6 assertions in each file.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
Verification performed locally on
linux/x64, Node.js v22:test/test.js— 56 passing, 0 failingtest/test.native.js— 56 passing, 0 failing (native add-on built locally)1) with identical results, confirming no FMA/architecture-dependent flakiness locally.npx eslintandmake lint-javascript-tests TESTS_FILTER=".*/stats/base/dists/rayleigh/entropy/.*"are both clean for the changed files.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written primarily by Claude Code, running as an unattended scheduled task. It searched the repository for packages still using the relative-tolerance test idiom, studied the git history of several already-converted packages in the same distribution family (e.g.
stats/base/dists/rayleigh/pdf,rayleigh/variance) to mirror the established idiom, applied the conversion, and determined the minimum ULP bound by computing the exact ULP distance between actual and expected values across the fixture set for both the JS and native implementations.@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01HPZpFvV75WUR79qSe8Katc
Generated by Claude Code