Skip to content

docs(reserved-oxide-symbols): document all ten symbol constants - #738

Merged
nihalpasham merged 1 commit into
NVIDIA:mainfrom
vyncint:fix/reserved-symbols-readme-completeness
Aug 10, 2026
Merged

nihalpasham merged 1 commit into
NVIDIA:mainfrom
vyncint:fix/reserved-symbols-readme-completeness

Conversation

@vyncint

@vyncint vyncint commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Closes #737.

When naming-guard rejects a hardcoded prefix literal, it says:

Use the constants, builders, and predicates from
crates/reserved-oxide-symbols/ instead. See its README for the layered API.

That README documented 4 of the 10 symbol constants the crate exports — the
same ten the guard's regex alternation is built to cover. So the guard could
block a hardcoded cuda_oxide_artifact_anchor_246e25db_ and send you to a page
that never names the constant to replace it with.

Added: CONSTANT_PREFIX, KERNEL_SCOPE_LOCAL, ARTIFACT_ANCHOR_PREFIX,
PTX_MERGE_REQUIRED_PREFIX, LEGACY_KERNEL_PREFIX, LEGACY_DEVICE_PREFIX.

#645 was this same shape on the enforcement side (the guard covered 6 of 10);
this is its documentation half.

Two things beyond a plain list

The table now says what each prefix names, so the right one is pickable
without reading lib.rs.

And it records a real trap: KERNEL_PREFIX contains LEGACY_KERNEL_PREFIX as
a substring, because the modern name is the legacy one behind a
cuda_oxide_codegen_v1_ scope:

starts_with(KERNEL_PREFIX, LEGACY_KERNEL_PREFIX) = false
contains   (KERNEL_PREFIX, LEGACY_KERNEL_PREFIX) = true

So contains reports every modern kernel as legacy. That is exactly the
substring matching the crate's Layer-3 predicates exist to hide, and the README
already promises they do — it just never said why it mattered.

Verified

Both mechanically, against lib.rs rather than by eye:

  • every pub const symbol constant now appears in the README — nothing missing
  • every documented value string matches the source exactly — no retyped values

Documentation only. No GPU needed.

When naming-guard rejects a hardcoded prefix literal it says "See its README for
the layered API". That README listed four of the ten symbol constants the crate
exports -- the same ten the guard's alternation is built to cover -- so the guard
could block a hardcoded `cuda_oxide_artifact_anchor_246e25db_` and point at a
page that never names the constant to use instead.

The six that were missing are CONSTANT_PREFIX, KERNEL_SCOPE_LOCAL,
ARTIFACT_ANCHOR_PREFIX, PTX_MERGE_REQUIRED_PREFIX, and the two legacy forms.
NVIDIA#645 was this same shape on the enforcement side; this is its documentation half.

The table now also says what each prefix names, so the right one is pickable
without reading lib.rs, and records that KERNEL_PREFIX contains
LEGACY_KERNEL_PREFIX as a substring: the modern name is the legacy one behind a
`cuda_oxide_codegen_v1_` scope, so `starts_with` separates them but `contains`
reports every modern kernel as legacy. That is precisely the substring matching
the Layer-3 predicates exist to hide, and the README already promises they do.

Values checked against lib.rs, not retyped.

Closes NVIDIA#737

Signed-off-by: Vyncint Ng <[email protected]>
@nihalpasham nihalpasham added the documentation Improvements or additions to documentation label Aug 10, 2026
@nihalpasham

Copy link
Copy Markdown
Collaborator

Checked all ten values against lib.rs, including the no-trailing-underscore case; the substring-trap note is worth its weight.

Merging;

closes #737.

@nihalpasham
nihalpasham merged commit a9b1573 into NVIDIA:main Aug 10, 2026
36 checks passed
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reserved-oxide-symbols README documents 4 of the 10 symbol constants the naming-guard sends you to it for

2 participants