Skip to content

style: align outliers in stats/base/dists/logistic with namespace majority patterns#11914

Closed
Planeshifter wants to merge 2 commits intodevelopfrom
philipp/drift-stats-base-dists-logistic-2026-05-03
Closed

style: align outliers in stats/base/dists/logistic with namespace majority patterns#11914
Planeshifter wants to merge 2 commits intodevelopfrom
philipp/drift-stats-base-dists-logistic-2026-05-03

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

Aligning outliers in stats/base/dists/logistic with namespace majority patterns (random namespace pick, seed 20260503).

Namespace summary

  • Members analyzed: 15 (cdf, ctor, entropy, kurtosis, logcdf, logpdf, mean, median, mgf, mode, pdf, quantile, skewness, stdev, variance)
  • Autogenerated members excluded: 0
  • Features analyzed: file tree, package.json shape, manifest.json shape, README section ordering, test/benchmark/example file naming, public signature, validation prologue, error construction, JSDoc shape, @stdlib/* dependency set
  • Features with clear majority (≥75% conformance): file tree (multiple shared paths at 87–93%), README section ordering at 80%, JSDoc shape at 100%
  • Features without clear majority (excluded from drift detection): errorConstruction (only ctor throws — others return NaN); validation-prologue scale guard splits cleanly along a mathematical fault line — 8 zero-arg (mu, s) functions use s <= 0.0, 6 parameterized (x|t|p, mu, s) functions use s < 0.0 to keep the s == 0 degenerate-distribution branch reachable

Outlier package: stats/base/dists/logistic/stdev

stats/base/dists/logistic/stdev is missing test/fixtures/julia/REQUIRE and test/fixtures/julia/runner.jl, which 13 of 15 sibling packages in stats/base/dists/logistic (87%) ship as standard fixture infrastructure; stdev and ctor are the only packages without it, but ctor is exempt by convention, making stdev the sole non-conforming outlier. Added the two Julia files mirroring variance/test/fixtures/julia/runner.jl with Distributions.var swapped for Distributions.std; existing Python/scipy fixtures are left in place.

Related Issues

None.

Questions

None.

Other

Validation

Three independent agents reviewed the drift findings before any commits were made:

  • Agent 1 (semantic review, opus): confirmed the validation-prologue split is intentional (degenerate-distribution handling for parameterized functions only) and that ctor's use of format-built throws is intentional given its constructor contract.
  • Agent 2 (cross-reference, opus): confirmed stdev/test/test.js only requires ./fixtures/python/data.json, so adding Julia files is purely additive; no sibling references stdev's fixture path; the variance Julia runner is directly adaptable.
  • Agent 3 (structural review, sonnet): confirmed ctor's missing native files are intentional (no gypfile, no native code); confirmed the Notes section in logcdf/logpdf READMEs documents log-domain numerical stability (intentional deviation, not drift).

Deliberately excluded from this PR:

  • ctor missing binding.gyp, manifest.json, lib/native.js, src/*, include.gypi, examples/c/*, benchmark/c/*, benchmark/benchmark.native.js, test/test.native.js, plus the Julia fixture pair — ctor is a pure-JS constructor with no native implementation; all native infrastructure is structurally inapplicable.
  • logcdf/logpdf extra Notes README section — documents log-domain overflow/underflow guidance that does not apply to non-log siblings.
  • The errorConstruction feature — no clear majority (only ctor throws).
  • Switching stdev's test.js from Python to Julia fixture data — would require regenerating fixture values under a different RNG and changing test inputs; out of scope for a mechanical drift correction.

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 running the cross-package drift-detection routine. The routine randomly picked the stats/base/dists/logistic namespace (seed 20260503), extracted structural and semantic features from all 15 member packages, computed the 75% majority pattern per feature, and validated outliers via three parallel review agents (Opus semantic, Opus cross-reference, Sonnet structural). Only the one drift correction whose three agents unanimously cleared as confirmed-drift advanced to a commit.



Generated by Claude Code

…ions

Add Julia fixture infrastructure (`test/fixtures/julia/REQUIRE` and
`test/fixtures/julia/runner.jl`) to match the namespace convention
used by 13/15 sibling packages (87%). The runner mirrors
`stats/base/dists/logistic/variance/test/fixtures/julia/runner.jl`,
substituting `Distributions.std` for `Distributions.var`. Existing
Python fixtures are left untouched; switching the test suite over to
the Julia data is left to a follow-up maintainer call.
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label May 3, 2026
… Julia runner

Lint Copyright Years CI failed because the file was scaffolded from
the 2018-vintage `variance/test/fixtures/julia/runner.jl` template
without resetting the year on a newly added file.
@stdlib-bot
Copy link
Copy Markdown
Contributor

stdlib-bot commented May 3, 2026

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/logistic/stdev $\color{green}180/180$
$\color{green}+100.00%$
$\color{green}9/9$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}180/180$
$\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

Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants