Repository navigation
Direct DXIL per-lane: ignore reserved OP_SEL[3:2] on V_PERMLANE(X)16_B32 - #2095
certified-retart wants to merge 1 commit into
Conversation
On RDNA2, 32-bit V_PERMLANE16_B32 and V_PERMLANEX16_B32 only define OP_SEL[0] (FI) and OP_SEL[1] (BOUND_CTRL); OP_SEL[3:2] are reserved and ignored by hardware. Both the HLSL backend (emit.rs) and per-instruction Direct DXIL (dxil/lower_valu.rs) already mask only bits 0 and 1. Remove the spurious op_sel & !3 != 0 rejection from the per-lane lowerer while keeping ABS/NEG/CLAMP/OMOD refused.
|
Tested
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
& 'L:/XclTooling/pr2014-1c971de6/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe' gpu::recomp::lower_dxil::tests::permlane_ignores_reserved_opsel_bits --exact --nocapture --test-threads=1
}
Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Independent Windows run on 1b4f9a7. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, DXC 1.8.2502.11, debug.
I extended the stock test to dispatch both permlane instructions on native wave32 for all 16
|
|
AMD RDNA4 run of Setup: AMD Radeon RX 9070 XT 16 GB (RDNA4, native wave64), driver 32.0.32015.2008, Ryzen 7 9800X3D, 31 GB RAM, Windows 11 26200.9974, rustc 1.100.0 MSVC, DXC 1.9.2602.17. This PR's head as pushed (its base is Tested
Regression run With Not tested
AI use
|
What is in it
Part of #1269 (per-lane direct DXIL compute coverage).
On RDNA2, 32-bit
V_PERMLANE16_B32andV_PERMLANEX16_B32only defineOP_SEL[0](FI) andOP_SEL[1](BOUND_CTRL);OP_SEL[3:2]are reserved and ignored by hardware. Both the HLSL backend (emit.rs) and the per-instruction direct DXIL backend (dxil/lower_valu.rs) already ignoreOP_SEL[3:2]and only read bits 0 and 1.crates/xcl/src/gpu/recomp/lower/wave.rsrejectedop_sel & !3 != 0withVOP3 modifiers, which caused the per-lane direct DXIL lowerer to refuse valid retail compute programs that set a reservedOP_SEL[3:2]bit (e.g.OP_SEL=0x9withABS=NEG=CLAMP=OMOD=0). This change removes theop_sel & !3 != 0check while keeping real VOP3 modifiers (ABS,NEG,CLAMP,OMOD) refused.crates/xcl/src/gpu/recomp/lower/wave.rs: stop rejecting reservedOP_SEL[3:2]bits onV_PERMLANE16_B32/V_PERMLANEX16_B32.crates/xcl/src/gpu/recomp/lower_dxil.rs: addpermlane_ignores_reserved_opsel_bits, verifying wave32/wave64 per-lane lowering and DXIL validation withOP_SEL=0x9andOP_SEL=0xE, verifyingABS/NEG/CLAMP/OMODremain refused, and checking real-GPU wave32 execution and parity with per-instruction direct DXIL.Tested
dxil.dll1.9.2602.17.cargo test -p xcl --lib permlane_ignores_reserved_opsel_bits -- --nocapture: 1 passed, 0 failed, 0 skipped; validated wave32 and wave64 DXIL and ran wave32 on the RTX 5070 with exact per-lane output and parity against per-instruction direct DXIL.cargo test --workspace -- --test-threads=4(debug): 1,155 passed, 0 failed, 46 ignored across 21 test suites.XCL_RECOMP_NO_HLSL=1 XCL_RECOMP_STAGES=CSsurvey over a retail shader pack (2,689 compute programs,origin/maincbc296avs1b4f9a7):V_PERMLANEX16_B32: VOP3 modifiersrefusals:42->0.origin/mainalone:579->583(+4), refused for instructions only:1,078->1,074(the remaining ~20 first-refusal programs also hit the single-operand atomic check fixed separately in Direct DXIL: skip unused compare/DATA1 VGPR reads on single-operand atomics #2077).Regression run
Matched 60 s
scripts/smoke.ps1runs on the same machine, title, and release build (XCL_D3D12_DIRset to Agility SDK v614):Baseline (
origin/main):This PR:
Not tested
AI use
Antigravity (
gemini-4-neon) diagnosed the per-lane refusal, implemented the fix and test, ran the tests and smoke run, and drafted this PR description.