Skip to content

bench: fix assertion#13391

Merged
kgryte merged 2 commits into
developfrom
philipp/ci-fix-index-modes-benchmark-2026-07-09
Jul 9, 2026
Merged

bench: fix assertion#13391
kgryte merged 2 commits into
developfrom
philipp/ci-fix-index-modes-benchmark-2026-07-09

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Resolves #{{N/A}}.

Description

This pull request:

  • Updates lib/node_modules/@stdlib/ndarray/index-modes/benchmark/benchmark.js to assert the correct current mode count (4), fixing a nightly random_benchmarks CI failure.

Related Issues

None.

Questions

No.

Other

Failing run: https://github.com/stdlib-js/stdlib/actions/runs/28985599743

Symptom: not ok 1 should return an array of length 3 in the index-modes benchmark.

Root cause: lib/modes.json lists 4 supported index modes (throw, normalize, clamp, wrap), but the benchmark still hardcoded the pre-wrap count of 3.

Fix: Update the hardcoded length check and failure message from 3 to 4, matching the sibling @stdlib/ndarray/orders package's exact-count benchmark convention.

Checklist

AI Assistance

  • Yes

  • No

  • Code generation (e.g., when writing an implementation or fixing a bug)

  • Test/benchmark generation

  • Documentation (including examples)

  • Research and understanding

Disclosure

This PR was written primarily by Claude Code as part of an automated CI-failure triage and fix routine, based on live GitHub Actions job log analysis. The fix was reviewed by three independent automated review passes (correctness, regression scope, style/conventions) before being proposed here; all three approved with no blocking findings.


@stdlib-js/reviewers


Generated by Claude Code

The job `random_benchmarks` on workflow `random_benchmarks` failed on
develop with `not ok 1 should return an array of length 3`. Root
cause: `lib/modes.json` lists 4 supported index modes (`throw`,
`normalize`, `clamp`, `wrap`), but `benchmark/benchmark.js` still
asserted the pre-`wrap` count of 3. This commit updates the hardcoded
length check and message to 4, matching the sibling `orders` package's
exact-count benchmark convention, so the benchmark reflects the
package's actual current mode list.

Ref: https://github.com/stdlib-js/stdlib/actions/runs/28985599743
@stdlib-bot

stdlib-bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
ndarray/index-modes $\\color{green}141/141$
$\\color{green}+0.00\\%$
$\\color{green}5/5$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}141/141$
$\\color{green}+0.00\\%$

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

@Planeshifter Planeshifter marked this pull request as ready for review July 9, 2026 14:51
@Planeshifter Planeshifter requested review from a team and kgryte July 9, 2026 14:51
@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. labels Jul 9, 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 Jul 9, 2026
Comment thread lib/node_modules/@stdlib/ndarray/index-modes/benchmark/benchmark.js Outdated
Comment thread lib/node_modules/@stdlib/ndarray/index-modes/benchmark/benchmark.js Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
@kgryte kgryte changed the title bench(@stdlib/ndarray/index-modes): update stale expected mode count bench: fix assertion Jul 9, 2026
@kgryte kgryte merged commit d32732a into develop Jul 9, 2026
14 checks passed
@kgryte kgryte deleted the philipp/ci-fix-index-modes-benchmark-2026-07-09 branch July 9, 2026 20:12
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.

4 participants