Skip to content

bench: replace new Array(100) with zeros(100, 'generic') in assert/is-*-property benchmarks#12010

Merged
kgryte merged 1 commit intodevelopfrom
philipp/fix-propagation-2026-05-09
May 10, 2026
Merged

bench: replace new Array(100) with zeros(100, 'generic') in assert/is-*-property benchmarks#12010
kgryte merged 1 commit intodevelopfrom
philipp/fix-propagation-2026-05-09

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

@Planeshifter Planeshifter commented May 9, 2026

Description

Propagating fixes merged to develop between 2026-05-08 17:03 PDT and 2026-05-09 02:24 PDT to sibling packages with the same defect.

6f01b40 — replace new Array(100) with zeros(100, 'generic') in assert/is-*-property benchmarks

Mirrors 6f01b40 across 19 benchmark files: replaces new Array( 100 ) with zeros( 100, 'generic' ) and adds the corresponding @stdlib/array/zeros require after the isBoolean import, resolving stdlib/no-new-array violations. The arr variable serves only as a property-inspection target, so zero-initialization is semantically equivalent to uninitialized. For is-readable-property-in, the inline // eslint-disable-line stdlib/no-new-array suppression directive is also removed alongside the violation it masked.

  • lib/node_modules/@stdlib/assert/is-accessor-property
  • lib/node_modules/@stdlib/assert/is-accessor-property-in
  • lib/node_modules/@stdlib/assert/is-configurable-property
  • lib/node_modules/@stdlib/assert/is-data-property
  • lib/node_modules/@stdlib/assert/is-data-property-in
  • lib/node_modules/@stdlib/assert/is-enumerable-property
  • lib/node_modules/@stdlib/assert/is-enumerable-property-in
  • lib/node_modules/@stdlib/assert/is-nonconfigurable-property
  • lib/node_modules/@stdlib/assert/is-nonconfigurable-property-in
  • lib/node_modules/@stdlib/assert/is-nonenumerable-property
  • lib/node_modules/@stdlib/assert/is-read-only-property
  • lib/node_modules/@stdlib/assert/is-read-only-property-in
  • lib/node_modules/@stdlib/assert/is-read-write-property
  • lib/node_modules/@stdlib/assert/is-read-write-property-in
  • lib/node_modules/@stdlib/assert/is-readable-property-in
  • lib/node_modules/@stdlib/assert/is-writable-property
  • lib/node_modules/@stdlib/assert/is-writable-property-in
  • lib/node_modules/@stdlib/assert/is-write-only-property
  • lib/node_modules/@stdlib/assert/is-write-only-property-in

Related Issues

None.

Questions

No.

Other

Validation

  • Search scope: each source pattern was searched within lib/node_modules/@stdlib/**/test/*.js and lib/node_modules/@stdlib/**/benchmark/*.js. Originating packages already fixed by the source commits (assert/is-readable-property) were excluded.
  • Independent validation: two independent Opus validation agents reviewed every candidate site by reading each file in full; both returned confirmed for all 19 P2 sites. A separate Opus adaptation agent generated the per-site P2 patches (import-after-anchor + line replace), and a Sonnet style-consistency agent confirmed each replacement matches the source-commit precedent.
  • Deliberately excluded:
    • The blank-line removals propagated from 41d54f5 and 6f01b40 (originally bundled with this PR) were dropped after reviewer feedback: the empty lines separating fixture import blocks are intentional logical-group separators (e.g., column_major_* vs row_major_*), not stray whitespace. See discussion at bench: replace new Array(100) with zeros(100, 'generic') in assert/is-*-property benchmarks #12010 (comment).
    • 01ddffb2 ("docs: propagate recent fixes across stats/base/dists and lapack/base") — itself a propagation commit; recent-merge dedup applies.
    • f7b9386 ("docs: place copy in codeblock") — one-off editorial fix to docs/contributing/zen_of_stdlib.md with no replicable search signature.
    • 88 files matched by the new Array(N) regex but rejected: math/strided/special/*-by, math/strided/ops/*-by, strided/base/*-by, and stats/strided/*-by test files use new Array(5) to construct intentionally sparse arrays — replacing with zeros(5, 'generic') would change test semantics (callbacks skip holes but would process zero-valued slots).
    • assert/is-prototype-of/benchmark.js and assert/is-arraybuffer-view/test/*.jsnew Array(N) used as a value in a heterogeneous-type-dispatch literal; replacement would change the runtime type observed by the type-checking function.
    • stats/{fligner,bartlett,kruskal}-test, stats/{ttest2,vartest,binomial-test,chi2gof}, blas/base/gasum, array/pool, and several utils/* benchmark files — arrays fully overwritten in a fill loop before any read; the Array constructor here triggers the lint rule but the values are not semantically uninitialized.

Checklist

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

This PR was authored by Claude Code as part of a routine that scans recent develop commits for generalizable fixes and propagates them to sibling packages. Each propagation site was independently verified by two Opus validation agents, an Opus adaptation agent (for the new Arrayzeros substitution), and a Sonnet style-consistency agent before patches were applied. The changes are mechanical analogs of the cited source commits and touch only benchmark setup.



Generated by Claude Code

@stdlib-bot
Copy link
Copy Markdown
Contributor

stdlib-bot commented May 9, 2026

Coverage Report

Package Statements Branches Functions Lines
assert/is-accessor-property-in $\color{green}130/130$
$\color{green}+0.00%$
$\color{green}5/5$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}130/130$
$\color{green}+0.00%$
assert/is-accessor-property $\color{green}130/130$
$\color{green}+0.00%$
$\color{green}5/5$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}130/130$
$\color{green}+0.00%$
assert/is-configurable-property $\color{green}118/118$
$\color{green}+0.00%$
$\color{green}4/4$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}118/118$
$\color{green}+0.00%$
assert/is-data-property-in $\color{green}124/124$
$\color{green}+0.00%$
$\color{green}4/4$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}124/124$
$\color{green}+0.00%$
assert/is-data-property $\color{green}124/124$
$\color{green}+0.00%$
$\color{green}4/4$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}124/124$
$\color{green}+0.00%$
assert/is-enumerable-property-in $\color{green}118/118$
$\color{green}+0.00%$
$\color{green}4/4$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}118/118$
$\color{green}+0.00%$
assert/is-enumerable-property $\color{green}232/232$
$\color{green}+0.00%$
$\color{green}16/16$
$\color{green}+0.00%$
$\color{green}2/2$
$\color{green}+0.00%$
$\color{green}232/232$
$\color{green}+0.00%$
assert/is-nonconfigurable-property-in $\color{green}118/118$
$\color{green}+0.00%$
$\color{green}4/4$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}118/118$
$\color{green}+0.00%$
assert/is-nonconfigurable-property $\color{green}118/118$
$\color{green}+0.00%$
$\color{green}4/4$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}118/118$
$\color{green}+0.00%$
assert/is-nonenumerable-property $\color{green}121/121$
$\color{green}+0.00%$
$\color{green}5/5$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}121/121$
$\color{green}+0.00%$
assert/is-read-only-property-in $\color{green}131/131$
$\color{green}+0.00%$
$\color{green}7/7$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}131/131$
$\color{green}+0.00%$
assert/is-read-only-property $\color{green}131/131$
$\color{green}+0.00%$
$\color{green}7/7$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}131/131$
$\color{green}+0.00%$
assert/is-read-write-property-in $\color{green}136/136$
$\color{green}+0.00%$
$\color{green}6/6$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}136/136$
$\color{green}+0.00%$
assert/is-read-write-property $\color{green}136/136$
$\color{green}+0.00%$
$\color{green}6/6$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}136/136$
$\color{green}+0.00%$
assert/is-readable-property-in $\color{green}130/130$
$\color{green}+0.00%$
$\color{green}5/5$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}130/130$
$\color{green}+0.00%$
assert/is-writable-property-in $\color{green}124/124$
$\color{green}+0.00%$
$\color{green}5/5$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}124/124$
$\color{green}+0.00%$
assert/is-writable-property $\color{green}124/124$
$\color{green}+0.00%$
$\color{green}5/5$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}124/124$
$\color{green}+0.00%$
assert/is-write-only-property-in $\color{green}131/131$
$\color{green}+0.00%$
$\color{green}6/6$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}131/131$
$\color{green}+0.00%$
assert/is-write-only-property $\color{green}131/131$
$\color{green}+0.00%$
$\color{green}6/6$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}131/131$
$\color{green}+0.00%$

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

Comment thread lib/node_modules/@stdlib/blas/base/dgemm/test/test.dgemm.js
…/is-*-property` benchmarks

Propagates fix from 6f01b40 ("fix: resolve JavaScript lint errors") to
the remaining `assert/is-*-property` benchmarks: replaces
`arr = new Array( 100 );` with `arr = zeros( 100, 'generic' );` and
adds the corresponding `@stdlib/array/zeros` require, eliminating the
`stdlib/no-new-array` lint warning. The accompanying inline
`// eslint-disable-line stdlib/no-new-array` directive in
`is-readable-property-in` is removed along with the violation.

Applies to 19 benchmark files under `assert/is-*-property/`.

https://claude.ai/code/session_019qz8kssWMLenCUTsgngDXj
@Planeshifter Planeshifter force-pushed the philipp/fix-propagation-2026-05-09 branch from aa226f2 to ae469a0 Compare May 10, 2026 21:22
@Planeshifter Planeshifter changed the title fix: propagate JS lint fixes to blas, lapack, math, and assert fix: replace new Array(100) with zeros(100, 'generic') in assert/is-*-property benchmarks May 10, 2026
@Planeshifter Planeshifter changed the title fix: replace new Array(100) with zeros(100, 'generic') in assert/is-*-property benchmarks bench: replace new Array(100) with zeros(100, 'generic') in assert/is-*-property benchmarks May 10, 2026
@Planeshifter Planeshifter marked this pull request as ready for review May 10, 2026 21:27
@Planeshifter Planeshifter requested review from a team and kgryte May 10, 2026 21:27
@kgryte kgryte added the Benchmarks Pull requests adding or improving benchmarks for measuring performance. label May 10, 2026
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label May 10, 2026
@kgryte kgryte removed the Needs Review A pull request which needs code review. label May 10, 2026
@kgryte kgryte merged commit a6af2c8 into develop May 10, 2026
60 checks passed
@kgryte kgryte deleted the philipp/fix-propagation-2026-05-09 branch May 10, 2026 21:57
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