Repository navigation
Recompiler: lower direct DXIL float_compare to ordered/unordered fcmp - #2258
ramon-victor wants to merge 1 commit into
Conversation
c7940b3 to
c204653
Compare
|
Fails on AMD (native wave64), passes on NVIDIA. On an RX 9070 XT, the ordered not-equal compare returns true for a NaN input, in the new test and in the existing Tested at head
So on this AMD driver the Not tested: the other 13 predicates past the first failing assertion on AMD, RDNA2/RDNA3. |
|
Independent RDNA2 confirmation of the AMD NaN regression reported above, at exact PR head Environment: Windows 11 build 26200; Ryzen 9 5980HX; Radeon RX 6800M driver Results
This extends the reported failure from RX 9070 XT/RDNA4 to RX 6800M/RDNA2. It is a reproducible PR-head regression against this main revision. I ran focused synthetic tests only; no full workspace suite or retail-title smoke on this head. No game data was used. AI use: OpenAI Codex (GPT-6; exact variant not exposed in this session) ran the native Windows GPU tests and main/PR controls, checked the exact assertions, and drafted this report. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
Lowers RDNA2 floating-point comparisons (
Lw::float_compare, coveringv_cmp*_f16,v_cmp*_f32, andv_cmp*_f64) in the direct DXIL translator directly to IEEE-754 ordered (FO*) and unordered (FU*) LLVMfcmppredicates instead of emitting explicitdx.op.isSpecialFloat(IsNaN)/splitDoubleNaN checks around each compare.Because the direct DXIL builder emits
fcmpwith zero fast-math flags, LLVM/DXILolt,oeq,ole,ogt,one,oge,ord,uno,ult,ueq,ule,ugt,une, andugealready define exact NaN semantics in a single instruction (1 instruction instead of 3–8 per compare).Part of #1269.
What is in it
crates/xcl/src/gpu/dxil/lower_valu.rs:Lw::float_compare's explicitisnan_any+or+xor+andwrapper with direct 1-to-1Pred::FO*/Pred::FU*fcmpemission, and remove the now-unusedLw::isnan_anyhelper (+18/-51production lines).float_compare_tests::gpu_direct_float_compare_uses_fcmp_and_matches_ieeeverifying DXIL validation and disassembly (every predicate emits the expectedfcmpwith nodx.op.isSpecialFloatorsplitDoubleNaN guards) and checking all 14v_cmp_*_f32predicates on the GPU across±0.0, finite,±Inf,qNaN, andsNaNpairs.On a seeded 600-program sample (
xcl shaders <archive> --direct --sample 600 --seed 3 --max-bytes 40000 --validate --threads 8, 573 programs within the cap), all 573/573 validate cleanly (0validator failures):41,323,736 B -> 40,857,992 B(-465,744 B,-1.13%)Tested
621.24, wave32), AMD Ryzen 7 5700X, Windows 11 Pro26300,rustc 1.99.0(x86_64-pc-windows-msvc), DXC/DXIL1.8.2502.11(Windows SDK10.0.26100.0).cargo test -p xcl --lib gpu::dxil::lower_valu::float_compare_tests(debug):1 passed; 0 failed.XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu_f32_compares(debug):1 passed; 0 failed(gpu_f32_compares_with_nanon RTX 3070)..\scripts\test.ps1(debug, full workspace on headc204653):1251 passed; 0 failed; 46 ignored(25 GPU sub-checks skipped on this wave32 adapter: 21no wave64, 1no heap windows, 3 per-lane#1426refusals).cargo build --release -p xcl+ direct DXIL validation sweep on 573 sampled retail shader programs:573/573translated anddxil.dll-validated (0failures).Regression run
Not tested
XCL_SAMPLE_*env vars unset).AI use
float_compareinlower_valu.rs, simplified it to direct LLVMfcmppredicates, wrote unit and GPU tests, rebased ontoorigin/main(1a0bbe3), and ranXCL_DIRECT_DXIL=1compare tests, the full workspace test suite, the 573-shader validation benchmark, and the 60 s smoke regression run.