Skip to content

docs: use canonical uinteger32 JSDoc tag in number/float32/base#12916

Draft
Planeshifter wants to merge 2 commits into
developfrom
philipp/drift-number-float32-base-2026-06-16
Draft

docs: use canonical uinteger32 JSDoc tag in number/float32/base#12916
Planeshifter wants to merge 2 commits into
developfrom
philipp/drift-number-float32-base-2026-06-16

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

Replaces the non-canonical {unsigned32} JSDoc type tag with {uinteger32} at three sites in number/float32/base. uinteger32 is the stdlib-wide alias for a 32-bit unsigned integer in the JS number value space (94% of stdlib occurrences) and is registered in _tools/eslint/rules/jsdoc-typedef-typos/lib/defaults.json; unsigned32 is an older alias absent from that allowlist. JSDoc-only; no runtime behavior change.

Namespace summary

  • Members analyzed: 18 (number/float32/base direct children with package.json).
  • Leaf packages used for the per-feature vote: 17 (the assert/ namespace re-export was excluded from semantic analysis as inapplicable).
  • Features extracted: file tree, package.json top-level/scripts/stdlib keys, manifest.json top-level keys, README sections (set and order), test/benchmark/example filenames, public signature, return kind, validation prologue, error construction, JSDoc shape, require() dependencies.
  • Features with a clear majority (≥75%) that surfaced an outlier:
    • JSDoc unsigned-32-bit-integer type tag — 4/4 sibling uses are {uinteger32}; 3 sites use {unsigned32}. Fixed here.
    • ## See Also README section — present in 14/17 leafs. Excluded: the section is auto-populated by the package-generator (<!-- Section for related stdlib packages. Do not manually edit this section, as it is automatically populated. -->).
  • Features without a clear majority (excluded from drift analysis):
    • lib/native.js presence — 12/17 leafs (70.6%); below the 75% threshold and the absences (from-binary-string, to-binary-string, to-int32, to-uint32, ulp-difference) are semantically intentional (string parsing, simple bitwise ops).
    • ## C APIs README section — 12/17 leafs (70.6%); tracks lib/native.js.
    • @example count, @param/@returns types — heterogeneous by function shape; no convergent majority and no candidate outlier.

number/float32/base/to-word

lib/main.js and lib/native.js both document @returns {unsigned32}. Sibling packages document the identical concept as {uinteger32} (see from-word @param, significand @returns, to-uint32 @returns), and unsigned32 is not in the stdlib JSDoc typedef allowlist. Renamed at both sites; no other changes.

number/float32/base/ulp-difference

lib/main.js documents @param {unsigned32} word on the private monotoneKey helper, whose argument is the uint32 produced by to-word. Renamed to match the canonical alias. The exported ulpdiff JSDoc is unchanged.

Related Issues

None.

Questions

None.

Other

Validation

  • Structural and semantic features were extracted across all 18 direct child packages of lib/node_modules/@stdlib/number/float32/base/ (file tree excluding sub-package recursion, package.json / manifest.json key sets, README section list, test//benchmark//examples/ filenames, JSDoc shape, validation prologue, error construction, dependency set).
  • Three validation passes were run over the surfaced drift candidate:
    1. Semantic. Confirmed unsigned32 and uinteger32 denote the same JSDoc concept; sibling packages in the namespace already use uinteger32 for the identical return/parameter type.
    2. Cross-reference. Tests (to-word/test/test.js, ulp-difference/test/test.js) assert runtime values only and do not depend on the JSDoc tag. examples/index.js and the lib/index.js @module docstrings do not reference either token. No README in number/float32/base references unsigned32.
    3. Structural. uinteger32 is registered in _tools/eslint/rules/jsdoc-typedef-typos/lib/defaults.json and _tools/eslint/rules/jsdoc-doctest-decimal-point/lib/integer_types.json; unsigned32 is absent from both. Production usage measured at 64 occurrences for uinteger32 vs 4 for unsigned32 (3 of the 4 are the sites fixed here; the remaining one is a test fixture inside _tools/).
  • Deliberately excluded from this PR:
    • ## See Also heading drift in significand, to-float16, ulp-difference — generator-owned section (scaffold present, content auto-populated by the package generator).
    • assert/ outlier on file-tree features (missing lib/main.js, docs/repl.txt, benchmark/) — assert/ is a namespace re-export package, not a leaf, and these files are inapplicable.
    • lib/native.js and ## C APIs absences — below the 75% conformance threshold and absences track a real semantic distinction (string-valued / bitwise-trivial packages legitimately lack a C addon).

Checklist

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

This PR was authored by Claude Code as part of an automated routine that scans a randomly chosen stdlib namespace for cross-package API drift via majority vote. Structural and semantic features were extracted across all members of number/float32/base; the only feature with a clear majority that surfaced advance-able outliers was the JSDoc unsigned-32-bit-integer type tag. Three independent validation passes (semantic, cross-reference, structural) confirmed the rename is mechanical and matches the stdlib eslint typedef allowlist. A human maintainer should verify before promoting this PR out of draft.


@stdlib-js/reviewers


Generated by Claude Code

claude added 2 commits June 16, 2026 04:15
Renames the `@returns` type from `{unsigned32}` to `{uinteger32}` in
`lib/main.js` and `lib/native.js`. `uinteger32` is the canonical stdlib
JSDoc alias for a 32-bit unsigned integer in the JS `number` value space
(used by 94% of stdlib occurrences and registered in the
`jsdoc-typedef-typos` eslint allowlist); `unsigned32` is an older alias
that is absent from the allowlist. Within `number/float32/base`,
sibling packages `from-word`, `significand`, `to-uint32`, and
`from-word/native` already use `{uinteger32}` for the same concept (4/4
intra-namespace conformance on this feature).

No runtime behavior change.
Renames the `@param` type on the private `monotoneKey` helper from
`{unsigned32}` to `{uinteger32}`. `uinteger32` is the canonical stdlib
JSDoc alias for a 32-bit unsigned integer (94% of stdlib occurrences and
registered in the `jsdoc-typedef-typos` eslint allowlist); `unsigned32`
is an older alias absent from the allowlist. Sibling packages within
`number/float32/base` use `{uinteger32}` for the same concept (4/4
intra-namespace conformance).

No runtime behavior change.
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
number/float32/base/to-word $\\color{green}153/153$
$\\color{green}+100.00\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}153/153$
$\\color{green}+100.00\\%$
number/float32/base/ulp-difference $\\color{green}160/160$
$\\color{green}+100.00\\%$
$\\color{green}9/9$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}160/160$
$\\color{green}+100.00\\%$

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants