Repository navigation
Direct DXIL: lower i64 min/max as compare/select - #1946
luckyteagirl wants to merge 1 commit into
Conversation
|
Checked on an RTX 3070 (Ampere, driver 616.56, Windows 11, debug build):
This PR also bumps AI-assisted (Claude Code). Synthetic tests only. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
b527347 to
f906266
Compare
|
Confirmed on AMD RX 6750 XT, driver
Stacked after #1974, this also clears the seed-783 i64 Not tested: full suite or retail title. AI use: OpenAI Codex (GPT-5) ran and analyzed the test; I reviewed the result. Thank you! |
|
Independent Windows run on f906266. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, DXC/DXIL 1.8.2502.11, debug.
A separate Direct DXIL fixture loaded both operands at runtime. Across 32 lanes it checked all four signed and unsigned min/max operations, including signed extrema, equal values, and low-word ordering when the high words were equal. DXC validated the shader. Disassembly showed four i64 compare/select pairs and zero i64 min/max intrinsic calls. All 128 full-width GPU results matched Rust. The original intrinsic path also validated and matched all 128 results on the RTX, with four intrinsic calls in its disassembly.
|
AMD's driver returns x | bfrev(x) for Bfrev.i32(trunc(mul i64)) when the product is the same on every lane. The i64 Bfrev lowering reverses each 32-bit half after a trunc / lshr of the i64 value, so a Bfrev of an i64 product hit it: fuzz seed 817 (xcl-dev#2115) read 0xfe53ffff for 0x4a43fdeb on an RX 7800 XT. Reduced to Bfrev.i64(mul i64 3, 5). The halves are now reversed with five shift-and-mask steps. The i64 case is the only one that goes through trunc of an i64 value; Bfrev.i32 on a plain i32 is unchanged. The new test fails without the change on the RX 7800 XT (low word 0xf000000f, expected 0) and passes with it. Part of xcl-dev#2115. Seed 783 is a separate driver bug (IMax.i64 after an i64 udiv); the compare / select lowering in xcl-dev#1946 fixes it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…1860, xcl-dev#1913, xcl-dev#2192, xcl-dev#1946, xcl-dev#2237 Integrates XG CopyFromSubresource 7-arg ABI (xcl-dev#684), DirectStorage physical-page list re-read (xcl-dev#1405), vkd3d-proton in-place vtable patching with UnadoptGuard composition (xcl-dev#1395), single-back-edge Direct DXIL CFG (xcl-dev#1860), wave64 graphics Direct DXIL guard (xcl-dev#1913), and AMD RDNA2-4 DXIL fuzz fixes (xcl-dev#2192, xcl-dev#1946, xcl-dev#2237).
Follow-up to #1679. On the Radeon RX 6800M with Windows driver
30.0.13002.13003, eachdx.op.binary.i64signed or unsigned min/max variant suspended the D3D12 device during pipeline creation (0x887A0005). This lowers those four forms to i64 comparisons andselect. The direct-DXIL source hash from #1947 keys the translated cache, so the rebased change needs no manual translator-version bump.What is in it
ops.rs: use signed or unsigned i64 comparison and select forIMax,IMin,UMax, andUMin; other binary operations keep their current path.ops_tests.rs: compare both output words against CPU signed and unsigned min/max across 32 lanes, including equal high words with different low words.Tested
f90626676934293a7c3c35cccd77c06299bce32don maincbc296ab65a2661a61e3e2da109134bcd5319f60. Windows 11 build 26200, Ryzen 9 5980HX, AMD Radeon RX 6800M driver30.0.13002.13003, Rust 1.99.0 MSVC, DXC/DXIL 1.9.2609.5.XCL_ADAPTER=6800M,XCL_REQUIRE_GPU=1,XCL_DIRECT_DXIL=1: the focusedgpu::dxil::ops_tests::int64_bit_ops_match_cputest passed (1 passed, 0 failed, 0 ignored, no explicit skip). The wholegpu::dxil::ops_testsgroup passed 20/20 with--test-threads=1and no explicit skips.cargo build --locked --workspace -j 2,cargo build --locked --release -p xcl -j 2, andgit diff --check origin/main...HEAD: passed.cargo test --locked --workspace --no-fail-fast -j 2 -- --test-threads=4 --show-outputcompleted with 998 passed, 156 failed, 46 ignored across the completed binaries. All 156 named failures weregpu::tests after the RX 6800M device was suspended (0x887A0005). Nine explicitSKIPPEDmessages included no GPU/device, unavailable D3D12 debug layer, no reserved cube with mips, and no heap windows. I did not run an equivalent full-suite baseline on this new main commit, so the failures are reported without attributing them to this PR.scripts/smoke.ps1runs on the RX 6800M. Each revision showed one frame, with no crash or device removal. Peak process commit was 6,911 MB on main and 7,063 MB on the PR.Regression run
main:
PR head:
Not tested
AI use
OpenAI Codex (GPT-6, exact variant not exposed in this session) isolated and implemented the fix, rebased it, ran the tests and smoke comparisons, reviewed the logs, and drafted this description.