Skip to content

docs(cuda-device): the re-export table lists 10 of the 13 macros re-exported - #1056

Merged
nihalpasham merged 2 commits into
NVIDIA:mainfrom
vyncint:docs/cuda-device-macro-reexports
Aug 20, 2026
Merged

nihalpasham merged 2 commits into
NVIDIA:mainfrom
vyncint:docs/cuda-device-macro-reexports

Conversation

@vyncint

@vyncint vyncint commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

src/lib.rs re-exports thirteen macros from cuda-macros:

pub use cuda_macros::{
    cluster_launch, constant, convergent, cooperative_launch, cuda_module,
    device, gpu_printf, kernel, launch_bounds, launch_contract, ptx_asm,
    pure, readonly,
};

The README's "Proc-Macro Re-exports" table lists ten. Missing are #[cuda_module], #[launch_contract] and #[constant] — the entry point for typed module loading, the attribute that unlocks a safe launch, and the one that puts a static in constant memory.

Not obscure corners: this same README already relies on two of the three. Its DisjointSlice section uses #[launch_contract(domain = 1, ...)] in prose, and its module table documents the constant module. So the crate's own README uses macros it does not list.

Add the three rows, and tie the table's lead-in to the pub use list it mirrors so the next macro added there has an obvious place to land.

Descriptions are taken verbatim from the book's API quick reference, which already carries all three — so the two documents now say the same thing rather than two things.

Verified: the thirteen names in the pub use and the thirteen backticked rows in the table are the same set, with nothing in the table that is not re-exported.

vyncint and others added 2 commits August 20, 2026 06:29
…xported

`src/lib.rs` re-exports thirteen macros from `cuda-macros`:

    pub use cuda_macros::{
        cluster_launch, constant, convergent, cooperative_launch, cuda_module,
        device, gpu_printf, kernel, launch_bounds, launch_contract, ptx_asm,
        pure, readonly,
    };

The README's "Proc-Macro Re-exports" table lists ten of them. Missing are
`#[cuda_module]`, `#[launch_contract]` and `#[constant]` -- which is to say,
the entry point for typed module loading, the attribute that unlocks a safe
launch, and the one that puts a static in constant memory. Not obscure corners:
this same README already relies on `#[launch_contract(domain = 1, ...)]` in its
`DisjointSlice` section and documents the `constant` module in its module
table, so the crate's own README uses two of the three it does not list.

Add the three rows, and tie the table's lead-in to the `pub use` list it
mirrors so the next macro added there has an obvious place to land.

Descriptions are taken verbatim from the book's API quick reference, which
already carries all three, so the two documents now say the same thing rather
than two things.

Verified: the thirteen names in the `pub use` and the thirteen backticked rows
in the table are the same set, with nothing in the table that is not
re-exported.

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
  • Verified the table against src/lib.rs: with the three added rows it is now the whole 13-entry pub use cuda_macros::{...} list, and each new description matches the macro's behavior.
  • One commit layered on: "launch shape" is now "launch requirements" (the contract also carries dynamic_shared and min_compute_capability, so it is more than dimensions), the dangling "with a host set_<name>" now says it is a setter, and the raw-text pipes are re-aligned.

@nihalpasham
nihalpasham merged commit 51047bc into NVIDIA:main Aug 20, 2026
49 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