Skip to content

docs(book): the dialect-nvvm counts predate the catalog, by the page's own test - #1052

Merged
nihalpasham merged 1 commit into
NVIDIA:mainfrom
vyncint:docs/book-dialect-counts-catalog-stamp
Aug 20, 2026
Merged

nihalpasham merged 1 commit into
NVIDIA:mainfrom
vyncint:docs/book-dialect-counts-catalog-stamp

Conversation

@vyncint

@vyncint vyncint commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

mlir-dialects.md anchors its op counts to a catalog stamp and says how to tell when they have rotted:

At catalog SHA-256 20440c06 (the stamp in every ops/generated/ file header), the dialect holds 560 operations across 42 modules … If the header stamp no longer starts with 20440c06, the counts on this page predate the catalog you are reading.

Every generated file now stamps 26a9cc13, so that condition is true.

claim page tree
dialect total 560 570
hand-written ops 19 21
hand-written wgmma row 7 9
generated ops 541 549
catalog entries 1002 1010
generated "Warp-level" row 31 39

Both deltas are traceable. #1021 and #1025 added two hand-written wgmma ops (19 → 21). #1032 added the eight redux.sync f32 variants, which moves the generated total, the catalog count, and the one area row that owns redux (541 → 549, 1002 → 1010, 31 → 39).

The description moved with the count, not just the number

The wgmma row read "the m64n64k16 bf16 shapes". #1025 added WgmmaMmaM64N64K16F32F16Op and WgmmaMmaGroupValuesM64N64K16F32F16Op, so the module holds f16 shapes too — the row now says bf16/f16. A count fix that left that alone would have replaced one wrong statement with another.

Module counts did not change: 7 hand-written plus 35 generated is still 42.

Verification

Measured against the tree, not against the merge descriptions:

  • ^pub struct \w+Op; counts 21 under src/ops/ and 549 under src/ops/generated/ — 570 together.
  • intrinsics/catalog.json holds 1010 entries.
  • All 35 generated files carry exactly one distinct stamp, 26a9cc13.
  • Both tables sum to their new totals (7 rows → 21, 11 rows → 549), and each still lists every module on disk with nothing in it that is not a module.
  • Book builds clean under sphinx-build -W.

…s own test

`mlir-dialects.md` anchors its op counts to a catalog stamp and says how to
tell when they have rotted:

    At catalog SHA-256 `20440c06` (the stamp in every `ops/generated/` file
    header), the dialect holds 560 operations across 42 modules ...
    If the header stamp no longer starts with `20440c06`, the counts on this
    page predate the catalog you are reading.

Every generated file now stamps `26a9cc13`, so that condition is true. Six
numbers and one description are stale, all of them from the last batch of
merges:

| claim | page | tree |
|---|--:|--:|
| dialect total | 560 | **570** |
| hand-written ops | 19 | **21** |
| hand-written `wgmma` row | 7 | **9** |
| generated ops | 541 | **549** |
| catalog entries | 1002 | **1010** |
| generated "Warp-level" row | 31 | **39** |

The two deltas are traceable: NVIDIA#1021 and NVIDIA#1025 added two hand-written `wgmma`
ops (19 -> 21), and NVIDIA#1032 added the eight `redux.sync` f32 variants
(541 -> 549, 1002 -> 1010, and the Warp-level row that owns `redux`).

The `wgmma` row's description moved with its count rather than just the
number. It read "the m64n64k16 bf16 shapes", but NVIDIA#1025 added
`WgmmaMmaM64N64K16F32F16Op` and `WgmmaMmaGroupValuesM64N64K16F32F16Op`, so the
module now holds f16 shapes too.

Module counts did not change: 7 hand-written plus 35 generated is still 42.

Verified against the tree rather than against the merge descriptions:
`^pub struct \w+Op;` counts 21 under `src/ops/` and 549 under
`src/ops/generated/`, 570 together; `intrinsics/catalog.json` holds 1010
entries; and all 35 generated files carry the one stamp `26a9cc13`. Both
tables sum to their new totals (7 rows to 21, 11 rows to 549) and each still
lists every module on disk with nothing that is not one. Book builds clean
under `sphinx-build -W`.

Signed-off-by: Vyncint Ng <[email protected]>
@nihalpasham nihalpasham added documentation Improvements or additions to documentation intrinsics Device intrinsics and libdevice math mappings labels Aug 20, 2026
@nihalpasham

