Skip to content

Conversation

@nakul-krishnakumar
Copy link
Member


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: passed
  • task: lint_package_json status: passed
  • task: lint_repl_help status: passed
  • task: lint_javascript_src status: passed
  • task: lint_javascript_cli status: na
  • task: lint_javascript_examples status: passed
  • task: lint_javascript_tests status: passed
  • task: lint_javascript_benchmarks status: passed
  • task: lint_python status: na
  • task: lint_r status: na
  • task: lint_c_src status: passed
  • task: lint_c_examples status: passed
  • task: lint_c_benchmarks status: passed
  • task: lint_c_tests_fixtures status: na
  • task: lint_shell status: na
  • task: lint_typescript_declarations status: passed
  • task: lint_typescript_tests status: passed
  • task: lint_license_headers status: passed ---

Resolves None.

Description

What is the purpose of this pull request?

This pull request:

  • Adds blas/ext/base/drsskbn.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

  • None.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

None.


@stdlib-js/reviewers

---
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: passed
  - task: lint_package_json
    status: passed
  - task: lint_repl_help
    status: passed
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: passed
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: passed
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: passed
  - task: lint_c_examples
    status: passed
  - task: lint_c_benchmarks
    status: passed
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: passed
  - task: lint_license_headers
    status: passed
---
@stdlib-bot stdlib-bot added BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). Needs Review A pull request which needs code review. labels Dec 12, 2025
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Dec 12, 2025

Coverage Report

Package Statements Branches Functions Lines
blas/ext/base/drsskbn $\color{green}409/409$
$\color{green}+0.00%$
$\color{green}19/19$
$\color{green}+0.00%$
$\color{green}4/4$
$\color{green}+0.00%$
$\color{green}409/409$
$\color{green}+0.00%$

The above coverage report was generated for the changes in this PR.

@kgryte kgryte added the Feature Issue or pull request for adding a new feature. label Dec 16, 2025
Signed-off-by: Nakul Krishnakumar <[email protected]>
…hmark name

---
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: passed
  - 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: na
  - 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
---
<!-- <equation class="equation" label="eq:residual_sum_of_squares" align="center" raw="d = \sum_{i=0}^{N-1} (y_i - x_i)^2" alt="Equation for residual sum of squares."> -->

```math
\mathop{\mathrm{RSS}} = \sum_{i=0}^{n-1} (y_i - x_i)^2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\mathop{\mathrm{RSS}} = \sum_{i=0}^{n-1} (y_i - x_i)^2
\mathop{\mathrm{RSS}} = \sum_{i=0}^{N-1} (y_i - x_i)^2

* var y = new Float64Array( [ 2.0, 1.0, 2.0, 1.0, -2.0, 2.0, 3.0, 4.0 ] );
*
* var z = drsskbn( x.length, x, 1, y, 1 );
* // returns 72
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment regarding decimals.

elapsed = tic() - t;
if ( v != v ) {
printf( "should not return NaN\n" );
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to free allocated memory.

elapsed = tic() - t;
if ( v != v ) {
printf( "should not return NaN\n" );
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to free allocated memory.

Copy link
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am guessing that some of the same comments made in #8722 also apply here.

@kgryte kgryte added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Dec 27, 2025
Signed-off-by: Nakul Krishnakumar <[email protected]>
Signed-off-by: Nakul Krishnakumar <[email protected]>
---
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: passed
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: passed
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: passed
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: passed
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: passed
  - task: lint_license_headers
    status: passed
---
@kgryte
Copy link
Member

kgryte commented Jan 10, 2026

/stdlib merge

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Jan 10, 2026
@kgryte kgryte added Needs Review A pull request which needs code review. and removed Needs Changes Pull request which needs changes before being merged. labels Jan 10, 2026
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Jan 10, 2026
@kgryte kgryte added the bot: Update Copyright Years Pull request needing the copyright years of its files updated. label Jan 10, 2026
@stdlib-bot stdlib-bot added bot: In Progress Pull request is currently awaiting automation. and removed bot: Update Copyright Years Pull request needing the copyright years of its files updated. labels Jan 10, 2026
@kgryte
Copy link
Member

kgryte commented Jan 10, 2026

@nakul-krishnakumar Lint failures.

---
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: passed
  - 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: na
  - 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
---
@nakul-krishnakumar
Copy link
Member Author

@kgryte This PR is ready for review.

// MODULES //

var stride2offset = require( '@stdlib/strided/base/stride2offset' );
var ndarray = require( './../lib/ndarray.js' );
Copy link
Member

@Planeshifter Planeshifter Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path ./../lib/ndarray.js is incorrect since this file is already in the lib/ directory.

Suggested change
var ndarray = require( './../lib/ndarray.js' );
var ndarray = require( './ndarray.js' );

// MAIN //

/**
* Computes the residual sum of squares of two double-precision floating-point strided arrays using using an improved Kahan–Babuška algorithm.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a duplicate "using" here.

Suggested change
* Computes the residual sum of squares of two double-precision floating-point strided arrays using using an improved Kahan–Babuška algorithm.
* Computes the residual sum of squares of two double-precision floating-point strided arrays using an improved Kahan–Babuška algorithm.


#### drsskbn.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )

Computes the [residual sum of squares][wikipedia-residual-sum-of-squares] of two double-precision floating-point strided arrays an improved Kahan–Babuška algorithm and alternative indexing semantics.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing word "using" - should be "...strided arrays using an improved..."

Suggested change
Computes the [residual sum of squares][wikipedia-residual-sum-of-squares] of two double-precision floating-point strided arrays an improved Kahan–Babuška algorithm and alternative indexing semantics.
Computes the [residual sum of squares][wikipedia-residual-sum-of-squares] of two double-precision floating-point strided arrays using an improved Kahan–Babuška algorithm and alternative indexing semantics.


<!--lint enable maximum-heading-length-->

Computes the [residual sum of squares][wikipedia-residual-sum-of-squares] of two double-precision floating-point strided arrays an improved Kahan–Babuška algorithm and alternative indexing semantics.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue here - missing word "using".

Suggested change
Computes the [residual sum of squares][wikipedia-residual-sum-of-squares] of two double-precision floating-point strided arrays an improved Kahan–Babuška algorithm and alternative indexing semantics.
Computes the [residual sum of squares][wikipedia-residual-sum-of-squares] of two double-precision floating-point strided arrays using an improved Kahan–Babuška algorithm and alternative indexing semantics.

const double x[] = { 1.0, -2.0, 2.0 };
const double y[] = { 1.0, 1.0, -4.0 };

double v = stdlib_strided_drsskbn_ndarray( 3, x, 1, 0, 1, 0 );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function call is missing the y array parameter. According to the function signature on line 256, it should have 7 arguments: N, X, strideX, offsetX, Y, strideY, offsetY.

Suggested change
double v = stdlib_strided_drsskbn_ndarray( 3, x, 1, 0, 1, 0 );
double v = stdlib_strided_drsskbn_ndarray( 3, x, 1, 0, y, 1, 0 );

* @param strideY stride length of `Y`
* @return output value
*/
double API_SUFFIX( stdlib_strided_drsskbn )( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const double *Y, const CBLAS_INT strideY ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same API_SUFFIX spacing issue throughout this file - should be API_SUFFIX(stdlib_strided_drsskbn) without the space after the opening paren.

Suggested change
double API_SUFFIX( stdlib_strided_drsskbn )( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const double *Y, const CBLAS_INT strideY ) {
double API_SUFFIX(stdlib_strided_drsskbn)( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const double *Y, const CBLAS_INT strideY ) {

double API_SUFFIX( stdlib_strided_drsskbn )( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const double *Y, const CBLAS_INT strideY ) {
const CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX );
const CBLAS_INT oy = stdlib_strided_stride2offset( N, strideY );
return API_SUFFIX( stdlib_strided_drsskbn_ndarray )( N, X, strideX, ox, Y, strideY, oy );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return API_SUFFIX( stdlib_strided_drsskbn_ndarray )( N, X, strideX, ox, Y, strideY, oy );
return API_SUFFIX(stdlib_strided_drsskbn_ndarray)( N, X, strideX, ox, Y, strideY, oy );

* @param offsetY starting index for `Y`
* @return output value
*/
double API_SUFFIX( stdlib_strided_drsskbn_ndarray )( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
double API_SUFFIX( stdlib_strided_drsskbn_ndarray )( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) {
double API_SUFFIX(stdlib_strided_drsskbn_ndarray)( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) {

STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 4 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, Y, N, strideY, argv, 3 );
STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX( stdlib_strided_drsskbn )( N, X, strideX, Y, strideY ), v );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same API_SUFFIX spacing issue.

Suggested change
STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX( stdlib_strided_drsskbn )( N, X, strideX, Y, strideY ), v );
STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX(stdlib_strided_drsskbn)( N, X, strideX, Y, strideY ), v );

STDLIB_NAPI_ARGV_INT64( env, offsetY, argv, 6 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, Y, N, strideY, argv, 4 );
STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX( stdlib_strided_drsskbn_ndarray )( N, X, strideX, offsetX, Y, strideY, offsetY ), v );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX( stdlib_strided_drsskbn_ndarray )( N, X, strideX, offsetX, Y, strideY, offsetY ), v );
STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX(stdlib_strided_drsskbn_ndarray)( N, X, strideX, offsetX, Y, strideY, offsetY ), v );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). bot: In Progress Pull request is currently awaiting automation. Feature Issue or pull request for adding a new feature. Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants