Repository navigation
chore: clean-up - #16091
Merged
Merged
chore: clean-up#16091
Conversation
`lib/index.js` attempts to load `./native.js`, but the file did not exist, so the native add-on was never used. Added `lib/native.js`, attaching the `ndarray` method to the native implementation, as do 48 of 50 (96%) `blas/base` packages that ship a native add-on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ww45AU5sngmnZj3CGPQP4
`lib/index.js` attempts to load `./native.js`, but the file did not exist, so the native add-on was never used. Added `lib/native.js`, attaching the `ndarray` method to the native implementation, as do 48 of 50 (96%) `blas/base` packages that ship a native add-on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ww45AU5sngmnZj3CGPQP4
Renamed `benchmark/benchmark.native.ndarray.js` to `benchmark/benchmark.ndarray.native.js`, matching the file name used by all 46 other `blas/base` packages that have a native ndarray benchmark (100%). No content changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ww45AU5sngmnZj3CGPQP4
The main export returns an index, not an output array. Changed the tag to `@returns {integer} index value`, matching `lib/ndarray.js` and `lib/accessors.js` in this package (main/ndarray `@returns` agreement: 70 of 71 packages, 99%).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ww45AU5sngmnZj3CGPQP4
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
marked this pull request as ready for review
October 13, 2026 10:43
kgryte
approved these changes
Oct 13, 2026
lib/native.js to blas/base/caxpy and blas/base/ssyr2
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:
lib/native.jstoblas/base/caxpyandblas/base/ssyr2, renames a misnamed benchmark inblas/base/zaxpy, and fixes an incorrect@returnstag inblas/base/igamax. In each case the package deviated from a convention followed by at least 96% of itsblas/basesiblings.blas/base/caxpylib/native.js.lib/index.jsalready doestryRequire( './native.js' ), but the file was missing, so the package always fell back to the JavaScript implementation even when the add-on was built. The new file has the same contents asdaxpy/lib/native.js: it attachesndarray.native.jstocaxpy.native.jsas thendarraymethod. 48 of the 50blas/basepackages that ship a native add-on (96%) have this file.blas/base/ssyr2lib/native.js, mirroringdsyr2/lib/native.js. The rest is the same as forcaxpy:lib/index.jsalready tries to load the file, andssyr2.native.js,ndarray.native.js,src/addon.candbinding.gypare all present.blas/base/zaxpybenchmark/benchmark.native.ndarray.jstobenchmark/benchmark.ndarray.native.js, the name used by all 46 other packages that have a native ndarray benchmark. The file content is unchanged.blas/base/igamax@returns {NumericArray} output arrayto@returns {integer} index valueinlib/main.js. The function returns an index, andlib/ndarray.jsandlib/accessors.jsin the same package already use{integer} index value. In 70 of 71 packages (99%), the@returnstype inlib/main.jsmatches the one inlib/ndarray.js.Related Issues
No.
Questions
No.
Other
How the changes were found. I compared all 110
blas/basepackages and flagged any package that differs from a pattern followed by at least 75% of them:package.jsonandmanifest.jsonkeys, README headings, and test/benchmark/example file names.lib/sources.How the findings were validated. Each candidate was checked independently three times:
All four changes were confirmed by every check that applied to them. None of them requires changes to tests or examples. The local clone has no
node_modules, so I could not run the package tests here.lib/native.jsonly loads when the add-on has been built, and the existingtest/test.jsin both packages already covers both the native and the JavaScript path.Deliberately excluded.
dsymvandsspmvthrow errors withoutformat(23 of 25 validating packages useformat). I left them out because open PRs refactor: update the implementation ofblas/base/dsymv#11087 and refactor: update implementation forblas/base/sspmv#2839 already make that change.dgemm,dspmv,dsymv,strmv, and others) have alib/index.jsthat tries to load./native.jsbut no native add-on at all. Fixing them requires a C implementation, so it is out of scope here.dcabs1,scabs1andxerblashiplib/native.js, but theirlib/index.jsintentionally exports the JavaScript implementation.## Notessections missing from 19 packages would need package-specific content, so I did not add them.*gemmpackages have nobenchmark/benchmark.jsbecause they use per-configuration benchmark files instead.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written primarily by Claude Code. It came out of an automated cross-package drift analysis of
blas/base, and each change was validated by several agents before it was committed.@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_016ww45AU5sngmnZj3CGPQP4
Generated by Claude Code