Copy link
Copy Markdown
Collaborator
  • Re-derived every number from the tree: 570 total ops (21 hand-written + 549 generated from 1010 catalog entries), wgmma 9, warp-level 39, and catalog.json hashes to 26a9cc13. All six changed counts and the ten unchanged rows are correct; sphinx-build -W passes on the head.
  • The bf16 to bf16/f16 wording matches the two F16 ops feat(wgmma): add value-threaded F16 full-drain lowering #1025 added (the body also credits feat(wgmma): support three-slot counted pipelines #1021, which added lowering only, no op structs).
  • Merge-order note: the counts re-stale the moment another op-adding PR lands, and no CI gate ties the page's stamp to the catalog hash. Filing a follow-up.

@nihalpasham
nihalpasham merged commit 1d53ce7 into NVIDIA:main Aug 20, 2026
49 checks passed
nihalpasham pushed a commit that referenced this pull request Aug 21, 2026
…1106)

Closes #1090.

`mlir-dialects.md` states its own freshness rule:

    At catalog SHA-256 `26a9cc13` (the stamp in every `ops/generated/` file
    header), the dialect holds 570 operations across 42 modules ...
    If the header stamp no longer starts with `26a9cc13`, the counts on this
    page predate the catalog you are reading.

Nothing enforced that rule, so the rule that would expose stale counts was
itself unchecked. The page failed its own test for weeks before #1052 (560
printed against 570 in the tree), and **it is failing again right now**: the
catalog hashes to `00372dfe`, five hand-written ops and five catalog entries
after that refresh landed. Two hand audits in two batches is the pattern this
closes.

## The gate

One file hashed, one page grepped, no cargo and no network. The hash is the one
`cuda-intrinsics-gen` stamps into every generated file --
`sha256_bytes(catalog_json.as_bytes())` over the file as committed -- so a
plain `sha256sum` reproduces it, and the page prints its first eight digits.

Three checks rather than one, so each failure says which thing moved:

- The generated sources must stamp the hash `catalog.json` actually has.
  Failing here means the generated outputs are stale, and the message says to
  run `cuda-intrinsics-gen -- generate` -- not to edit the book.
- The page must print exactly one distinct stamp. It names it twice, once
  stating it and once in the rule that tells a reader what a mismatch means, so
  updating one and not the other leaves the rule contradicting the statement
  above it.
- The stamps must agree, and the failure prints both sides plus the two
  commands that re-derive the counts the stamp guards.

It refuses to report success from a check that found nothing: a page reworded
so no stamp is left fails with that stated, rather than passing vacuously. That
path needed the `|| true` on the capture rather than on a later pipeline --
under `pipefail` a grep matching nothing aborted the script before the
diagnostic, turning a reworded page into a silent non-zero exit.

## The refresh that makes it pass

Five numbers and the stamp, all re-derived from the tree:

| claim | was | now |
|---|--:|--:|
| catalog stamp (x2) | `26a9cc13` | `00372dfe` |
| total operations | 570 | 575 |
| hand-written operations | 21 | 26 |
| hand-written `wgmma` row | 9 | 14 |
| catalog entries | 1010 | 1015 |

Generated stays 549 across 35 modules and every area row is unchanged, because
#1085's five new catalog entries are aliases onto existing structural ops --
exactly what the page's "several intrinsics can share one structural op"
sentence predicts. The +5 hand-written are all `wgmma`, from #1075, #1077 and
#1079.

The `wgmma` row's description moves with its count, as in #1052: it said "the
m64n64k16 bf16/f16 shapes", and the module now holds four shape/type pairs --
`m64n64k16` bf16 and f16, `m64n128k16` bf16 (#1079), `m64n64k8` tf32 (#1077).

## Verification

- Four mutations, each failing with its own message: a stale stamp, only one of
  the two stamps updated, the page reworded so none is found, and an edited
  `catalog.json`. The healthy tree passes.
- Every count re-checked against the tree: 26 + 549 = 575, both tables sum to
  their stated totals (7 rows to 26, 11 rows to 549), and each still lists
  every module on disk.
- All eleven guard scripts pass, `check-spdx-headers.sh` accepts the new file,
  `cuda-intrinsics-gen -- check` reports outputs current, the workflow parses
  with all nine jobs on `ubuntu-latest`, and the book builds clean under
  `sphinx-build -W`.

`just check-guards` should list this script too, one line beside the other ten.
Its recipe is being restructured in #1102, so that line is left for a follow-up
rather than conflicting; no guard enforces that list, so CI is unaffected
either way.

Signed-off-by: Vyncint Ng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation intrinsics Device intrinsics and libdevice math mappings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants