Conversation
Replace relative tolerance comparisons with `isAlmostSameValue` ULP difference assertions. Measured minimum ULP bounds over the full fixture sets: 9 (large gamma), 12 (`x0 < 0`), and 6 (`x0 > 0`). Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JJpTawRyis6YRq457jNZ8b
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/cauchy/logcdffrom relative tolerance testing to ULP difference testing, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.Only test files are changed (
test/test.logcdf.js,test/test.factory.js,test/test.native.js);test/test.jscontains no tolerance-based assertions and is left untouched. The implementation is unchanged.Per fixture set, the ULP constants were tightened to the measured minimum over the full 1000-element fixture:
large_gamma.json7.0 * EPS * abs( expected[i] )99(fails at8)negative_median.json7.0 * EPS * abs( expected[i] )(JS),300.0 * EPS * ...(native)1212(fails at11)positive_median.json7.0 * EPS * abs( expected[i] )(JS),220.0 * EPS * ...(native)66(fails at5)The same constants are used in all three test files.
Related Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352Questions
One, concerning
test/test.native.js.The native add-on is not built in the environment used to author this PR, so
test/test.native.jsis skipped there and the C implementation could not be exercised through the add-on. To avoid guessing,src/main.cwas compiled standalone together with its resolved C dependency closure (math/base/special/atan2,math/base/special/ln, etc.) and evaluated against the same fixtures. That C implementation reproduced the JavaScript ULP profile exactly —9/12/6, identical worst-case indices, and stable across-O0,-O2, and-O3— so the native test uses the same constants as the JavaScript tests.Note that this tightens the native assertions considerably relative to the previous
300.0 * EPSand220.0 * EPStolerances (roughly 300–600 ULP). The measurement suggests those tolerances were loose padding rather than evidence of real JS/C divergence, but a reviewer with a built add-on may wish to confirm on their own platform before this is merged.Other
Verification performed:
test.logcdf.js(3014 assertions) andtest.factory.js(3018 assertions) pass;test.js(3 assertions) is unchanged and passes.N-1,large_gammaandnegative_medianeach produce one failure andpositive_medianproduces three, for both the main export and the factory-generated function..eslintrc.jsandetc/eslint/.eslintrc.tests.js.Marked as a draft pending the native add-on question above.
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 selected the package, mirrored the conversion idiom from the already-migrated sibling package
stats/base/dists/cauchy/logpdf, measured the minimum ULP bounds against the fixtures, and ran the verification described above.@stdlib-js/reviewers
Generated by Claude Code