From 87bfa26135a2e3aec4030040d2e0790abe42026f Mon Sep 17 00:00:00 2001 From: Faraz Ghani Date: Sun, 16 Nov 2025 02:57:52 +0530 Subject: [PATCH 1/6] chore: fix JavaScript lint errors (issue #8508) --- .../ndarray/base/assert/is-row-major/examples/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major/examples/index.js b/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major/examples/index.js index 13e6c0bc321b..805b43067c8b 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major/examples/index.js +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major/examples/index.js @@ -25,7 +25,7 @@ var shape = [ 10, 10, 10 ]; var strides = shape2strides( shape, 'row-major' ); console.log( 'Strides: %s', strides.join( ',' ) ); -// => Strides: 100,10,1 +// => 'Strides: 100,10,1' var bool = isRowMajor( strides ); console.log( bool ); @@ -33,7 +33,7 @@ console.log( bool ); strides = shape2strides( shape, 'column-major' ); console.log( 'Strides: %s', strides.join( ',' ) ); -// => Strides: 1,10,100 +// => 'Strides: 1,10,100' bool = isRowMajor( strides ); console.log( bool ); From 89624b341369e67cc480f7264c8225597e7b0300 Mon Sep 17 00:00:00 2001 From: Faraz Ghani Date: Tue, 2 Dec 2025 15:52:11 +0530 Subject: [PATCH 2/6] bench: refactor to use dynamic memory allocation in blas/base/drot --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../base/drot/benchmark/c/benchmark.length.c | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/drot/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/drot/benchmark/c/benchmark.length.c index da9726c259fc..7a1786e61545 100644 --- a/lib/node_modules/@stdlib/blas/base/drot/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/drot/benchmark/c/benchmark.length.c @@ -96,11 +96,13 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; - double y[ len ]; + double *x; + double *y; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); + y = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*200.0 ) - 100.0; y[ i ] = ( rand_double()*200.0 ) - 100.0; @@ -117,6 +119,9 @@ static double benchmark1( int iterations, int len ) { if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); } + + free( x ); + free( y ); return elapsed; } @@ -129,11 +134,14 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; - double y[ len ]; + double *x; + double *y; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); + y = (double *) malloc( len * sizeof( double ) ); + for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*200.0 ) - 100.0; y[ i ] = ( rand_double()*200.0 ) - 100.0; @@ -150,6 +158,10 @@ static double benchmark2( int iterations, int len ) { if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); } + + free( x ); + free( y ); + return elapsed; } From c354cf2d213d09040f103d561ab4b80f03ac3643 Mon Sep 17 00:00:00 2001 From: Faraz Ghani Date: Tue, 2 Dec 2025 16:23:24 +0530 Subject: [PATCH 3/6] bench: refactor to use dynamic memory allocation in blas/base/dcopy --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../base/dcopy/benchmark/c/benchmark.length.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dcopy/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/dcopy/benchmark/c/benchmark.length.c index cb0c65d1c0c7..dc81cea210f2 100644 --- a/lib/node_modules/@stdlib/blas/base/dcopy/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/dcopy/benchmark/c/benchmark.length.c @@ -96,11 +96,14 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; - double y[ len ]; + double *x; + double *y; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); + y = (double *) malloc( len * sizeof( double ) ); + for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*20000.0 ) - 10000.0; y[ i ] = 0.0; @@ -117,6 +120,9 @@ static double benchmark1( int iterations, int len ) { if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); } + + free( x ); + free( y ); return elapsed; } @@ -129,11 +135,13 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; - double y[ len ]; + double *x; + double *y; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); + y = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*20000.0 ) - 10000.0; y[ i ] = 0.0; @@ -150,6 +158,8 @@ static double benchmark2( int iterations, int len ) { if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); + free( y ); return elapsed; } From eae91d4cd3ea8c0f1f283f2a157a784231689d92 Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 2 Dec 2025 20:44:38 -0800 Subject: [PATCH 4/6] Discard changes to lib/node_modules/@stdlib/blas/base/drot/benchmark/c/benchmark.length.c --- .../base/drot/benchmark/c/benchmark.length.c | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/drot/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/drot/benchmark/c/benchmark.length.c index 7a1786e61545..da9726c259fc 100644 --- a/lib/node_modules/@stdlib/blas/base/drot/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/drot/benchmark/c/benchmark.length.c @@ -96,13 +96,11 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double *x; - double *y; + double x[ len ]; + double y[ len ]; double t; int i; - x = (double *) malloc( len * sizeof( double ) ); - y = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*200.0 ) - 100.0; y[ i ] = ( rand_double()*200.0 ) - 100.0; @@ -119,9 +117,6 @@ static double benchmark1( int iterations, int len ) { if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); } - - free( x ); - free( y ); return elapsed; } @@ -134,14 +129,11 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double *x; - double *y; + double x[ len ]; + double y[ len ]; double t; int i; - x = (double *) malloc( len * sizeof( double ) ); - y = (double *) malloc( len * sizeof( double ) ); - for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*200.0 ) - 100.0; y[ i ] = ( rand_double()*200.0 ) - 100.0; @@ -158,10 +150,6 @@ static double benchmark2( int iterations, int len ) { if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); } - - free( x ); - free( y ); - return elapsed; } From 142364521700e2bb4ddc765b29f0bb9489d7a94f Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 2 Dec 2025 20:44:43 -0800 Subject: [PATCH 5/6] Discard changes to lib/node_modules/@stdlib/ndarray/base/assert/is-row-major/examples/index.js --- .../ndarray/base/assert/is-row-major/examples/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major/examples/index.js b/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major/examples/index.js index 805b43067c8b..13e6c0bc321b 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major/examples/index.js +++ b/lib/node_modules/@stdlib/ndarray/base/assert/is-row-major/examples/index.js @@ -25,7 +25,7 @@ var shape = [ 10, 10, 10 ]; var strides = shape2strides( shape, 'row-major' ); console.log( 'Strides: %s', strides.join( ',' ) ); -// => 'Strides: 100,10,1' +// => Strides: 100,10,1 var bool = isRowMajor( strides ); console.log( bool ); @@ -33,7 +33,7 @@ console.log( bool ); strides = shape2strides( shape, 'column-major' ); console.log( 'Strides: %s', strides.join( ',' ) ); -// => 'Strides: 1,10,100' +// => Strides: 1,10,100 bool = isRowMajor( strides ); console.log( bool ); From 665f0d35a7c0004c362d22d2d8ad0c56945c8ffc Mon Sep 17 00:00:00 2001 From: Athan Date: Thu, 4 Dec 2025 18:31:51 -0800 Subject: [PATCH 6/6] Apply suggestions from code review Signed-off-by: Athan --- .../@stdlib/blas/base/dcopy/benchmark/c/benchmark.length.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dcopy/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/dcopy/benchmark/c/benchmark.length.c index dc81cea210f2..e539d8e277c6 100644 --- a/lib/node_modules/@stdlib/blas/base/dcopy/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/dcopy/benchmark/c/benchmark.length.c @@ -103,7 +103,6 @@ static double benchmark1( int iterations, int len ) { x = (double *) malloc( len * sizeof( double ) ); y = (double *) malloc( len * sizeof( double ) ); - for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*20000.0 ) - 10000.0; y[ i ] = 0.0; @@ -120,7 +119,6 @@ static double benchmark1( int iterations, int len ) { if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); } - free( x ); free( y ); return elapsed;