Repository navigation
Conversation
Migrate the remaining relative tolerance test cases in `test.factory.js` to ULP difference testing, matching the already migrated `test.pdf.js` and `test.native.js` in this package. The measured maximum ULP difference across all three fixture sets (small, medium, and large range; 3000 values) is zero, so the minimum required ULP value is 0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JXoRr3mZZKDUogNbuRfHXz --- 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 ---
This branch has not been deployed
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/triangular/pdfto ULP difference testing.The only file in this package still using relative tolerance was
test/test.factory.js; the siblingtest/test.pdf.jsandtest/test.native.jshad already been migrated, so this change bringstest.factory.jsin line with them.Each of the three fixture loops (small, medium, and large range) previously used:
and now uses:
The now-unused
absandEPSrequires, along with thedeltaandtoldeclarations, were removed, and@stdlib/assert/is-almost-same-valuewas added.ULP constant:
0(all three fixture loops).This is the measured minimum. The maximum observed ULP difference between the returned and expected values was
0across all 3000 fixture values (1000 each forsmall_range,medium_range, andlarge_range), for both thefactoryand the directpdfcode paths, so no non-zero ULP allowance is required. Note thatisAlmostSameValuewith amaxULPof0falls back to aSameValuecomparison; none of the fixtures contain a zero or signed-zero expected value, so this is safe. The implementation performs only plain IEEE 754 multiplication, subtraction, and division, which are correctly rounded and not subject to FMA contraction in JavaScript, so the result is bit-reproducible.The package's test suite was run twice at the final ULP value to confirm determinism (3027 passing assertions in
test.factory.jseach time, with no failures).Related Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352Questions
The already-migrated sibling
test/test.pdf.jsasserts the same three fixture sets with a ULP value of1, where0would also pass. This pull request uses the measured minimum of0fortest.factory.js, per the guidance in #11352 to use the minimum required ULP value. Happy to use1instead if you would prefer consistency withtest.pdf.jsover the tightest bound.Other
make test TESTS_FILTER=".*/stats/base/dists/triangular/pdf/.*"passes.test/test.native.jsreports 0 tests in this environment because the native add-on was not built; this is pre-existing and unrelated to this change.make eslint-tests TESTS_FILTER=".*/stats/base/dists/triangular/pdf/.*"passes cleanly.lint-editorconfig-filescheck could not be run in this environment, as it downloads theeditorconfig-checkerbinary from GitHub and network access to that repository was unavailable. The changed lines were verified manually to use tab indentation, LF line endings, no trailing whitespace, and a final newline.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This pull request was authored by Claude Code, run as an automated task by @kgryte. The migration mirrors the already-migrated
test/test.pdf.jsin the same package, and the ULP bound was measured empirically against all 3000 fixture values rather than guessed.@stdlib-js/reviewers
Generated by Claude Code