Repository navigation
test: migrate stats/base/dists/gamma/mean to ULP-based assertions - #15683
Merged
Merged
Conversation
Replace the relative tolerance assertions in the fixture loops with `@stdlib/assert/is-almost-same-value`, using the minimum required ULP value (1) for both the JavaScript and native test suites. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kzet3PR1rz8dncKtRLZ7eW
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
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/gamma/meanfrom relative tolerance assertions to ULP difference assertions, replacing theEPS-scaleddelta <= tolchecks in the fixture loops withisAlmostSameValue( y, expected[ i ], 1 )in bothtest/test.jsandtest/test.native.js.@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires and the associateddelta/tollocals.Final ULP constant:
1(bothtest/test.jsandtest/test.native.js).The bound was tightened from a high starting point down to the measured minimum. Over the full 200-value Julia fixture set (
test/fixtures/julia/data.json), the maximum observed ULP difference is1:0ULP → 45 of 200 fixture cases fail.1ULP → all cases pass.So
1is the minimum integer bound which passes, for both the JavaScript and the native implementation. Both implementations computealpha / beta, which IEEE-754 rounds exactly, so the two produce bit-identical results across the fixture set (0 divergences measured) and share the same bound; no JS-vs-C split was required.The package test suite (214 assertions per file) was run twice at the final bound, with the native add-on compiled so that
test/test.native.jsactually executes rather than skipping. Both runs were fully green, confirming there is no FMA/arch-dependent flakiness at1ULP.Only the two test files are changed.
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
The repository's
editorconfig-checkerpre-commit lint could not run in this environment, as the checker downloads its binary from theeditorconfig-checker/editorconfig-checkerGitHub releases, which is outside the network allowances available here. Formatting of the two changed files was instead verified manually (tab indentation, LF line endings, no trailing whitespace, single final newline).make lint-javascript-testspasses for both files.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written by Claude Code, running as an unattended scheduled task. It selected the package, mirrored the conversion idiom from already-merged PRs in the same family, measured the minimum ULP bound, and verified the tests and lint locally.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01Kzet3PR1rz8dncKtRLZ7eW
Generated by Claude Code