Skip to content

chore: rename C source files according to convention - #15435

Merged
kgryte merged 2 commits into
developfrom
claude/trusting-hamilton-2iy07t
Sep 23, 2026
Merged

kgryte merged 2 commits into
developfrom
claude/trusting-hamilton-2iy07t

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • Renames src/from_word.c to src/main.c in number/float32/base/from-word and src/to_word.c to src/main.c in number/float32/base/to-word, updating each package's manifest.json source entry to match, so that both packages use the C source filename already used by the rest of the namespace.

Namespace summary

Audited @stdlib/number/float32/base.

  • Members: 18 (13 native, gypfile: true). No member is wholly generator-owned, so all 18 participated.
  • Features analyzed: 18 structural and semantic features — file tree, package.json top-level/scripts/stdlib key sets, manifest.json keys, README section set and heading order, test/benchmark/example filenames, public signature, return kind, validation prologue, error construction, JSDoc shape, and source dependencies. Several structural features were additionally voted within the 13-member native sub-population.
  • Features with a clear majority (≥75%): 14. Conformance is high across the board — package.json key sets, scripts, manifest.json keys, return kind, and test/example filenames are all at 100%.
  • Features without a clear majority (excluded): 4 — README heading order (max 7/18, 38.9%), public-signature arity (12/18, 66.7%), keywords family (12/18, 66.7%), and source dependencies (max 4/18, 22.2%).

The keywords and arity splits are not drift: they separate bit-level type utilities from arithmetic operations. They were excluded rather than forced.

number/float32/base/from-word

The number/float32/base/from-word package renamed src/from_word.c to src/main.c and updated the corresponding src entry in manifest.json; 11 of 13 native packages in the number/float32/base namespace (84.6%) already use src/main.c, and this brings the package in line with that convention. The build derives sources solely from manifest.json via include.gypi/binding.gyp, and src/Makefile hardcodes no filename, so no build configuration changes are required. The public header include/stdlib/number/float32/base/from_word.h is untouched and the renamed file compiles cleanly; this change is behavior-neutral.

number/float32/base/to-word

In number/float32/base/to-word, src/to_word.c retained the legacy package-named filename against the namespace's 84.6% src/main.c convention (11/13 packages) and the repository's 95.1% convention (1645/1729). Renamed to src/main.c and updated the corresponding src entry in manifest.json; the public header include/stdlib/number/float32/base/to_word.h and the build graph (binding.gyp, include.gypi, src/Makefile) resolve the source list dynamically and required no changes. Behavior-neutral: the file compiles cleanly and no other reference to to_word.c exists in the repository.

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.

Validation

Checked:

  • Structural extraction across all 18 members (file tree, package.json/manifest.json key sets, README headings, test/benchmark/example filenames).
  • Semantic extraction via one agent per package reading lib/main.js, lib/index.js, and lib/validate.js/lib/assign.js/lib/polyfill.js where present.
  • Three-agent drift validation — semantic review, cross-reference against tests/benchmarks/build config/tooling, and structural review. The correction in this pull request was returned confirmed-drift unanimously by all three.
  • Post-apply: a repository-wide grep for from_word.c/to_word.c returns no remaining references, and both renamed sources compile cleanly under gcc -c -Wall against the package include path.

Deliberately excluded:

  • Intentional deviations. assert lacks lib/main.js, benchmark/benchmark.js, and docs/repl.txt because it is a namespace aggregator, matching number/float64/base/assert and math/base/assert. to-float16/lib/main.js carries no JSDoc because it is the Math.f16round builtin alias behind the standard builtin-vs-polyfill dispatch. from-binary-string is the only member that validates its argument, which is its documented contract and asserted by its tests. identity keeps C benchmarks under benchmark/c/native/, a distinct and actively used convention (477 packages repository-wide, 219 carrying both paths) reproduced in the float64 and complex identity packages.
  • Generator-owned sections. The missing ## See Also blocks in significand, to-float16, ulp-difference, and assert are emitted by remark-stdlib-related from @stdlib/namespace/pkg2related data, which has an empty entry for significand and no entry for the other three. This is generator state rather than a README defect and is not addressed here.
  • Features without a clear majority, listed in the namespace summary above.
  • A single-precision keyword gap in ulp-difference, dropped on materiality — a lone one-line metadata tweak, and the package also lacks the plain single keyword, so adding one keyword would leave it off-pattern regardless.

No test expectations, public signatures, or observable behavior are changed by this pull request.

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 pull request was prepared by Claude Code running an automated cross-package drift audit of the number/float32/base namespace. AI was used to survey the namespace, compute per-feature majority patterns, adversarially validate each candidate finding, and draft this description. The change itself is a mechanical file rename plus a one-line manifest.json update in each package; it was verified by a repository-wide reference grep and by compiling both renamed sources. Reviewers should confirm the src/main.c naming convention is in fact desired for these two packages, since the change is consistency-only and carries no functional benefit.


@stdlib-js/reviewers

🤖 Generated with Claude Code

https://claude.ai/code/session_011xn7JS4jsZNBTj4fRBXKFr


Generated by Claude Code

…word`

Renamed `src/from_word.c` to `src/main.c` and updated the corresponding
`manifest.json` source entry. 11 of 13 native packages in
`number/float32/base` (84.6%) name their single C source `src/main.c`, as
do 1645 packages repository-wide against 84 retaining the legacy
package-named form (95.1%).

The rename is behavior-neutral: the package's public C surface is the
header `include/stdlib/number/float32/base/from_word.h`, which is
unchanged, and `binding.gyp` resolves sources through `<@(src_files)`
from `manifest.json` rather than by filename.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011xn7JS4jsZNBTj4fRBXKFr
Renamed `src/to_word.c` to `src/main.c` and updated the corresponding
`manifest.json` source entry. 11 of 13 native packages in
`number/float32/base` (84.6%) name their single C source `src/main.c`, as
do 1645 packages repository-wide against 84 retaining the legacy
package-named form (95.1%).

The rename is behavior-neutral: the package's public C surface is the
header `include/stdlib/number/float32/base/to_word.h`, which is
unchanged, and `binding.gyp` resolves sources through `<@(src_files)`
from `manifest.json` rather than by filename.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011xn7JS4jsZNBTj4fRBXKFr
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
number/float32/base/from-word $\\color{green}145/145$
$\\color{green}+100.00\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}145/145$
$\\color{green}+100.00\\%$
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\\%$

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

@Planeshifter
Planeshifter marked this pull request as ready for review September 23, 2026 00:07
@Planeshifter
Planeshifter requested a review from a team September 23, 2026 00:07
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Sep 23, 2026
@kgryte kgryte changed the title chore: rename C source files to main.c in number/float32/base/from-word and to-word chore: rename C source files according to convention Sep 23, 2026
@kgryte
kgryte merged commit d8a1167 into develop Sep 23, 2026
34 checks passed
@kgryte
kgryte deleted the claude/trusting-hamilton-2iy07t branch September 23, 2026 06:27
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Sep 23, 2026
@Planeshifter Planeshifter mentioned this pull request Oct 7, 2026
4 of 7 tasks
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.

4 participants