Repository navigation
fix: use matching precision for logspace base and exponents - #16397
harsh-thakkar7 wants to merge 1 commit into
Conversation
|
Hi Harsh, would independent tests for the temporary-buffer copy-back path be useful here? The new If you haven't already planned it, could you and a maintainer approve me taking a test-only follow-up for a non-contiguous output with a nonzero offset and a reversed output view? I'd check the computed values, returned object identity, and sentinel elements outside each view, with a non-integer exponent to exercise the higher-precision path. This would build on your implementation. I haven't run the package or these cases yet. |
|
Hi @Shubham-Padkonde, sorry for the slow reply. Yes, independent tests for the copy-back path would be useful, and please go ahead with the test-only follow-up for a non-contiguous output with a nonzero offset and a reversed output view. Checking the computed values, returned object identity, and the sentinel elements outside each view all sound right, and the non-integer exponent for the higher-precision path is a good idea. Thanks for asking first! |
|
Thanks, Harsh. I’ll wait for the precision decision on #16335 before building on this PR. If the float64 temporary stays, would the maintainers like me to add the two output-view tests in a separate PR after this lands? That would keep your implementation and the test follow-up independently reviewable. |
Resolves #16335.
Description
This pull request:
baseis normalized to the real precision expected by the selected kernel (float32forfloat32/complex64,float64forfloat64/complex128);float64/complex128when afloat64base ndarray is paired with a single-precision output, then downcasts only the result, per the maintainer guidance in the issue;startandstopto that compute precision so non-integer exponents are not rounded before the higher-precision computation;Related Issues
basehas the precision expected by the selected kernel inblas/ext/logspace#16379 (closed draft exploring the alternative downcast-base approach)Questions
No.
Other
Validation:
test.main.js595/595,test.assign.js441/441,test.normalize_arguments.js30/30, andtest.js3/3. ESLint reports 0 errors (two pre-existingmax-lineswarnings). The non-integer regression changes the result from1105.12939453125to1105.1297607421875, matching double-precision evaluation downcast to float32.Checklist
AI Assistance
Yes
No
Code generation
Test/benchmark generation
Documentation (including examples)
Research and understanding
Disclosure
This PR was prepared with Qoder AI assistance under the contributor's direction. All changed code and tests were reviewed and executed locally.
@stdlib-js/reviewers