Repository navigation
Conversation
Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HtvSGpkyByQ4moq9RNr2hZ
|
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. |
kgryte
left a comment
There was a problem hiding this comment.
The ULP values should be inlined.
Resolves a part of #11352.
Description
This pull request:
blas/base/scasumfrom relative tolerance assertions to ULP-based assertions, replacing thedelta/tolcomputation in theisApproxhelper with@stdlib/number/float32/base/assert/is-almost-same-value(the single-precision variant, matching the package's single-precision output and siblingblas/base/srotm).test/test.scasum.js,test/test.scasum.native.js,test/test.ndarray.js, andtest/test.ndarray.native.js. Only test files are changed.ULP = 1in every converted test.ULP measurement
Each approximate assertion was swept from a high bound downward to the minimum integer that still passes. The measured minimum for every assertion in this package is 1 ULP:
scasum( 4, x, 1 )1.6000000238418581.6scasum( 3, x, 1 )1.30000007152557371.3scasum( 4, x, 2 )1.6000000238418581.6scasum( 4, x, -1 )28.89999961853027328.9scasum( 4, x, -2, 6 )1.6000000238418581.6ULP = 0is not viable here because a zero bound degenerates to an exactSameValuecomparison, while the expected values in these tests are double-precision literals (e.g.1.6) rather than exactly representable single-precision values. Hence1is the tightest bound. The suite was run twice at the final bound to confirm deterministic results.Test cases that already asserted exact equality via
t.strictEqual(zero-N, view offsets, offset) were left untouched.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 native (
*.native.js) tests mirror the JavaScript ULP constants, following the convention in the already-migratedblas/base/drot,blas/base/drotm, andblas/base/srotm. The native add-on was not built in the environment used to author this change, so those tests were skipped locally and their bounds have not been empirically verified against the C implementation.Other
Opened as a draft pending CI, in particular the native add-on test runs.
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. The agent studied the already-migrated sibling packages (
blas/base/dzasum,blas/base/srotm,blas/base/drot) to mirror the established idiom, applied the conversion, and determined the minimum ULP bound empirically by sweeping bounds against the fixture values.@stdlib-js/reviewers
Generated by Claude Code