Skip to content

Clarify user-defined identifiers in auto-diff-tutorial-2.md (NFloat, InterlockedAddF16Emulated) #196

Description

@nv-slang-bot

Following up on #188 / #195: a similar identifier-ambiguity pattern appears in docs/auto-diff-tutorial-2.md and warrants its own fix, since the right shape is different from the empty-struct stubs we used in coming-from-glsl.md.

What's ambiguous

NFloat is used pervasively as a scalar type — for example:

NFloat* weights;
NFloat learningRate;

…but is never declared, defined, or explained. A reader can plausibly mistake it for a built-in scalar type alongside float / half. (It looks like a user-defined typedef/alias for half or similar, given the surrounding context about f16 atomics.)

InterlockedAddF16Emulated(...) shows up the same way — used as if it were an HLSL intrinsic, but it's a user-defined helper. The naming pattern (InterlockedAdd*) makes it especially easy to mistake for a built-in.

Why a separate PR

The fix here probably isn't an empty struct stub — NFloat is a typedef-like alias and the natural fix is either a one-line typedef half NFloat; (or whatever the intended underlying type is) near the top of the tutorial, plus a brief sentence explaining what it represents. InterlockedAddF16Emulated likely needs a short signature stub or a sentence noting it's a helper the reader is expected to provide. Whoever picks this up should confirm the intended underlying type with the tutorial author before stubbing.

Found by

Audit performed during review of #195 (coming-from-glsl.md user-defined identifier sweep).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions