Skip to content

docs(cuda-device): the Modules table names 17 of the crate's 39 public modules - #1045

Merged
nihalpasham merged 2 commits into
NVIDIA:mainfrom
vyncint:docs/cuda-device-module-inventory
Aug 19, 2026
Merged

nihalpasham merged 2 commits into
NVIDIA:mainfrom
vyncint:docs/cuda-device-module-inventory

Conversation

@vyncint

@vyncint vyncint commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

src/lib.rs declares 39 pub mod. The README's ## Modules table lists 17 of them, and the other 22 appear nowhere in the file — not in the table, not in the ASCII diagram, not in prose:

access  async_copy  bf16  bf16x2  constant  convert  dotprod  f16
f16x2   f32x2       float i16x2   iket      int      mma_frag  prmt
ptx     swizzle     uniform vector view     wmma

None is #[doc(hidden)] and none is #[cfg]-gated, so all 22 are ordinary public API of a published crate. Between them they hold the packed-type families (f16x2, bf16x2, i16x2, f32x2), the register matrix ops (wmma, mma_frag), constant memory, inline PTX, the swizzle and transaction-width helpers, and the checked view/witness types — so a reader using this table as the crate's index misses most of it.

Why this is an inventory and not a sample

Every name in the existing table is a real module and every description matches its module, so the table reads as the inventory; it is simply 22 rows short. The additions go in a second table, with each description taken from that module's own //! summary line.

No GPU column on the additions

The floor for these is per function, not per module — int holds both an intrinsic-free scalar min/max and the sm_90+ min.relu.s32 — so inventing a per-module floor would be less accurate than pointing at the rustdoc, which states it per item. Where a module's own documentation names an architecture the row keeps it (f32x2 is native SM100, int's relu clamps are sm_90+).

I checked whether the floors could be derived mechanically and they cannot: grepping sm_ across these files returns measurement notes ("measured on sm_86") as often as requirements, so filling that column would have meant guessing.

Deliberately untouched

This commit is insertions only — the first table, its GPU column and the diagram are unchanged. The diagram's stmatrix is not a module (it is part of tcgen05, as that table row already says) and coop_grps is an abbreviation, but both read as feature labels in a picture rather than inventory claims, so they are left alone.

Verification

The README's 39 backticked module rows and src/lib.rs's 39 pub mod declarations are now the same set, with nothing in the tables that is not a module. Both counts re-measured against f1e62fe2. Book builds clean under sphinx-build -W; check-book-api-names.sh passes.

…c modules

`src/lib.rs` declares 39 `pub mod`. The README's "## Modules" table lists 17
of them, and the other 22 appear nowhere in the file -- not in the table, not
in the diagram, not in prose:

    access  async_copy  bf16  bf16x2  constant  convert  dotprod  f16
    f16x2   f32x2       float i16x2   iket      int      mma_frag prmt
    ptx     swizzle     uniform vector view     wmma

None is `#[doc(hidden)]` and none is `#[cfg]`-gated, so all 22 are ordinary
public API of a published crate. Between them they hold the packed-type
families (`f16x2`, `bf16x2`, `i16x2`, `f32x2`), the register matrix ops
(`wmma`, `mma_frag`), constant memory, inline PTX, the swizzle and
transaction-width helpers, and the checked view/witness types -- so a reader
using this table as the crate's index misses most of it.

Every listed name in the existing table is a real module and every
description matches, so the table is an inventory rather than a sampling; it
is simply 22 rows short. Add them in a second table, with each description
taken from that module's own `//!` summary.

The additions carry no GPU column. The floor for these is per function, not
per module -- `int` holds both an intrinsic-free scalar min/max and the
`sm_90+` `min.relu.s32` -- so inventing a per-module floor would be less
accurate than pointing at the rustdoc, which states it per item. Where a
module's own documentation names an architecture the row keeps it (`f32x2` is
native SM100, `int`'s relu clamps are `sm_90+`).

