test: migrate stats/base/dists/frechet/logpdf to ULP-based assertions - #14851
Draft
kgryte wants to merge 1 commit into
Draft
test: migrate stats/base/dists/frechet/logpdf to ULP-based assertions#14851kgryte wants to merge 1 commit into
stats/base/dists/frechet/logpdf to ULP-based assertions#14851kgryte wants to merge 1 commit into
Conversation
Ref: #11352 Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014ELuZviBroYtrbvbt8KQG7
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/frechet/logpdffrom relative tolerance testing (delta <= N * EPS * abs( expected )) to ULP difference testing using@stdlib/assert/is-almost-same-value.The following files are updated, each containing the same three Julia fixture loops:
large_shape.jsonlarge_scale.jsonboth_large.jsontest/test.logpdf.jstest/test.factory.jstest/test.native.jsEach bound is the measured minimum over the full fixture set (1000 cases per fixture, 3000 cases per file). Lowering the bounds by one ULP fails:
large_shapeyields 34 failures at1,large_scaleyields 30 failures at1, andboth_largeyields 1 failure at24.The JavaScript, factory, and C implementations were each measured independently and agree exactly on all three bounds, so a single set of values is used across the three files.
Only the three test files are changed; no implementation, documentation, or fixture files are touched.
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 performed locally:
The native add-on was built locally so that
test/test.native.jsactually executed rather than being skipped. The full suite was run twice at the final bounds to confirm the results are deterministic, and the add-on was additionally rebuilt withCFLAGS="-ffp-contract=off"to confirm the C bounds are not sensitive to FMA contraction (identical bounds in both builds).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. The agent studied previously merged conversions under this tracking issue (in particular the sibling package
stats/base/dists/frechet/logcdf) to match the established idiom, applied the migration, and determined the minimum ULP bounds empirically by computing the exact per-element ULP distance across the fixture set and confirming failures one ULP below each bound.@stdlib-js/reviewers