Skip to content

fix: clamp only the upper bound and clean-up - #16108

Merged
kgryte merged 2 commits into
developfrom
claude/trusting-cannon-vb9x2o
Oct 13, 2026
Merged

kgryte merged 2 commits into
developfrom
claude/trusting-cannon-vb9x2o

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • propagates fixes merged to develop between 2026-10-12 13:10 UTC and 2026-10-13 13:10 UTC to sibling packages.
  • propagates dab2209 ("fix: clamp only the upper bound"). clipIndex maps a negative fromIndex with magnitude exceeding the vector length to 0, so the first element is still searched and 0 may be returned instead of -1. Switches to clipUpperIndex with an early -1 return and updates the corresponding test assertion (0 → -1), mirroring the source commit.
    • blas/ext/base/ndarray/dlast-index-equal
    • blas/ext/base/ndarray/dlast-index-of-truthy
  • propagates b44ccd7 ("test: fix typos in descriptions"). Fixes the same whitespace typos (missing space before a backticked identifier, doubled spaces) in tape descriptions.
    • stats/base/dists/gamma/quantile (test.quantile.js; the source only fixed test.native.js)
    • stats/array/mskrange
    • stats/ranks
    • stats/base/dists/weibull/logpdf
    • stats/base/dists/weibull/pdf
    • random/base/chi
    • random/base/chisquare
    • blas/ext/base/gnancount
    • iter/filter-map
    • assert/is-node-{stream,duplex-stream,readable-stream,transform-stream,writable-stream}-like

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.

Validation. Sites were found by searching blas/ext/base/ndarray/*last-index* for the clipIndex clamp and all test*.js files for whitespace typos in tape descriptions. Two independent reviewers confirmed every site, an adaptation pass checked that each patch applies verbatim within the target file, and a style pass checked that each patch matches the surrounding code. With fromIndex = -100, both dlast-index-* packages returned 0 before this change and now return -1. Their test suites pass after the change.

Excluded.

  • Other candidate commits in the window yielded no sibling sites:
    • ed03196: arguments.length loop indexing.
    • 287a20d: @returns descriptions.
    • 51a4592: lognormal parameter descriptions.
    • 72cf0ed: -0.0 return annotations. All 513 // returns 0.0/-0.0 examples in stats/base/dists were evaluated.
    • 1f923e3: blas clean-up.
  • Not propagated:
    • 8f62240 (docs sweep) and 32dd475 (array preallocation clean-up): no concrete search signature or objective defect.
    • random/base/minstd-shuffle "r`normalized`": a different typo shape.

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

This PR was written primarily by Claude Code as part of an automated fix-propagation routine.


🤖 Generated with Claude Code

https://claude.ai/code/session_01EuwEAYSHY7ShHtD7EZrjcp


Generated by Claude Code

Propagates fix from dab2209 ("fix: clamp only the upper bound") to
`dlast-index-equal` and `dlast-index-of-truthy`, which clamped a negative
`fromIndex` whose magnitude exceeds the vector length to `0` and thus
still searched the first element instead of returning `-1`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EuwEAYSHY7ShHtD7EZrjcp
Propagates fix from b44ccd7 ("test: fix typos in descriptions") to
sibling test files containing the same whitespace typos (missing space
before a backticked identifier and doubled spaces) in `tape` descriptions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EuwEAYSHY7ShHtD7EZrjcp
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
assert/is-node-duplex-stream-like $\\color{green}103/103$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}103/103$
$\\color{green}+100.00\\%$
assert/is-node-readable-stream-like $\\color{green}109/109$
$\\color{green}+100.00\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}109/109$
$\\color{green}+100.00\\%$
assert/is-node-stream-like $\\color{green}108/108$
$\\color{green}+100.00\\%$
$\\color{green}11/11$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}108/108$
$\\color{green}+100.00\\%$
assert/is-node-transform-stream-like $\\color{green}106/106$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}106/106$
$\\color{green}+100.00\\%$
assert/is-node-writable-stream-like $\\color{green}109/109$
$\\color{green}+100.00\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}109/109$
$\\color{green}+100.00\\%$
blas/ext/base/gnancount $\\color{green}262/262$
$\\color{green}+100.00\\%$
$\\color{green}25/25$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}262/262$
$\\color{green}+100.00\\%$
blas/ext/base/ndarray/dlast-index-equal $\\color{green}134/134$
$\\color{green}+100.00\\%$
$\\color{green}7/7$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}134/134$
$\\color{green}+100.00\\%$
blas/ext/base/ndarray/dlast-index-of-truthy $\\color{green}127/127$
$\\color{green}+100.00\\%$
$\\color{green}7/7$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}127/127$
$\\color{green}+100.00\\%$
iter/filter-map $\\color{green}210/210$
$\\color{green}+100.00\\%$
$\\color{green}20/20$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}210/210$
$\\color{green}+100.00\\%$
random/base/chi $\\color{green}376/376$
$\\color{green}+100.00\\%$
$\\color{green}44/44$
$\\color{green}+100.00\\%$
$\\color{green}10/10$
$\\color{green}+100.00\\%$
$\\color{green}376/376$
$\\color{green}+100.00\\%$
random/base/chisquare $\\color{green}375/375$
$\\color{green}+100.00\\%$
$\\color{green}44/44$
$\\color{green}+100.00\\%$
$\\color{green}10/10$
$\\color{green}+100.00\\%$
$\\color{green}375/375$
$\\color{green}+100.00\\%$
stats/array/mskrange $\\color{green}127/127$
$\\color{green}+100.00\\%$
$\\color{green}15/15$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}127/127$
$\\color{green}+100.00\\%$
stats/base/dists/gamma/quantile $\\color{green}314/314$
$\\color{green}+100.00\\%$
$\\color{green}28/28$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}314/314$
$\\color{green}+100.00\\%$
stats/base/dists/weibull/logpdf $\\color{green}308/308$
$\\color{green}+100.00\\%$
$\\color{green}35/35$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}308/308$
$\\color{green}+100.00\\%$
stats/base/dists/weibull/pdf $\\color{green}310/310$
$\\color{green}+100.00\\%$
$\\color{green}36/36$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}310/310$
$\\color{green}+100.00\\%$
stats/ranks $\\color{red}491/493$
$\\color{green}+99.59\\%$
$\\color{red}67/68$
$\\color{green}+98.53\\%$
$\\color{green}7/7$
$\\color{green}+100.00\\%$
$\\color{red}491/493$
$\\color{green}+99.59\\%$

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

@kgryte
kgryte marked this pull request as ready for review October 13, 2026 16:32
@kgryte
kgryte requested a review from a team October 13, 2026 16:32
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Oct 13, 2026
@kgryte kgryte changed the title fix: clamp only the upper bound in blas/ext/base/ndarray/dlast-index-* fix: clamp only the upper bound and clean-up Oct 13, 2026
@kgryte
kgryte merged commit ebec084 into develop Oct 13, 2026
34 checks passed
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants