Repository navigation
Per-lane: track the SCC of mixed mask and number operations - #1866
Conversation
|
Same on Ampere: RTX 3070 8 GB (32-lane waves), driver 616.56, Windows 11, debug,
AI-assisted (Claude Code). Synthetic tests only. |
|
AMD run with native 64-lane waves, which this PR lists as not tested (the other report here is Ampere). Updated for head Tested: pass, head
Not tested: Linux; the whole workspace suite. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report. |
The per-lane lowering extracts a bit from a numeric operand when a bitwise operation or compare also reads a mask. Give the unknown operand a lane atom in the mask analysis so its branch and select guards see the same mask-valued SCC.
33b1b33 to
438d420
Compare
|
Independent split-wave64 check of 438d420 on an RTX 3080 Ti (621.35), Windows 11 build 26300, Rust 1.99.1 MSVC debug, DXC 1.8.2502.11. In a synthetic compute shader, only lane 63 set VCC. A 64-bit AND with a user SGPR pair supplied the SCC branch condition. With the parent analysis, the shader entered the per-lane path and 63 of 64 lanes wrote the wrong branch result when the SGPR pair kept bit 63. With
AI-assisted. Codex (GPT-6 family, exact variant unavailable) extended and ran the GPU test and drafted this report. |
, xcl-dev#1876, xcl-dev#1866) Brings main to full parity with upstream/main (62265d3): - xcl-dev#1005: skip VirtualQuery on committed coherent UMA windows in cpu_writes and kernelx - xcl-dev#1053: opt-in fast-boot env vars (Bink intro skip, frame interval override, device type, TTS mute) - xcl-dev#1876: float v_cmpx through xcl-dev#1426 lowering keeps lanes outside EXEC out - xcl-dev#1866: track SCC of mixed mask and number operations Conflict in crates/xcl/src/hle/xgameruntime/api.rs resolved by keeping both the in-process Wine XAsync path and upstream's XCL_MUTE_TTS XAccessibility path. Assisted-by: Antigravity (Gemini 4)
Pulls in xcl-dev#1836 (graphics and two-pass PSO disk cache + lazy MS/GS + shader build coalescing), xcl-dev#1930 (DXIL CSE across discard), xcl-dev#1900, xcl-dev#1005, xcl-dev#1053, xcl-dev#1864, xcl-dev#1866, xcl-dev#1869, xcl-dev#1876, and xcl-dev#1898 while keeping our RDNA4 MSAA clamp (xcl-dev#1908), wave64 graphics Direct DXIL guard (xcl-dev#1913), atomic writable-range tracking, static-sampler cache keys, and 4M-group indirect dispatch clamp.
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
Pipodi's point 2 on #1745: a scalar bitwise operation or compare that reads a mask (VCC, EXEC, a compare result) together with an SGPR the analysis can't track. The per-lane lowering takes that operation as a mask and extracts each lane's bit, while the analysis dropped the mask and classified SCC as uniform. So a branch or select on that SCC went per lane where the console tests the whole word once for the wave. The fix gives the untracked operand a lane atom, so the existing whole-wave checks see these operations and refuse them where the condition differs across lanes. @gefydev handed this point to us on #1269 (#1269 (comment)).
What is in it
crates/xcl/src/gpu/recomp/lane_masks.rs: a mask operation with one untracked operand keeps a lane atom for that operand instead of losing the mask.crates/xcl/src/gpu/recomp/lower.rs: the whole-wave guard reads the same mask-valued SCC.crates/xcl/src/gpu/recomp/lower_dxil.rs: GPU and CPU tests. A wave32 compute program sets the low 16 bits of VCC, ANDs VCC with an all-ones input SGPR and branches on SCC; further cases cover a scalar select and a mixed compare.Tested
cargo test --release --workspace -- --test-threads=4on33b1b33: 960 passed, 0 failed, 43 ignored. Twelve tests printed 22 SKIPPED messages (no native wave64, heap windows, the existing f16 exclusions). The mixed-mask GPU test ran without a skip.mainc4d37be: lane 16 reads 0 in the per-lane form where HLSL gives 1 (lanes 16 to 31 differ). On33b1b33: HLSL gives 1 in all 32 lanes, and the per-lane translator refuses the branch.maintakes 316 of 2,689 programs per lane, and so does this change, with the same programs and the same DXIL sizes. The whole-wave check is the first refusal for 1,771 programs before and 1,769 after, because two programs now stop at a later check.Regression run
scripts/smoke.ps1, the same retail title for 60 s each, one after the other on the machine under Tested, release builds from clean trees.main689f2db(this PR's base):this PR,
438d420:PR vs
main: 1280 / 1235 frames (104 %), peak commit 26990 / 26475 MB (102 %); device removals 0 and crashes 0 on the PR run, 0 and 0 onmain.The tests under Tested ran on
33b1b33, this change before its rebase ontomain689f2db; the rebase applied without conflicts.Not tested
mainin the same test harness, not fixed here: a wave32 kernel launched with EXEC =fffffffegivess0= 0 per lane where HLSL gives 5. We have not seen it in a retail program.AI use
OpenAI Codex (GPT-6.2) wrote the patch and the tests and ran the suite, the GPU tests and the pack count. A separate Codex session built the Z3 check that found the case. Claude Code (Claude Opus 5.5) ran the regression pair and wrote this description; no person reviewed the code before posting.
🤖 Generated with Claude Code