Repository navigation
test: migrate stats/base/dists/planck/cdf to ULP-based assertions - #15650
Conversation
Replaces the relative-tolerance comparisons (`delta <= tol`) in the fixture loops with `@stdlib/assert/is-almost-same-value` assertions. The ULP bounds are the measured minima over the full fixture sets: `1` for the small `lambda` fixtures and `0` (i.e., exact) for the large `lambda` fixtures. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ih3rRmRJdoJ4wWMPTY83i
|
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/planck/cdffrom relative tolerance checks (delta <= tol, computed as1.0 * EPS * abs( expected[ i ] )) to ULP-based assertions using@stdlib/assert/is-almost-same-value.test/test.cdf.js,test/test.factory.js, andtest/test.native.js(the three files containing fixture loops with computed tolerances).test/test.jsonly performs exact comparisons and is left unchanged.@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires, along with thedeltaandtoldeclarations.ULP bounds
The bounds are the measured minima over the full fixture sets, determined by computing the maximum ULP difference between the actual and expected values for every fixture element:
small_lambda.json11(a single element,x = 1,lambda ≈ 0.0431137);0fails.large_lambda.json00is the minimum possible.The same bounds are used in
test.cdf.js,test.factory.js, andtest.native.js.Verification
test.native.jsis skipped, as the native add-on is not built in this environment).lambdabound to0fails for both the main and factory implementations, while1passes.make lint-javascript-files ... ESLINT_CONF=etc/eslint/.eslintrc.tests.jsis clean.Related Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352Questions
test.native.jsbounds mirror the JavaScript bounds, following the convention in already-converted packages (e.g.,stats/base/dists/poisson/cdf), but could not be measured here because the native add-on was not built. Please flag if you would prefer them verified against a built add-on first.Other
The inline integer bound idiom (rather than a named
ULPconstant) mirrors the prevailing convention instats/base/dists, where all already-converted test files use inline literals.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code, which surveyed prior converted packages to match the established idiom, applied the test edits, and measured the minimum ULP bounds empirically over the fixture sets.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_015ih3rRmRJdoJ4wWMPTY83i
Generated by Claude Code