Repository navigation
test: migrate stats/base/dists/geometric/median to ULP-based assertions - #16085
Conversation
…ions Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PLFuz8CVWmXctkncnwpzcA --- 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 ---
|
Hello! 👋 We've noticed that you've been opening a number of PRs addressing good first issues. Thank you for your interest and enthusiasm! Now that you've made a few contributions, we suggest no longer working on good first issues. Instead, we encourage you to prioritize cleaning up any PRs which have yet to be merged and then proceed to work on more involved tasks. Not only does this ensure that other new contributors can work on things and get ramped up on all things stdlib, it also ensures that you can spend your time on more challenging problems. 🚀 For ideas for future PRs, feel free to search the codebase for TODOs and FIXMEs and be sure to check out other open issues on the issue tracker. Cheers! |
Coverage Report
The above coverage report was generated for the changes in this PR. |
Resolves a part of #11352.
Description
This pull request:
@stdlib/stats/base/dists/geometric/medianfrom relative tolerance (EPS-scaled) comparisons to ULP-based assertions using@stdlib/assert/is-almost-same-value.delta/tolcomputation and theif ( y === expected[i] ) { ... } else { ... }branch intest/test.native.jswitht.strictEqual( isAlmostSameValue( y, expected[ i ], 0 ), true, 'returns expected value' );, and drops the now unusedabsandEPSimports.Final ULP constant:
0.The bound was tightened agentically. Starting from a high bound (
64) and lowering, the minimum integer ULP value which still passes over the full fixture set is0(i.e., the native implementation returns bit-for-bit identical values). This was measured per-fixture over all 1000 cases intest/fixtures/julia/data.json: the maximum required ULP difference is0, so0is both the measured minimum and the floor. The package test suite was run twice at the final bound, with identical results both times (1007 passing assertions per test file, 0 failures), confirming the bound is not architecture- or FMA-sensitive in this environment.test/test.jsis intentionally left unchanged: it already performs an exact comparison (t.strictEqual( y, expected[i], ... )) and contains no tolerance math, matching the existing state of sibling packages such asstats/base/dists/t/varianceandstats/base/dists/negative-binomial/variance. Only the test file containing tolerance math is modified; no source, 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
stats/base/dists/geometric/quantile(test: migratestats/base/dists/geometric/quantileto ULP-based assertions #16078).make lint-editorconfig-filescould not be run in this environment because theeditorconfig-checkerbinary could not be downloaded; formatting was instead verified manually (tabs for indentation, LF line endings, no trailing whitespace, single trailing newline). The project's JavaScript test lint ran via the pre-commit hook and reported no problems.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written primarily by Claude Code, running as an unattended scheduled task. It studied the prior art in already-converted sibling packages, applied the conversion, and determined the minimum passing ULP bound empirically over the full fixture set.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01PLFuz8CVWmXctkncnwpzcA
Generated by Claude Code