Repository navigation
Conversation
`wave32_reductions` previously accepted several non-reduction shapes
and mid-section `EXEC` mutations in wave32 VS/PS shaders:
- DPP8 (`a, b, c`) and DPP16 (`mirror`) steps checked `r.contains(&v)`
instead of requiring both operands to be `v` (`r == [v, v]`), and
`mirror` did not verify `ROW_MASK & 0x3 == 0x3` and `BANK_MASK == 0xF`.
- `V_PERMLANEX16_B32` (`cross`) did not check `Variant::Plain`,
`SRC0 == 256 + v`, or `dst != v`; `last` checked `r.contains(&v)`
instead of requiring inputs `{v, cross_dst}`; and `V_READLANE_B32`
did not check `Variant::Plain` and `SRC0 == 256 + v`.
- `S_OR_SAVEEXEC_B32` (`open`) accepted `SDST` in `126..=127` (writing
the saved mask back into `EXEC`), and the `EXEC`-clobber check inside
`open + 1..=end` missed implicit/SMEM/VOP3/SDWA `EXEC` writers such
as `V_CMPX_*`, `S_ANDN{1,2}_WREXEC_*`, `S_SUBVECTOR_LOOP_*`, and
`ENC_SMEM` loads targeting `EXEC_LO`/`EXEC_HI`.
Enforce exact operand/mask matching across every reduction step and
reject any `EXEC` write or branch/indirect transfer inside the section.
Part of xcl-dev#1401
Assisted-by: Google Antigravity (Gemini 4 Neon)
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Tested: current PR head merged onto current Not tested: retail titles (no title data on this lane, counts only). AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting. |
bmjask
left a comment
There was a problem hiding this comment.
No concrete defect found. The recognizer validates the relevant DPP/permlane/readlane shapes and expanded EXEC-write cases; unit coverage is broad and current Windows CI plus the RTX smoke pair are green. Residual validation is the disclosed lack of AMD/native-wave64 testing, but the changed recognizer is CPU-side static analysis. I found no blocker.
|
NVIDIA test report for
Lib tests only; no title run. AI-assisted (Claude Code, Claude Opus 5.5). |
|
Independent NVIDIA test report on exact head Tested
Regression run main: PR: Not tested
AI use
|
Part of #1401
Follow-up to
12f25f1(crates/xcl/src/gpu/recomp/mod.rs).wave32_reductionsreplaces the console compiler's wave32 whole-wave reduction sequence withxcl_red_<op>(xcl_seed_<pc>)so waves that are not full still reduce every live lane. Several operand, mask, andEXEC-clobber checks were too loose and could rewrite non-reduction code or sequences whoseEXECwas modified mid-section.What is in it
wave32_reductions(crates/xcl/src/gpu/recomp/mod.rs):a,b,c) and DPP16 (mirror) step to bev(r == [v, v]), plusmirrorROW_MASK & 0x3 == 0x3andBANK_MASK == 0xF.cross(V_PERMLANEX16_B32) to beVariant::PlainwithSRC0 == 256 + vand single destinationcw != v; requirelastto beVariant::Plainwriting[v]with inputs strictly{v, cw}(lr == [v, cw] || lr == [cw, v]); and requireread(V_READLANE_B32) to beVariant::PlainwithSRC0 == 256 + vandSRC1 == 128.open(S_OR_SAVEEXEC_B32) whenSDSTis in126..=127(EXEC_LO/EXEC_HI), and reject any instruction inopen + 1..=endthat branches/jumps/terminates (F_TERMINATOR | F_BRANCH | F_INDIRECT) or writesEXEC— including implicitOPR_EXEC/OPR_SDST_EXECoutputs (V_CMPX_*,S_*_SAVEEXEC_*,S_ANDN{1,2}_WREXEC_*,S_SUBVECTOR_LOOP_*), explicit SGPR/VOP3/SMEM destinations in126..=127(sgpr_uses+ENC_SMEMSDATA), andENC_VOPCSDWA compare writes to126..=127.wave32_reduction_tests(crates/xcl/src/gpu/recomp/mod.rs): 2 pure-CPU unit tests covering all 4 valid reduction ops (or/max/and/min) acrossROW_MASK0xF/0x3, bothlastoperand orders, and wave32 PS/VStranslate()emission, plus 19 invalid/clobbered shapes verified to be rejected by bothwave32_reductionsandtranslate().Tested
rustc 1.100.0, DXC1.9.2609.5, release profile (--release).cargo test --release -p xcl --lib gpu::recomp::wave32_reduction_tests:: -- --nocapture: 1 passed, 1 failed (invalid_wave32_reduction_shapes_and_exec_writes_are_rejectedfailed onorigin/main).cargo test --release -p xcl --lib gpu::recomp::wave32_reduction_tests:: -- --nocapture: 2 passed, 0 failed, 0 ignored (0.01 s).cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1286 passed, 0 failed, 46 ignored across 23 test binaries (28 pre-existingSKIPPEDlines: 21 no wave64 on RTX 4060, 3 per-lane wave32 refused, 2 no D3D12 debug layer, 1 no heap windows, 1 cannot disable driver cache; 0 skipped ingpu::recomp::wave32_reduction_tests).Regression run
main:
PR:
Not tested
wave32_reductionsis pure-CPU static RDNA2 analysis in the recompiler).title: 29640639.AI use
wave32_reductions,rdna2_spec.rs, andemit.rs, implemented the tightened operand/mask/EXECchecks and failing-first unit tests, and ran the workspace and paired smoke verification.