tests: add supplemental SDWA 32-bit integer compare draws and refusal controls #1916
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1923"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by KomaGuy on 2026-11-24T21:20:38Z.
Rebased onto current
main(214ed093) after #1790 landed all 46 non-cmpxSDWA comparisons intools/pixel_aot.pyandtools/scan_unsupported_shaders.py, keeping the supplemental per-predicate 32-bit integer draw and refusal test coverage:What this adds
tests/pixel_aot_check.py,CMakeLists.txt): four 4-channel groups (i32_lo,i32_hi,u32_lo,u32_hi) covering all 16v_cmp_*_{i32,u32}_sdwaforms across all 7src0_sel/src1_selselectors, zero/sign extension (sext()), and SGPR/VGPR source pairs, with 41 targeted single-channel negative controls (pixel_aot_sdwa_int_compare_{warp,hardware}) and LLVM binary round-trip fixtures incheck_binary.check_sdwa_int_compare_lowering): whole-dword equivalence withe32, single-register destination enforcement (vcc/vcc_lo/s52accepted, SGPR pairss[52:53]/s[51:52]/s[105:106]and out-of-ranges106rejected),low16VGPR source rejection, pending sample and pending scalar source/destination rejection, non-entry mask rejection, float modifiers (-s44,|v18|,abs(v18),sext(-s44)),clamp,dst_sel, and remaining unlowered SDWA compare neighbours (i64,v_cmpx).docs/experiments.md): notes the supplemental fixture alongside #1790's entry.Verification (Linux)
git merge-tree --write-tree --name-only origin/main HEAD: clean, no conflicts.python3 tests/pixel_aot_check.py: PASS.python3 tests/docs_links_check.py: PASS (19 files, 457 links).python3 tests/bidi_controls_check.py: PASS (1641 files).python3 tests/rdna2_tools_check.py: PASS (156 tests OK, 19 skipped).git diff --check origin/main...HEAD: clean.Windows draws (
pixel_aot_sdwa_int_compare_{warp,hardware}) and LLVM 15check_binaryrun in CI.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T21:24:12Z.
Review: COMMENTED
Review of head
f81ecee36e093d04be1d7e7a4b0ce857103090e0(first review). Verdict: not mergeable as it stands, no merge.Blocking:
git merge-tree --write-tree --name-only origin/main HEADreports a content conflict in tests/pixel_aot_check.py (GitHub: CONFLICTING/DIRTY). Please rebase.Read of the diff (no P1/P2 found in the code itself):
Commands run locally (Linux):
Mutation (reverted with git checkout -- ., tree clean):
Not done: the Windows draw tests (pixel_aot_check.py draw-sdwa-int-compare) were not run, since the conflict blocks a merge anyway. No GitHub checks are reported for the branch. No receipt, no merge.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T21:34:09Z.
Thanks for the distinct signed/unsigned draw and refusal cases. The 16 production forms overlap #1670 and #1790, which are already under review. Please hold this branch while we reconcile the shared implementation. The single-register destination follows the actual SDWA encoding; an aligned SGPR pair accepted by the textual parser does not establish an encodable form. If a new fixture survives the overlap review, it can land as supplemental coverage with your attribution.
Imported from R0Y00/Xbox2Windows. Originally posted by KomaGuy on 2026-11-24T21:38:12Z.
Understood — I'll hold this branch while #1670 and #1790 are reconciled, and noted on the single-register SDWA destination encoding. Happy to rebase any surviving supplemental draw or refusal cases if useful.
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-25T03:33:36Z.
Same collision as #1747/#1793, this time on the SDWA integer comparisons: this and #1670 both add a
v_cmp_*_sdwabranch totools/pixel_aot.py, andgit merge-tree pr1670 pr1923conflicts intests/pixel_aot_check.py,tests/rdna2_tools_check.pyandtools/scan_unsupported_shaders.py. Both aredirtyagainstmain.The two are not identical in what they cover:
v_cmp_(...)_(i32|u32)_sdwaonly;(i32|u32|i16|u16), so it also lowers the 16-bit comparisons;pixel_aot_check.pyagainst 198, plusform_coverage_check.py).So the union is worth more than either alone. @R0Y00, which one do you want to land? If it is #1670, the extra cases here are worth porting; if it is this one, the
i16/u16kinds need adding.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by KomaGuy on 2026-11-25T07:52:04Z.
Thanks for comparing #1923 and #1670! Note that #1790 ("shader: lower the 46 non-cmpx SDWA comparisons") has since been merged into
main, which already covers all 16 32-bit integer SDWA comparisons from this PR as well as the 16-bit integer and binary16/class forms.I'm keeping this branch held per @R0Y00's earlier note — happy to close it or extract any surviving extra refusal/draw cases if useful.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T12:43:58Z.
@KomaGuy could you rebase this branch onto current
mainand force-push?GitHub reports head
f81ecee3as conflicting withmain, so it cannot be merged as is.Files that conflict with current
main(b1a644ae):tests/pixel_aot_check.pytests/rdna2_tools_check.pytools/pixel_aot.pytools/scan_unsupported_shaders.pyCommands run locally:
Once it is rebased and CI is green it will be re-checked right away.
AI-assisted; commands listed were executed locally.
[PR #1923] shader: lower SDWA forms of 32-bit integer comparisons in pixel_aotto [PR #1923] tests: add supplemental SDWA 32-bit integer compare draws and refusal controlsImported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T13:38:44Z.
Review: COMMENTED
Review of head
db10c4aca4cb7e5b75f2c8c90d2fa2325826e665. Verdict: 0 P1, 0 P2. This is a clean result.Changes since my earlier review of
f81ecee3:tools/changes are gone; the lowering forv_cmp_*_{i32,u32}_sdwais already on main (tools/pixel_aot.py, theINT_COMPAREbranch). The PR now only adds tests.git merge-tree --write-tree origin/main HEADrc=0). The earlier conflict is resolved.Read of the diff (CMakeLists.txt, docs/experiments.md, tests/pixel_aot_check.py):
draw-sdwa-int-comparecovers all 16 i32/u32 predicates in four groups, with 41 single-channel negative controls that must report a mismatch.pixel_aot_sdwa_int_compare_<adapter>next topixel_aot_sdwa_cmp_<adapter>, with the same timeout, skip code and coverage record.Commands run locally (Linux):
git diff --check origin/main...HEAD: rc=0python3 tests/docs_links_check.py: pass (19 files, 457 links)python3 tests/bidi_controls_check.py: passpython3 -B tests/pixel_aot_check.py: rc=0tools/pixel_aot.py,asintselection changed from i32 to u32.check_sdwa_int_compare_loweringfailed. Killed.values[::-1]) andasintreplaced withasuint. The same check failed. Killed.git checkout -- ..Windows Server 2025 (D3D12 WARP):
ctest --preset dev -R '^(pixel_aot_sdwa_int_compare_warp|pixel_aot_sdwa_cmp_warp)$': 2/2 passed.--preset release: 2/2 passed.tests/vk_offscreen.py: ok.Build and test on Windows= SUCCESS.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by KomaGuy on 2026-11-25T13:30:55Z.
@tedin7 Rebased onto current
main(214ed093) and force-pusheddb10c4ac.Since #1790 already landed the production lowering and scanner entries for all 46 non-
cmpxSDWA comparisons (including the 16 32-bit integer forms and single-register destination enforcement), this rebased head drops the duplicatetools/pixel_aot.py,tools/scan_unsupported_shaders.py,tests/rdna2_tools_check.py, andtests/form_coverage_check.pychanges and keeps the supplemental per-predicate 32-bit integer draw coverage (pixel_aot_sdwa_int_compare_{warp,hardware}, 4 groups with 41 single-channel negative controls, pluscheck_binary) and additional refusal controls (low16VGPR source, pending sample/scalar loads, non-entry mask, SGPR pair destinations, float modifiers,clamp, whole-dworde32equivalence).Verified locally on Linux (
pixel_aot_check.py,docs_links_check.py,bidi_controls_check.py,rdna2_tools_check.py,git merge-treeclean,git diff --checkclean). Ready for re-check once CI finishes!Imported from R0Y00/Xbox2Windows. Originally posted by Makto94 on 2026-11-25T16:53:54Z.
Hardware run and Windows 11 MSVC build at head
db10c4ac.Environment: Windows 11 Pro build 26300.9974, Debug (
devpreset), MSVC 19.44.35230.0 (cl 14.44.35207), driver 32.0.16.2101 (the test does not print it; the value comes from another hardware test log on the same machine in the same session). The passing test does not print the adapter name; the only hardware adapter in this machine is an NVIDIA GeForce RTX 3070 Ti. The runs were serial (-j1); the hardware run was on an idle machine.Build:
cmake --build --preset devexited 0. This PR changes no C++ source.Tests:
ctest --preset dev --no-tests=error -j1 -R 'pixel_aot_sdwa_int_compare_warp' -V: 1/1 passed.ctest --preset dev --no-tests=error -j1 -R 'pixel_aot_sdwa_int_compare_hardware' -V: 1/1 passed (draw-sdwa-int-compare). 0 capability skips (77).offscreen_checkenables the D3D12 debug layer when it is available, and other runs of the same renderer on this machine printdebug_layer=enabled. The passing test log does not print the debug-layer state; debug-layer status for this run is therefore not stated.Not covered by this run: AMD hardware, and the LLVM 15 binary path (
pixel_aot_check.py binary).Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T17:19:44Z.
Review: APPROVED
Approved at head
db10c4ac. The change is test-only after the rebase:tests/pixel_aot_check.py, one CTest registration and one docs line. This adds an AMD run and a lowering mutant to @tedin7's review and @Makto94's RTX 3070 Ti run.Environment
--preset dev(Debug), DXC from SDK 10.0.26100.offscreen_checkbuilt atdb10c4ac.Commands executed
db10c4ac:pixel_aot_sdwa_int_compare_{warp,hardware}and the neighbouringpixel_aot_sdwa_cmp_{warp,hardware}pass, 4/4, with no skips.main(a96874a6, clean merge): the same 4/4 pass. The no-argument controls exit 0; they includecheck_sdwa_int_compare_lowering.Negative control on the lowering
The 41 wrong-word channels in the batches are the built-in controls. On top of those, I mutated the lowering itself: in
tools/pixel_aot.py, thev_cmp_*_{i32,u32}_sdwabranch changed fromvalues = [f"asint({word})" if kind == "i32" else word ...]tovalues = [word ...], so i32 compares become unsigned. The emittedi32_loandi32_hicompares then lose theirasint.Expected ['pass', 'pass', 'mismatch', ...], got ['mismatch', 'pass', 'mismatch', ...], so the firsti32_lorow is now wrong.I didn't run
binarymode locally. CI's LLVM 15 job ("Assemble and translate gfx1013 fixtures") passed at this head.Merge checks: required CI passed at this head ("Build and test on Windows" and both Linux jobs). The
/O2and coverage skips come from explicit workflow conditions. There are no unresolved review threads.Note for routing: #1670 is still open on the same forms with
tools/changes. Per @tedin7's earlier note, whichever lands second should reconcile its tests with these. That PR changes translation, so it stays with the maintainer.AI-assisted; commands listed were executed locally.