shader: accept the SDWA form of mesh v_cmpx_lt_u32 (Part of #3703) #3949
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3949
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3947"
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?
@mumba17 on GitHub · 2026-12-03 16:45 UTC · original
mumba17:shader/mesh-cmpx-sdwa→main· +19 −2 · 2 files · 1 commits · openPart of #3705 (X1, the SDWA slice: #3705).
Problem
The mesh frontend lowers
v_cmpx_lt_u32only in its plain VOPC and VOP3 forms (plain_cmpx_ltrequires!i.subword). The SDWA form, a compare of one 16-bit half (src0_sel:WORD_0) with ans_cbranch_execzafter it, was refused withunsupported mesh instruction or EXEC state: v_cmpx_lt_u32. #3924 and the CMPX paths in #3888/#3666 keep SDWA refused as well.Change
plain_cmpx_ltaccepts SDWA. Nothing else was needed for the compare itself:invalid SDWA compare destination) and integer abs/neg.comparisonapplies each source's WORD/BYTE select and sign extension.So the SDWA form narrows EXEC exactly like the plain one, and VCC stays unwritten. The one place that reads the whole operand as a lane-linear thread index, the export-count bound, now requires a non-SDWA compare: a bound taken from half a thread index would be wrong.
Tests (
native_direct_mesh)v-cmpx-lt-sdwa-word0:v_cmpx_lt_u32_sdwa v0, v2 src0_sel:WORD_0narrows EXEC withicmp ultonand v0, 65535, with no VCC ballot.v-cmpx-lt-sdwa-word1:src0_sel:WORD_1compares(v0 >> 16) & 65535.v-cmpx-lt-sdwa-sgpr-destination: SD set (explicit SGPR destination) is still refused.v-cmpx-lt-sdwa-word0fails with thev_cmpx_lt_u32refusal.Census
Our native Mesh86 capture (RTX 3090, 600 s): 6,685 distinct
.m86programs, each run once throughcompile_dxil … gfx1013-container-ms-texture-heap.mainc6a0b036(with #3924): 2,163 translate. 178 stop atv_cmpx_lt_u32, and in this capture all 178 are this SDWA form.v_readfirstlane_b32. No other program's first refusal changes.v_cmpx_lt_u32get past it too, and all 277 then stop at a laterv_readfirstlane_b32. These programs have several walls in a row.Counts only; request bytes stay local.
Checks
Windows 11 build 26300, MSVC (VS Build Tools 14.44), SDK/DXC 10.0.26100.
ctest --preset pron this commit (rebased onmain4324d81f, which has #3947 and #3948): 349/351 pass,native_direct_meshincluded. The two local failures,native_compute_implicit_lod_controlsandnative_wave_virtual_derivative_controls, are the local SDK validator 1.7 vs DXIL 1.8 and fail onmaintoo. The census was measured before the rebase (c6a0b036, andc6a0b036+ #3948) and not rerun on4324d81f.AI-assisted (Claude Code).
🤖 Generated with Claude Code
@R0Y00 on GitHub · 2026-12-03 17:21 UTC · original · reviewed
Independently rebuilt compile_dxil on
efdaf580with MSVC Debug; native_direct_mesh passed 1/1, including both SDWA half selectors and the explicit destination refusal. The hosted Windows run's only failure was startup_stage_package: stage_package.ps1 exceeded the fixture's 30 s subprocess deadline. The shader case did not fail there. I reran the failed job on this same head to keep the required Windows gate intact.@R0Y00 on GitHub · 2026-12-03 17:25 UTC · original · approved these changes
Re-reviewed
efdaf580. The SDWA path still narrows EXEC only, and the lane-linear export count proof remains limited to the full-width operand. The source-built native_direct_mesh suite passed 1/1 in MSVC Debug. Restoring only the old !i.subword guard caused the WORD_0 control to fail at +0x24 with the former v_cmpx_lt_u32 EXEC refusal. WORD_1 and explicit SGPR destination controls also ran in the unmodified suite. The initial required Windows job failed only its package staging subprocess timeout; I requested the exact-head retry.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.