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).
|
Independent Windows AMD Radeon RX 6600 (RDNA2, 8 GB VRAM, native wave64) verification of Tested
Regression run (
Not tested: AI use: Antigravity (Gemini 4 Neon) ran the merge, workspace tests, and smoke runs and drafted this report; the account owner reviewed and approved posting. |
…1946, xcl-dev#1803, xcl-dev#2297, xcl-dev#2320, xcl-dev#2333 Carries forward still-open high-value upstream PRs onto upstream/main (2898511) + our updated Wine PR stack (xcl-dev#867, xcl-dev#1395-successor, xcl-dev#871, xcl-dev#877, xcl-dev#1732). Preserves UnadoptGuard in xcl-dev#2320 KickoffX reset_one. Assisted-by: Antigravity (Gemini 4 Neon)
…1946, xcl-dev#1803, xcl-dev#2297, xcl-dev#2320, xcl-dev#2333 Carries forward still-open high-value upstream PRs onto upstream/main (2898511) + our updated Wine PR stack (xcl-dev#867, xcl-dev#1395-successor, xcl-dev#871, xcl-dev#877, xcl-dev#1732). Preserves UnadoptGuard in xcl-dev#2320 KickoffX reset_one. Assisted-by: Antigravity (Gemini 4 Neon)
bmjask
left a comment
There was a problem hiding this comment.
No concrete source-level defect found. Signed/unsigned compare predicates and strict-select semantics are correct, Int64Ops is retained, and the path avoids AMD-problematic binary i64 min/max; focused lane/half tests are good. Current head lacks visible Windows build/test and description reports device-loss cascades in full-suite run without same-base comparison. Refresh full GPU/Windows evidence after investigation; equality cases would be a minor additional guard.
f906266 to
71acf1f
Compare
|
Same-base full-suite runs of the rebased head Tested
Not tested: a release build, a title or smoke run, the RX 6800M driver AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this comment from their output. |
|
NVIDIA test report for
|
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
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 no manual translator-version bump is needed.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
71acf1f073985faa62ae89701ed35e27199bec1c, based on main6d12f58a229bc73889878a448c64dc3af25eeba0. Windows 11, AMD Radeon RX 6800M, driver30.0.13002.13003, DXC/DXIL 1.9.2609.5,XCL_ADAPTER=6800M,XCL_REQUIRE_GPU=1,XCL_DIRECT_DXIL=1.cargo test --locked -p xcl --lib -j 2 gpu::dxil::ops_tests::int64_bit_ops_match_cpu -- --exact --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored, 0 SKIPPED.cargo test --locked -p xcl --lib -j 2 gpu::dxil::ops_tests:: -- --test-threads=2 --nocapture: 24 passed, 0 failed, 0 ignored, 0 SKIPPED.cargo build --locked --release -p xcl --bins -j 2: passed.f90626676934293a7c3c35cccd77c06299bce32d, the focused i64 GPU test passed on an RX 6750 XT. An independent RTX 3080 Ti run reported 1,154 passed, 0 failed, 46 ignored across the workspace; an RX 6600 run of main2898511plus this change and Shaders: preserve first active lane reads across divergent switches #2192 reported 1,364 passed, 0 failed, 46 ignored. These are not tests of the rebased commit.71acf1fand its base6d12f58on an RX 7600 XT and Ryzen 5 9600X iGPU. No run lost the device. The seed 783 mismatch count went from 32 to 0 on both GPUs. The RX 7600 XT full suite withXCL_DIRECT_DXIL=1had one extra failure ina_dispatch_with_a_pipeline_still_building_waits_at_the_submit. That test passed 80 of 80 isolated reruns across the two trees and GPUs. Independent report with full counts.SKIPPEDnotices. The focused i64 test passed 3/3 runs in each of HLSL and direct-DXIL modes; the fullgpu::dxil::ops_tests::group passed 24/24. This was a library run, not a title run. Independent NVIDIA report.Regression run
Release binaries, same owned title, RX 6800M, 7 seconds.
Main:
PR head:
Not tested
AI use
OpenAI Codex (GPT-6.2) implemented the change and tests in the existing commit; Codex refreshed the rebased-head focused tests, release build, smoke comparison, and this report. Codex also checked the independent results and drafted the description update.