Skip to content

[WIP - Please do not review] feat(intrinsics): validate PTX floors from evidence - #1212

Closed
almightychang wants to merge 1 commit into
NVIDIA:mainfrom
almightychang:ptx-floor-evidence
Closed

almightychang wants to merge 1 commit into
NVIDIA:mainfrom
almightychang:ptx-floor-evidence

Conversation

@almightychang

Copy link
Copy Markdown
Contributor

Summary

  • add a CUDA 13.2.51 ptxas floor probe that lowers each resolved intrinsic at its declared PTX floor, requires assembly success there, and requires rejection at the immediately preceding PTX spelling
  • record the accepted/rejected boundary, target, rejection diagnostic, and SHA-256 identities of both ptxas and the Rust LLVM llc
  • represent floors below the live toolchain boundary as unverifiable instead of manufacturing a verdict
  • make normal catalog resolution require exact floor-evidence coverage and equality with every resolved policy floor; CI therefore checks committed evidence without needing ptxas

Population and measurement

The 160 literal minimum_ptx declarations in intrinsics/overlay/*.toml split into 102 probeable and 58 unprobeable declarations. Resolution expands compact admission matrices, so the generator's actual validation population is larger:

  • 1,025 resolved intrinsic policies total
  • 942 measured: CUDA 13.2.51 accepted the declared floor and rejected the immediately preceding PTX spelling
  • 83 explicitly unverifiable: their floor is below PTX 6.3

The measurement used:

  • ptxas CUDA 13.2 V13.2.51, SHA-256 c0a7c9752d1a1b29310ffbb453e8b895fb09e909dcf7436fef5c2c986c1a658e
  • Rust LLVM 23.1.0 from nightly 2026-08-28, llc SHA-256 ca7af83e237af640fe337faff2eff49055988921933186ab5535b38addeb7b49
  • no GPU execution

CUDA 13.2 ptxas accepts no target below sm_75, and PTX 6.2 cannot name sm_75; PTX 6.3 can. The negative diagnostic is retained per record, including cases where instruction and target floors are coupled. This also means PtxIsaRequirement::Ptx62 appears unreachable with this current assembler, but this PR does not change requirement lowering.

CI does not rerun this experiment. It follows the existing recorded-evidence model: the live toolkit produces committed evidence, while stock runners validate the resolved catalog against that evidence. probe --all --skip-terminal --per-target continues to work without ptxas.

Positive control

I deliberately probed abs_bf16x2 with a false PTX 7.1 declaration. The command failed because CUDA 13.2 accepted the PTX 7.0 negative probe:

error: below-floor positive control failed: ptxas accepted abs_bf16x2 at PTX 7.0, below declared PTX 7.1

Legacy barrier note

The NVIDIA PTX ISA states exactly:

bar.sync without a thread count introduced in PTX ISA version 1.0.

Register operands, thread count, and bar.{arrive,red} introduced in PTX ISA version 2.0.

It also states that those register/count/arrive/red forms require sm_20 or higher. Source: NVIDIA PTX ISA 9.3, bar/barrier notes.

Accordingly, the fixed-immediate sync.toml declaration appears correct at PTX 1.0, while counted bar.sync and bar.arrive declarations appear under-declared. They are in the unprobeable population, and this PR intentionally does not edit counted_barrier.toml or sync.toml because those files are being changed concurrently.

Not verified here

  • CUDA 13.3 is not installed on this machine, so the new evidence has its own CUDA 13.2.51 profile and does not modify or claim to refresh the existing CUDA 13.3 evidence.
  • Floors below PTX 6.3 cannot be measured by this supported assembler/target combination and remain explicitly unverifiable.
  • No runtime behavior was tested; the GPU is currently unavailable, and floor validation requires only PTX assembly.

Verification

  • cargo test -p cuda-intrinsics-gen — 311 passed
  • cargo run -p cuda-intrinsics-gen -- check
  • git diff --check
  • full live probe-floors run using CUDA 13.2.51
  • false-floor positive control described above

@almightychang
almightychang marked this pull request as draft August 30, 2026 14:35
@almightychang almightychang changed the title feat(intrinsics): validate PTX floors from evidence [WIP - Please do not review] feat(intrinsics): validate PTX floors from evidence Aug 30, 2026
@nihalpasham

Copy link
Copy Markdown
Collaborator

Please submit an issue prior to opening a PR directly for any discussion.

@almightychang

Copy link
Copy Markdown
Contributor Author

@nihalpasham
My bad. Accidentally pushed the draft to upstream.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants