Repository navigation
Conversation
In crates/xcl/src/gpu/dxil/lower.rs, Lw::salu unconditionally called read64 on _b64 saveexec/wrexec forms even in wave32 (!self.wave64) and unconditionally read sreg(127) (EXEC_HI) before branching on (!self.wave64 || name.ends_with("_b32")). On 32-bit-only source encodings such as m0 (SSRC0 = 124), wave32 S_AND_SAVEEXEC_B64 failed translation with Err("...: op"), and on SGPR sources it spuriously touched s[n+1] and EXEC_HI (s127).
Move source reads and EXEC_HI handling inside the wave32/_b32 vs wave64 _b64 branches to mirror HLSL (xcl-dev#191), and add unit/disassembly and wave32 RTX 4060 GPU regression tests in lower.rs.
Part of xcl-dev#1269
Assisted-by: Google Antigravity (Gemini 4 Neon)
PR #2073 compatibility verificationTested PR #2073 was open at exact head
Commands The unoptimized test binary was prebuilt outside the Arc mutex in 63.801 s. The GPU confirmation ran inside $env:CARGO_TARGET_DIR = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target'
$env:CARGO_BUILD_JOBS = '2'
$env:CARGO_INCREMENTAL = '0'
$env:CARGO_PROFILE_DEV_DEBUG = '0'
$env:CARGO_PROFILE_TEST_DEBUG = '0'
$env:XCL_ADAPTER = 'A770'
$env:XCL_DXC_DIR = Join-Path $env:LOCALAPPDATA 'XclTooling/dxc-1.9.2609/bin/x64'
$env:TEMP = 'L:/XclTooling/pr2073/temp-20261125T030153830Z'
$env:TMP = $env:TEMP
cargo test -p xcl --lib --no-run
$binary = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe'
& $binary 'gpu::dxil::lower::saveexec_tests::direct_wave32_and_b32_saveexec_skip_read64_and_exec_hi' --exact --nocapture --test-threads=1
# Script block encoded as UTF-16LE for the child PowerShell's -EncodedCommand.
# Child options were -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -OutputFormat Text.
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
& $binary 'gpu::dxil::lower::saveexec_tests::gpu_direct_wave32_saveexec_and_wrexec' --exact --nocapture --test-threads=1
}In the actual child command, the binary path was passed as a literal. The logs under
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 ( |
|
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
Not tested
AI use
|
|
Native-wave64 AMD run on Windows, which this PR lists as not tested (the reports above are Intel and NVIDIA). Tested: pass, head
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report. |
|
NVIDIA RTX 3070 on native Windows, head Tested
Regression run ( PR head That is 105 % of Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
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.