Skip to content

feat: add blas/ext/base/sfirst-index-less-than-equal - #15120

Open
headlessNode wants to merge 3 commits into
stdlib-js:developfrom
headlessNode:blas/sfirst-index-less-than-equal
Open

feat: add blas/ext/base/sfirst-index-less-than-equal#15120
headlessNode wants to merge 3 commits into
stdlib-js:developfrom
headlessNode:blas/sfirst-index-less-than-equal

Conversation

@headlessNode

Copy link
Copy Markdown
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_pkg_readmes status: passed
  • task: lint_markdown_docs status: na
  • task: lint_markdown status: na
  • 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: missing_dependencies
  • task: lint_c_examples status: missing_dependencies
  • 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: passed
  • task: lint_license_headers status: passed ---

Resolves stdlib-js/metr-issue-tracker#1312.

Description

What is the purpose of this pull request?

This pull request:

  • add blas/ext/base/sfirst-index-less-than-equal

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

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.".

Primarily written by Claude Code.


@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_pkg_readmes
    status: passed
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - 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: missing_dependencies
  - task: lint_c_examples
    status: missing_dependencies
  - 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: passed
  - task: lint_license_headers
    status: passed
---
@headlessNode
headlessNode requested a review from a team September 9, 2026 06:27
@headlessNode headlessNode added Feature Issue or pull request for adding a new feature. METR Pull request associated with the METR project. labels Sep 9, 2026
@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 Sep 9, 2026
@stdlib-bot

stdlib-bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
blas/ext/base/sfirst-index-less-than-equal $\\color{green}372/372$
$\\color{green}+0.00\\%$
$\\color{green}19/19$
$\\color{green}+0.00\\%$
$\\color{green}4/4$
$\\color{green}+0.00\\%$
$\\color{green}372/372$
$\\color{green}+0.00\\%$

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

@headlessNode

Copy link
Copy Markdown
Member Author

While porting this package to dfirst-index-less-than-equal, a review surfaced a few consistency issues which are also present here:

  1. docs/repl.txt: "which elements in the strided array are accessed" should be plural ("strided arrays"), as this is a two-array package.
  2. test/test.sfirst_index_less_than_equal.js: the N <= 0 tape uses y = [ 2.0, 3.0, 4.0 ], while the native mirror and both ndarray test files use [ 1.0, 2.0, 3.0 ].
  3. test/test.sfirst_index_less_than_equal.js: three // eslint-disable-line max-len comments (NaN/±0 tapes) are absent from the native mirror for identical-length lines.
  4. src/addon.c: #include "stdlib/napi/export.h" is placed last among the NAPI includes; convention places it immediately after stdlib/blas/base/shared.h.
  5. src/addon.c (addon_method): the STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY macro for X is interleaved between the INT64 macros; sibling packages (e.g., dfirst-index-equal) group all INT64 macros first (N, strideX, offsetX, strideY, offsetY), followed by X and Y.
  6. README.md: eight <!-- eslint-disable id-length --> comments are unnecessary (sfirstIndexLessThanEqual is 24 characters, under the 25-character limit); only the max-len disable on the long .ndarray offsets example is needed.
  7. docs/types/test.ts: two consecutive blank lines between the ndarray third-argument and fourth-argument $ExpectError blocks.
  8. Main tapes: the first match is a strict-less hit (2 <= 5), so only the ±0 tape distinguishes <= from <; changing y[ 1 ] from 5.0 to 2.0 makes the first match an equality hit (2 <= 2) with the expected index unchanged.
  9. ndarray test files: the stride/offset tapes place a blank line between the function call and t.strictEqual, while the main test files keep them adjacent with the blank line before t.end().

---
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_pkg_readmes
    status: passed
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - 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: missing_dependencies
  - 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: passed
  - task: lint_license_headers
    status: 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). Feature Issue or pull request for adding a new feature. METR Pull request associated with the METR project. Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC]: add blas/ext/base/sfirst-index-less-than-equal

2 participants