Skip to content

bench: fix swapped dtypes in size benchmarks#11648

Merged
kgryte merged 1 commit intodevelopfrom
philipp/fix-ndarray-float-size-benchmarks
Apr 20, 2026
Merged

bench: fix swapped dtypes in size benchmarks#11648
kgryte merged 1 commit intodevelopfrom
philipp/fix-ndarray-float-size-benchmarks

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

@Planeshifter Planeshifter commented Apr 20, 2026

Description

What is the purpose of this pull request?

This pull request:

  • Fixes the opts.dtype values in the per-size float32 and float64 benchmark files for @stdlib/ndarray/ones, @stdlib/ndarray/zeros, and @stdlib/ndarray/empty. The values were swapped between the two files in each package, so each file benchmarked the opposite dtype from the one its filename and bench label advertised.

Related Issues

Does this pull request have any related issues?

No.

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.

Scope verified across all ndarray benchmark files: only the three packages above use the opts.dtype pattern. The *-like and ndarray/base/* size benchmarks pass the dtype positionally (e.g., `zeros( 'float32', [len], 'row-major' )`) and were already correct.

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

Claude Code identified the swapped dtypes while reviewing @stdlib/ndarray/ones and applied the fix to all affected packages per my instructions.


@stdlib-js/reviewers

…arks

The per-size float32 and float64 benchmark files had their `opts.dtype`
values swapped relative to the filename and bench label, so each file
benchmarked the opposite dtype from the one it advertised.

---
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
---
@Planeshifter Planeshifter changed the title bench: fix swapped dtypes in ndarray/{ones,zeros,empty} size benchmarks bench: fix swapped dtypes in size benchmarks Apr 20, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
ndarray/empty $\color{green}199/199$
$\color{green}+100.00%$
$\color{green}30/30$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}199/199$
$\color{green}+100.00%$
ndarray/ones $\color{green}122/122$
$\color{green}+100.00%$
$\color{green}5/5$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}122/122$
$\color{green}+100.00%$
ndarray/zeros $\color{green}195/195$
$\color{green}+100.00%$
$\color{green}29/29$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}195/195$
$\color{green}+100.00%$

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

@Planeshifter Planeshifter marked this pull request as ready for review April 20, 2026 06:38
@Planeshifter Planeshifter requested review from a team and kgryte April 20, 2026 06:38
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Apr 20, 2026
@kgryte kgryte added Benchmarks Pull requests adding or improving benchmarks for measuring performance. and removed Needs Review A pull request which needs code review. labels Apr 20, 2026
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 merged commit 869c9da into develop Apr 20, 2026
68 checks passed
@kgryte kgryte deleted the philipp/fix-ndarray-float-size-benchmarks branch April 20, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Benchmarks Pull requests adding or improving benchmarks for measuring performance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants