pixel_aot: lower integer-to-float conversions v_cvt_f32_u32 and v_cvt_f32_i32 #529
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!529
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/529/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@stan495 on GitHub · 2026-11-22 09:30 UTC · original
stan495:shader/lower-v-cvt-f32-int→main· +161 −1 · 4 files · 1 commits · merged 2026-11-22 11:17 UTCChange
Translate RDNA 2/3 integer-to-float conversions
v_cvt_f32_u32andv_cvt_f32_i32intools/pixel_aot.pyfor both_e32and_e64encodings, along with unsuffixed assembler forms. Operands are converted through HLSLfloat(asuint(...))andfloat(asint(...)).Sources are integer bit patterns, so floating-point input modifiers (
neg,abs) and float literals are rejected. The_e64form lowers theclampmodifier tosaturate(...).Add scanner recognition in
tools/scan_unsupported_shaders.pyandtests/rdna2_tools_check.py. Add unit, literal, and D3D12 draw fixtures intests/pixel_aot_check.pycovering SGPR, VGPR, and literal immediate operands across positive and negative values.Refs #360
Verification
Commit:
66a2b98Result: All passed.
Result: 8/8 passed (100%).
0x1002, Device ID:0x744c), Driver32.0.32029.2010, Windows 11 Build 26100, D3D12 Debug Layer enabled. Errors: 0, Warnings: 0, Max Absolute Error: 0.0x1414, Device ID:0x008c), Driver10.0.26100.9711. Errors: 0, Warnings: 0, Max Absolute Error: 0.Result:
form coverage checks passed(recordedv_cvt_f32_i32_e32,v_cvt_f32_i32_e64,v_cvt_f32_u32_e32,v_cvt_f32_u32_e64).Evidence and follow-up
Fixtures are purely synthetic pixel shader assemblies under
tests/pixel_aot_check.pysubmitted under the project's MIT License.Negative controls verify that:
-v,|v|,abs(v),-s,|s|,abs(s)), float literals (1.5), out-of-range 32-bit immediates, and SGPR destinations are rejected at translation time.s_waitcnt lgkmcnt(0)or writing befores_waitcnt vmcnt(0)is rejected.v_cvt_f32_i32tov_cvt_f32_u32or mutating signed literals on negative values produces apixel_mismatchruntime assertion failure (exit code 1).clampon clamped_e64conversions produces apixel_mismatchruntime assertion failure (exit code 1).Checklist
This change was AI-assisted.
@R0Y00 on GitHub · 2026-11-22 10:00 UTC · original
Thanks for the scanner coverage, literal cases, and negative controls. For #360, the agreed completion check observes the uncompressed f32 bits at the signed and unsigned endpoints and on both sides of 2^24, including ties to even. The current binary16 export cannot distinguish those rows.
Please change Fixes #360 to Refs #360. The bit-exact path is queued as #363 → #392 → #417, with e64/clamp following the e32 acceptances. Your scanner cases, distinctive literals and mutation checks are useful as a focused follow-up, or can be carried into the staged changes with your attribution. Please keep the checks that extend that coverage.
@stan495 on GitHub · 2026-11-22 10:03 UTC · original
Thanks for the clear explanation and roadmap context!
I have updated the commit and PR description to
Refs #360instead ofFixes #360.I've preserved all the extended checks, distinctive literals, e64/clamp handling, and mutation controls. Whether they land as this focused follow-up or are carried into the staged changes in the pipeline with attribution, either way sounds great to me. Thank you!