stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

[RFC]: add C implementations for `blas/ext/base/ndarray` packages

Open ujjwalv01 opened this issue 3 months ago • 20 comments

Purpose

This issue tracks the initiative to add native C implementations for typed ndarray APIs in blas/ext/base/ndarray. It serves as a central reference point for contributors so that work can be coordinated, PRs can be linked back here, and duplicate effort can be avoided.


Summary

In blas/ext/base/ndarray, if a typed ndarray API is missing a native C implementation, it is fair game to add one. This issue serves as a general tracking reference for this ongoing initiative.

Candidates for C implementations typically include packages handling the following data types (indicated by their prefixes):

  • d (double-precision)
  • s (single-precision)
  • c (complex single-precision)
  • z (complex double-precision)

Since new strided APIs are constantly being added to blas/ext/base, this is intentionally kept as a generalized issue rather than an enumerated checklist, which would become outdated quickly.

What to Do

If you find a package under blas/ext/base/ndarray that has a JavaScript implementation but is missing a native C addon (src/, include/, manifest.json, binding.gyp, etc.), you may go ahead and add the C implementation.

Reference Library

To help contributors understand exactly what is required when adding a native C implementation, we have compiled a "Reference Library" of merged PRs. Please refer to the PR that best matches the type of package you are working on:

PR Title Convention

When opening a pull request for this work, please use the following title format so others can easily search GitHub and avoid duplicate PRs:

feat: add C implementation for `blas/ext/base/ndarray/<package-name>`

You are Advised

  • Before starting, please leave a comment on this issue mentioning which package you are working on (e.g., "I am working on dsum"). This helps avoid two contributors working on the same package simultaneously.
  • Reference this issue in your PR description if you are adding a C implementation for any blas/ext/base/ndarray package. This helps reviewers understand the context and track progress against this initiative.
  • Check the PR tracker before starting to make sure there is no existing open PR for the same package.

Related Issues

None.

Questions

No.

Other

No.

Checklist

  • [x] I have read and understood the Code of Conduct.
  • [x] Searched for existing issues and pull requests.
  • [x] The issue name begins with RFC:.

ujjwalv01 avatar Aug 30 '26 16:08 ujjwalv01

I'd like to work on 'blas/ext/base/ndarray/dsumpw'. Will open a PR referencing this issue once ready.

Nehant18 avatar Aug 30 '26 19:08 Nehant18

I'd like to work on 'blas/ext/base/ndarray/dcusum'. Will open a PR referencing this issue once ready.

Nehant18 avatar Aug 31 '26 09:08 Nehant18

I would like to work on adding the native C implementation for blas/ext/base/ndarray/dcircshift. Will submit a PR shortly referencing this issue. Thank you!

utkarshpatwa393-sys avatar Nov 04 '26 03:11 utkarshpatwa393-sys

I would like to work on adding the native C implementation for blas/ext/base/ndarray/dvander. Will submit a PR shortly referencing this issue. Thank you!

utkarshpatwa393-sys avatar Nov 04 '26 03:11 utkarshpatwa393-sys

I would like to work on adding the native C implementation for blas/ext/base/ndarray/svander. Will submit a PR shortly referencing this issue. Thank you!

utkarshpatwa393-sys avatar Nov 04 '26 03:11 utkarshpatwa393-sys

I would like to work on adding the native C implementation for blas/ext/base/ndarray/sapx. Will submit a PR shortly referencing this issue. Thank you!

utkarshpatwa393-sys avatar Nov 04 '26 16:11 utkarshpatwa393-sys

I would like to work on adding the native C implementation for blas/ext/base/ndarray/dlogspace. Will submit a PR shortly referencing this issue. Thank you!

utkarshpatwa393-sys avatar Nov 04 '26 16:11 utkarshpatwa393-sys

I would like to work on adding the native C implementation for blas/ext/base/ndarray/slinspace. Will submit a PR shortly referencing this issue. Thank you!

utkarshpatwa393-sys avatar Nov 04 '26 16:11 utkarshpatwa393-sys

I would like to work on adding the native C implementation for blas/ext/base/ndarray/slinspace. Will submit a PR shortly referencing this issue. Thank you!

Hey @utkarshpatwa393-sys, just make sure you’re applying the suggestions from @ujjwalv01 etc. to the subsequent PRs where applicable when you’re taking on a bunch of implementations in parallel.

batpigandme avatar Nov 04 '26 17:11 batpigandme

I would like to work on adding the native C implementation for blas/ext/base/ndarray/dlinspace. Will submit a PR shortly referencing this issue. Thank you!

utkarshpatwa393-sys avatar Nov 04 '26 17:11 utkarshpatwa393-sys

Thank you @batpigandme! I have addressed all suggestions from @ujjwalv01 across dvander (#16486) and svander (#16487), and verified that all subsequent PRs (sapx #16493, dlogspace #16494, slinspace #16495, and dlinspace #16496) strictly follow the exact same conventions (including srand seeding in C benchmarks, TAP format string, C documentation delimiters, and matching C README examples).

utkarshpatwa393-sys avatar Nov 04 '26 17:11 utkarshpatwa393-sys

I have submitted PR #16501 adding the native C implementation for blas/ext/base/ndarray/dcircshift. Thank you!

utkarshpatwa393-sys avatar Nov 04 '26 17:11 utkarshpatwa393-sys

I would like to work on adding the native C implementation for blas/ext/base/ndarray/scircshift. Will submit a PR shortly referencing this issue. Thank you!

utkarshpatwa393-sys avatar Nov 04 '26 17:11 utkarshpatwa393-sys

I have submitted PR #16502 adding the native C implementation for blas/ext/base/ndarray/scircshift. Thank you!

utkarshpatwa393-sys avatar Nov 04 '26 17:11 utkarshpatwa393-sys

I would like to work on adding the native C implementation for blas/ext/base/ndarray/ddiff. Will submit a PR shortly referencing this issue. Thank you!

utkarshpatwa393-sys avatar Nov 13 '26 16:11 utkarshpatwa393-sys

I have submitted PR #16639 adding the native C and Node-API implementation for blas/ext/base/ndarray/ddiff. Ready for review when convenient. Thank you!

utkarshpatwa393-sys avatar Nov 15 '26 10:11 utkarshpatwa393-sys

I would like to work on adding the native C and Node-API implementation for blas/ext/base/ndarray/sdiff. Will submit a PR shortly!

utkarshpatwa393-sys avatar Nov 15 '26 10:11 utkarshpatwa393-sys

I have submitted PR #16640 adding the native C and Node-API implementation for blas/ext/base/ndarray/sdiff. Ready for review when convenient. Thank you!

utkarshpatwa393-sys avatar Nov 15 '26 10:11 utkarshpatwa393-sys

I'd like to work on adding the native C implementation for blas/ext/base/ndarray/dasumpw. I couldn't find an open PR or claim for it, and I'm following the ndarray/dsum reference (#10065). I'll open a PR referencing this issue shortly.

utsxvrai avatar Nov 21 '26 10:11 utsxvrai

I'd like to work on blas/ext/base/ndarray/dcuany and blas/ext/base/ndarray/scuany. I couldn't find an open PR or claim for either. I'll open PRs referencing this issue.

devnaldo avatar Nov 24 '26 04:11 devnaldo