test: migrate stats/base/dists/discrete-uniform/stdev to ULP-based assertions - #14337
Merged
Conversation
…assertions Replaces the EPS-derived tolerance check with `isAlmostSameValue`, tightened to a maximum ULP difference of 1 measured against the full fixture set. 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 ---
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
approved these changes
Aug 16, 2026
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves a part of #11352.
Description
This pull request:
stats/base/dists/discrete-uniform/stdevfrom 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.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 ], 1 ), true, 'returns expected value' );.No implementation, fixture, or documentation files are touched, and no test cases were added, removed, or otherwise altered.
ULP bound
The converted assertion loop uses an ULP value of
1, which is the measured minimum.The bound was measured rather than guessed: computing the exact ULP difference (via
@stdlib/number/float64/base/ulp-difference) between the computed value and the expected fixture value for all 1000 fixtures (test/fixtures/julia/data.json) yields a maximum observed ULP difference of1.Verification:
test/test.js— 1008 assertions (1000 fixture comparisons + 8 edge-case assertions), all passing at ULP bound1.test/test.native.jswas updated identically for consistency with the JS implementation's idiom; the native add-on was not compiled in this environment, so those assertions are skipped (as they were prior to this change, sincelib/native.jsis not built by default).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 issue and previously merged ULP migrations in the same package family (notably the sibling package
stats/base/dists/discrete-uniform/cdf, #14311) to match the established idiom, applied the mechanical test conversion, and empirically measured the minimum ULP bound before verifying the test suite.@stdlib-js/reviewers
Generated by Claude Code