Skip to content

fix: propagate recent develop fixes to sibling packages (2026-05-20)#12218

Draft
Planeshifter wants to merge 3 commits into
developfrom
philipp/fix-propagation-2026-05-20
Draft

fix: propagate recent develop fixes to sibling packages (2026-05-20)#12218
Planeshifter wants to merge 3 commits into
developfrom
philipp/fix-propagation-2026-05-20

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

Propagating fixes merged to develop between 9559de0 (2026-05-19 18:52 -0400) and 8c6dabd (2026-05-20 03:14 -0700) to sibling packages with the same underlying defect.

Pattern: correct default order resolution via defaults.get() accessor

62d6dcc0b fixed a bug in @stdlib/ndarray/base/ndarraylike2ndarray/lib/main.js where defaults( 'order' ) ignores its argument and returns the full defaults object rather than the order string, so DEFAULT_ORDER held an object instead of a string, breaking the fallback path when getOrder( x ) returns falsy. The identical defect exists in @stdlib/ndarray/ndarraylike2ndarray, which receives the same single-line fix: defaults( 'order' )defaults.get( 'order' ). The remaining changes from 62d6dcc0b — switching inner calls to base APIs to avoid redundant validation — do not apply here, as @stdlib/ndarray/ndarraylike2ndarray is the validating public wrapper and must retain those calls.

Pattern: const-qualify compile-time ndims scalar in ndarray/base/assert/* benchmarks

Propagated from ffbae8968, which added const to compile-time-constant arrays and scalars in the benchmark loop of is-single-segment-compatible while leaving mutated variables (e.g., offset) unqualified. The ndims const addition is propagated to seven sibling packages (the shape[]/strides[] array-const additions were deliberately deferred — see Validation below). ndims is passed by value, so the local-only const addition is warning-free across all targets.

  • ffbae8968 (chore: fix C lint errors)
    • @stdlib/ndarray/base/assert/is-row-major
    • @stdlib/ndarray/base/assert/is-row-major-contiguous
    • @stdlib/ndarray/base/assert/is-column-major
    • @stdlib/ndarray/base/assert/is-contiguous
    • @stdlib/ndarray/base/assert/is-column-major-contiguous
    • @stdlib/ndarray/base/assert/is-buffer-length-compatible
    • @stdlib/ndarray/base/assert/is-buffer-length-compatible-shape

Pattern: correct "find a search vector" phrasing in blas/ext/base umbrella declarations

Commit 9559de0 corrected the misleading phrase "find a search vector" across per-package lib/*.js and docs/types/index.d.ts files for the row-finding APIs in blas/ext/base, but the umbrella namespace declarations file at blas/ext/base/docs/types/index.d.ts was missed. This patch replaces all 12 occurrences: 10 with "find a matching row" for the row-finding APIs (cindexOfRow, clastIndexOfRow, dindexOfRow, dlastIndexOfRow, gindexOfRow, glastIndexOfRow, sindexOfRow, slastIndexOfRow, zindexOfRow, zlastIndexOfRow) and 2 with "find a matching column" for the column-finding APIs (gindexOfColumn, sindexOfColumn), matching the wording already present in those packages' own declaration files.

Related Issues

None.

Questions

No.

Other

Validation

Reviewed all 37 commits merged to develop in the 24-hour window. Three propagatable source patterns advanced to the patch stage; per-pattern search scope and validation procedure:

  • Search scope: scoped to the source commit's namespace first (ndarray/base/assert/* for the const lint fix, ndarray/* for the defaults.get() fix, blas/ext/base/* for the typo correction), widened only when warranted by the pattern signature.
  • Two independent opus validation passes confirmed (a) the defect is present at each candidate site, (b) surrounding context does not change the semantics, and (c) the proposed patch matches the source commit's exact fix shape.
  • An adaptation pass produced the row-vs-column per-occurrence replacements for the umbrella blas/ext/base declarations file.
  • A style-consistency pass confirmed const placement, JS var-style, JSDoc indentation, and wording match the source-commit canonical form.

Deliberately excluded:

  • shape[]/strides[] const additions in ndarray/base/assert/*/benchmark/c/benchmark.c siblings: five of the seven target sibling C headers still declare the pointer parameters as int64_t *shape/int64_t *strides. Adding const to the local arrays would emit -Wdiscarded-qualifiers at the call sites — directly at odds with the source commit's "fix C lint errors" intent. A complete fix needs accompanying header/implementation patches, which exceeds single-file propagation scope.
  • The bench-string-interpolation pattern from ad8f9b59d (bench: refactor to use string interpolation in ndarray/base): open PRs bench: refactor to use string interpolation in array #11411, bench: refactor to use string interpolation in array/float32 #11341, and bench: refactor to use string interpolation in ndarray/base #11437 already propagate this pattern to other namespaces; dropped per the open-PR collision gate.
  • Autogenerated namespace-TOC and related-packages docs updates from 050cabae and 2dd6ec1c (stdlib-bot commits): generator-owned files.
  • Sites where applying the local-only patch would require touching multiple files in the same package (cascade rule) or interpretive judgment about whether the fix applies (e.g., 3df93b0c's Last argumentCallback argument error-message normalization, where "last argument" is intentional in many signatures).

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 on behalf of @Planeshifter as an automated propagation of fixes merged to develop over the prior 24 hours. Candidate source commits were filtered for generalizable patterns, sibling sites located via grep-able pattern signatures, and each proposed patch independently validated by parallel reviewer agents (two opus validation passes plus a style-consistency pass) before commits were applied in the primary worktree. A human will audit and promote the PR out of draft.


@stdlib-js/reviewers


Generated by Claude Code

claude added 3 commits May 20, 2026 13:31
Propagates fix from ffbae89 ("chore: fix C lint errors") to sibling
benchmark.c files in the `ndarray/base/assert/*` namespace. Adds the
`const` qualifier to the `ndims` scalar in each benchmark function;
since `ndims` is passed by value, the local-only change does not
cascade into header updates. `shape[]` and `strides[]` const-additions
were deliberately deferred because the corresponding sibling C headers
still take non-const pointers and adding `const` to the local arrays
would emit `-Wdiscarded-qualifiers` warnings — defeating the source
commit's lint-fix intent.
Propagates fix from 62d6dcc ("fix: avoid duplicate validation
overhead and fix default order resolution"). The expression
`defaults( 'order' )` ignores its argument and returns the full
defaults object instead of the order string, so `DEFAULT_ORDER` was
bound to an object and the `getOrder( x ) || DEFAULT_ORDER` fallback
in the public wrapper silently produced an object where a string was
required. Switches to the `defaults.get( 'order' )` per-key accessor
to mirror the base-package fix. The other changes from the source
commit (switching inner calls to base APIs to skip validation) do not
apply, as the public package is the validating wrapper.
…ations

Propagates fix from 9559de0 ("chore: propagate typo and doc-note
fixes across `blas` sibling packages") to the namespace-level
declarations file that the prior propagation missed. The misleading
phrase "find a search vector" (the function searches for a matching
row or column, not for the search vector itself) is replaced across
12 JSDoc blocks: 10 row-finding APIs (`cindexOfRow`, `clastIndexOfRow`,
`dindexOfRow`, `dlastIndexOfRow`, `gindexOfRow`, `glastIndexOfRow`,
`sindexOfRow`, `slastIndexOfRow`, `zindexOfRow`, `zlastIndexOfRow`)
get "find a matching row"; 2 column-finding APIs (`gindexOfColumn`,
`sindexOfColumn`) get "find a matching column", matching the wording
already present in the column packages' own declaration files.
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
blas/ext/base $\color{red}75912/91976$
$\color{green}+82.53%$
$\color{red}1358/1540$
$\color{green}+88.18%$
$\color{red}20/764$
$\color{green}+2.62%$
$\color{red}75912/91976$
$\color{green}+82.53%$
ndarray/base/assert/is-buffer-length-compatible-shape $\color{green}104/104$
$\color{green}+100.00%$
$\color{green}3/3$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}104/104$
$\color{green}+100.00%$
ndarray/base/assert/is-buffer-length-compatible $\color{green}118/118$
$\color{green}+100.00%$
$\color{green}4/4$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}118/118$
$\color{green}+100.00%$
ndarray/base/assert/is-column-major-contiguous $\color{green}137/137$
$\color{green}+100.00%$
$\color{green}5/5$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}137/137$
$\color{green}+100.00%$
ndarray/base/assert/is-column-major $\color{green}108/108$
$\color{green}+100.00%$
$\color{green}9/9$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}108/108$
$\color{green}+100.00%$
ndarray/base/assert/is-contiguous $\color{green}135/135$
$\color{green}+100.00%$
$\color{green}4/4$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}135/135$
$\color{green}+100.00%$
ndarray/base/assert/is-row-major-contiguous $\color{green}137/137$
$\color{green}+100.00%$
$\color{green}5/5$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}137/137$
$\color{green}+100.00%$
ndarray/base/assert/is-row-major $\color{green}108/108$
$\color{green}+100.00%$
$\color{green}9/9$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}108/108$
$\color{green}+100.00%$
ndarray/ndarraylike2ndarray $\color{green}143/143$
$\color{green}+100.00%$
$\color{red}7/8$
$\color{green}+87.50%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}143/143$
$\color{green}+100.00%$

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

Copy link
Copy Markdown
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the const changes in this PR should be reverted. Before we can include these changes, all of the functions need to change their signatures to include const parameters. At the moment, that is not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants