Skip to content

Replace Remaining Types#6897

Open
Disservin wants to merge 6 commits into
official-stockfish:masterfrom
Disservin:further-type-cleanup
Open

Replace Remaining Types#6897
Disservin wants to merge 6 commits into
official-stockfish:masterfrom
Disservin:further-type-cleanup

Conversation

@Disservin

Copy link
Copy Markdown
Member

Somehow a few size_t slipped through #6874

@Disservin Disservin changed the title Replace Remaining size_t usages Replace Remaining size_t Types Jun 11, 2026
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: afc31d33-a3b0-4327-818f-a87b84955feb

📥 Commits

Reviewing files that changed from the base of the PR and between c9af0cf and 49d84de.

📒 Files selected for processing (3)
  • src/nnue/nnz_helper.h
  • src/nnue/simd.h
  • src/shm.h
✅ Files skipped from review due to trivial changes (1)
  • src/shm.h

📝 Walkthrough

Walkthrough

This PR systematically migrates size-related types from size_t to the project-standard usize across the codebase. Memory allocation function signatures are updated in both header declarations and implementations, including aligned allocation and large-page allocation helpers. Array-specific allocation and deallocation helpers are retyped to use usize for element counts and iteration. Iteration and indexing APIs such as MoveList::size(), search worker PV tracking, benchmark accumulation loops, and tune array parameters are converted to usize. Platform-specific and utility types, including atomic sizeof thresholds, SIMD macro casts, thread stack constants, and system path reading, are unified to use project-standard integer types.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

(execution 27359266424 / attempt 1)

@robertnurnberg

Copy link
Copy Markdown
Contributor

Just wondering, would it make sense to have a CI job that checks for the old names? Similarly to our clang formatting CI?

@Disservin

Copy link
Copy Markdown
Member Author

Just wondering, would it make sense to have a CI job that checks for the old names? Similarly to our clang formatting CI?

feel free to add that :D

@github-actions

Copy link
Copy Markdown

(execution 27360297076 / attempt 1)

@robertnurnberg

robertnurnberg commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Right, something for the future. For now, these seem to be left for the most recent commit of this PR:

$ grep -rPo --include=\*.cpp --include=\*.h --exclude=misc.h 'u?int[0-9]+_t\b' .         
./nnue/simd.h:int64_t
$ grep -rPo --include=\*.cpp --include=\*.h --exclude=misc.h  'size_t\b' .  
./misc.cpp:size_t
./shm.h:size_t
./shm.h:size_t
./universal/entry_x86.cpp:size_t
./numa.h:size_t
./numa.h:size_t
./numa.h:size_t
./nnue/nnz_helper.h:size_t
./syzygy/tbprobe.cpp:size_t

A run with grep -rPo --include=\*.cpp --include=\*.h --exclude=misc.h 'ptrdiff_t\b' . is clean.

@github-actions

Copy link
Copy Markdown

(execution 27366204211 / attempt 1)

@github-actions

Copy link
Copy Markdown

(execution 27366232687 / attempt 1)

@Disservin

Copy link
Copy Markdown
Member Author

Right, something for the future. For now, these seem to be left for the most recent commit of this PR:

$ grep -rPo --include=\*.cpp --include=\*.h --exclude=misc.h 'u?int[0-9]+_t\b' .         
./nnue/simd.h:int64_t
$ grep -rPo --include=\*.cpp --include=\*.h --exclude=misc.h  'size_t\b' .  
./misc.cpp:size_t
./shm.h:size_t
./shm.h:size_t
./universal/entry_x86.cpp:size_t
./numa.h:size_t
./numa.h:size_t
./numa.h:size_t
./nnue/nnz_helper.h:size_t
./syzygy/tbprobe.cpp:size_t

A run with grep -rPo --include=\*.cpp --include=\*.h --exclude=misc.h 'ptrdiff_t\b' . is clean.

more correct would be grep -rPo --include='*.cpp' --include='*.h' --exclude='misc.h' '\bsize_t\b' . and the ./syzygy/tbprobe.cpp:size_t is inside a comment :p and the universal ones are fine to leave as it

@Disservin Disservin changed the title Replace Remaining size_t Types Replace Remaining Types Jun 11, 2026
@github-actions

Copy link
Copy Markdown

(execution 27367784336 / attempt 1)

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.

2 participants