Repository navigation
tests: read back s_pack_ll/lh/hh and s_absdiff_i32 on D3D12 WARP and hardware (follow-up to #2512) - #2523
Merged
Conversation
…hardware Review request on R0Y00#2512: compile the HLSL that gfx2hlsl emits for each op into one cs_6_0 shader with DXC and run it through offscreen_check --raw-uav-dump. The sources are loaded from the UAV fill pattern and XORed, so DXC cannot fold them; D and, for s_absdiff_i32, SCC are stored and compared with the integer references. Cases: absdiff (0x80000000, 1) and its reverse, (0x7fffffff, 0x80000000) and its reverse, equal sources, 0 and 0xffffffff; packs with the <<16 and 0xffff0000 edges, both orders. The operand region must come back unchanged. Registered as startup_gfx2hlsl_pack_absdiff_dispatch_warp and _hardware (skip 77). AI-assisted.
tedin7
reviewed
Nov 25, 2026
tedin7
left a comment
Collaborator
There was a problem hiding this comment.
Review of head 0aa0986 (comment only).
Checked:
- The new
dispatchmode builds a cs_6_0 shader from the lines gfx2hlsl really emits, XORs the loaded sources so DXC cannot fold them, and compares D (and SCC fors_absdiff_i32) with the integer references already in the file. The operand region is checked unchanged. Real D3D12 readback, not a string check. - Edge cases from the #2512 review are covered (INT_MIN, 0x7fffffff/0x80000000 both orders, equal, zero, 0xffff0000/0x0000ffff masks, both orders for packs).
- Dump size is padded to 16-byte rows as
--raw-uav-dumprequires. Exit 77 maps to SKIP in CMake for both adapters. Sibling check is registered next to the existing test. - No other open or merged PR covers this readback slice (searched s_absdiff_i32 / pack).
Commands run (Linux, worktree of the exact head):
python3 -B tests/startup_gfx2hlsl_pack_absdiff_check.py: okpython3 tests/docs_links_check.py: okpython3 tests/bidi_controls_check.py: okgit diff --check origin/main...HEAD: clean
Not run here: the dispatch test needs DXC and D3D12, so it is verified in the Win2025 WARP run that follows.
AI-assisted; commands listed were executed locally.
Collaborator
|
Win2025 WARP receipt for head 18f3d72 after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
AI-assisted; commands listed were executed locally. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2512, which merged before I pushed this. It adds the D3D12 readback @tedin7 asked for in his review of
s_pack_ll_b32_b16,s_pack_lh_b32_b16,s_pack_hh_b32_b16ands_absdiff_i32. Part of #1723.tests/startup_gfx2hlsl_pack_absdiff_check.py dispatch <dxc> <offscreen_check> <adapter>(the no-argument mode is unchanged):offscreen_check --raw-uav-dump.s_absdiff_i32. Both are compared with the integer references already in the file.--raw-uav-dumprequires.startup_gfx2hlsl_pack_absdiff_dispatch_warpand_hardware, withSKIP_RETURN_CODE 77, next to the existing test.Cases (8 absdiff + 3 x 9 pack = 35 per adapter), covering the edges named in the review:
(0x80000000, 1)and its reverse,(0x7fffffff, 0x80000000)and its reverse,(5, 5),(0, 0),(0xffffffff, 0),(3, 10);0xffffffff,0x0000ffff,0xffff0000,0x00010000/0x0000ffff,0x12345678/0x9abcdef0and0/0xffffffff, in both orders where they differ, covering<< 16and& 0xffff0000.Results at this branch's head (main
396e7e2plus this commit), Windows 11, Python 3.14, DXC from the Windows SDK 10.0.26100, debug layer not enabled:python -B tests/startup_gfx2hlsl_pack_absdiff_check.py: ok.... dispatch <dxc> <offscreen_check> warp: 35/35 cases, Microsoft Basic Render Driver.... dispatch <dxc> <offscreen_check> hardware: 35/35 cases, NVIDIA GeForce RTX 5080 (driver 32.0.16.2101).Mutations in
tools/startup/gfx2hlsl.py. Each made both dispatch runs fail; the mismatch counts are per adapter:s_absdiff_i32withoutasint: 4;s_absdiff_i32SCC inverted: 8;s_pack_llshifting by 15: 7;s_pack_lhmasking0x7fff0000: 4;s_pack_hhshifting by 15: 7.AI-assisted.