dxil: prefer live lanes in PS v_readfirstlane and lane-mask SCC tests #2501
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2501
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2501"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Decodere on GitHub · 2026-11-25 20:52 UTC · original
Decodere:fix-dxil-ps-live-lanes-675→main· +175 −5 · 2 files · 1 commits · openBring the direct DXIL pixel-shader lowering into parity with the HLSL recompiler's live-lane handling for helper lanes under
s_wqm(v_readfirstlaneandVCC/EXEClane-maskSCCchecks). Part of #675. Part of #1401. Part of #1833.What is in it
crates/xcl/src/gpu/dxil/lanes.rs:Lw::is_pixel(reused inballotandrla) andLw::live_lanes, which emitsWaveActiveBallot(true)and selects the active half in wave32-in-64 mode (matching HLSLballot(true)).Lw::first_laneso pixel shaders intersect(lo, hi)withlive_lanes()beforefirstbitlowwhen any live lane bit is set, falling back to raw(lo, hi)when only helper lanes are set (parity with HLSLfirst_lane_live; non-pixel stages unchanged).crates/xcl/src/gpu/dxil/lower.rs:Lw::ps_mask_live_sccmatching pixel-shaderENC_SOP2s_and_b32,s_andn2_b32,s_and_b64, ands_andn2_b64instructions withVCC(106) orEXEC(126) asSSRC0,SSRC1, orSDST.Lw::saluandLw::salu64to mask only theSCCzero-check bylive_lanes()whenps_mask_live_sccholds, leaving the destination register write (write32/write64) unmasked (parity with HLSLmask_live, extended to 64-bit masks).crates/xcl/src/gpu/dxil/lanes.rs(ps_ballot_tests):direct_ps_readfirstlane_filters_exec_by_live_lanes: pure-CPU DXC 1.9 validation and disassembly check for wave32/wave64 PS plus compute negative control.direct_ps_mask_and_scc_counts_live_lanes_only: pure-CPU DXC 1.9 validation and disassembly check for wave32/wave64 PSs_and/s_andn2touchingVCC/EXEC(includingSDST=NULL) plus non-mask PS and compute negative controls.gpu_direct_ps_readfirstlane_and_mask_live_on_triangle_edges: draws two triangles sharing a diagonal (32x32) on wave32 (and wave64 when supported) verifyingv_readfirstlaneselects a live lane (2.0), helper-onlys_andn2setsSCC == 0while preserving helper bits in the destination and live-lanes_andsetsSCC == 1, and a 6-pass march loop exits at6.0on all1024/1024pixels (cleanly skipped on WARP/CI without wave32).Tested
dxil.dll1.9.2609.5, release build.lanes.rs/lower.rsfix (onorigin/maine0d93c8): both new pure-CPU/DXC tests failed (0 passed, 2 failed).cargo test --release -p xcl --lib -- gpu::dxil::lanes::ps_ballot_tests:: --nocapture:7 passed, 0 failed, 0 ignored(0.43 s,0skipped;1024/1024pixels passed for bothwave64 = falseandwave64 = true).XCL_ADAPTER=warp:7 passed, 0 failed, 0 ignored(0.05 s; all 5 pure-CPU/DXC tests passed with0skips; the 2 GPU edge-draw tests cleanly skipped withno wave32/no wave64).cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture(RTX 4060):1424 passed, 0 failed, 46 ignoredacross37test binaries (184/184gpu::dxil::*passed;29pre-existingSKIPPEDGPU/environment checks:21no wave64,3per-lane wave32 refused,3no D3D12 debug layer,1no heap windows,1cannot disable driver cache;0skipped inps_ballot_tests).Regression run
main:
PR:
Not tested
d3d12SDKLayers.dll.AI use
is_pixel/live_lanes/first_laneinlanes.rsandps_mask_live_sccinlower.rs, wrote the DXC-validated and GPU edge tests, ran the test and smoke suites, and drafted this PR description.@DavidM1911 on GitHub · 2026-11-25 21:03 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@SlopTart on GitHub · 2026-11-25 21:08 UTC · original
gpu_suite (cold cache): 165 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.Targeted run of the new mask/readfirstlane tests (
direct_ps_mask_and_scc_counts_live_lanes_only,direct_ps_readfirstlane_filters_exec_by_live_lanes,gpu_direct_ps_readfirstlane_and_mask_live_on_triangle_edges, helper): 4 passed.@DarkPanda69 on GitHub · 2026-11-25 21:07 UTC · original · edited 2026-11-25 22:02 UTC
Correction: the PR test translates its
wave64pass in the native form (wave64: true, split: false), and that pass ran and passed on the RX 9070 XT. Which wave size the driver gives a pixel shader is the driver's choice, though, and the test does not check it, so this report does not show that the pass ran in 64-lane waves.AMD RDNA4 run of the native (
split: false) wave64 pixel-shader form, plus an RTX 3060: all 3 new tests pass on both cards, and nothing else changes.Diff applied on
main6d12f58, debug, Windows 11 Pro 26200,XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu:: --test-threads=4, run onmainand with the PR, card chosen withXCL_ADAPTER:XCL_SPLIT_WAVE64unset):gpu_direct_ps_readfirstlane_and_mask_live_on_triangle_edges,direct_ps_readfirstlane_filters_exec_by_live_lanesanddirect_ps_mask_and_scc_counts_live_lanes_onlyok. 701 passed, 2 failed; the 2 failures are the AMD fuzz seeds tracked in #2115, the same onmain. Same skip count asmain(6).No other test changes result on either card.
Not tested: the D3D12 debug-layer tests (
d3d12SDKLayers.dll), RDNA2/3, retail pixel shaders.AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@luckyteagirl on GitHub · 2026-11-26 04:16 UTC · original · edited 2026-11-26 04:20 UTC
RX 6800M focused validation on exact PR head
de915b5adb519c9aa342107fb05fbe56540541ff:30.0.13002.13003; Rust 1.99.0 MSVC; DXC 1.9.2609.5.XCL_ADAPTER=6800M,XCL_REQUIRE_GPU=wave64, pinnedXCL_DXC_DIR;cargo test --locked -p xcl --lib gpu::dxil::lanes::ps_ballot_tests::gpu_direct_ps_readfirstlane_and_mask_live_on_triangle_edges -- --exact --test-threads=1 --show-output.The fixture does not print its selected adapter or report the driver's physical pixel-shader wave width. The
XCL_ADAPTERselector and required-GPU mode were set, but this result should not be read as proof that the driver executed 64-lane pixel waves. This was one focused debug test, not a full suite or retail-title run.AI use: Codex (exact model name not exposed to me) with a Luna subagent prepared and ran the test and drafted this report; I checked the exact head and log before posting.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.