Direct DXIL: skip read64 and EXEC_HI for wave32 and b32 saveexec/wrexec #2063
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2073"
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 ivall/xcl. Originally posted by Decodere on 2026-11-25T02:54:59Z.
What is in it
Bring Direct DXIL
saveexecandwrexeclowering for wave32 and_b32forms into parity with the HLSL path (merged in #191).Part of #1269
crates/xcl/src/gpu/dxil/lower.rs,Lw::saluunconditionally calledself.read64(d, ins[0], false)on_b64saveexec/wrexecinstructions even in wave32 (!self.wave64), and unconditionally calledself.sreg(127)(EXEC_HI) and computed the high-half resultt1before branching onif !self.wave64 || name.ends_with("_b32"):m0(SSRC0 = 124), wave32S_AND_SAVEEXEC_B64 s0, m0failed translation withErr("s_and_saveexec_b64 s[0:1], m0: op")becausecode64(124, ...)returnsNone, even though the HLSL path accepts it._b64forms spuriously toucheds[n+1]ininit.touched, and both wave32 and_b32forms spuriously touchedEXEC_HI(s127) and emitted dead high-half IR.EXEC_HI(sreg(127)) handling inside theif !self.wave64 || name.ends_with("_b32")vselse(wave64_b64) branches incrates/xcl/src/gpu/dxil/lower.rs:_b32branch reads a single 32-bit operand (self.read(d, ins[0], false)), reads onlyEXEC_LO(self.sreg(126)), updatesEXEC_LOandSCC, and writes 32-bitdst(t0forwrexec, oldelforsaveexec) without touchings[n+1]orEXEC_HI._b64branch reads the 64-bit source pair (self.read64), updatesEXEC_LO+EXEC_HI+SCC, and writes the 64-bit destination pair unchanged.saveexec_testsat the end ofcrates/xcl/src/gpu/dxil/lower.rs:direct_wave32_and_b32_saveexec_skip_read64_and_exec_hi: verifies wave32S_AND_SAVEEXEC_B64 s0, m0translates and validates, checksLw::init.touchedacross wave32_b64/_b32/wrexecand wave64_b32forms (confirming neithers11nors127is touched), checks wave32 disassembly emits only oneand i32, and checks wave64S_AND_SAVEEXEC_B64control still touchess10,s11,EXEC_LO, andEXEC_HI.gpu_direct_wave32_saveexec_and_wrexec: wave32 Direct DXIL GPU test (guarded byrunner::wave32_supported()) executingS_AND_SAVEEXEC_B64 s0, m0,S_OR_SAVEEXEC_B32 s2, s10, andS_ANDN2_WREXEC_B64 s4, s12and asserting exacts0/s2/s4/EXEC_LO/SCCresults whiles1,s5, andEXEC_HI(s127) keep their initial sentinel values.Tested
621.14, wave32), Intel Core i5-11400F, 32 GB RAM, Windows 11 Home build 26200, Rust1.100.0(stable-x86_64-pc-windows-msvc), DXC1.9.2609.5(01b62ad4).origin/maincbc296abwith new test added, debug):cargo test -p xcl --lib gpu::dxil::lower::saveexec_tests::direct_wave32_and_b32_saveexec_skip_read64_and_exec_hi -- --nocapture->0 passed; 1 failed(panicked:wave32 S_AND_SAVEEXEC_B64 s0, m0: "s_and_saveexec_b64 s[0:1], m0: op").d8f8dd33):cargo test --release -p xcl --lib gpu::dxil::lower::saveexec_tests -- --nocapture->2 passed; 0 failed; 0 ignored(both CPU/disassembly test and RTX 4060 wave32 GPU test).d8f8dd33):cargo build --release --workspace+cargo test --release --workspace -- --test-threads=4 --nocapture->1156 passed, 0 failed, 46 ignoredacross 21 test binaries.SKIPPEDlines (27 total, all pre-existing on this wave32 Windows host without Graphics Tools / Developer Mode / heap windows):no wave64skips (4ingpu::recomp::lower::tests,14ingpu::recomp::lower_dxil::tests,2ingpu::recomp::tests).per-lane form: refusedskips ingpu::recomp::lower_dxil::tests(f16 arithmetic,f16 packed,f32 conversions).test_title_draws_with_a_root_signature_under_the_debug_layer: nod3d12SDKLayers.dll;uploads_start_from_each_subresources_state:0x887A002D).shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable driver cache without Windows Developer Mode.heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows.Regression run
Paired 60 s retail title runs with
scripts/smoke.ps1(release build, same title, clean working tree) onorigin/main(cbc296ab) and this PR (d8f8dd33):main:this PR:
Not tested
S_AND_SAVEEXEC_B64translation/validation andinit.touchedwere tested on CPU only), D3D12 debug layer, heap windows, and Linux/Wine.S_*_SAVEEXEC_B64with a 32-bit-only source; the paired smoke run is a regression check only.AI use
Google Antigravity (Gemini 4 Neon) wrote the fix, tests, and this PR description; all builds, tests, and paired retail smoke runs were executed locally on the hardware listed above.
upstream-sync referenced this pull request2026-11-25 04:08:41 +00:00
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T03:08:11Z.
PR #2073 compatibility verification
Tested
PR #2073 was open at exact head
d8f8dd33d9b228c45644d0aff1d30d1dab2e29f4before and after testing. GitHub’s PR page,refs/pull/2073/head, and the reused clean checkout agreed after the run at2026-11-25T03:06:52.4996740Z.direct_wave32_and_b32_saveexec_skip_read64_and_exec_hi: 1 passed, 0 failed, 0 ignored, 0 skipped. 1,125 filtered out, exit 0, 0.20 s. Wave32S_AND_SAVEEXEC_B64translated and validated withm0. The disassembly assertion checked oneand i32for the SGPR-source example. Register-touch assertions covered both wave32 and_B32cases, and the wave64_B64control validated and touched both halves.gpu_direct_wave32_saveexec_and_wrexec: 1 passed, 0 failed, 0 ignored, 0 skipped. 1,125 filtered out, exit 0, 0.16 s. The Arc A770 dispatched the signed direct-DXIL fixture with the wave size fixed at 32. Eight readback assertions coveredEXEC_LO,SCC, the destination SGPRs and preserved high halves includingEXEC_HIacross the three-instruction sequence.26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 driver32.0.101.9175, Rust1.100.0(0ef1bc386,x86_64-pc-windows-msvc), Cargo1.100.0(3acc79c0c), DXC and DXIL1.9.2609.5(DXC build01b62ad4). Both test logs show the selected DXC and DXIL DLLs.Commands
The unoptimized test binary was prebuilt outside the Arc mutex in 63.801 s. The GPU confirmation ran inside
Invoke-ArcTest.ps1using process-scopedRemoteSigned. It took 78.13 s including lock wait. An initial GPU invocation also returned an ordinary libtest pass, but PowerShell mishandled its combined stderr. The counts above use the confirmation invocation with separate streams. The original log is preserved.In the actual child command, the binary path was passed as a literal. The logs under
L:/XclTooling/pr2073are:prebuild-d8f8dd3-20261125T030153830Z.logcpu-dxc-d8f8dd3-20261125T030153830Z.logarc-wave32-confirm-d8f8dd3-20261125T030153830Z.stdout.logandarc-wave32-confirm-d8f8dd3-20261125T030153830Z.stderr.logarc-wave32-d8f8dd3-20261125T030153830Z.log(initial capture)The public PR discussion had no separate discussion anchors before or after the run. The PR description already records the author's RTX 4060 results. The public GPU results issue #42 had no matching reference to this head or either fixture in the returned discussion. Publication was left to the coordinator.
Not tested
Native or split wave64 hardware execution, other adapters, retail titles, smoke tests, performance, release builds, and the full workspace suite. The checked-in CPU wave64 control is included above.
AI use
T3 Code / Codex (
gpt-6.2-sol) executed the checked-in fixtures, checked the logs and live SHA, and signed this empirical report.Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-25T03:14:28Z.
A run with vkd3d-proton as the host D3D12. The DXIL goes through dxil-spirv and then the NVIDIA Vulkan driver, a different compiler from a native-Windows run: this PR's 2 new tests pass.
Tested
x86_64-pc-windows-gnu.d8f8dd3as it is (merge base withmaincbc296a), no uncommitted changes. The lib test binary runs under Wine, one test per process.direct_wave32_and_b32_saveexec_skip_read64_and_exec_hi: ok, not skippedgpu_direct_wave32_saveexec_and_wrexec: ok, not skippedNot tested
AI use
Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-25T03:28:31Z.
Native-wave64 AMD run on Windows, which this PR lists as not tested (the reports above are Intel and NVIDIA).
Tested: pass, head
d8f8dd3applied on its basemaincbc296a, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17.cargo test -p xcl --lib -- gpu:: --test-threads=4:gpu_direct_wave32_saveexec_and_wrexecok. The 2 failures aregpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1and_3, the same as onmaincbc296awithout this PR on this card.AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Imported from ivall/xcl. Originally posted by Parakeet-Wheat on 2026-11-25T03:51:47Z.
NVIDIA RTX 3070 on native Windows, head
d8f8dd3on its basecbc296a(currentmain): both new tests fail without the fix and pass with it, the whole suite passes, and the smoke pair is within the limits. This adds the whole-suite counts and the smoke pair to the test runs above.Tested
610.88, 32-lane waves), Ryzen 5 5600X, 32 GB, Windows 11 26300, Rust 1.95.0stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11, retail 1.0.2.1. Headd8f8dd3(one commit onmaincbc296a), checked out clean. Tests in the debug profile, smoke in release.cargo test -p xcl --lib saveexec_tests -- --nocapture --test-threads=1:cbc296awith the PR'slower.rsbut its twoLw::saluhunks (the fix) reverted: 2 failed, 0 passed. Both stop ats_and_saveexec_b64 s[0:1], m0: op(direct_wave32_and_b32_saveexec_skip_read64_and_exec_hiat the wave32m0translate,gpu_direct_wave32_saveexec_and_wrexecat its direct translate);d8f8dd3: 2 passed, 0 failed, not skipped..\scripts\test.ps1(cargo build --workspace, thencargo test --workspace -- --test-threads=4) ond8f8dd3: 1156 passed, 0 failed, 46 ignored, exit 0. SKIPPED, 25: 20 ×no wave64, 3 × per-lane form refused (V_CVT_F16_F32,V_PK_MUL_F16,V_MUL_F16: "its #1426 semantics differ from the console's"), 1 ×no heap windows, 1 × cannot disable the driver cache (Windows Developer Mode required).Regression run (
scripts/smoke.ps1 -Game <folder> -Seconds 60, the same title, back to back, menus, no input; unedited).maincbc296a:PR head
d8f8dd3:That is 105 % of
main's frames and 99 % of its peak commit.Not tested
no wave64skips above), AMD, a world run (the smoke stays in the menus, so it does not show whether the title reaches a wave32saveexecwith anm0source), the tests on game data (XCL_SAMPLE_*not set).AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T05:09:56Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
upstream-sync referenced this pull request2026-11-25 10:09:30 +00:00
Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-25T17:43:09Z.
Independent AMD RDNA4 / Linux (RADV, native wave64) test report for head
d8f8dd33d9b228c45644d0aff1d30d1dab2e29f4(merged locally ontomain68a284a, clean merge).Hardware & environment
experimental-11.0-20261112),vkd3d-protonmasterec207194(3.2.0) +dxil-spirvb540c8a2+ relaxed-vtable patch (-Db_ndebug=true), DXVKv3.1.1-209, DXC1.9.2609.5, Rustx86_64-pc-windows-gnu(debug)Tested (
XCL_REQUIRE_GPU=wave64,VKD3D_CONFIG=ignore_shared_fence,--test-threads=1 --nocapture)gpu::dxil::lower::saveexec_tests: 2 passed, 0 failed, 0 ignored (0 skipped — bothdirect_wave32_and_b32_saveexec_skip_read64_and_exec_hiand the GPU testgpu_direct_wave32_saveexec_and_wrexecran on RADV and passed in 0.13 s, peak VRAM 1,650 MiB).Not tested
AI use