Skip to content

test: add alpha & beta tests for blas/base/dgemm#10709

Merged
kgryte merged 3 commits into
stdlib-js:developfrom
dhruvan2006:test/dgemm
May 18, 2026
Merged

test: add alpha & beta tests for blas/base/dgemm#10709
kgryte merged 3 commits into
stdlib-js:developfrom
dhruvan2006:test/dgemm

Conversation

@dhruvan2006
Copy link
Copy Markdown
Contributor

@dhruvan2006 dhruvan2006 commented Mar 5, 2026

Description

All the tests for blas/base/dgemm assumed α = 1 and β = 1 which miss some critical functionality.

From LAPACK: dgemm:

!>
!> DGEMM performs one of the matrix-matrix operations
!>
!> C := alpha*op( A )*op( B ) + beta*C,
!>
!> [...]

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

@stdlib-js/reviewers

@stdlib-bot stdlib-bot added the BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). label Mar 5, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

@stdlib-bot stdlib-bot added First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Needs Review A pull request which needs code review. labels Mar 5, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

stdlib-bot commented Mar 5, 2026

Coverage Report

Package Statements Branches Functions Lines
blas/base/dgemm $\color{green}843/843$
$\color{green}+100.00%$
$\color{green}119/119$
$\color{green}+100.00%$
$\color{green}8/8$
$\color{green}+100.00%$
$\color{green}843/843$
$\color{green}+100.00%$

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

---
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: passed
  - 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: 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
---
@stdlib-bot stdlib-bot removed the First-time Contributor A pull request from a contributor who has never previously committed to the project repository. label Mar 6, 2026
@kgryte kgryte requested a review from MeKaustubh07 May 18, 2026 02:06
@kgryte kgryte added the Tests Pull requests specifically adding tests. label May 18, 2026
@kgryte
Copy link
Copy Markdown
Member

kgryte commented May 18, 2026

@MeKaustubh07 Would you mind reviewing this to determine whether the proposed tests are applicable and should be added? Cheers!

@MeKaustubh07
Copy link
Copy Markdown
Member

@kgryte Yes, the proposed tests seems fairly applicable and should be added.

I verified the fixture math and reran all tests locally, While tests for β=0 (zeroing C) and β!=1 with α=0 (scaling C) already exist, no existing test exercises the full formula C = α*op(A)*op(B) + β*C with both α != {0,1} and β != {0,1} simultaneously, the matrix multiplication path is always tested with α=1, β=1. These changes fills that gap.

Copy link
Copy Markdown
Member

@MeKaustubh07 MeKaustubh07 left a comment

Choose a reason for hiding this comment

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

Applied Suggestions from the code review

Comment thread lib/node_modules/@stdlib/blas/base/dgemm/test/test.ndarray.js Outdated
Comment thread lib/node_modules/@stdlib/blas/base/dgemm/test/test.dgemm.js
Comment thread lib/node_modules/@stdlib/blas/base/dgemm/test/test.ndarray.js
Comment thread lib/node_modules/@stdlib/blas/base/dgemm/test/test.ndarray.js
@kgryte
Copy link
Copy Markdown
Member

kgryte commented May 18, 2026

@MeKaustubh07 Once merged, we'll want to replicate the tests to the other *gemm packages.

Co-authored-by: Kaustubh Patange <kaustubh.mp007@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
@kgryte kgryte requested a review from a team May 18, 2026 05:44
Copy link
Copy Markdown
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.

LGTM

@kgryte kgryte added difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. review: 3 and removed Needs Review A pull request which needs code review. labels May 18, 2026
@MeKaustubh07
Copy link
Copy Markdown
Member

@kgryte I will apply these changes in similar way for other *gemm packages ( gemm,sgemm ).

@kgryte
Copy link
Copy Markdown
Member

kgryte commented May 18, 2026

Sounds good! Thanks!

@kgryte kgryte merged commit 42bb7cc into stdlib-js:develop May 18, 2026
47 checks passed
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). difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. review: 3 Tests Pull requests specifically adding tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants