test: migrate stats/base/dists/gumbel/stdev to ULP-based assertions - #14811
Draft
kgryte wants to merge 1 commit into
Draft
test: migrate stats/base/dists/gumbel/stdev to ULP-based assertions#14811kgryte wants to merge 1 commit into
stats/base/dists/gumbel/stdev to ULP-based assertions#14811kgryte wants to merge 1 commit into
Conversation
Ref: #11352 --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: skipped - task: lint_markdown_pkg_readmes status: na - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
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/gumbel/stdevfrom relative tolerance testing to ULP difference testing, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.The computed-tolerance idiom (
delta = abs( y - expected[i] ),tol = 1.0 * EPS * abs( expected[i] ),t.ok( delta <= tol, ... )) is replaced withisAlmostSameValuefrom@stdlib/assert/is-almost-same-value, and the now-unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires are dropped. The existingexpected[i] !== nullguard is preserved. Onlytest/test.jsandtest/test.native.jsare changed.Final ULP constant:
1(bothtest/test.jsandtest/test.native.js).This is the measured minimum. Before editing, the JavaScript and C implementations were both run against the full Julia fixture set (100 cases, no
nullentries) and the minimum passing ULP bound was computed for every individual case:Nlib/main.js)src/main.c, addon built locally)Both implementations agree bit-for-bit with each other, which is expected from the sources: each computes
PI_OVER_SQRT6 * beta— a single correctly rounded IEEE-754 double multiplication, with no addition for a compiler to contract into an FMA. There is therefore no JS-vs-C divergence of the kind described in the FAQ, and no architecture-dependent rounding to absorb.1is the tightest bound that passes. The worst case ismu = -3.3192170148182183,beta = 0.9006151006176755, where the returned1.1550837443384099is one ULP above the fixture value1.1550837443384097. Running the suite atN = 0fails 18 of the 100 fixture assertions, so the bound is not merely conservative and the assertions are non-vacuous.The suite was run twice at
N = 1with the native addon built, and bothtest/test.js(110 assertions) andtest/test.native.js(111 assertions) passed identically on both runs.test/test.native.jswas confirmed to be actually executing rather than skipping.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
Opened as a draft.
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. It selected the package, studied prior converted packages in the same family to match the established idiom, measured the minimum passing ULP bound for every fixture case against both the JavaScript and C implementations, and applied the edits.
@stdlib-js/reviewers
Generated by Claude Code