From 87bfa26135a2e3aec4030040d2e0790abe42026f Mon Sep 17 00:00:00 2001 From: Faraz Ghani Date: Sun, 16 Nov 2025 02:57:52 +0530 Subject: [PATCH 1/4] 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/4] 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 fad16938e3bdc6fab7d5b27fdbfa24f7dd5c4892 Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 2 Dec 2025 17:18:37 -0800 Subject: [PATCH 3/4] 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 b627e87790a476d65d458e571133adc354ef712d Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 2 Dec 2025 17:19:08 -0800 Subject: [PATCH 4/4] Apply suggestions from code review Signed-off-by: Athan --- .../@stdlib/blas/base/drot/benchmark/c/benchmark.length.c | 4 ---- 1 file changed, 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 7a1786e61545..91657cf2b006 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 @@ -119,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; @@ -141,7 +140,6 @@ static double benchmark2( 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()*200.0 ) - 100.0; y[ i ] = ( rand_double()*200.0 ) - 100.0; @@ -158,10 +156,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; }