From 87bfa26135a2e3aec4030040d2e0790abe42026f Mon Sep 17 00:00:00 2001 From: Faraz Ghani Date: Sun, 16 Nov 2025 02:57:52 +0530 Subject: [PATCH 1/9] 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/9] 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/9] 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 faac90b4d7a6bc75d7d66e4c9a7e026600330c0a Mon Sep 17 00:00:00 2001 From: Faraz Ghani Date: Tue, 2 Dec 2025 16:57:02 +0530 Subject: [PATCH 4/9] bench: refactor to use dynamic memory allocation in blas/base/ddot --- 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/ddot/benchmark/c/benchmark.length.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ddot/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/ddot/benchmark/c/benchmark.length.c index 49675328c1da..15acb31a1797 100644 --- a/lib/node_modules/@stdlib/blas/base/ddot/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/ddot/benchmark/c/benchmark.length.c @@ -96,12 +96,15 @@ 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 z; 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 ] = ( rand_double()*20000.0 ) - 10000.0; @@ -119,6 +122,8 @@ static double benchmark1( int iterations, int len ) { if ( z != z ) { printf( "should not return NaN\n" ); } + free( x ); + free( y ); return elapsed; } @@ -131,12 +136,15 @@ 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 z; 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 ] = ( rand_double()*20000.0 ) - 10000.0; @@ -154,6 +162,9 @@ static double benchmark2( int iterations, int len ) { if ( z != z ) { printf( "should not return NaN\n" ); } + + free( x ); + free( y ); return elapsed; } From b6b037c7e9e0f0a85b0d96e67e3b0cb73ad59c58 Mon Sep 17 00:00:00 2001 From: Faraz Ghani Date: Tue, 2 Dec 2025 17:24:50 +0530 Subject: [PATCH 5/9] bench: refactor to use dynamic memory allocation in blas/ext/base/dnanasum --- 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 --- --- .../ext/base/dnanasum/benchmark/c/benchmark.length.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnanasum/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dnanasum/benchmark/c/benchmark.length.c index d524f4d8ebe5..16feac5deb98 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnanasum/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dnanasum/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -121,6 +122,8 @@ static double benchmark1( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + + free(x); return elapsed; } @@ -133,11 +136,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -158,6 +162,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free(x); return elapsed; } From 0394e1bdd17e651b8da85b2a32a74f455575d155 Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 2 Dec 2025 20:45:05 -0800 Subject: [PATCH 6/9] Discard changes to lib/node_modules/@stdlib/blas/base/dcopy/benchmark/c/benchmark.length.c --- .../base/dcopy/benchmark/c/benchmark.length.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 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..cb0c65d1c0c7 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,14 +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()*20000.0 ) - 10000.0; y[ i ] = 0.0; @@ -120,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; } @@ -135,13 +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()*20000.0 ) - 10000.0; y[ i ] = 0.0; @@ -158,8 +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 4cb11f93a7dec94261eead9caee547b56443fd8e Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 2 Dec 2025 20:45:12 -0800 Subject: [PATCH 7/9] Discard changes to lib/node_modules/@stdlib/blas/base/ddot/benchmark/c/benchmark.length.c --- .../base/ddot/benchmark/c/benchmark.length.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/ddot/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/ddot/benchmark/c/benchmark.length.c index 15acb31a1797..49675328c1da 100644 --- a/lib/node_modules/@stdlib/blas/base/ddot/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/ddot/benchmark/c/benchmark.length.c @@ -96,15 +96,12 @@ 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 z; 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 ] = ( rand_double()*20000.0 ) - 10000.0; @@ -122,8 +119,6 @@ static double benchmark1( int iterations, int len ) { if ( z != z ) { printf( "should not return NaN\n" ); } - free( x ); - free( y ); return elapsed; } @@ -136,15 +131,12 @@ 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 z; 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 ] = ( rand_double()*20000.0 ) - 10000.0; @@ -162,9 +154,6 @@ static double benchmark2( int iterations, int len ) { if ( z != z ) { printf( "should not return NaN\n" ); } - - free( x ); - free( y ); return elapsed; } From 15051573de41f56f023d08c75e56da18b78bfdd6 Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 2 Dec 2025 20:45:17 -0800 Subject: [PATCH 8/9] 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 7b4d646efef6436ec2af404a00cf459db947521e Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 2 Dec 2025 20:45:25 -0800 Subject: [PATCH 9/9] 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 );