Repository navigation
test: migrate stats/base/dists/betaprime/logcdf to ULP-based assertions - #15519
Merged
Merged
Conversation
…ions Replace relative tolerance comparisons with `isAlmostSameValue` assertions in the `logcdf` and `factory` fixture loops. Each ULP bound is the measured minimum which passes over the full fixture set: - `both_large`: 24 ULP - `large_alpha`: 14 ULP - `large_beta`: 394 ULP Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017hromeZsxQw8Yt9DEQzL9S
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
marked this pull request as ready for review
September 25, 2026 02:31
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/betaprime/logcdffrom relative tolerance testing to ULP difference testing, replacing thedelta/tol/EPScomparisons in the fixture loops oftest/test.logcdf.jsandtest/test.factory.jswitht.strictEqual( isAlmostSameValue( y, expected[ i ], N ), true, 'returns expected value' ).@stdlib/assert/is-almost-same-valuerequire and drops the now-unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires.The ULP bound for each fixture is the measured minimum which passes over the full 1000-element fixture set (identical for the main export and the factory-created function):
main/factory)both_large120.0 * EPS/120.0 * EPSlarge_alpha120.0 * EPS/10.0 * EPSlarge_beta400.0 * EPS/400.0 * EPSEach bound was tightened until one fixture case fails at
N-1, so none can be lowered further:Only the two test files are changed; no implementation, fixtures, or documentation were touched. The suite was run twice at the final bounds to confirm determinism (6055 assertions, 0 failures, identical both runs), and
make eslint-tests TESTS_FILTER=".*/stats/base/dists/betaprime/logcdf/.*"is 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
No.
Other
The
if ( y === expected[i] ) { ... } else { ... }split in the original fixture loops was collapsed into a singleisAlmostSameValueassertion, matching the converted sibling packagestats/base/dists/betaprime/cdf, sinceisAlmostSameValuealready returnstruefor exactly equal values.Note: the
lint_editorconfigpre-commit task could not be run in the authoring environment, aseditorconfig-checkeris fetched from a GitHub release that the environment could not reach. The changed lines were verified manually against.editorconfig(tab indentation, LF endings, UTF-8, no new trailing whitespace, final newline present); the other applicable pre-commit tasks (lint_filenames,lint_javascript_tests) were run and pass.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written by Claude Code as part of an automated, unattended run of the
#11352migration. It studied the already-converted sibling packagestats/base/dists/betaprime/cdfto mirror the project's settled idiom, measured the minimum ULP bounds by binary search over the fixture sets, and verified them against the test runner.@stdlib-js/reviewers
Generated by Claude Code