pixel_aot_dpp_extra_hardware fails on RX 9060 XT: the dpp8 lane rotation reads 0 #1024
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#1024
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@lantiumBot on GitHub · 2026-11-23 21:56 UTC · original
Summary
pixel_aot_dpp_extra_hardwarefails on an AMD Radeon RX 9060 XT at currentmain.pixel_aot_dpp_extra_warppasses on the same machine and build. The failing draw is the 32-bit wrap-around check forv_dot4c_i32_i8_dpp ... dpp8:[1,2,3,0,5,6,7,4]added with #423. A reduced shader shows the generated lane rotation returning 0 for a value that is the same in every lane.Identical in 9 of 9 runs of the test (5 at
44c7a7b, then 4 atcd87907: two in thedevpreset and two inrelease) and 4 of 4 runs of the probe.Environment
cd87907670e56cf9767d13c2248461b98aeedcec(main), clean tree,dev(Debug) andreleasepresets; first seen at44c7a7bWaveGetLaneCount()= 64)WaveGetLaneCount()= 4)Command
Expected
Both tests pass.
Observed
pixel_aot_dpp_extra_warppassed in every run.pixel_aot_dpp_extra_hardwarefailed incheck_dpp_extra_subnormal_draw, ondpp_dotc_wrap.cso(subprocess.CalledProcessError, renderer exit status 1). The draws before it in that test passed. First mismatch:Channel 2 is
v_dot4c_i32_i8_dpp v14, v22, v21 dpp8:[1,2,3,0,5,6,7,4]withv22 = s44 = 0xf8f8f8f8. Its accumulator0x80000010comes back unchanged, so the dot term was 0 instead of -32. Channel 3 is the_e32form of the same instruction on the same input and is correct, and channel 0 (quad_perm:[1,0,3,2], emitted asQuadReadAcrossX) is correct.Reduction
The translator emits this for the dpp8 rotation (
outnaming mine):Since
uis uniform,smust be0xf8f8f8f8whatever the lane order. Words of pixel (0, 0) from the renderer's R32G32B32A32_UINT target,ps_6_2,-Gis -denorm preserve, renderer from thedevpreset:uint4(u, u, u, u)f8f8f8f8x4f8f8f8f8x4uint4(l0, l1, l2, l3)(no select)f8f8f8f8x4f8f8f8f8x4QuadReadAcrossX/Y/Diagonal(u),uf8f8f8f8x4f8f8f8f8x4uint4(s, s, s, s)00000000x4f8f8f8f8x4uint4(s, l2, l3, q)00000000,f8f8f8f8,f8f8f8f8,00000000f8f8f8f8,f8f8f8f8,f8f8f8f8,00000000uint4(s, l0, l1, q)f8f8f8f8,f8f8f8f8,f8f8f8f8,00000000s = (q == 0u ? l1 : u),uint4(s, s, s, s)f8f8f8f8x4f8f8f8f8x4uin every arm, no quad readf8f8f8f8x4f8f8f8f8x4(The rows that export
qare not uniform by construction.)What was measured, and what was not
QuadReadLaneAtresults returns 0 at pixel (0, 0), anduint4(s, s, s, s)is not uniform across the 64 pixels. The same select is correct whenl0andl1are also written to the render target. EachQuadReadLaneAtalone, the select alone, and a one-arm select are correct.8868f7c.WaveGetLaneIndex() & 3uas the quad-local index is one candidate, although it cannot explain a 0 when every lane holds the same value.The other
_hardwareresults, from the full run at44c7a7b: 148 tests, 143 passed, 1 capability skip (bc7_mode6_multiblock_hardware), 4 failed. The other three failures are the rows already recorded for RDNA 4 (dxr_opacity_hardware,gpu_alias_lookup_writes_hardware,pixel_aot_comparisons_hardware, #958).quad_lane_probe.py (uncommitted)
AI-assisted (Claude Code - Fable 5.2); runs executed locally on the adapter above.
@MasterDomino on GitHub · 2026-11-23 22:00 UTC · original
Second RDNA 4 device on a different driver, plus the driver's ISA, which shows where the 0 comes from. Measurement only, no project change.
Environment
1002:7550), driver32.0.31044.1610.0.26100.9818cd87907,devpreset, DXC1.8.2502.11,-Gis -denorm preserve -T ps_6_2debug_errors=0 debug_warnings=0Same failure
pixel_aot_dpp_extra_hardwarefails with the same first mismatch (channel=2 expected_bits=7ffffff0 actual_bits=80000010) in every run on this adapter (devpreset, 3 full-suite runs and 2 single runs)._warppasses.I reduced it on the fixture's own generated HLSL rather than a hand-written shader, replacing only the final
return:QuadReadLaneAt(u, 0..3)f8f8f8f8×4s(the four-way select),u, fixture result00000000,f8f8f8f8,80000010f8f8f8f8,f8f8f8f8,7ffffff0, all equalThe driver's ISA
The
s-exporting shader compiled for gfx1201 through the installed driver with Radeon GPU Analyzer 2.15.0.30 (officialrga-windows-x64-2.15.zip, SHA-256 matched the release digest). The pipeline pairs it with a pass-throughvs_6_2, anR32G32B32A32_UINTtarget andRootFlags(ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT), CBV(b0), DescriptorTable(SRV(t0)), StaticSampler(s0). The DXIL is straight-line: fourdx.op.quadReadLaneAt.i32on the same value, then the select. The ISA, with scheduling waits removed (v1=WaveGetLaneIndex() & 3,s0=params[0].w):Each quad read has moved into the branch of the select arm that uses it, and the uniform value is put into a VGPR only in that branch's active lanes. Lanes of one quad take different arms, so every
ds_swizzlereads a source lane that is inactive in its branch and still holds an unrelated value. This explains the 0 at a uniform input, and the pixel-to-pixel variation. It also explains why youruint4(s, l0, l1, q)row is correct. Whenl0andl1are also used outside the select, those reads cannot move into its branches.Control: a source the compiler cannot prove uniform
This is the same generated shader with
uint dpp29_in = asuint(alu26) ^ (asuint(uv.x) & 0x80000000u);.uvis in [0, 1], so the value is unchanged.80000010,80000010,7ffffff0,7ffffff0on all 64 pixels, and the select isf8f8f8f8, in 3 of 3 runs. That is correct.v_mov_b32_dpp vN, v0 quad_perm:[n,n,n,n] row_mask:0xf bank_mask:0xf bound_ctrl:1and no branches.So the wrong result needs a source the driver treats as uniform. That matches your hypothesis of a driver code-generation defect. The emitted
WaveGetLaneIndex() & 3uquad index is not the cause, since the same HLSL with a non-uniform source is correct.Limits
offscreen_checkcreates. The runtime pattern matches it: individual reads correct, select wrong, varying source correct.AI-assisted.
@R0Y00 on GitHub · 2026-11-23 22:04 UTC · original
The current evidence points to the compiler moving quad reads into divergent select arms. The uniform word must survive every permutation, so this is separate from lane numbering. Please keep the existing test strict. As the next comparison, keep the four constant-index reads and replace the ternary with integer masks:
On the same adapter and compiler, compare the original and changed shaders in the existing wrap fixture and the reduction. Include a distinct four-lane input so a wrong rotation cannot pass, plus all 64 pixel words or a strict full-buffer count. Please note if the AMD compiler still introduces control flow. Use constant quad-lane indices throughout. #421 shares this path, so its hardware acceptance needs the outcome too.
@R0Y00 on GitHub · 2026-11-23 22:12 UTC · original
The general DPP mask change is available in draft #1030 at
364eb996. The strict DPP readback passed on WARP and RTX 4060 Laptop, and the compiled minimal helper contains four fixed quad reads and integer masks. Could either AMD reporter rerundraw-dpp-extraon this head with the original strict comparison? Please include the adapter, driver and mismatch count. The draft stays open for that hardware check.@lantiumBot on GitHub · 2026-11-23 22:30 UTC · original
Hardware check of draft #1030, then the comparison requested earlier. Data only, no project change.
Draft #1030 at
364eb996on the RX 9060 XTdraw-dpp-extrawith the original strict comparison, run from a detached worktree of the draft head. The renderer is the existingdevbuild, made atf8e80e5; no source of theoffscreen_checktarget differs betweenf8e80e5and364eb996, andee04692..364eb996touches onlytools/pixel_aot.pyanddocs/experiments.md, so the two trees differ in the translator alone.364eb996pixels=4096 channels=16384 max_absolute_error=0; all 18 wrong-reference and mutation controls of the mode caught364eb996ee04692(the draft's parent commit onmain)dpp_dotc_wrapfails at pixel (0,0),channel=2 expected_bits=7ffffff0 actual_bits=80000010ee04692dpp_extra_subnanddpp_dotc_wrap, and five float-target draws), so the count is 0 for every draw of the #1030 runs. The renderer stops at the first mismatching pixel, so for the failingee04692draw I can give the first mismatch only, not a count.364eb996the HLSL generated forDPP_DOTC_WRAP_BODYhas the four fixedQuadReadLaneAt(dpp29_in, 0..3)reads followed bydpp29_even/dpp29_topmasks, and no?:on thedpp29lines._hardwareset was not rerun on this head.The sections below were measured before the draft existed, with the mask line substituted by hand into the
ee04692output. They explain the result and answer the earlier questions.1. The wrap fixture, ternary against masks
The HLSL the translator emits for
DPP_DOTC_WRAP_BODY, unchanged, and the same text with only thedpp29_sline replaced by the mask form above (names prefixeddpp29_). Constant quad-lane indices in both. Fixture expectation80000010,80000010,7ffffff0,7ffffff0, then its clamped wrong reference. Three runs each.80000010,80000010,80000010,7ffffff02. Reduction, with a distinct word per lane
Each shader keeps the four constant-index reads and exports
uint4(s ^ want_s, v ^ want_v, q ^ lane, 0), wherelane = (x & 1) | ((y & 1) << 1)fromSV_Positionandwant_*is the[1,2,3,0]rotation computed from it. A correct rotation writes zero everywhere, so one all-zero expectation is a strict check of the whole target (the renderer compares 4096 pixels). Inputs:uniformisparams[0].w=0xf8f8f8f8;distinctis0xd0 | lane;distinct-dataisparams[1][lane]withparams[1] = (0xd0, 0xd1, 0xd2, 0xd3). With the distinct inputs a wrong rotation, or aqthat disagrees with the pixel position, cannot pass. Three runs each, identical.s=00000000v_cmpx, 4s_cbranch_execzds_swizzle_b32, each inside an armds_swizzle_b32, straight-linev_mov_b32_dpp quad_permv_mov_b32_dpp quad_permv_mov_b32_dpp quad_permv_mov_b32_dpp quad_permq ^ lanewas zero on every pixel that was compared, on both adapters, soWaveGetLaneIndex() & 3matched the position-derived quad lane here. That is an observation on fully covered quads (one full-target triangle), not a guarantee; each pixel checks the one read its lane selects, and helper lanes of partial quads are not exercised.3. Does the AMD compiler still introduce control flow?
Not with the masks. Radeon GPU Analyzer 2.15.0.30, DX12 mode,
gfx1200, pipeline asdraw_verified()builds it (tests/pixel_aot_vs.hlslasvs_6_0, its root signature, oneR32G32B32A32_UINTtarget). These are RGA's compiles forgfx1200, not captures from the running pipeline. In both listings below onlys_wait_*ands_delay_alulines are removed, and the prologue before the cbuffer load and the trailings_code_endpadding are cut.Uniform input, masks, from the load of
uto the export. Nov_cmpx, no branch, nov_cndmask:Uniform input, ternary, from the load of
uto the join. It has the structure of the gfx1201 listing above, with one mores_cbranch_execzafterL3:With a per-lane value the driver reads through
v_mov_b32_dpp ... quad_perm:[k,k,k,k]in both forms. The ternary then becomesv_cndmask, the masks stayv_and/v_and_or, and neither listing has a branch. So in these six shaders the failure appears only where the driver kept the branches and the source was a uniform value in an SGPR, materialized withv_mov_b32_e32inside each arm. I did not find a per-lane case where the driver keeps the branches, and I did not try a literal, a uniform value already in a VGPR, or reads that are also used outside the select, so I cannot separate "uniform source" from "branches kept" as the cause.On where the control flow comes from: with DXC 1.9.2602.17 the ternary is not straight-line DXIL. The four
quadReadLaneAtcalls are in the entry block, followed bybr i1onq == 0,br i1onq == 1, oneselectonq == 2and aphi. The unmodified fixture HLSL compiles to the same shape with this DXC. So here the branches come from DXC; the AMD compiler preserves them for the uniform source and sinks the four reads into them, and removes them for a per-lane source. The gfx1201 report above describes straight-line DXIL from DXC 1.8.2502.11; I did not run that DXC.Correction to my report above
The table in the issue has a column "all 64 px equal". The render target is 64x64: the case file holds 64 expected texels, each covering 8x8 pixels, and the renderer compares 4096 pixels. The column should read "whole target equal". The words and verdicts are unchanged.
Environment
offscreen_checkfrom thedevpreset, built atf8e80e5;tests/offscreen_check.cpp,tests/pixel_aot_render.cppandtests/pixel_aot_vs.hlslare unchanged from there throughee04692. Translator andtests/pixel_aot_check.pyfromee04692; the HLSL generated forDPP_DOTC_WRAP_BODYis identical atcd87907WaveGetLaneCount()read back as 64 in the probe of the report above, and the RGA listings are wave64-Gis -denorm preserve -T ps_6_2; RGA 2.15.0.30Limits
ds_swizzle, so theds_swizzlepath is exercised by the uniform input only. A per-lane value that reachesds_swizzlewas not found.quad_rotate_compare.py and quad_rotate_fixture.py (uncommitted)
AI-assisted (Claude Code - Fable 5.2); runs executed locally on the adapter above.
@R0Y00 on GitHub · 2026-11-23 22:34 UTC · original
Thanks for the same-adapter verification. The exact #1030 head passed three runs of the original strict fixture on RX 9060 XT, including all 18 controls, while its parent reproduced the channel-2 mismatch three times. The distinct-lane readback also checks the rotation independently. I've moved #1030 out of draft for CI. The RGA output is a useful explanation for this reproducer; it stays separate from the D3D12 readback. RX 9070 XT remains a useful independent check.
@R0Y00 on GitHub · 2026-11-23 22:36 UTC · original
Fixed by #1030 on main at
4bc40d05. The original RX 9060 XT reproducer passed three strict runs with zero mismatches, including its 18 controls. Please add any RX 9070 XT retest here; a remaining mismatch can reopen this report.@thepatrickworld on GitHub · 2026-11-23 22:42 UTC · original
RX 9070 XT retest of the fix
Third adapter, as asked in the closing note. I ran at
d1ea7d5, which merges4bc40d05(#1030) into the #419 branch, so the quad routing under test is #1030's.1002:7550, driver32.0.32029.2010,debug_layer=unavailable1.9.2602.17, presetdev,XBOX2WINDOWS_ADAPTER="AMD Radeon RX 9070 XT", clean treectest --preset dev -R "^pixel_aot_dpp_extra_hardware$", original strict comparison, three runspixel_mismatchlinesA verbose run of the same entry prints each draw as
pixels=4096 channels=16384 max_absolute_error=0, so the full buffer is compared, not a count of matching pixels.Same test on the parent commit
2d8a0cc, same adapter, same driver, same build settings: failed 3 of 3, channel 2,expected_bits=7ffffff0 actual_bits=80000010. So the fix holds on this adapter and the report can stay closed.For completeness:
pixel_aot_dpp_f16_hardwarepasses on the same head (2.47 s), and both warp entries pass (1.72 s / 2.68 s).AI-assisted; one machine, one adapter.