Skip to content

bench: add benchmarks to stats/kde2d - #16127

Draft
Planeshifter wants to merge 1 commit into
developfrom
claude/cool-johnson-93n132
Draft

Planeshifter wants to merge 1 commit into
developfrom
claude/cool-johnson-93n132

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • adds the missing benchmark to @stdlib/stats/kde2d, the only non-namespace package in stats/* that has none.

@stdlib/stats/kde2d

Adds benchmark/benchmark.js, present in 56 of 57 sibling packages (98%), and the matching directories.benchmark entry in package.json (98%). The benchmarks cover the default call and the n, kernel, and h options, and follow the layout of stats/lowess/benchmark/benchmark.js.

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.

Namespace summary. stats has 62 direct packages. Of these, 57 are non-namespace members; array, base, incr, iter, and strided are namespace aggregators and were excluded. A feature has a clear majority when at least 43 of the 57 packages (75%) agree.

  • Majority found for: file tree, top-level package.json keys, README ## Usage/## Examples sections, returnKind, JSDoc @returns/@throws/@example presence.
  • No clear majority, so excluded: public signature shape (top pattern 19/57), validation prologue (37 empty, 20 non-empty), error construction (37 none, 13 format, 7 mixed), scripts/stdlib key sets, dependencies.

Validation. Structural features were extracted from the filesystem. Semantic features were extracted by agents that read each package's lib/ sources. The candidate correction was then reviewed for structural fit and for cross-references. Across stdlib, 92.4% of packages with a lib/main.js ship a benchmark, which clears the 90% presence gate. Nothing depends on the benchmark being absent.

Candidates dropped as intentional deviations:

  • stats/lowess has no @example in lib/main.js. The function there is named main, and none of the 143 stdlib packages that export a function named main carry an @example in it; the example lives in lib/index.js.
  • Static error messages built from plain strings (anova1, chi2gof, lowess, pcorrtest, ttest, wilcoxon, …) follow the stdlib-wide convention: 2,207 plain-string uses, and no format() calls without interpolation.

The benchmark was smoke-tested by running its bodies under a stub harness. The full @stdlib/bench harness could not be run because the build environment has no installed npm dependencies.

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 cross-package API drift detection run.


🤖 Generated with Claude Code

https://claude.ai/code/session_012wvaXWDrnZ4nfKTjK5LcpV


Generated by Claude Code

Added missing `benchmark/benchmark.js` (present in 56 of 57 `stats/*` sibling packages, 98%) and the corresponding `directories.benchmark` entry in `package.json` (98% of siblings). Benchmarks cover the default call and the `n`, `kernel`, and `h` options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wvaXWDrnZ4nfKTjK5LcpV
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Oct 14, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/kde2d $\\color{red}1226/1312$
$\\color{green}+93.45\\%$
$\\color{red}96/103$
$\\color{green}+93.20\\%$
$\\color{red}13/20$
$\\color{green}+65.00\\%$
$\\color{red}1226/1312$
$\\color{green}+93.45\\%$

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

@Planeshifter Planeshifter mentioned this pull request Oct 14, 2026
4 of 7 tasks

This branch has not been deployed

No deployments
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