test: migrate stats/base/dists/negative-binomial/logpmf to ULP-based assertions - #14199
Merged
Conversation
…d assertions Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WqbmGdvGjziBtU3pQnBwDi
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
Member
|
An automated check found potentially unrelated issue/PR references in this PR:
Why this matters: GitHub automatically closes issues referenced with What to do:
This assessment was generated by an AI model and is informational only. Generated by Claude Code |
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/negative-binomial/logpmffrom relative tolerance testing to ULP difference testing, replacing the computeddelta/tolcomparisons with@stdlib/assert/is-almost-same-value.@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires and the associateddelta/tollocal variables.test/test.factory.jsandtest/test.logpmf.js(test/test.jsonly asserts exports and required no changes).The ULP bounds were tightened to the minimum value which still passes over the full fixture sets (each fixture set contains 1000 values, and the
factoryand main entry points require identical bounds):small_small.jsonrandp10.0 * EPS * abs( expected )66(fails at5; worst casex = 13,r = 9,p = 0.135318550619653)small_high.jsonr, largep40.0 * EPS * abs( expected )5757(fails at56; worst casex = 0,r = 8,p = 0.9868792801820985)high_small.jsonr, smallp10.0 * EPS * abs( expected )99(fails at8; worst casex = 39,r = 14,p = 0.12604764008592798)high_high.jsonrandp80.0 * EPS * abs( expected )109109(fails at108; worst casex = 1,r = 93,p = 0.8327586644536866)The larger bounds correspond to fixtures whose expected values are log-probabilities close to zero, where the relative tolerance expressed in ULPs is necessarily looser.
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 notes:
make test TESTS_FILTER=".*/stats/base/dists/negative-binomial/logpmf/.*"passes: 4026 assertions intest/test.factory.js, 4020 intest/test.logpmf.js, and 3 intest/test.js, with no failures. The suite was run twice at the final ULP values with identical results, in order to rule out FMA/architecture-dependent flakiness.N-1ULP; each set fails atN-1, so none of the four bounds can be lowered further.make lint-javascript-tests TESTS_FILTER=".*/stats/base/dists/negative-binomial/logpmf/.*"is clean.test/test.native.jsto update.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. The conversion mirrors the idiom established in previously merged migration commits, and the ULP bounds were determined empirically rather than guessed.
@stdlib-js/reviewers
Generated by Claude Code