test: fix Complex64 import in tests#12054
Closed
Planeshifter wants to merge 2 commits intodevelopfrom
Closed
Conversation
Both test files imported `Complex64` from `@stdlib/complex/float64/ctor` (the `Complex128` constructor, 64-bit real + 64-bit imaginary) instead of `@stdlib/complex/float32/ctor` (the correct `Complex64` constructor, 32-bit real + 32-bit imaginary). The variable is used to construct expected values inserted into `Complex64Array` slots; using the wrong type makes the test semantically incorrect even though the only instantiation is `new Complex64( 0.0, 0.0 )` (zero is exactly representable in float32, so assertions do not fail numerically, but the wrong constructor is resolved at require-time and the wrong type is used throughout). The same defect was fixed in the sibling package `@stdlib/strided/base/binary` (commit 9a829b3, labeled "Bug"). Ref: 9a829b3
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
Member
|
/stdlib merge |
Complex64 import in testsComplex64 import in tests
Contributor
|
Thank you for working on this pull request. However, we cannot accept your contribution as the issue this pull request seeks to resolve has already been addressed in a different pull request or commit. Thank you again for your interest in stdlib, and we look forward to reviewing your future contributions. |
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.
Description
This pull request:
Complex64import in two test files for@stdlib/strided/base/map-by2. Bothtest.main.jsandtest.ndarray.jsrequired@stdlib/complex/float64/ctor(theComplex128constructor) and assigned it to a variable namedComplex64. The correct path is@stdlib/complex/float32/ctor. The fix is a one-line change on line 31 of each file, replacingfloat64withfloat32in the require path.The wrong constructor was used exclusively as
new Complex64( 0.0, 0.0 ). Because zero is exactly representable in both float32 and float64, no numerical assertion failed, masking the defect. The same root cause — afloat64/float32path substitution error — was identified and fixed today in the sibling package@stdlib/strided/base/binary(see commit9a829b3below). No source files, public APIs, or benchmarks are touched by this PR.Related Issues
None.
Questions
No.
Other
Sibling precedent: 9a829b3 — identical defect patched in
@stdlib/strided/base/binary, labeled "Bug" by maintainers.Root cause: Copy-paste or code-generation error substituted
float64forfloat32in the require path. Missed in original review because every instantiation isnew Complex64( 0.0, 0.0 ), which satisfies float32 numeric comparisons regardless of which constructor is invoked.Scope: 2 files changed, 2 lines changed (require paths only). No source files, no API surface, no benchmarks, no documentation affected. No regression is possible.
Reviewer verdicts (three independent agents, all
approve,blocking: false):Complex64usages are( 0.0, 0.0 ); change is strictly minimal; no regression possible.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
Claude Code identified the incorrect import path via a codebase-wide grep for the wrong
float64/ctorbinding, then applied the one-line fix in each file. Three separate Claude agent reviewers (correctness/Opus, regression-scope/Opus, style/Sonnet) independently verified the change before submission.Generated by Claude Code