Repository navigation
bench: fix data generation - #15535
Merged
Merged
Conversation
Propagates fix from 66f69b6 ("bench: fix data generation in `blas/ext/base` sort benchmarks") to the generic-array sort packages, whose reverse-sorted benchmark data was seeded from the iteration count rather than the array length. The source commit corrected `iter - j - randu()` to `len - j - randu()` wherever the expression was written in indexed form (`tmp[ j ] = ...`), which is the spelling used by the typed-array `dsort*` and `ssort*` packages. The generic-array `gsort*` packages build their input via `tmp.push( ... )` and were therefore left unchanged, even though the source commit touched those same packages for the unrelated `i % M` correction in their `few_uniques` benchmarks. Because `iter` is derived from the array length per size tier (`floor( pow( iter, 3/4 ) )` or `floor( sqrt( iter ) )`), the offset shrinks as `len` grows, so the larger tiers generated predominantly negative values spanning a range unrelated to `len`. The sequence remained strictly decreasing, so measured timings are unaffected; what changes is that the generated values now match the intended `(0, len]` range and the already-corrected typed-array siblings, making cross-package comparisons meaningful. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0166DfWubFLrTN9qRtaKbATZ
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
marked this pull request as ready for review
September 26, 2026 02:07
kgryte
approved these changes
Sep 26, 2026
blas/ext/base generic sort benchmarks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Propagating fixes merged to
developbetween 2026-09-24 16:49 PDT and 2026-09-25 04:01 PDT to sibling packages.This pull request:
Reverse-sorted benchmark data seeded from the iteration count instead of the array length.
66f69b6acorrectediter - j - randu()tolen - j - randu(), but only where the expression is written in indexed form (tmp[ j ] = ...), the spelling used by the typed-arraydsort*/ssort*packages. The generic-array packages build their input viatmp.push( ... )and were left unchanged, even though that commit touched the same packages for the unrelatedi % Mcorrection in theirfew_uniquesbenchmarks. Source:66f69b6a. Target packages:blas/ext/base/gsort2hpblas/ext/base/gsort2insblas/ext/base/gsort2shblas/ext/base/gsorthpblas/ext/base/gsorthp-byblas/ext/base/gsortinsblas/ext/base/gsortshTwo files per package (
benchmark.rev_sorted_random.jsandbenchmark.rev_sorted_random.ndarray.js), 14 files, one line each.Because
iteris derived from the array length per size tier (floor( pow( iter, 3/4 ) )orfloor( sqrt( iter ) )), the offset shrinks aslengrows, so the larger tiers generated predominantly negative values over a range unrelated tolen. The sequence remained strictly decreasing, so measured timings are unaffected; what changes is that the generated values now fall in the intended(0, len]range and match the already-corrected typed-array siblings, making cross-package comparisons meaningful.Related Issues
No.
Questions
The source commit's exclusion of these files looks unintentional, but the
gsort*packages were in its diff, so flagging in case the omission was deliberate.Other
Validation. Pattern search covered all
benchmark/**/*.jsunderlib/node_modules/@stdlib/; the 14 sites here are the only remaining occurrences of aniter-derived data-generation expression inside an element loop anywhere in the tree. Every site was reviewed by two independent validation agents that read each file in full, then by an adaptation pass confirming the change is confined to a single line per file, then by a style pass checking spacing, tab indentation, and thatiterremains used in each file (it does — as the outer loop bound and inmain()— so no unused-variable lint failure).node --checkpasses on all 14 files;eslintcould not be run locally because package dependencies are not installed in this environment, so CI is the first lint signal.Deliberately excluded. Six further fix patterns were extracted from the same commit window and searched, and all yielded zero live sites — the originating commits were already complete:
8da0d154—docs/types/test.tsimporting its own package by@stdlib/...path rather than./index: 0 remaining.8da0d154— extensionless relativerequire: 22 textual matches, all false positives (every target resolves to a directory, where omitting the extension is correct).e0453d77— README heading not matching the exported name: 0 remaining.e737e900— anchor placed after its heading, and escaped-bracket interval notation: 0 remaining each.27b070dd—## C APIssection missing its<section class="c">wrapper: 0 remaining.Also excluded: the
test:ULP-assertion migrations merged in this window, since choosing a per-package tolerance requires judgment rather than a mechanical transformation; and several one-off cleanups with no generalizable search signature. Nothing here required cross-package changes, new tests, or adaptation beyond a single file.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This pull request was authored by Claude Code as part of an automated routine that reviews fixes merged to
developand propagates them to sibling packages carrying the same defect. The candidate sites were found by pattern search and each was independently reviewed before inclusion, as described under "Other" above.@stdlib-js/reviewers
Generated by Claude Code