Skip to content

bench: clean-up - #15934

Merged
kgryte merged 22 commits into
developfrom
claude/cool-johnson-xksvaz
Oct 12, 2026
Merged

kgryte merged 22 commits into
developfrom
claude/cool-johnson-xksvaz

Conversation

@Planeshifter

@Planeshifter Planeshifter commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request fixes misplaced and mislabeled C benchmarks in 20 math/base/special packages, so that they match the conventions used by nearly all of their 384 siblings.

This pull request:

  • math/base/special/hyp2f1, math/base/special/sqrtpif: moves the native C benchmark from benchmark/c/ to benchmark/c/native/, where 97.1% of siblings keep it, and relabels it c::native:: (95.2% of native C benchmarks). Both files include the package header and call stdlib_base_*, so they are native benchmarks, and their Makefile is byte-identical to sibling native Makefiles apart from the copyright year.
  • math/base/special/tanh: both C benchmarks printed a hardcoded "tan" label, which was copied from tan. This adds #define NAME "tanh" and prints NAME instead, as 99.7% of native and 99.4% of libm C benchmarks do. The libm benchmark keeps its c:: label.
  • math/base/special/{beta,boxcox,cfloorf,dirac-delta,dirac-deltaf,kernel-cos,kernel-cosf,kernel-sin,kernel-sincos,kernel-sinf,kernel-tan,kernel-tanf,nonfibonacci,nonfibonaccif,sqrtpi,wrap,wrapf}: changes the benchmark/c/native/benchmark.c label from c:: to c::native:: (355 of 373 native C benchmarks, 95.2%). In dirac-delta, dirac-deltaf, wrap and wrapf, the native and libm benchmarks currently print the same label, so their results cannot be told apart.

Related Issues

Does this pull request have any related issues?

None.

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. All 384 members of math/base/special were analyzed; none are autogenerated. A pattern counts as the majority only if at least 75% of members share it (288 packages). The following had a clear majority:

  • file tree;
  • package.json and manifest.json key sets;
  • README section set and order;
  • C benchmark location and label.

These were excluded because they gave no signal:

  • validation prologue and error construction: no package throws, since the functions return NaN;
  • scripts and stdlib keys in package.json: empty everywhere.

Validation. Structural features came from the filesystem. Semantic features came from static analysis of lib/main.js. Every candidate was then reviewed independently for semantic intent, cross-references in tooling, tests and CI, and structural applicability.

The C benchmark runners (tools/make/lib/benchmark/c.mk and run_affected_benchmarks) scan the whole benchmark/c tree, so moving files under it does not affect benchmark discovery. Nothing parses the label strings. All 20 touched native benchmarks pass gcc -fsyntax-only. The tanh libm benchmark compiles, runs and prints # c::tanh.

Deliberately excluded:

  • The 8 members without native addons (fast, maxabsn, maxn, minabsn, minmaxabsn, minmaxn, minn, sici). fast is a sub-namespace, and the variadic functions have no C ABI.
  • cfloor, which lacks a native C benchmark. Adding one needs new package-specific code.
  • Optional README ## Notes sections.
  • The rest-parameter signatures of the n-ary min/max functions.

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 run that compares packages across a namespace for inconsistencies.


@stdlib-js/reviewers

🤖 Generated with Claude Code

https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB

claude added 21 commits October 6, 2026 04:39
…special/hyp2f1`

Moved the native C benchmark (includes the package header and calls `stdlib_base_hyp2f1`) from `benchmark/c/` to `benchmark/c/native/` (present in 97.1% of siblings) and updated its label to `c::native::` (95.2% of native C benchmarks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
…special/sqrtpif`

Moved the native C benchmark (includes the package header and calls `stdlib_base_sqrtpif`) from `benchmark/c/` to `benchmark/c/native/` (present in 97.1% of siblings) and updated its label to `c::native::` (95.2% of native C benchmarks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Added `#define NAME "tanh"` to both C benchmarks and printed it in place of the hardcoded `"tan"` label (NAME is defined and used in 99.7% of native and 99.4% of libm C benchmarks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Added `@example` tags to the main function JSDoc in `lib/main.js`, mirroring the examples in `lib/index.js` (present in 99.7% of siblings).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Updated the `benchmark/c/native/benchmark.c` label from `c::` to `c::native::` (355 of 373 native C benchmarks, 95.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Updated the `benchmark/c/native/benchmark.c` label from `c::` to `c::native::` (355 of 373 native C benchmarks, 95.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Updated the `benchmark/c/native/benchmark.c` label from `c::` to `c::native::` (355 of 373 native C benchmarks, 95.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Updated the `benchmark/c/native/benchmark.c` label from `c::` to `c::native::` (355 of 373 native C benchmarks, 95.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Updated the `benchmark/c/native/benchmark.c` label from `c::` to `c::native::` (355 of 373 native C benchmarks, 95.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Updated the `benchmark/c/native/benchmark.c` label from `c::` to `c::native::` (355 of 373 native C benchmarks, 95.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Updated the `benchmark/c/native/benchmark.c` label from `c::` to `c::native::` (355 of 373 native C benchmarks, 95.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Updated the `benchmark/c/native/benchmark.c` label from `c::` to `c::native::` (355 of 373 native C benchmarks, 95.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Updated the `benchmark/c/native/benchmark.c` label from `c::` to `c::native::` (355 of 373 native C benchmarks, 95.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Updated the `benchmark/c/native/benchmark.c` label from `c::` to `c::native::` (355 of 373 native C benchmarks, 95.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Updated the `benchmark/c/native/benchmark.c` label from `c::` to `c::native::` (355 of 373 native C benchmarks, 95.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Updated the `benchmark/c/native/benchmark.c` label from `c::` to `c::native::` (355 of 373 native C benchmarks, 95.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Updated the `benchmark/c/native/benchmark.c` label from `c::` to `c::native::` (355 of 373 native C benchmarks, 95.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Updated the `benchmark/c/native/benchmark.c` label from `c::` to `c::native::` (355 of 373 native C benchmarks, 95.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Updated the `benchmark/c/native/benchmark.c` label from `c::` to `c::native::` (355 of 373 native C benchmarks, 95.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Updated the `benchmark/c/native/benchmark.c` label from `c::` to `c::native::` (355 of 373 native C benchmarks, 95.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
Updated the `benchmark/c/native/benchmark.c` label from `c::` to `c::native::` (355 of 373 native C benchmarks, 95.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpipJ33aybJ58u4jotoxaB
@stdlib-bot stdlib-bot added the Math Issue or pull request specific to math functionality. label Oct 6, 2026
@stdlib-bot

stdlib-bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/beta $\\color{red}326/339$
$\\color{green}+0.00\\%$
$\\color{red}28/35$
$\\color{green}+0.00\\%$
$\\color{green}3/3$
$\\color{green}+0.00\\%$
$\\color{red}326/339$
$\\color{green}+0.00\\%$
math/base/special/boxcox $\\color{green}208/208$
$\\color{green}+0.00\\%$
$\\color{green}13/13$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}208/208$
$\\color{green}+0.00\\%$
math/base/special/cfloorf $\\color{green}180/180$
$\\color{green}+0.00\\%$
$\\color{green}5/5$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}180/180$
$\\color{green}+0.00\\%$
math/base/special/dirac-delta $\\color{green}160/160$
$\\color{green}+0.00\\%$
$\\color{green}9/9$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}160/160$
$\\color{green}+0.00\\%$
math/base/special/dirac-deltaf $\\color{green}160/160$
$\\color{green}+0.00\\%$
$\\color{green}9/9$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}160/160$
$\\color{green}+0.00\\%$
math/base/special/kernel-cos $\\color{red}326/330$
$\\color{green}+0.00\\%$
$\\color{red}9/11$
$\\color{green}+0.00\\%$
$\\color{green}4/4$
$\\color{green}+0.00\\%$
$\\color{red}326/330$
$\\color{green}+0.00\\%$
math/base/special/kernel-cosf $\\color{red}241/243$
$\\color{green}+0.00\\%$
$\\color{red}7/8$
$\\color{green}+0.00\\%$
$\\color{green}3/3$
$\\color{green}+0.00\\%$
$\\color{red}241/243$
$\\color{green}+0.00\\%$
math/base/special/kernel-sin $\\color{green}255/255$
$\\color{green}+0.00\\%$
$\\color{green}7/7$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}255/255$
$\\color{green}+0.00\\%$
math/base/special/kernel-sincos $\\color{red}395/403$
$\\color{green}+0.00\\%$
$\\color{red}15/19$
$\\color{green}+0.00\\%$
$\\color{green}6/6$
$\\color{green}+0.00\\%$
$\\color{red}395/403$
$\\color{green}+0.00\\%$
math/base/special/kernel-sinf $\\color{red}283/287$
$\\color{green}+0.00\\%$
$\\color{red}9/11$
$\\color{green}+0.00\\%$
$\\color{green}4/4$
$\\color{green}+0.00\\%$
$\\color{red}283/287$
$\\color{green}+0.00\\%$
math/base/special/kernel-tan $\\color{red}394/398$
$\\color{green}+0.00\\%$
$\\color{red}15/17$
$\\color{green}+0.00\\%$
$\\color{green}4/4$
$\\color{green}+0.00\\%$
$\\color{red}394/398$
$\\color{green}+0.00\\%$
math/base/special/kernel-tanf $\\color{green}227/227$
$\\color{green}+0.00\\%$
$\\color{green}7/7$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}227/227$
$\\color{green}+0.00\\%$
math/base/special/nonfibonacci $\\color{green}215/215$
$\\color{green}+0.00\\%$
$\\color{green}12/12$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}215/215$
$\\color{green}+0.00\\%$
math/base/special/nonfibonaccif $\\color{green}210/210$
$\\color{green}+0.00\\%$
$\\color{green}12/12$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}210/210$
$\\color{green}+0.00\\%$
math/base/special/sqrtpi $\\color{green}168/168$
$\\color{green}+0.00\\%$
$\\color{green}5/5$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}168/168$
$\\color{green}+0.00\\%$
math/base/special/tanh $\\color{red}297/298$
$\\color{green}+0.00\\%$
$\\color{red}23/24$
$\\color{green}+0.00\\%$
$\\color{green}3/3$
$\\color{green}+0.00\\%$
$\\color{red}297/298$
$\\color{green}+0.00\\%$
math/base/special/wrap $\\color{green}236/236$
$\\color{green}+0.00\\%$
$\\color{green}21/21$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}236/236$
$\\color{green}+0.00\\%$
math/base/special/wrapf $\\color{green}247/247$
$\\color{green}+0.00\\%$
$\\color{green}21/21$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}247/247$
$\\color{green}+0.00\\%$

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

@Planeshifter
Planeshifter marked this pull request as ready for review October 6, 2026 15:51
@Planeshifter
Planeshifter requested a review from a team October 6, 2026 15:51
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Oct 6, 2026
@Planeshifter Planeshifter mentioned this pull request Oct 7, 2026
4 of 7 tasks
@kgryte kgryte added Benchmarks Pull requests adding or improving benchmarks for measuring performance. and removed Needs Review A pull request which needs code review. labels Oct 12, 2026
@kgryte kgryte changed the title bench: fix C benchmark placement and labels in math/base/special/{hyp2f1,sqrtpif,tanh,...} bench: clean-up Oct 12, 2026
@kgryte
kgryte merged commit 8c05bc6 into develop Oct 12, 2026
17 checks passed
@kgryte
kgryte deleted the claude/cool-johnson-xksvaz branch October 12, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Benchmarks Pull requests adding or improving benchmarks for measuring performance. Math Issue or pull request specific to math functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants