From efa801c900c6adaac9372cc763265ad8b057b57f Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 9 Jul 2026 14:14:35 +0000 Subject: [PATCH 1/2] bench(@stdlib/ndarray/index-modes): update stale expected mode count The job `random_benchmarks` on workflow `random_benchmarks` failed on develop with `not ok 1 should return an array of length 3`. Root cause: `lib/modes.json` lists 4 supported index modes (`throw`, `normalize`, `clamp`, `wrap`), but `benchmark/benchmark.js` still asserted the pre-`wrap` count of 3. This commit updates the hardcoded length check and message to 4, matching the sibling `orders` package's exact-count benchmark convention, so the benchmark reflects the package's actual current mode list. Ref: https://github.com/stdlib-js/stdlib/actions/runs/28985599743 --- .../@stdlib/ndarray/index-modes/benchmark/benchmark.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/index-modes/benchmark/benchmark.js b/lib/node_modules/@stdlib/ndarray/index-modes/benchmark/benchmark.js index 86fa5b935b17..f03a126c4d73 100644 --- a/lib/node_modules/@stdlib/ndarray/index-modes/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/ndarray/index-modes/benchmark/benchmark.js @@ -35,8 +35,8 @@ bench( pkg, function benchmark( b ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { out = modes(); - if ( out.length !== 3 ) { - b.fail( 'should return an array of length 3' ); + if ( out.length !== 4 ) { + b.fail( 'should return an array of length 4' ); } } b.toc(); From 30a8ed515a5e0dd581a1ae9313052bedb5d79b5a Mon Sep 17 00:00:00 2001 From: Athan Date: Thu, 9 Jul 2026 13:07:55 -0700 Subject: [PATCH 2/2] bench: avoid hardcoding specific array length Co-authored-by: Athan Signed-off-by: Athan --- .../@stdlib/ndarray/index-modes/benchmark/benchmark.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/index-modes/benchmark/benchmark.js b/lib/node_modules/@stdlib/ndarray/index-modes/benchmark/benchmark.js index f03a126c4d73..8eb2581d62ce 100644 --- a/lib/node_modules/@stdlib/ndarray/index-modes/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/ndarray/index-modes/benchmark/benchmark.js @@ -35,8 +35,8 @@ bench( pkg, function benchmark( b ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { out = modes(); - if ( out.length !== 4 ) { - b.fail( 'should return an array of length 4' ); + if ( out.length < 2 ) { + b.fail( 'should return an array of strings' ); } } b.toc();