The first table, its GPU column and the ASCII diagram are untouched: this
commit is insertions only. The diagram's `stmatrix` is not a module (it is
part of `tcgen05`, as that table row already says) and `coop_grps` is an
abbreviation, but both read as feature labels in a picture rather than
inventory claims, so they are left alone.

Verified: the README's 39 backticked module rows and `src/lib.rs`'s 39
`pub mod` declarations are now the same set, with nothing in the tables that
is not a module.

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 19, 2026
@nihalpasham

Copy link
Copy Markdown
Collaborator
  • Verified all 22 descriptions against each module's own doc summary, including int's min.relu.s32 needing sm_90+ and wmma covering movmatrix/mma.sync/ldmatrix. With these rows every pub mod in lib.rs is in the README.
  • One commit layered on: dropped the hardcoded module counts and the grep bookkeeping from the intro (both go stale on the next module), plain-worded the per-function architecture note, and swapped the access row to the module's own one-line summary.

@nihalpasham
nihalpasham merged commit badbd79 into NVIDIA:main Aug 19, 2026
0 of 48 checks passed
nihalpasham added a commit that referenced this pull request Aug 21, 2026
* docs(ptx-schedule): the one published crate with no README

`ptx-schedule` arrived with #1065 and is the only publishable crate in the
workspace with neither a `readme` key nor a README.md on disk. Checked across
`cargo metadata`: every other publishable member has both. crates.io renders
that file as the package page, so this one would publish with an empty body.

This is the same gap #981 closed for `ptx-parse`, and the README follows that
one's shape.

Content is taken from the crate rather than from the commit that added it:

- The purpose and the "owns neither CUDA execution nor an input generator"
  boundary come from `lib.rs`'s module header.
- The seven `SiteKind` variants and the eight campaign `RunKind` verdicts are
  each enumerated in full, since a partial list of a closed enum is the thing
  that rots (#978, #1045, #1056).
- `InjectionOptions`' four fields, `DEFAULT_MAX_SLEEP_NS` (64 µs), the
  `nanosleep.u32` insertion, and the `confirm_runs` re-run before a finding is
  reported are all as implemented.
- `cargo oxide fuzz-schedule` is named as the user-facing entry point, with the
  crate's own binary shown for single-file work; the flags in the example come
  from `main.rs`'s usage string.

One detail carried over from #981's review: the License link is absolute rather
than `../../LICENSE`, because crates.io rewrites relative README links against
the repository root and the relative form 404s there.

Verified: `cargo metadata` now reports `readme: README.md` for the crate and
the file resolves; all seven `SiteKind` and eight `RunKind` names appear;
`check-crate-inventory.sh`, `check-spdx-headers.sh` and
`check-book-api-names.sh` pass; no relative `../` links remain.

Signed-off-by: Vyncint Ng <[email protected]>

* docs(ptx-schedule): align the README with the code it describes

Six statements did not match the crate as it stands:

- the execution disclaimer claimed the whole crate owns no CUDA
  execution while campaign.rs two sections down builds, launches,
  watchdogs and assigns verdicts; the section now scopes the claim to
  analyze_ptx/perturb_ptx and points at the campaign layer;
- intensity is a probability dial (0.75 x intensity per site, and it
  scales the drawn sleep lengths), not a fraction of sites touched;
- focus re-weights selection by substring over each site's opcode and
  instruction text (0.95x hits, 0.15x misses); it never restricts the
  sweep to one callable;
- Skipped is assigned only when the example prints a skip marker; a
  zero-injection seed still runs and reports like the baseline;
- findings are reported with their confirmation counts attached, not
  gated on confirmation;
- a seed pins the rewrite, not the schedule the GPU then picks.

Smaller table fixes from the same read of classify_instruction: the
Barrier row now names mbarrier.*, OrderedMemory names the ordering
qualifiers it actually matches (a scope alone never classifies), the
Backedge row describes the conservative same-or-earlier-block test
(no dominance is computed), and the block-index field is called out as
back-edge-only. The injection knobs move into a bulleted list so each
one can state its own semantics.

---------

Signed-off-by: Vyncint Ng <[email protected]>
Co-authored-by: nihalpasham <[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