Skip to content

feat: add TypeScript declarations for blas/base/igamax#12420

Merged
kgryte merged 1 commit into
developfrom
philipp/drift-blas-base-2026-06-01
Jun 1, 2026
Merged

feat: add TypeScript declarations for blas/base/igamax#12420
kgryte merged 1 commit into
developfrom
philipp/drift-blas-base-2026-06-01

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

Adds the missing docs/types/index.d.ts and docs/types/test.ts files for @stdlib/blas/base/igamax. The package's package.json already declares "types": "./docs/types" — pointing at a directory that did not exist. This patch makes that pointer resolve.

Namespace summary

  • Target: @stdlib/blas/base
  • Members: 110 total; 107 voted (3 namespace-aggregator packages — assert, ndarray, wasm — excluded).
  • Features extracted: file tree, package.json shape (top-level keys, scripts, keywords), manifest.json shape, README H2/H3 sections, test/benchmark/example file naming, plus a fast cross-package scan for error-construction patterns in lib/main.js.
  • Features with a clear majority (≥75%): top-level package.json keys (100%), manifest.json shape where present (100%), lib/, test/, examples/, docs/ directories (100%), benchmark/ directory (98%), docs/types/ directory (99%), docs/repl.txt (98%), test/test.js (100%), examples/index.js (100%), benchmark/benchmark.js (97%), README ## Usage / ## Examples (100% / 98%), and error-construction (the 4 main files that throw all use format).
  • Features without a clear majority (excluded): ## Notes (79% — many small enum/resolver utilities legitimately do not need notes), binding.gyp / include.gypi / src/ / native-bindings cluster (~47-53% — split intentionally between native and pure-JS implementations), ## C APIs (64%), ## See Also (23%), ## References (7%).

blas/base/igamax

igamax is the lone outlier on the docs/types/ feature (106/107 = 99% conformance). The package's own package.json declares "types": "./docs/types", but the directory does not exist; every other generic g* sibling (gasum, gaxpy, gcopy, gdot, ggemm, ggemv, gger, gnrm2, gscal, gswap, gsyr) ships one. The added index.d.ts adopts gasum's generic input typing — NumericArray | Collection<number> | AccessorArrayLike<number> — because igamax accepts any numeric array. The signature surface mirrors the existing idamax / isamax declarations (the closest i*amax siblings): a Routine interface with the 3-arg main overload and the 4-arg .ndarray overload, both returning number. The test.ts exercises both overloads against Float64Array and AccessorArray, with $ExpectError coverage for argument-type and arity mismatches matching the sibling conventions.

Validation

Checked:

  • Structural feature extraction across all 110 members (3 aggregators excluded).
  • Per-package agent extraction was scoped to error-construction patterns rather than full signature/JSDoc shape, since the 100% format-conformance signal made the wider semantic sweep unnecessary.
  • Three-agent drift validation on the surviving candidate. Both reviewers (cross-reference, structural) returned confirmed-drift.
  • Pre-validation open-PR collision check via GitHub MCP — no open PRs touch blas/base/igamax.
  • No tests or examples in blas/base/igamax/ reference the absence of docs/types/; the README's documented signatures (igamax( N, x, strideX ) and igamax.ndarray( N, x, strideX, offsetX ), both returning an index) match the declarations exactly.

Deliberately excluded:

Related Issues

None.

Questions

No.

Other

Generated by an automated cross-package drift-detection run (random-pick namespace selection; full per-feature distribution and dropped-candidate log live in the local report). The diff is mechanical: two new files, no edits to existing code, no observable behavior change.

Checklist

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

This PR was authored by Claude Code as part of an automated cross-package drift-detection routine. The drift was identified by structural feature extraction across @stdlib/blas/base/; the proposed fix was validated by parallel cross-reference and structural-review subagents (both confirmed-drift); the .d.ts and .ts content was generated by modeling on the existing blas/base/gasum/docs/types/ (generic input typing) and blas/base/idamax/docs/types/ (index-returning Routine interface) siblings.


@stdlib-js/reviewers


Generated by Claude Code

Adds the missing `docs/types/index.d.ts` and `docs/types/test.ts`
declarations for `blas/base/igamax`. The package's `package.json`
already declares `"types": "./docs/types"` (pointing at a directory
that did not exist), and the surrounding generic `g*` siblings under
`blas/base/` (gasum, gaxpy, gcopy, gdot, gnrm2, gscal, gswap, gsyr,
ggemv, gger, ggemm) all ship `docs/types/`. The index/`.ndarray`
signature is modeled on the closest BLAS-`amax` sibling (`idamax`,
`isamax`) and the input typing — `NumericArray | Collection<number> |
AccessorArrayLike<number>` — is modeled on the closest generic
sibling (`gasum`).

Added missing `docs/types/index.d.ts` and `docs/types/test.ts` (present
in 99% of siblings; 106/107 voted members).
@stdlib-bot stdlib-bot added the BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). label Jun 1, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
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\%$

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

@kgryte kgryte marked this pull request as ready for review June 1, 2026 08:28
@kgryte kgryte requested a review from a team June 1, 2026 08:28
@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. labels Jun 1, 2026
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Jun 1, 2026
@kgryte kgryte merged commit 57b21c2 into develop Jun 1, 2026
70 checks passed
@kgryte kgryte deleted the philipp/drift-blas-base-2026-06-01 branch June 1, 2026 08:28
@kgryte kgryte added GSoC Google Summer of Code. gsoc: 2026 Google Summer of Code (2026). and removed GSoC Google Summer of Code. gsoc: 2026 Google Summer of Code (2026). labels Jun 1, 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