Skip to content

refactor: change ordering of checks to reflect parameter order#11884

Merged
kgryte merged 1 commit intodevelopfrom
philipp/drift-stats-base-dists-gumbel-2026-05-02
May 3, 2026
Merged

refactor: change ordering of checks to reflect parameter order#11884
kgryte merged 1 commit intodevelopfrom
philipp/drift-stats-base-dists-gumbel-2026-05-02

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

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

Namespace summary

  • Members analyzed: 15 (all non-autogenerated children of stats/base/dists/gumbel/)
  • Majority threshold: 12/15 (≥75%)
  • Features analyzed: file tree, package.json shape, manifest.json presence, README sections (set + order), test/benchmark/examples filenames, public signature, validation prologue, return kind, error construction, JSDoc shape, dependencies
  • Features with clear majority that produced advancing corrections: validation prologue (1 outlier)
  • Features with clear majority but no advancing corrections: structural drift on ctor, mgf, skewness — all dropped (see Validation)
  • Features without clear majority: none — all observed features either reached 75% or had a single dominant value

quantile

Reorders the validation prologue so p is checked before mu and beta, matching the parameter-declaration order and the convention followed by 13 of 14 sibling packages in the stats/base/dists/gumbel/ namespace. No behavioral change — all validation branches return NaN.

Validation

What was checked:

  • Structural feature extraction across all 15 members (file tree, package.json/manifest.json keys, README headings, test/benchmark/examples file naming).
  • Semantic feature extraction (public signature, validation prologue, return kind, error construction, JSDoc shape, dependencies) across the 14 function-style packages.
  • Three independent validation passes against the merged outlier list:
    1. Opus semantic-review on the quantile validation prologue → confirmed-drift (no domain reason for the reorder; identical behavior; signature, JSDoc, and README all describe p first).
    2. Opus cross-reference on quantile's tests, examples, factory, and namespace re-exports → safe-to-apply (no test or external reference depends on the textual order of the || predicates; the factory's hot loop already validates only p).
    3. Sonnet structural-review on ctor, mgf, and skewness outliers → all rejected as inapplicable or cascading.

What was deliberately excluded:

  • ctor's missing native bindings, gypfile, manifest.json, and ## C APIs sections — inapplicable to a JavaScript constructor with property accessors.
  • mgf's missing test/fixtures/julia/ directory — would require cascading test.js rewrites to consume the fixtures; out of scope for a mechanical drift fix.
  • skewness's missing test/fixtures/julia/ directory — Gumbel skewness is a parameter-independent constant; Julia ground-truth fixtures are mathematically meaningless here.
  • All features whose only outliers fell into the above categories.

Other

This PR is the output of a per-namespace cross-package drift-detection routine. Random target namespace picked uniformly from eligible namespaces (≥8 non-autogenerated members) using seed 20260502. The full per-feature majority/conformance/outlier breakdown and the per-agent verdicts are recorded in the local report at ~/drift-reports/drift-stats-base-dists-gumbel-2026-05-02.md.

Checklist

AI Assistance

  • Yes
  • No

How AI assistance was used:

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Research and understanding

Disclosure

This PR was authored by Claude Code running an automated cross-package drift-detection routine. The routine extracted structural and semantic features from every member of stats/base/dists/gumbel/, computed per-feature majority patterns at a 75% threshold, and dispatched three independent agents (two Opus, one Sonnet) to validate the surviving findings. Only one finding survived all three checks; the corresponding patch is the single-line reorder applied here.


Generated by Claude Code

…h namespace convention

Reorder NaN checks in the validation prologue so the first declared
parameter (`p`) is checked first, matching the convention used by
13/14 (93%) sibling packages in `stats/base/dists/gumbel/`. Behavior
is unchanged: every branch still returns NaN.
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label May 2, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/gumbel/quantile $\color{green}296/296$
$\color{green}+100.00%$
$\color{green}23/23$
$\color{green}+100.00%$
$\color{green}4/4$
$\color{green}+100.00%$
$\color{green}296/296$
$\color{green}+100.00%$

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

@Planeshifter Planeshifter changed the title fix: align outliers in stats/base/dists/gumbel with namespace majority patterns refactor: change ordering of checks to reflect parameter order May 2, 2026
@Planeshifter Planeshifter marked this pull request as ready for review May 2, 2026 15:28
@Planeshifter Planeshifter requested review from a team and kgryte May 2, 2026 15:28
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label May 2, 2026
@kgryte kgryte removed the Needs Review A pull request which needs code review. label May 3, 2026
@kgryte kgryte merged commit 39b17ab into develop May 3, 2026
58 checks passed
@kgryte kgryte deleted the philipp/drift-stats-base-dists-gumbel-2026-05-02 branch May 3, 2026 01:47
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.

4 participants