Repository navigation
ci: check the device names the book puts in prose and tables - #846
Merged
nihalpasham merged 1 commit intoAug 13, 2026
Merged
Conversation
NVIDIA#819 reads only ```rust fenced blocks, and said so: a call is something a reader pastes, while a name in running text might be a PTX mnemonic or another project's function. That scoping left half of the very bug it was written for uncovered. NVIDIA#815 removed two things from the API quick reference. One code-block line, `warp::shuffle_xor_i32(val, mask)`, which NVIDIA#819 now catches. And four *table* rows, written `shuffle_xor_{f32,i32}(val, mask)` -- which it does not, because they are not in a code block and not literal names. Reinstating that row today passes the guard. Adds a second pass over everything outside a fenced block, restricted to backticked, module-qualified names. Backticks are what make it precise: a backticked `warp::foo` is a claim about this API wherever it appears, so the false positives that motivated the code-block-only scope do not arise. Unqualified table entries stay out of scope -- deciding which module a bare `shuffle_xor` belongs to is guesswork, and that is the one thing this cannot do without inventing a mapping. `_{a,b,c}` families are expanded, so a family with one bad member fails on that member instead of passing as an unrecognised literal. That notation is live today in `thread::threadIdx_{x,y,z}()`, and it is what carried NVIDIA#815's rows. Both passes now self-test for a non-empty result, since the new regex is the likelier of the two to break quietly. Verified: passes clean (34 calls in 271 blocks, 31 names in prose and tables, against 1161 exported fns) and exits 1 under four mutations -- NVIDIA#815's exact table row reinstated (reports `warp::shuffle_xor_i32`), a bad axis in the live shorthand (reports `thread::threadIdx_q`), a broken call in a code block (the pre-existing pass, unchanged), and a rotted prose regex (self-test). Signed-off-by: Vyncint Ng <[email protected]>
Collaborator
|
Gist: extends the book-API guard from ```rust blocks to prose and tables, which is where the #815 ghost ( Verified here (reproduced from a scratch extraction of main + this head):
Landing once CI is green. |
nihalpasham
approved these changes
Aug 13, 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.
The gap, with the receipt
#819 reads only ```rust fenced blocks, and said so on purpose: a call is something a reader pastes, while a name in running text might be a PTX mnemonic or another project's function. That scoping left half of the very bug it was written for uncovered.
#815 removed two things from the API quick reference:
Only the first is a call. Reinstating one of those table rows today passes the guard.
The change
A second pass over everything outside a fenced block, restricted to backticked, module-qualified names. Backticks are what make it precise: a backticked
warp::foois a claim about this API wherever it appears, so the false positives that motivated the code-block-only scope do not arise._{a,b,c}families are expanded, so a family with one bad member fails on that member rather than passing as an unrecognised literal. The notation is live today inthread::threadIdx_{x,y,z}(), and it is exactly what carried #815's rows.What it still cannot do
Unqualified table entries stay out of scope. #815's rows as literally written (
shuffle_xor_{f32,i32}, nowarp::) would need a section-to-module mapping, and inventing one is guesswork — so this catches them only in the qualified form the book now tends to use. I would rather state that limit than imply the hole is fully closed.Verified
Passes clean: 34 calls in 271 Rust blocks, 31 qualified names in prose and tables, against cuda-device's 1161 exported functions. Exits 1 under four mutations:
warp::shuffle_xor_i32thread::threadIdx_qwarp::popc_nopeparse self-test failed: found 0 qualified device namesBoth passes now self-test for a non-empty result, since the new regex is the likelier of the two to break quietly. One implementation note that cost a debug cycle: the brace group must not require its own leading
_, because the identifier class is greedy and otherwise swallows the_inthreadIdx_{x,y,z}, leaving the truncatedthreadIdx_reported as missing. No GPU needed.