Skip to content

chore: propagate recent develop fixes to sibling packages (2026-07-08)#13374

Draft
Planeshifter wants to merge 3 commits into
developfrom
philipp/fix-propagation-2026-07-08
Draft

chore: propagate recent develop fixes to sibling packages (2026-07-08)#13374
Planeshifter wants to merge 3 commits into
developfrom
philipp/fix-propagation-2026-07-08

Conversation

@Planeshifter

@Planeshifter Planeshifter commented Jul 8, 2026

Copy link
Copy Markdown
Member

Description

Propagating fixes merged to develop between 2026-07-07 14:20 PDT (b5b7b4c) and 2026-07-08 01:31 PDT (bb93e56) to sibling packages carrying the same defect.

Pattern: logcdf description missing "natural logarithm" qualifier

Commit a3c9b30 corrected the JSDoc/JSDoc-in-C description in stats/base/dists/pareto-type1/logcdf where the sentence read "Evaluates the cumulative distribution function (CDF)" for a function that computes the natural logarithm of the CDF. The same defect is present in stats/base/dists/gumbel/logcdf/src/main.c — the sibling lib/main.js and header already carry the correct wording, so only the C source needs to be aligned.

Pattern: const-qualify read-only input arrays in number/* C examples

Commit 3fab81a added const to the input double x[] in number/float64/base/signbit's examples/c/example.c and README C snippet, matching the cppcheck lint that flags never-mutated arrays. Three sibling number/float{32,64}/base/* packages carry the same defect: the input array is iterated over and each element passed by value into a stdlib scalar-read call. const is added to examples/c/example.c for all three packages; the mirrored snippet in README.md is only updated for float64/base/to-words, where the surrounding JS example passes Lint Changed Files — the READMEs for the other two carry a pre-existing stdlib/doctest-marker violation on adjacent // => comments that surfaces the moment the file enters the changed-files set.

  • 3fab81a (chore: fix C lint errors)
    • @stdlib/number/float64/base/exponent (examples/c/example.c only)
    • @stdlib/number/float64/base/to-words (examples/c/example.c + README.md)
    • @stdlib/number/float32/base/to-word (examples/c/example.c only)

Effective PR diff vs develop: 5 files, 5 LOC.

Related Issues

No.

Questions

The Run changed examples and Lint Changed Files jobs triggered by the push event on commit 1f85abc79 fail, but for a scope-of-comparison reason worth flagging to reviewers:

  • run_affected_examples.yml computes changed files with git diff HEAD~ HEAD on push events. Commit 1f85abc79 is the revert that removed the two problematic READMEs (float32/base/to-word/README.md and float64/base/exponent/README.md) from the effective PR diff. Its HEAD~..HEAD delta is exactly those two README files, so the push-triggered run re-lints them and re-hits the pre-existing stdlib/doctest-marker violation on the adjacent // => markers — even though the effective diff vs develop no longer touches either README.
  • The workflow's pull_request-triggered path (lines 118–121 of run_affected_examples.yml, merge-base to head) compares to the PR base, which excludes the reverted READMEs.

Should the two // => doctest-marker violations be normalized as a follow-up (either here or in a separate maintenance PR), the const propagation can be extended back to the two dropped READMEs. Not attempted in this PR because the source commit's mechanical shape is s/double x\[\]/const double x\[\]/, and normalizing // => X inline comments is adaptive rewriting outside that shape.

Other

Validation

  • Search scope: each source pattern was searched within the source commit's namespace and the immediate sibling namespaces (stats/base/dists/*/{logcdf,logpdf,logpmf,logsf} for the description fix; number/*/base/*/examples/c/example.c and the mirrored README.md snippets for the const-qualifier fix). Header files under include/ were checked for the description pattern; only src/main.c in gumbel/logcdf carried the pre-fix wording. math/strided/special/* example.c files were checked for the const pattern; the arrays are already const there.
  • Two independent Opus validation agents confirmed the defect at each candidate site by reading the file in full and cross-checking sibling files (for the description pattern: verifying lib/main.js and the header already use the corrected phrasing; for the const pattern: verifying x is never written and the C-snippet in README.md matches the example.c code).
  • Style-consistency: the description fix reproduces the exact sentence used by the pareto-type1 sibling; the const-qualifier addition is a one-token prefix with no impact on surrounding style.

Deliberately excluded:

  • Two of the three README C snippets covered by the const-qualifier pattern — float32/base/to-word/README.md and float64/base/exponent/README.md. Lint Changed Files flags // => doctest markers on adjacent JS example lines the moment either README enters the changed-files set (stdlib/doctest-marker: Use // returns after variable declarations or assignment expressions instead of =>). The lint is pre-existing debt; normalizing it is adaptive rewriting outside the source commit's mechanical shape. Follow-up commit 1f85abc reverts the two README lines while keeping the sibling .c edits. See the note in "Questions" for how this interacts with the Run changed examples push-event trigger.
  • The refactor: add isnan guards sweep from b5b7b4c (stats/base/dists/{beta,betaprime,f,gamma,invgamma}): sibling PR chore: follow-up fixes for recent develop commits #13373 already flagged the isnan-guard ordering as a follow-up, and other candidate dists (uniform, arcsine) return NaN correctly via NaN-arithmetic propagation without an explicit guard — adding one is an adaptive, defense-in-depth call, not a mechanical propagation, and better handled as a deliberate normalization pass.
  • The logorithmlogarithm typo on line 29 of gumbel/logcdf/src/main.c and the GUMBEL_CDF_HGUMBEL_LOGCDF_H include-guard-comment typo: unrelated to the description pattern the source commit fixed. Log-and-skip for a future maintenance pass.
  • chi/logpdf and t/logpdf files ("log probability density function (logPDF)"): technically consistent phrasing, not the same defect a3c9b30 fixed.
  • Other stats/base/dists/*/log{cdf,pdf,pmf,sf} files scanned; none carried the exact pre-fix wording.
  • The 37 blas/*/examples/c/example.c files declaring double x[]: all wrap in-place BLAS routines (dscal, dsort, dfill, dswap, …) that mutate the input array; const would emit a discarded-qualifier warning.

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 on behalf of @Planeshifter as an automated propagation of fixes merged to develop over the prior 24 hours. Candidate source commits were filtered for generalizable patterns, sibling sites located via grep-able pattern signatures, and each proposed patch independently validated by parallel reviewer agents (two Opus validation passes) before commits were applied in the primary worktree. A maintainer should audit and promote out of draft.


claude added 2 commits July 8, 2026 13:18
Propagates the description fix from a3c9b30 ("docs: update
descriptions") to the C source in `stats/base/dists/gumbel/logcdf`,
which shared the same defect as the pareto-type1 sibling: the JSDoc
sentence said "Evaluates the cumulative distribution function (CDF)"
instead of "Evaluates the natural logarithm of the cumulative
distribution function (CDF)". The sibling `lib/main.js` and header
already carry the corrected wording.
Propagates the C lint fix from 3fab81a ("chore: fix C lint errors") to
sibling `number/float{32,64}/base/*` packages whose example.c and
README C snippets declare a read-only input array `x[]` without
`const`. The pattern (cppcheck flagging arrays that are only
indexed-read as candidates for `const`) applies verbatim in
`number/float64/base/exponent`, `number/float64/base/to-words`, and
`number/float32/base/to-word` — the arrays are iterated over and each
element is passed by value into the stdlib call, never mutated.
@stdlib-bot

stdlib-bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
number/float32/base/to-word $\\color{green}153/153$
$\\color{green}+0.00\\%$
$\\color{green}5/5$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}153/153$
$\\color{green}+0.00\\%$
number/float64/base/exponent $\\color{green}173/173$
$\\color{green}+0.00\\%$
$\\color{green}5/5$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}173/173$
$\\color{green}+0.00\\%$
number/float64/base/to-words $\\color{green}313/313$
$\\color{green}+0.00\\%$
$\\color{green}10/10$
$\\color{green}+0.00\\%$
$\\color{green}3/3$
$\\color{green}+0.00\\%$
$\\color{green}313/313$
$\\color{green}+0.00\\%$
stats/base/dists/gumbel/logcdf $\\color{green}293/293$
$\\color{green}+0.00\\%$
$\\color{green}19/19$
$\\color{green}+0.00\\%$
$\\color{green}4/4$
$\\color{green}+0.00\\%$
$\\color{green}293/293$
$\\color{green}+0.00\\%$

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

Revert the `const` addition on the C snippet inside
`number/float32/base/to-word/README.md` and
`number/float64/base/exponent/README.md`. Both READMEs carry a
pre-existing `stdlib/doctest-marker` violation on nearby `// =>`
comments in the JS example, and touching either file surfaces the
lint failure under `Lint Changed Files`. Fixing that lint is
adaptive rewriting outside the source commit's mechanical shape;
drop these README sites and keep the const propagation to the
sibling `examples/c/example.c` files (which stay landed) plus
`float64/base/to-words/README.md`, which has no such marker.
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.

3 participants