Repository navigation
fix(intrinsics-gen): an unescaped pipe drops a column from three reference rows - #1067
Merged
nihalpasham merged 2 commits intoAug 20, 2026
Merged
Conversation
…rence rows
`intrinsics/generated-reference.md`'s main table has six columns. Three of its
1010 rows render with seven cells, and a renderer drops the extra one -- so
those three lose their Backend evidence column entirely.
The cause is a `|` in cell data. GFM splits a table row on pipes *before* it
parses inline spans, so a pipe splits the cell even inside a code span; the
spec's own rule is that a literal pipe must be written `\|` wherever it
appears. Three catalog entries write a PTX destination pair that way:
elect.sync <register|predicate>, <register-or-immediate>;
match.all.sync.b32 <register|predicate>, <register-or-immediate>, ...
match.all.sync.b64 <register|predicate>, <register-or-immediate>, ...
`render_reference` interpolated `expected_ptx` straight into the row, so
`elect_sync`, `match_all_sync` and `match_all_i64_sync` are the three
intrinsics whose evidence column is unreachable in the rendered table.
Escape the pipe. The helper is applied to every catalog-derived value in that
row rather than to `expected_ptx` alone: the other fields carry no pipe today
(proved below), so it is a no-op for them, and the next PTX pattern or LLVM
symbol that grows one lands in an already-escaped cell. `availability` is left
alone because the renderer builds it, markdown link included, rather than
taking it from the catalog.
A unit test renders the full reference and asserts every row has exactly seven
cell delimiters after escaped pipes are removed, plus that at least three rows
needed escaping at all -- so the check cannot pass by the patterns quietly
disappearing. Reverting the escape fails it with the offending row printed.
Verified:
- 1010 rows before and after; the three affected rows now read
`<register\|predicate>` and no other row changed (6 lines of diff).
- markdownlint with the repo's own `.markdownlint.json` drops from 21
violations on this file to 12: the 3 `MD056/table-column-count` and the 6
`MD038/no-space-in-code` they caused are gone.
- `cargo run -p cuda-intrinsics-gen -- check` reports outputs current,
`probe --all --skip-terminal` probes all 1010 routes, and
`check-abi-history` preserves all 1010 base entries.
- `intrinsics/catalog.json` is untouched, so the catalog SHA-256 the generated
headers stamp is unchanged.
- 293 tests pass; fmt and `clippy --all-targets -- -D warnings` clean.
The remaining 12 `MD037` violations on this file are a separate defect with a
different source: an evidence `detail` string writes `Literal _p64 and _p32`
without backticks, so markdown consumes the underscores it is documenting.
That prose lives in `intrinsics/evidence/` and editing it would move the
catalog hash, so it is left for its own change.
Signed-off-by: Vyncint Ng <[email protected]>
Collaborator
|
nihalpasham
approved these changes
Aug 20, 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.
intrinsics/generated-reference.md's main table has six columns. Three of its 1010 rows render with seven cells, and a renderer drops the extra one — so those three lose their Backend evidence column entirely.The cause is a
|in cell data. GFM splits a table row on pipes before parsing inline spans, so a pipe splits the cell even inside a code span; the spec's own rule is that a literal pipe must be written\|wherever it appears. Three catalog entries write a PTX destination pair that way:render_referenceinterpolatedexpected_ptxstraight into the row, soelect_sync,match_all_syncandmatch_all_i64_syncare the three intrinsics whose evidence column is unreachable in the rendered table.What changes
Escape the pipe. The helper is applied to every catalog-derived value in that row rather than to
expected_ptxalone: the other fields carry no pipe today (measured — 1007 of 1010 rows have exactly seven delimiters, and no row carries a target union), so it is a no-op for them, and the next PTX pattern or LLVM symbol that grows one lands in an already-escaped cell.availabilityis left alone because the renderer builds it, markdown link included, rather than taking it from the catalog.A unit test renders the full reference and asserts every row has exactly seven cell delimiters after escaped pipes are removed, plus that at least three rows needed escaping at all — so it cannot pass by the patterns quietly disappearing. Reverting the escape fails it with the offending row printed.
Verification
<register\|predicate>and no other row changed — 6 lines of diff..markdownlint.json, drops from 21 violations on this file to 12: the 3MD056/table-column-count("Too many cells, extra data will be missing") and the 6MD038/no-space-in-codethey caused are gone.generated-intrinsicsCI steps pass:checkreports outputs current,probe --all --skip-terminalprobes all 1010 routes,check-abi-historypreserves all 1010 base entries.intrinsics/catalog.jsonis untouched, so the catalog SHA-256 the generated headers stamp is unchanged.clippy --all-targets -- -D warningsclean.Out of scope, deliberately
The remaining 12
MD037violations on this file have a different source: an evidencedetailstring writesLiteral _p64 and _p32without backticks, so markdown consumes the underscores it is documenting. That prose lives inintrinsics/evidence/, and editing it would move the catalog hash, so it belongs in its own change.