test: migrate stats/base/dists/invgamma/skewness to ULP-based assertions - #14573
Draft
kgryte wants to merge 1 commit into
Draft
test: migrate stats/base/dists/invgamma/skewness to ULP-based assertions#14573kgryte wants to merge 1 commit into
stats/base/dists/invgamma/skewness to ULP-based assertions#14573kgryte wants to merge 1 commit into
Conversation
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/invgamma/skewnessfrom relative tolerance testing to ULP difference testing, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.delta/tolcomparisons intest/test.jsandtest/test.native.jswitht.strictEqual( isAlmostSameValue( y, expected[ i ], 0 ), true, 'returns expected value' );, adding the@stdlib/assert/is-almost-same-valuerequire and dropping the now unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires.ULP bound:
0(bothtest/test.jsandtest/test.native.js), the measured minimum over the fixture set.The bound was determined empirically rather than assumed: for every fixture, the minimum admissible bound was found by scanning
isAlmostSameValueupward from0, and the maximum over the full Julia fixture set (all 200 values) is exactly0. That is, the implementation reproduces every fixture value bit-for-bit, so the bound is already at its floor and cannot be tightened further. The previous relative tolerance was2.0 * EPS, so this is a tightening, not a loosening, of the prior accuracy budget. Note that the removedif ( y === expected[ i ] ) { ... } else { ... }branch was therefore always taking the exact-equality path.The suite was run twice at the final bound with identical results (214/214 passing each time), so the bound is not sensitive to run-to-run variation.
The native addon was built locally for this package, so
test/test.native.jswas actually exercised rather than skipped (214/214 passing, twice, with no skipped assertions). Evaluating the C implementation over the same fixtures gives a maximum ULP difference of0as well, attained with all 200 values matching exactly, so a single bound is correct across both suites. This matches the sibling conversions in this family (erlang/skewness,gamma/kurtosis,weibull/entropy), which likewise use a single bound across both suites.Only the two test files are modified; no implementation, fixture, or documentation changes are included.
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
Two environment notes, neither of which affects the diff:
make install-node-modulesinitially failed in this sandbox because the npm registry mirror servesstring.prototype.trim@1.2.11but not itses-object-atoms@^1.1.2dependency. Installation succeeded with a temporary, local-onlyoverridesentry pinningstring.prototype.trimto1.2.10;package.jsonwas restored immediately afterwards and is unchanged in this PR.lint-editorconfigpre-commit hook could not run because theeditorconfig-checkerwrapper downloads its binary from GitHub releases, which is not reachable from this sandbox. The two changed files were instead verified manually against.editorconfig(LF endings, UTF-8, tab indentation, no trailing whitespace, final newline).make lint-javascript-tests TESTS_FILTER=".*/stats/base/dists/invgamma/skewness/.*"passes cleanly.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 studied previously merged conversions under #11352 (including the
erlang/skewnesssibling) to match the established idiom, applied the migration, measured the minimum ULP bound empirically against the fixtures for both the JS and the native implementations, and verified that the tests pass deterministically and that the files lint cleanly.@stdlib-js/reviewers
Generated by Claude Code