Skip to content

chore: clean-up - #16091

Merged
kgryte merged 4 commits into
developfrom
claude/cool-johnson-9m52nq
Oct 13, 2026
Merged

kgryte merged 4 commits into
developfrom
claude/cool-johnson-9m52nq

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • adds a missing lib/native.js to blas/base/caxpy and blas/base/ssyr2, renames a misnamed benchmark in blas/base/zaxpy, and fixes an incorrect @returns tag in blas/base/igamax. In each case the package deviated from a convention followed by at least 96% of its blas/base siblings.

blas/base/caxpy

  • Added lib/native.js. lib/index.js already does tryRequire( './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 as daxpy/lib/native.js: it attaches ndarray.native.js to caxpy.native.js as the ndarray method. 48 of the 50 blas/base packages that ship a native add-on (96%) have this file.

blas/base/ssyr2

  • Added lib/native.js, mirroring dsyr2/lib/native.js. The rest is the same as for caxpy: lib/index.js already tries to load the file, and ssyr2.native.js, ndarray.native.js, src/addon.c and binding.gyp are all present.

blas/base/zaxpy

  • Renamed benchmark/benchmark.native.ndarray.js to benchmark/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

  • Changed @returns {NumericArray} output array to @returns {integer} index value in lib/main.js. The function returns an index, and lib/ndarray.js and lib/accessors.js in the same package already use {integer} index value. In 70 of 71 packages (99%), the @returns type in lib/main.js matches the one in lib/ndarray.js.

Related Issues

Does this pull request have any related issues?

No.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

How the changes were found. I compared all 110 blas/base packages and flagged any package that differs from a pattern followed by at least 75% of them:

  • Structural pass: file tree, package.json and manifest.json keys, README headings, and test/benchmark/example file names.
  • Semantic pass: public signature, return kind, validation prologue, error construction and JSDoc shape, extracted from each package's lib/ sources.

How the findings were validated. Each candidate was checked independently three times:

  • whether the deviation was intentional, by reading the package source and comparing it with conforming siblings;
  • whether any test, example or documented contract relies on the current behavior;
  • whether the conformance counts are correct and the fix applies to the package.

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.js only loads when the add-on has been built, and the existing test/test.js in both packages already covers both the native and the JavaScript path.

Deliberately excluded.

  • dsymv and sspmv throw errors without format (23 of 25 validating packages use format). I left them out because open PRs refactor: update the implementation of blas/base/dsymv #11087 and refactor: update implementation for blas/base/sspmv #2839 already make that change.
  • 12 packages (dgemm, dspmv, dsymv, strmv, and others) have a lib/index.js that tries to load ./native.js but no native add-on at all. Fixing them requires a C implementation, so it is out of scope here.
  • dcabs1, scabs1 and xerbla ship lib/native.js, but their lib/index.js intentionally exports the JavaScript implementation.
  • The README ## Notes sections missing from 19 packages would need package-specific content, so I did not add them.
  • The *gemm packages have no benchmark/benchmark.js because they use per-configuration benchmark files instead.
  • Features without a clear majority (for example, the main API's return kind, split 50/50) were not analyzed for drift.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

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

`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
@stdlib-bot stdlib-bot added the BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). label Oct 12, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
blas/base/caxpy $\\color{green}403/403$
$\\color{green}+100.00\\%$
$\\color{green}18/18$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}403/403$
$\\color{green}+100.00\\%$
blas/base/igamax $\\color{green}268/268$
$\\color{green}+100.00\\%$
$\\color{green}19/19$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}268/268$
$\\color{green}+100.00\\%$
blas/base/ssyr2 $\\color{green}673/673$
$\\color{green}+100.00\\%$
$\\color{green}92/92$
$\\color{green}+100.00\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{green}673/673$
$\\color{green}+100.00\\%$

The above coverage report was generated for the changes in this PR.

@kgryte
kgryte marked this pull request as ready for review October 13, 2026 10:43
@kgryte
kgryte requested a review from a team October 13, 2026 10:43
@kgryte kgryte changed the title fix: add missing lib/native.js to blas/base/caxpy and blas/base/ssyr2 chore: clean-up Oct 13, 2026
@kgryte
kgryte merged commit 1f923e3 into develop Oct 13, 2026
36 checks passed
@kgryte
kgryte deleted the claude/cool-johnson-9m52nq branch October 13, 2026 10:44
@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. and removed Needs Review A pull request which needs code review. labels Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants