Repository navigation
Conversation
In `Lw::sources` (`dxil/lower_valu.rs`), the initial operand loop skipped `SRC0` for non-plain variants but did not skip `VSRC1` for `Variant::Sdwa` (unlike HLSL `recomp/emit.rs` after merged PR xcl-dev#191). Before the SDWA match arm replaced `u[1]` using `S1` + `VSRC1`, the initial loop called `self.read` -> `self.vreg(vsrc1)` on the raw 8-bit `VSRC1` encoding. When `S1 == 1` (scalar SGPR or inline constant such as `242` = `1.0f` or `138` = `10`), that polluted `self.init.touched` with bogus VGPRs (`v242`, `v138`, `v4`) and inflated `top_vgpr()`, bloating any `v_movrel*` / `v_swaprel_b32` select chains in the shader. Skip `VSRC1` for `Variant::Sdwa` in the initial operand loop (parity with `xcl-dev#191`) and add DXIL disassembly + RTX 4060 GPU regression tests. Part of xcl-dev#1269 Assisted-by: Google Antigravity (Gemini 4 Neon)
4398ee3 to
b6bf898
Compare
|
Fixed the Re-verified locally (release): AI use: Google Antigravity (Gemini 4 Neon). |
PR #2068 — Intel Arc A770 compatibility testTested GitHub PR xcl-dev/xcl #2068 at Tested
& 'C:/Users/ljensen/.cargo/bin/cargo.exe' +stable-x86_64-pc-windows-msvc test -p xcl --lib --no-run --jobs 2 --message-format=json
$testExe = 'L:/XclTooling/pr1844-71f2ceb-t3-737e5ee5/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe' # Cargo compiler-artifact executable
& $testExe --exact gpu::dxil::lower_valu::sdwa_tests::direct_sdwa_scalar_vsrc1_does_not_touch_bogus_vgpr --nocapture
# GPU retry in a separate PowerShell process
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned -Force
$gpu = 'gpu::dxil::lower_valu::sdwa_tests::gpu_direct_sdwa_scalar_vsrc1'
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { & $testExe --exact $gpu --nocapture }The initial GPU invocation stopped at PowerShell script loading. The wrapper ran on retry with
Cargo prebuilt the test binary outside the GPU mutex in 1 min 08 s. Each exact invocation filtered out 1,125 tests. The GPU wrapper printed lock acquisition and release, and the invoked test exited 0. The enclosing PowerShell command returned 1 because its post-run check looked for the
At the post-run check (2026-11-25 03:05 UTC), GitHub still displayed the PR as open and Not testedCoverage was limited to the isolated wave32 fixture and the three CPU DXIL cases on this exact PR commit. Retail titles, whole-workspace tests, other adapters, WARP, wave64, the D3D12 debug layer, and production PSO backend selection were outside the run. EvidenceLogs in this directory share prefix AI useT3 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 103 % of Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
Fixes
Lw::sourcesincrates/xcl/src/gpu/dxil/lower_valu.rsso SDWAVSRC1operands are skipped during the initial operand-read loop before the SDWA arm selects the real operand usingS1(bringing direct DXIL into parity with merged HLSL PR #191). Part of #1269.Previously,
Lw::sourcesskippedSRC0for non-plain variants (SDWA/DPP) but did not skipVSRC1forVariant::Sdwa. On any SDWAVOP2orVOPCinstruction, the initial loop calledself.read->self.vreg(vsrc1)on the raw 8-bitVSRC1encoding before the SDWA arm overwroteu[1]. WhenS1 == 1(scalar SGPR or inline constant such as242=1.0for138=10), that inserted bogus VGPRs (v242,v138,v4) intoself.init.touchedand inflatedLw::top_vgpr(), causingv_movrel*/v_swaprel_b32select chains in the same shader to emit hundreds of unnecessary select instructions.What is in it
crates/xcl/src/gpu/dxil/lower_valu.rs:Lw::sources, skipo.field == Some("VSRC1")whend.variant == Variant::Sdwa(matchingrecomp/emit.rsafter Recompiler: wave32 src_vccz / src_execz and SDWA f16 inline constants #191), while keeping implicit operands (o.field == None, e.g.,VCConV_CNDMASK_B32/V_ADD_CO_CI_U32) andVDSTread normally.sdwa_tests::direct_sdwa_scalar_vsrc1_does_not_touch_bogus_vgprverifying viatranslate_compute+ DXIL disassembly that SDWAS1 == 1V_ADD_F32(VSRC1=242),V_CMP_LT_U32(VSRC1=138), andV_ADD_NC_U32(VSRC1=4) do not inflatetop_vgpr()with bogus VGPRs, plussdwa_tests::gpu_direct_sdwa_scalar_vsrc1(guarded byrunner::wave32_supported() == Ok(true)so non-wave32 adapters like WARP skip cleanly while DXIL validation still runs on CPU) verifying HLSL and direct DXIL runtime parity on the GPU across scalar SGPR and inline-constantVSRC1operands.Tested
0ef1bc386), DXC 1.9.2609.5 (01b62ad4), release build.direct_sdwa_scalar_vsrc1_does_not_touch_bogus_vgprfails before the fix (v_add_f32_sdwa_inline_242: bogus VGPR v242 polluted top_vgpr() in direct DXIL, emitting >1000 SSA instructions for a 5-instruction compute shader).cargo test --release -p xcl --lib gpu::dxil::lower_valu::sdwa_tests -- --nocapture(RTX 4060): 2 passed, 0 failed, 0 ignored, 0 skipped (DXIL disassembly + HLSL/direct DXIL wave32 GPU parity).XCL_ADAPTER="Microsoft Basic Render Driver"cargo test --release -p xcl --lib gpu::dxil::lower_valu::sdwa_tests -- --nocapture(WARP): 2 passed, 0 failed, 0 ignored (gpu_direct_sdwa_scalar_vsrc1skips cleanly after DXIL validation without attempting a wave32 PSO on 4-lane WARP).cargo build --release --workspace+cargo test --release --workspace -- --test-threads=4: 1156 passed, 0 failed, 46 ignored across 21 test binaries.SKIPPEDGPU/runtime tests on this adapter (25 lines on stderr; D3D12 debug-layer tests also skip withoutd3d12SDKLayers.dll):no wave64subcases acrossgpu::recomp::lower::tests(4),gpu::recomp::lower_dxil::tests(14), andgpu::recomp::tests(2)#1426refusals (V_MUL_F16,V_PK_MUL_F16,V_CVT_F16_F32) ingpu::recomp::lower_dxil::testsshaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required)heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windowsRegression run
scripts/smoke.ps1onmain(cbc296ab65a2661a61e3e2da109134bcd5319f60) and on this PR's head commit (b6bf898254cd059c64999b962fde7f136c710ee9):Not tested
rdna2::vgpr_usesSDWA extension-dword analysis (covered separately by open PR Recompiler: SDWA register uses come from the extension dword #811).d3d12SDKLayers.dllnot installed), and debug-profile full workspace test run (the full suite ran in--release).AI use
Lw::sourcesagainst HLSL#191, implemented the SDWAVSRC1guard, DXIL disassembly and GPU parity regression tests (including thewave32_supported()WARP guard), and PR description; all tests and paired 60s smoke runs were executed and verified locally on RTX 4060 and WARP.