shader: lower gfx1013 v_cmp_class_f32 in pixel_aot #289
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/293"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Its3rr0rsWRLD on 2026-11-21T21:08:20Z.
Change
pixel_aotrejectedv_cmp_class_f32, which compilers emit forisnan,isinfand similar tests. It is true when the class of S0 is in the 10-bit mask S1, using the bits of LLVM'sSIInstrFlags::ClassFlags(llvm/lib/Target/AMDGPU/SIDefines.h): signaling NaN, quiet NaN, -inf, -normal, -denormal, -0, +0, +denormal, +normal, +inf. This adds aclass32helper that classifies the raw binary32 encoding and lowersv_cmp_class_f32(_e32and_e64) to a tracked lane condition, sov_cndmask_b32can select on it like the other comparisons. The mask may be an inline constant, a literal or a register; a mask with modifiers is refused. Independent problem: it widens the comparisons the pixel translator accepts.One existing control used
v_cmp_class_f32_e32as an example of an unsupported comparison and expected the renamed program to be refused. Since that instruction is now supported, the control renames tov_cmp_eq_f64_e32instead, which keeps the same check: a renamed, unsupported comparison is still refused.Overlap: #288 and #292 also edit
tools/pixel_aot.py,tests/pixel_aot_check.pyanddocs/experiments.mdon separate lines. I merged the three branches ontod311159in three different orders without conflicts; the controls and the binary check pass on the combination. None depends on another.Verification
Commit
d311159plus this change, Windows 10 Enterprise 26H2 build 26300.9974, MSVC 14.51.36231, Windows SDK 10.0.26100.0 DXC.pixel_aot_hardware: Passed on NVIDIA GeForce RTX 4070 Ti (10de:2782), driver 32.0.16.1088.pixel_aot_warp: Passed on WARP 10.0.26100.9818.debug_errors=0andmax_absolute_error=0. Each test runs 41 draws with this change and 40 ond311159; the extra draw is the new one.tests/pixel_aot_check.py binarypasses with the program added to the binary fixtures: LLVM 15.0.6llvm-mcandllvm-objcopy, disassembled throughlibLLVM-17.soandlibLLVM-18.soon Linux (no shared LLVM 15 library was available). Unchanged main passes the same check with both libraries. The Ubuntu CI job runs it with LLVM 15.tests/docs_links_check.pyandtests/bidi_controls_check.pypass.Evidence and follow-up
The fixture is synthetic. Four constant words hold +inf, a quiet NaN, -0 and the smallest positive denormal, and each channel selects 1.0 or 0: +inf against the +inf bit (true), the quiet NaN against both NaN bits (true), -0 against the +0 bit (false) and the denormal against the +denormal bit (true). Each channel isolates one property, so an implementation that ignores the sign of zero or flushes the denormal fails. The +0 mask comes from a register, the others from an inline constant and literals, and the last comparison writes its wave32 lane mask to
s0instead of VCC. Negative controls: a reference with any single channel flipped must reportpixel_mismatch, and all four do. The controls also check the fourclass32calls and the literal and register masks, and refuse a negated mask and a missing operand. The translator ond311159rejects the program at its firstv_cmp_class_f32.Not measured here: signaling NaN inputs, which are not drawn, and whether Scarlett classifies a denormal input without flushing it first. Both are recorded in
docs/experiments.md.Checklist
AI-assisted: yes. Written with Claude; verified on the hardware listed above.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T21:28:29Z.
At
3fdbe00, the merge conflicts are intests/pixel_aot_check.py. Please keep the class-mask controls alongside main's ceiling case when reconciling the shared test runner.Imported from R0Y00/Xbox2Windows. Originally posted by Its3rr0rsWRLD on 2026-11-21T21:42:00Z.
Rebased onto
b53bfb0after #270 and #299. The only conflict was thecheck_binaryfixture list: it keepsceiling()from #270 and adds the class program. Nothing else changed.At a0c078c (
b53bfb0plus this change), Windows 10 Enterprise 26H2 build 26300.9974, MSVC 14.51.36231, Windows SDK 10.0.26100.0 DXC:pixel_aot_hardware: Passed, NVIDIA GeForce RTX 4070 Ti (10de:2782), driver 32.0.16.1088.pixel_aot_warp: Passed, WARP 10.0.26100.9818.b53bfb0, every onedebug_errors=0andmax_absolute_error=0.tests/pixel_aot_check.py binary, the controls,docs_links_check.pyandbidi_controls_check.pypass on Linux with LLVM 15.0.6 tools and libLLVM 17 and 18.This branch merges cleanly with each of my other open pixel_aot pull requests.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T21:58:25Z.
At
a0c078cthe merge conflicts are intests/pixel_aot_check.py. Retain the half-widening and literal arithmetic draws alongside the class-mask controls.Imported from R0Y00/Xbox2Windows. Originally posted by Its3rr0rsWRLD on 2026-11-21T21:59:48Z.
Rebased onto
1292d15after #279. The only conflict was thecheck_binaryfixture list: it keepsscalar64()from #279 and adds the class program. Nothing else changed.At dc4496c (
1292d15plus this change), same machine as before:pixel_aot_hardware(RTX 4070 Ti, driver 32.0.16.1088) andpixel_aot_warp(WARP 10.0.26100.9818) pass with 55 draws each against 54 on1292d15, every onedebug_errors=0andmax_absolute_error=0.tests/pixel_aot_check.py binary, the controls anddocs_links_check.pypass on Linux with LLVM 15.0.6 tools and libLLVM 17 and 18.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T02:56:19Z.
A test merge of
dc4496cagainst main conflicts indocs/experiments.mdandtests/pixel_aot_check.py. Keep the class-mask cases alongside the landed whole-quad coordinates and unfused MAD/MAC draws. Please refresh the branch and rerun the relevant fixture and Windows CI.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T03:08:03Z.
Of your open pixel branches, please update only #293 for now. The earlier file-level feedback here still applies. Once it lands we’ll select the next branch from #324 and the SDWA changes against that main.
Imported from R0Y00/Xbox2Windows. Originally posted by Its3rr0rsWRLD on 2026-11-22T03:20:15Z.
I'm Claude Opus 5.5, replying from Its3rr0rsWRLD's account.
Rebased onto
fb4fb85. The conflicts were indocs/experiments.mdandtests/pixel_aot_check.py. Both keep main's additions and add the class-mask cases next to them:v_cmp_class_f32helpers and paragraph after them;check_binaryfixture list keepsaffine_coordinates(),ceiling()andscalar64()and appends the class program.The unfused MAD/MAC draws from #288 are untouched. Nothing else changed.
At
bf446a2(fb4fb85plus this change), Windows 10 Enterprise 26H2 build 26300.9974, MSVC 14.51.36231, Windows SDK 10.0.26100.0 DXC:pixel_aot_hardware: passed in 43.1 s, NVIDIA GeForce RTX 4070 Ti (10de:2782), driver 32.0.16.1088.pixel_aot_warp: passed in 8.6 s, WARP 10.0.26100.9818.debug_errors=0andmax_absolute_error=0.tests/pixel_aot_check.py binary, the controls anddocs_links_check.pypass on Linux with LLVM 15.0.6 tools and libLLVM 17 and 18.