Repository navigation
test: migrate stats/base/dists/laplace/logpdf to ULP-based assertions - #14673
Merged
Merged
Conversation
Migrate the test suites for `stats/base/dists/laplace/logpdf` from relative tolerance (EPS-based) assertions to ULP difference assertions via `@stdlib/assert/is-almost-same-value`. The measured maximum ULP difference over the full fixture set is zero for both the JavaScript and the native implementations, and thus the minimum required ULP value is zero. Ref: #11352
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
marked this pull request as ready for review
August 27, 2026 05:40
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:
test/test.logpdf.js,test/test.factory.js, andtest/test.native.jsofstats/base/dists/laplace/logpdffrom relative tolerance (EPS-based) assertions to ULP difference assertions via@stdlib/assert/is-almost-same-value.delta/toltolerance branch (previouslytol = 1.0 * EPS * abs( expected[ i ] )) witht.strictEqual( isAlmostSameValue( y, expected[ i ], 0 ), true, 'returns expected value' ), retaining the existingexpected[ i ] !== nullguard.absandEPSrequires and the correspondingdelta/tolvariable declarations.Final ULP constant:
0, for all three test suites (main, factory, and native).The bound was tightened empirically. Starting from a high value and searching downward via a per-case minimum-ULP computation over the full fixture set (
positive_mean.json,negative_mean.json, andlarge_variance.json; 3000 fixture cases in total), the measured maximum ULP difference is0— every fixture value is reproduced bit-for-bit — so0is the minimum value at which the suites pass.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
make install-node-addons NODE_ADDONS_PATTERN="stats/base/dists/laplace/logpdf") so thattest/test.native.jsactually executed rather than being skipped; the native implementation also matches the fixtures exactly (max ULP difference0).test.logpdf.js, 3018/3018 intest.factory.js, and 3015/3015 intest.native.json both runs.make lint-javascript-tests TESTS_FILTER=".*/stats/base/dists/laplace/logpdf/.*"is clean.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This pull request was authored by an automated Claude Code agent running as a scheduled task, following the conventions established in previously merged ULP migration pull requests for this issue.
@stdlib-js/reviewers
Generated by Claude Code