Skip to content

fix(intrinsics): decouple ABI IDs from canonical variant order - #1038

Merged
nihalpasham merged 1 commit into
NVIDIA:mainfrom
uurl:fix/decouple-canonical-abi-ids
Aug 19, 2026
Merged

nihalpasham merged 1 commit into
NVIDIA:mainfrom
uurl:fix/decouple-canonical-abi-ids

Conversation

@uurl

@uurl uurl commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Partially addresses #604: this unblocks the compact-admission families (scalar_math, packed_conversion, tcgen05, TMA reduction). The register_mma float/FP8/sparse and cluster-sreg families still derive ABI IDs positionally, so #604 stays open for those.

Summary

Canonical compact-family variant lists currently serve two independent roles: they define the closed semantic set and, in several families, implicitly assign ABI IDs from variant position.

This change separates those responsibilities.

Canonical lists continue to enforce semantic membership, completeness, and ordering, while compact admission entries carry the explicit ABI ID. The global append-only ABI ledger remains responsible for validating historical ABI identity and uniqueness.

Changes

Remove positional ABI derivation from:

  • TMA reduction variants
  • tcgen05 copy variants
  • tcgen05 load variants
  • tcgen05 store variants
  • tcgen05 offset load/store variants
  • tcgen05 MMA variants
  • scalar arithmetic
  • scalar math
  • extended min/max

Semantic recipe construction remains closed over the canonical variant sets, but recipes no longer derive or own ABI IDs from their position.

Admission expansion now propagates each variant's explicit abi_id.

Policy validation continues to validate the semantic identity independently of ABI numbering, while the global ABI ledger remains the authority for stable ABI identity.

Behavior

Before:

canonical semantic position
    -> family ABI base + position
    -> expected ABI ID
    -> admission ABI ID must match

After:

canonical variant list
    -> semantic membership / completeness / ordering

admission variant.abi_id
    -> explicit ABI identity

intrinsics/abi-v1.toml
    -> global uniqueness / history / append-only validation

This allows a future family variant to use the next globally available ABI ID even when that ID is non-contiguous with previous members of the family.

Tests

Regression coverage verifies that compact admissions still reject semantic reordering while accepting a valid non-contiguous ABI ID at the expansion layer.

Existing ABI protection remains enforced by the global ledger.

Validation performed:

cargo fmt --all -- --check
cargo test -p cuda-intrinsics-gen
cargo run -p cuda-intrinsics-gen -- check
cargo run -p cuda-intrinsics-gen -- check-abi-history --base-ref nvlabs/main
git diff --check

Results:

  • 290 tests passed
  • generated intrinsic outputs remain current
  • ABI history preserves all 1002 existing entries
  • no ABI ledger entries were added, removed, or changed

@nihalpasham nihalpasham added bug Something isn't working intrinsics Device intrinsics and libdevice math mappings build-related Build scripts, toolchain discovery, or compilation setup labels Aug 19, 2026
@nihalpasham

nihalpasham commented Aug 19, 2026 •

Copy link
Copy Markdown
Collaborator

@nihalpasham
nihalpasham merged commit b14cdfb into NVIDIA:main Aug 19, 2026
48 checks passed
@uurl
uurl deleted the fix/decouple-canonical-abi-ids branch August 19, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working build-related Build scripts, toolchain discovery, or compilation setup intrinsics Device intrinsics and libdevice math mappings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants