From 5efe290a6ad59f62b70f892ab589fadad2ee6601 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 20 May 2026 13:31:44 +0000 Subject: [PATCH 1/3] chore: const-qualify `ndims` in `ndarray/base/assert/*` benchmarks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Propagates fix from ffbae8968 ("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. --- .../is-buffer-length-compatible-shape/benchmark/c/benchmark.c | 2 +- .../assert/is-buffer-length-compatible/benchmark/c/benchmark.c | 2 +- .../assert/is-column-major-contiguous/benchmark/c/benchmark.c | 2 +- .../ndarray/base/assert/is-column-major/benchmark/c/benchmark.c | 2 +- .../ndarray/base/assert/is-contiguous/benchmark/c/benchmark.c | 2 +- .../base/assert/is-row-major-contiguous/benchmark/c/benchmark.c | 2 +- .../ndarray/base/assert/is-row-major/benchmark/c/benchmark.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-buffer-length-compatible-shape/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/ndarray/base/assert/is-buffer-length-compatible-shape/benchmark/c/benchmark.c index 8dc87f32f35d..5c2bb40014d3 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-buffer-length-compatible-shape/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-buffer-length-compatible-shape/benchmark/c/benchmark.c @@ -96,7 +96,7 @@ static double benchmark( void ) { double t; int i; - int64_t ndims = 3; + const int64_t ndims = 3; int64_t shape[] = { 10, 10, 10 }; t = tic(); diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-buffer-length-compatible/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/ndarray/base/assert/is-buffer-length-compatible/benchmark/c/benchmark.c index 023463e534de..ef1bcda2f32e 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-buffer-length-compatible/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-buffer-length-compatible/benchmark/c/benchmark.c @@ -100,7 +100,7 @@ static double benchmark( void ) { int64_t shape[] = { 10, 10, 10 }; int64_t strides[] = { 100, 10, -1 }; int64_t offset = 0; - int64_t ndims = 3; + const int64_t ndims = 3; t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-column-major-contiguous/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/ndarray/base/assert/is-column-major-contiguous/benchmark/c/benchmark.c index 13ac19882061..22397ccd8a0d 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-column-major-contiguous/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-column-major-contiguous/benchmark/c/benchmark.c @@ -100,7 +100,7 @@ static double benchmark( void ) { int64_t shape[] = { 10, 10, 10 }; int64_t strides[] = { 1, 10, 100 }; int64_t offset = 0; - int64_t ndims = 3; + const int64_t ndims = 3; t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-column-major/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/ndarray/base/assert/is-column-major/benchmark/c/benchmark.c index 5a2d6fd3379d..31248b0bdea5 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-column-major/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-column-major/benchmark/c/benchmark.c @@ -96,7 +96,7 @@ static double benchmark( void ) { double t; int i; - int64_t ndims = 3; + const int64_t ndims = 3; int64_t strides[] = { 1, 10, 100 }; t = tic(); diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-contiguous/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/ndarray/base/assert/is-contiguous/benchmark/c/benchmark.c index b1431d03d351..e20bc9cbfd9c 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-contiguous/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-contiguous/benchmark/c/benchmark.c @@ -100,7 +100,7 @@ static double benchmark( void ) { int64_t shape[] = { 10, 10, 10 }; int64_t strides[] = { 1, 10, 100 }; int64_t offset = 0; - int64_t ndims = 3; + const int64_t ndims = 3; t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major-contiguous/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major-contiguous/benchmark/c/benchmark.c index d647a4611e44..5121a0c08ad6 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major-contiguous/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major-contiguous/benchmark/c/benchmark.c @@ -100,7 +100,7 @@ static double benchmark( void ) { int64_t shape[] = { 10, 10, 10 }; int64_t strides[] = { 100, 10, 1 }; int64_t offset = 0; - int64_t ndims = 3; + const int64_t ndims = 3; t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major/benchmark/c/benchmark.c index 0c7b631161f3..1c16a63e556f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major/benchmark/c/benchmark.c @@ -96,7 +96,7 @@ static double benchmark( void ) { double t; int i; - int64_t ndims = 3; + const int64_t ndims = 3; int64_t strides[] = { 100, 10, 1 }; t = tic(); From b17aa8df39dc6579d78e40855d2216c1d2af5958 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 20 May 2026 13:31:52 +0000 Subject: [PATCH 2/3] fix: correct default order resolution in `ndarray/ndarraylike2ndarray` Propagates fix from 62d6dcc0b ("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. --- .../@stdlib/ndarray/ndarraylike2ndarray/lib/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/ndarray/ndarraylike2ndarray/lib/main.js b/lib/node_modules/@stdlib/ndarray/ndarraylike2ndarray/lib/main.js index bfb11307cad3..882623bf9731 100644 --- a/lib/node_modules/@stdlib/ndarray/ndarraylike2ndarray/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/ndarraylike2ndarray/lib/main.js @@ -33,7 +33,7 @@ var defaults = require( '@stdlib/ndarray/defaults' ); // VARIABLES // -var DEFAULT_ORDER = defaults( 'order' ); +var DEFAULT_ORDER = defaults.get( 'order' ); // MAIN // From 762fa1a78f4ec2e88040bd696b97375f28acf507 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 20 May 2026 13:32:01 +0000 Subject: [PATCH 3/3] chore: correct row/column phrasing in `blas/ext/base` umbrella declarations Propagates fix from 9559de093 ("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. --- .../blas/ext/base/docs/types/index.d.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/docs/types/index.d.ts index 87c842ac2f0c..d6e5f72eba8b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/docs/types/index.d.ts @@ -342,7 +342,7 @@ interface Namespace { * * ## Notes * - * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - If the function is provided an empty matrix or if the function is unable to find a matching row, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. * * @param order - storage layout @@ -385,7 +385,7 @@ interface Namespace { * * ## Notes * - * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - If the function is provided an empty matrix or if the function is unable to find a matching row, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. * * @param order - storage layout @@ -1191,7 +1191,7 @@ interface Namespace { * * ## Notes * - * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - If the function is provided an empty matrix or if the function is unable to find a matching row, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. * * @param order - storage layout @@ -1265,7 +1265,7 @@ interface Namespace { * * ## Notes * - * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - If the function is provided an empty matrix or if the function is unable to find a matching row, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. * * @param order - storage layout @@ -3293,7 +3293,7 @@ interface Namespace { * * ## Notes * - * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - If the function is provided an empty matrix or if the function is unable to find a matching column, the function returns `-1` (i.e., an invalid index). * * @param order - storage layout * @param M - number of rows in `A` @@ -3325,7 +3325,7 @@ interface Namespace { * * ## Notes * - * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - If the function is provided an empty matrix or if the function is unable to find a matching row, the function returns `-1` (i.e., an invalid index). * * @param order - storage layout * @param M - number of rows in `A` @@ -3435,7 +3435,7 @@ interface Namespace { * * ## Notes * - * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - If the function is provided an empty matrix or if the function is unable to find a matching row, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. * * @param order - storage layout @@ -4893,7 +4893,7 @@ interface Namespace { * * ## Notes * - * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - If the function is provided an empty matrix or if the function is unable to find a matching column, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in row-major order. When the matrix is stored in column-major order, the workspace array is ignored. * * @param order - storage layout @@ -4936,7 +4936,7 @@ interface Namespace { * * ## Notes * - * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - If the function is provided an empty matrix or if the function is unable to find a matching row, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. * * @param order - storage layout @@ -5010,7 +5010,7 @@ interface Namespace { * * ## Notes * - * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - If the function is provided an empty matrix or if the function is unable to find a matching row, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. * * @param order - storage layout @@ -5894,7 +5894,7 @@ interface Namespace { * * ## Notes * - * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - If the function is provided an empty matrix or if the function is unable to find a matching row, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. * * @param order - storage layout @@ -5937,7 +5937,7 @@ interface Namespace { * * ## Notes * - * - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index). + * - If the function is provided an empty matrix or if the function is unable to find a matching row, the function returns `-1` (i.e., an invalid index). * - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored. * * @param order - storage layout