Skip to content

fix: propagate fixes to blas/ext/base and stats/base/dists - #15039

Draft
Planeshifter wants to merge 3 commits into
developfrom
philipp/fix-propagation-2026-09-06
Draft

fix: propagate fixes to blas/ext/base and stats/base/dists#15039
Planeshifter wants to merge 3 commits into
developfrom
philipp/fix-propagation-2026-09-06

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-09-05 (a730ce8ee) and 2026-09-06 (6eb47fed7) to sibling packages carrying the same underlying defects.

Propagated fix (2306e85, f29d4c7): slinspace and slogspace had the same JS/C divergence already fixed upstream in clinspace/clogspace: the JavaScript ndarray.js kernels computed the increment and each interpolated value in double precision, rounding to single precision only at the final Float32Array store, while the C implementations compute natively in float. Both kernels now round through @stdlib/number/float64/base/to-float32 after every intermediate operation — the increment, the multiply-accumulate, and, in slogspace, the exponent passed to powf — so intermediate rounding matches the C implementations instead of drifting on inputs where double- and single-precision rounding disagree.

  • blas/ext/base/slinspace
  • blas/ext/base/slogspace

Propagated fix (d0a642c): ("docs: update parameter type", PR #15002) corrected lambda's @param type in the wald/{cdf,logcdf,logpdf} native wrappers from {number} to {NonNegativeNumber}, bringing the wrapper JSDoc in line with the input guard in each package's lib/main.js. We applied the same alignment across 27 drifted @param types in 22 sibling lib/native.js files, spanning chi, planck, t, negative-binomial, normal, poisson, rayleigh, triangular, truncated-normal, and weibull — each verified against its package's own lib/main.js guard rather than assumed from the pattern. Two corrections run the opposite direction: rayleigh/skewness's native type was over-restrictive (PositiveNumberNonNegativeNumber) and triangular/mean's wrongly excluded negative support bounds (NonNegativeNumbernumber).

  • stats/base/dists/chi/{kurtosis,logpdf,pdf,skewness}
  • stats/base/dists/negative-binomial/variance
  • stats/base/dists/normal/cdf
  • stats/base/dists/planck/{kurtosis,logcdf,median,stdev,variance}
  • stats/base/dists/poisson/mgf
  • stats/base/dists/rayleigh/skewness
  • stats/base/dists/t/{logpdf,mean,median,mode,pdf,variance}
  • stats/base/dists/triangular/mean
  • stats/base/dists/truncated-normal/pdf
  • stats/base/dists/weibull/quantile

Propagated fix (80d3df7): ("chore: fix EditorConfig lint errors", issue #14500) — same class of violation: these five sibling JSON files under plot/ctor/lib/props/ still carry tab indentation predating the .editorconfig two-space rule for [*.{json,json.txt}]; this PR re-indents them the same way, no other changes.

  • plot/ctor/lib/props/engine/engines.json
  • plot/ctor/lib/props/render-format/formats.json
  • plot/ctor/lib/props/symbols/symbols.json
  • plot/ctor/lib/props/viewer/viewers.json
  • plot/ctor/lib/props/y-rug-orient/orientations.json

Related Issues

Does this pull request have any related issues?

No related issues.

Questions

Any questions for reviewers of this pull request?

Should the slinspace/slogspace kernels also round start/stop on entry? The C implementations receive them already cast to float, while the JS kernels receive raw doubles, so exact JS/C agreement for non-float32-representable endpoints would additionally require rounding the endpoints. This was deliberately left out to keep the change the exact analog of the source commits (whose inputs were pre-rounded via realf/imagf).

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Validation performed:

  • Pattern search scoped to sibling namespaces of each source commit; candidate sites confirmed by two independent validation passes reading each target file in full against the source diffs, followed by an adaptation pass and a style-consistency pass.
  • Every fixture invocation in the slinspace/slogspace test suites was replayed against the modified kernels: all pass (all fixtures use exactly-representable float32 values, so the added rounding cannot alter existing expected values). All re-indented JSON files re-parse cleanly and are byte-identical apart from indentation.
  • Deliberately excluded: stats/base/dists/chi/mean/lib/native.js (its lib/main.js guards k < 0.0 while its C implementation guards k <= 0.0 — that behavioral divergence should be resolved before documenting the wrapper's domain); sites requiring cross-package changes; campaign-owned migrations (ULP-based test assertions, doctest improvements, constants/float32/nan refactors).
  • Flagged for follow-up, not touched here: negative-binomial/variance/lib/native.js describes r as "number of successes" while lib/main.js says "number of failures until experiment is stopped".

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

This PR was authored by Claude Code running a scheduled fix-propagation routine: it identified generalizable fixes merged to develop in the last 24 hours, located sibling packages with the same defects, and applied the equivalent fixes after multi-pass validation. All changes were machine-generated and machine-validated; a maintainer should review before promoting from draft.


🤖 Generated with Claude Code

https://claude.ai/code/session_0136wJPUFFRGY8suFjHCCqXk


Generated by Claude Code

Propagates fixes from 2306e85 ("fix: ensure consistent behavior
between JavaScript and C" in `blas/ext/base/clinspace`) and f29d4c7
(same fix in `blas/ext/base/clogspace`) to sibling single-precision
packages whose JavaScript implementations compute the increment and
per-iteration values in double precision, diverging from their C
implementations which compute in single precision:

-   `blas/ext/base/slinspace`
-   `blas/ext/base/slogspace`

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136wJPUFFRGY8suFjHCCqXk
Propagates fix from d0a642c ("docs: update parameter type") to
sibling distribution packages whose `lib/native.js` JSDoc parameter
types drifted from the types documented in the corresponding
`lib/main.js`:

-   `stats/base/dists/chi/{kurtosis,logpdf,pdf,skewness}`
-   `stats/base/dists/negative-binomial/variance`
-   `stats/base/dists/normal/cdf`
-   `stats/base/dists/planck/{kurtosis,logcdf,median,stdev,variance}`
-   `stats/base/dists/poisson/mgf`
-   `stats/base/dists/rayleigh/skewness`
-   `stats/base/dists/t/{logpdf,mean,median,mode,pdf,variance}`
-   `stats/base/dists/triangular/mean`
-   `stats/base/dists/truncated-normal/pdf`
-   `stats/base/dists/weibull/quantile`

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136wJPUFFRGY8suFjHCCqXk
Propagates fix from 80d3df7 ("chore: fix EditorConfig lint errors")
to sibling tab-indented JSON prop files under `plot/ctor/lib/props`,
which the repository EditorConfig requires to use two-space
indentation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136wJPUFFRGY8suFjHCCqXk
@stdlib-bot stdlib-bot added the Good First PR A pull request resolving a Good First Issue. label Sep 6, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
blas/ext/base/slinspace $\\color{red}422/429$
$\\color{green}+98.37\\%$
$\\color{red}22/23$
$\\color{green}+95.65\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{red}422/429$
$\\color{green}+98.37\\%$
blas/ext/base/slogspace $\\color{green}434/434$
$\\color{green}+100.00\\%$
$\\color{green}24/24$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}434/434$
$\\color{green}+100.00\\%$
plot/ctor $\\color{red}6958/9246$
$\\color{green}+75.25\\%$
$\\color{green}127/127$
$\\color{green}+100.00\\%$
$\\color{red}0/129$
$\\color{green}+0.00\\%$
$\\color{red}6958/9246$
$\\color{green}+75.25\\%$
stats/base/dists/chi/kurtosis $\\color{green}173/173$
$\\color{green}+100.00\\%$
$\\color{green}8/8$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}173/173$
$\\color{green}+100.00\\%$
stats/base/dists/chi/logpdf $\\color{green}307/307$
$\\color{green}+100.00\\%$
$\\color{green}29/29$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}307/307$
$\\color{green}+100.00\\%$
stats/base/dists/chi/pdf $\\color{green}304/304$
$\\color{green}+100.00\\%$
$\\color{green}27/27$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}304/304$
$\\color{green}+100.00\\%$
stats/base/dists/chi/skewness $\\color{green}172/172$
$\\color{green}+100.00\\%$
$\\color{green}8/8$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}172/172$
$\\color{green}+100.00\\%$
stats/base/dists/negative-binomial/variance $\\color{green}189/189$
$\\color{green}+100.00\\%$
$\\color{green}11/11$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}189/189$
$\\color{green}+100.00\\%$
stats/base/dists/normal/cdf $\\color{green}299/299$
$\\color{green}+100.00\\%$
$\\color{green}25/25$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}299/299$
$\\color{green}+100.00\\%$
stats/base/dists/planck/kurtosis $\\color{green}162/162$
$\\color{green}+100.00\\%$
$\\color{green}8/8$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}162/162$
$\\color{green}+100.00\\%$
stats/base/dists/planck/logcdf $\\color{green}283/283$
$\\color{green}+100.00\\%$
$\\color{green}25/25$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}283/283$
$\\color{green}+100.00\\%$
stats/base/dists/planck/median $\\color{green}163/163$
$\\color{green}+100.00\\%$
$\\color{green}8/8$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}163/163$
$\\color{green}+100.00\\%$
stats/base/dists/planck/stdev $\\color{green}166/166$
$\\color{green}+100.00\\%$
$\\color{green}8/8$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}166/166$
$\\color{green}+100.00\\%$
stats/base/dists/planck/variance $\\color{green}165/165$
$\\color{green}+100.00\\%$
$\\color{green}8/8$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}165/165$
$\\color{green}+100.00\\%$
stats/base/dists/poisson/mgf $\\color{green}246/246$
$\\color{green}+100.00\\%$
$\\color{green}15/15$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}246/246$
$\\color{green}+100.00\\%$
stats/base/dists/rayleigh/skewness $\\color{green}169/169$
$\\color{green}+100.00\\%$
$\\color{green}8/8$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}169/169$
$\\color{green}+100.00\\%$
stats/base/dists/t/logpdf $\\color{green}273/273$
$\\color{green}+100.00\\%$
$\\color{green}17/17$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}273/273$
$\\color{green}+100.00\\%$
stats/base/dists/t/mean $\\color{green}161/161$
$\\color{green}+100.00\\%$
$\\color{green}8/8$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}161/161$
$\\color{green}+100.00\\%$
stats/base/dists/t/median $\\color{green}161/161$
$\\color{green}+100.00\\%$
$\\color{green}8/8$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}161/161$
$\\color{green}+100.00\\%$
stats/base/dists/t/mode $\\color{green}161/161$
$\\color{green}+100.00\\%$
$\\color{green}8/8$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}161/161$
$\\color{green}+100.00\\%$
stats/base/dists/t/pdf $\\color{green}275/275$
$\\color{green}+100.00\\%$
$\\color{green}17/17$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}275/275$
$\\color{green}+100.00\\%$
stats/base/dists/t/variance $\\color{green}169/169$
$\\color{green}+100.00\\%$
$\\color{green}10/10$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}169/169$
$\\color{green}+100.00\\%$
stats/base/dists/triangular/mean $\\color{green}189/189$
$\\color{green}+100.00\\%$
$\\color{green}11/11$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}189/189$
$\\color{green}+100.00\\%$
stats/base/dists/truncated-normal/pdf $\\color{red}295/330$
$\\color{green}+89.39\\%$
$\\color{green}15/15$
$\\color{green}+100.00\\%$
$\\color{red}2/3$
$\\color{green}+66.67\\%$
$\\color{red}295/330$
$\\color{green}+89.39\\%$
stats/base/dists/weibull/quantile $\\color{green}294/294$
$\\color{green}+100.00\\%$
$\\color{green}25/25$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}294/294$
$\\color{green}+100.00\\%$

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Good First PR A pull request resolving a Good First Issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants