bench: use isnanf in strided/napi/smap#13385
Merged
Merged
Conversation
The `smap` package operates on `Float32Array` values but its native benchmark still guarded against NaN via the double-precision `isnan` helper. All four sibling single-precision NAPI packages (`strided/napi/smap2`, `strided/napi/smskmap`, `strided/napi/smskmap2`, and `strided/napi/cmap`) use `@stdlib/math/base/assert/is-nanf` in the same position (4/5 of the single-precision family). Swap the import and the two call sites to bring `smap` in line with its family.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
approved these changes
Jul 9, 2026
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
Normalizes the NaN guard in
@stdlib/strided/napi/smap's native benchmark to match the rest of the single-precision NAPI family.strided/napi/smapsmapoperates exclusively onFloat32Array(declared atbenchmark/benchmark.native.js:26,49-50), but its NaN guard imports@stdlib/math/base/assert/is-nan— the double-precision helper. Its four single-precision sibling packages in@stdlib/strided/napi/(smap2,smskmap,smskmap2,cmap) all use@stdlib/math/base/assert/is-nanfin the same benchmark position;smapis the sole outlier (4/5 → 80% conformance within the single-precision family). Swap the require and the two call sites to align with the family.Related Issues
No.
Questions
No.
Other
Detected by a cross-package drift audit over the 15 members of
@stdlib/strided/napi. The single-precision-family NaN-helper feature has a clear majority (isnanfin 4/5 float32-precision packages, i.e.smap2/smskmap/smskmap2/cmap);smapdeviates and its deviation is not justified by any semantic difference fromsmap2. The remainder of the namespace was clean once intentional generic-vs-specialized and unary-vs-binary-vs-nullary splits were accounted for. One sub-threshold observation surfaced (;missing from theSTDLIB_STRIDED_NAPI_MODULE_<NAME>(...)code-fence line in 4 of 14 README / header@exampleblocks — cmap/dmap/smap/zmap) but sits at 10/14 = 71% conformance, below the 75% majority bar; not proposed here.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code running the cross-package drift-detection routine on the
@stdlib/strided/napinamespace. Structural features were extracted with a script, semantic drift was surfaced by three parallel subagents auditing READMEs, C sources, and JS/TS files, and the sole surviving correction was adversarially verified by a second agent before being applied. A human maintainer will audit before promoting out of draft.@stdlib-js/reviewers
Generated by Claude Code