Repository navigation
Recompiler: fix per-lane whole-wave predicate and SRC_SCC checks - #2014
Conversation
Fixes xcl-dev#1888. - Distinguish wave-wide any-lane-nonzero (SccKind::Any) from all-lanes-equal (SccKind::All) in lane_masks::uniform_over so inactive lanes (EXEC == 0) are accounted for on S_CMP_EQ, S_CMP_LG, S_NOT, and mask-op SCC joins/branches. - Stop ANDing VCC with EXEC in S_CBRANCH_VCCZ / S_CBRANCH_VCCNZ in both lane_masks::cond and lower::cond; hardware tests all bits of VCC regardless of EXEC. - Validate explicit SRC_SCC (encoding 253) source operands and implicit OPR_SSRC_SPECIAL_SCC inputs against uniform_over in lane_masks. Assisted-by: Antigravity (Gemini 4 Neon)
dae6a97 to
1c971de
Compare
|
Tested
The CPU checks include inactive-lane SCC decisions, VCC bits outside EXEC, and explicit Not tested Full workspace suite, retail-title smoke, native wave64, or other GPU/driver combinations in this run. Explicit AI use Codex ( |
|
Diff audit passed on Remaining before merge: independent AMD and NVIDIA GPU test runs on |
|
NVIDIA and native-wave64 AMD runs, which this PR lists as not tested (the report above is on an Arc A770). Tested: pass, head
Not tested: AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report. |
|
Passes on NVIDIA (RTX 3060, wave32 only) in the whole workspace suite and with This adds to the RTX 3060
Hardware: RTX 3060 12 GB, driver 610.88, Windows 11 Pro 26300, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug. Not tested: native wave64, a release build, AI use: Claude Code (Claude Opus 5.5) ran the tests and the mutation checks and wrote this report. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
Fixes #1888.
Fixes three soundness gaps in the per-lane (
XCL_PER_LANE=1) whole-wave mask predicate analysis and lowering (crates/xcl/src/gpu/recomp/lane_masks.rs,crates/xcl/src/gpu/recomp/lower.rs):What is in it
lane_masksviaSccKind(Uniform,Any,All,Unknown) souniform_overaccounts for inactive lanes (EXEC == 0) whenwave_branches == false:Any(mask != 0, e.g.S_*_SAVEEXEC,S_NOT, mask bitwise ops,S_CMP_LG_U32/U64): per-lane bit matches hardware only whenc == FALSEwave-wide orre != FALSE && re => c.All(a == b,S_CMP_EQ_U32/U64): per-lane bit matches hardware only whenc == TRUEwave-wide orre != FALSE && re => !c.SccKindacross CFG joins without folding non-uniform mask SCCs viafactalone, and checkuniform_overon the unnegated branch predicate before applyingSCC0/VCCZ/EXECZnegation.VCCwithEXECinS_CBRANCH_VCCZ/S_CBRANCH_VCCNZ(lane_masks::condandlower::condwhen!self.wave_branches), matching RDNA2 hardware which tests all bits ofVCCindependent ofEXEC.reads_scc: both implicitOPR_SSRC_SPECIAL_SCCinputs and explicitSRC_SCC(encoding253) inSSRC0,SSRC1,SRC0,SRC1,SRC2,SOFFSET.lane_masks::testscovering inactive-laneS_CMP_EQ/S_CMP_LG/S_NOTSCC checks,S_CBRANCH_VCCZ/VCCNZwith bits outsideEXEC, and explicitSRC_SCC(253) SALU/VALU reads.Tested
rustc 1.100.0, DXC1.9.2602.17.cargo test -p xcl --lib gpu::recomp::lane_masks: 13 passed, 0 failed, 0 ignored, 0 skipped.cargo test -p xcl --lib gpu::recomp::lower -- --test-threads=4: 51 passed, 0 failed, 0 ignored, 6 sub-case skips (V_MUL_F16/V_PK_MUL_F16/V_CVT_F16_F32unsupported in per-lane form).cargo test --workspace -- --test-threads=4(xcllib, prior to#1910rebase): 945 passed, 4 failed (pre-existing on RX 6800:fuzz_validate_and_gpu_1DXIL GPU fuzz tests reproducibly fail with E_OUTOFMEMORY on RTX 5060 #1905 andplaced_title_textures_share_vram_and_preserve_pixels+ 2VRAM_TEST_LOCKPoisonErrorcascades D3D12.X: map a one-slice title texture's packed mips where D3D12 addresses them #470), 25 ignored, 1 skipped (pso_measurement_compiles_an_exact_synthetic_record: Windows Developer Mode not enabled).cargo test -p xcl --test '*' -- --test-threads=4: 49 passed, 0 failed, 20 ignored, 1 skipped (heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows).Not tested
XCL_PER_LANE=1full retail title playthrough past 60 s.Regression run
AI use
lane_masks.rsandlower.rschanges and unit tests, rebased onto6567c5f(Recompiler: take native compute mask branches across the whole wave #1910), ran the local test suite and pairedscripts/smoke.ps1runs, and drafted this PR description.