bench: adopt y != y NaN check across stats/base/dists/* C benchmarks#13229
Draft
Planeshifter wants to merge 1 commit into
Draft
bench: adopt y != y NaN check across stats/base/dists/* C benchmarks#13229Planeshifter wants to merge 1 commit into
y != y NaN check across stats/base/dists/* C benchmarks#13229Planeshifter wants to merge 1 commit into
Conversation
Propagates fix from fe3bace ("bench: add missing function documentation and ensure consistency with other benchmarks") to sibling C benchmarks still using `isnan( y )`. Removes the now-unneeded `<math.h>` include and switches both call sites to the tree's canonical `y != y` self-comparison idiom. Affects: chi/entropy, chisquare/kurtosis, chisquare/mgf, degenerate/logpmf, degenerate/pdf, degenerate/pmf, degenerate/quantile, planck/mgf.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Propagating fixes merged to
developbetweenfe3bacee0(2026-07-01 12:58 -0700) andc38afb148(2026-07-01 13:07 -0700) to sibling packages with the same underlying defect.Pattern: adopt
y != yNaN check and drop unneeded<math.h>in C benchmarksSource commit
fe3bacee0reworkedstats/base/dists/anglit/quantile/benchmark/c/benchmark.cto match sibling style. Among those changes, bothif ( isnan( y ) )sites insidestatic double benchmark( void )were switched to the tree's canonicaly != yself-comparison idiom, and the now-unneeded#include <math.h>was dropped. The identical pair of defects (unnecessary<math.h>include;isnan( y )NaN check inconsistent with sibling benchmarks) exists in every listed target, and<math.h>carries no other symbol into any of them. Fix applies verbatim per file: one include line deleted, twoisnan( y )occurrences swapped fory != y.fe3bacee0(bench: add missing function documentation and ensure consistency with other benchmarks)@stdlib/stats/base/dists/chi/entropy@stdlib/stats/base/dists/chisquare/kurtosis@stdlib/stats/base/dists/chisquare/mgf@stdlib/stats/base/dists/degenerate/logpmf@stdlib/stats/base/dists/degenerate/pdf@stdlib/stats/base/dists/degenerate/pmf@stdlib/stats/base/dists/degenerate/quantile@stdlib/stats/base/dists/planck/mgfRelated Issues
None.
Questions
No.
Other
Validation
lib/node_modules/@stdlib/**/benchmark/c/benchmark.cmatchingisnan( y ); eight sites returned, all understats/base/dists/*.#include <math.h>is present on its own line and carries no other symbol into the file (stdlib headers likestdlib/math/base/special/ceil.hare unrelated), (b) exactly twoif ( isnan( y ) )occurrences exist, both insidestatic double benchmark( void )— one inside the ITERATIONS loop, one after — and (c)yis declareddoubleand assigned by the loop's first iteration before the check, soy != yis semantically equivalent toisnan( y )in all reachable states.if ( ... )single-space padding at both call sites.Deliberately excluded:
fe3bacee0(JSDoc scaffolding for static helpers,/** Main execution sequence. */beforeint main, inline// TAP plan/// Use the current time to seed the random number generator:comments,i + 1→i+1): every candidate site already carries most of these, and the missing subsets differ per file. Applying them here would drift into "while we're here" cleanup beyond the propagatable core.feat:commits from the window (c81fa285array/filledfloat16,c38afb148array/base/getterfloat16): feature additions, not defect propagations.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code on behalf of @Planeshifter as an automated propagation of fixes merged to
developover the prior 24 hours. Candidate source commits were filtered for generalizable patterns, sibling sites located via grep-able pattern signatures, and each proposed patch independently validated by parallel reviewer agents (two opus validation passes plus a sonnet style-consistency pass) before commits were applied in the primary worktree. A human will audit and promote the PR out of draft.@stdlib-js/reviewers
Generated by Claude Code