Repository navigation
test: migrate blas/base/wasm/srot to ULP-based assertions - #15444
Conversation
Migrate the tests for `blas/base/wasm/srot` from relative tolerance assertions to ULP difference assertions. The `EPS`/`abs` based `isApprox` helper in `test/test.main.js`, `test/test.ndarray.js`, `test/test.module.main.js`, and `test/test.module.ndarray.js` is replaced with `@stdlib/number/float32/base/assert/is-almost-same-value`, following the idiom already used in `blas/base/wasm/cscal`. Each ULP bound is tightened to the minimum integer which still passes over the full fixture set. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MxidB8AeFaVEWsPmCsirHK --- 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:
blas/base/wasm/srotfrom relative tolerance assertions to ULP difference assertions, as proposed in [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.EPS/absbasedisApproxhelper intest/test.main.js,test/test.ndarray.js,test/test.module.main.js, andtest/test.module.ndarray.jswith@stdlib/number/float32/base/assert/is-almost-same-value, following the single-precision idiom already used inblas/base/wasm/cscal(and mirroring the double-precision migration inblas/base/wasm/drotm).The measured minimum ULP bounds are (
x/youtput arrays, respectively):x)y)test/test.main.jstest/test.main.jstest/test.main.jstest/test.main.jstest/test.main.jsxstride supporttest/test.main.jstest/test.main.jstest/test.ndarray.jstest/test.ndarray.jstest/test.ndarray.jstest/test.ndarray.jstest/test.ndarray.jsxstride supporttest/test.ndarray.jsxoffset supporttest/test.ndarray.jsystride supporttest/test.ndarray.jsyoffset supporttest/test.ndarray.jstest/test.ndarray.jstest/test.module.main.jstest/test.module.main.jstest/test.module.main.jstest/test.module.main.jstest/test.module.main.jsxstride supporttest/test.module.main.jsystride supporttest/test.module.main.jstest/test.module.main.jstest/test.module.ndarray.jstest/test.module.ndarray.jstest/test.module.ndarray.jstest/test.module.ndarray.jstest/test.module.ndarray.jsxstride supporttest/test.module.ndarray.jsxoffset supporttest/test.module.ndarray.jsystride supporttest/test.module.ndarray.jsyoffset supporttest/test.module.ndarray.jstest/test.module.ndarray.jsThe overall maximum bound is
6; most assertions are satisfied at0–2.Bounds were determined by measuring the exact ULP difference of every asserted value, taking the per-call-site maximum, and then confirming minimality: each of the 62 non-zero bounds was individually decremented by one and the corresponding test file re-run, and every one of those 62 runs failed. The full suite (1007 assertions across all seven test files) was run twice at the final bounds with identical results, so the bounds are not sensitive to run-to-run variation.
Only test files are changed; no source, documentation, or benchmark 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
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code. The test migration was performed mechanically against the idiom established in
blas/base/wasm/cscalandblas/base/wasm/drotm, and the ULP bounds were measured empirically rather than guessed.@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01MxidB8AeFaVEWsPmCsirHK
Generated by Claude Code