Commit Graph

37 Commits

Author SHA1 Message Date
b2a7dabd10 Merge main and preserve tier C reference checks across subgroup widths 2026-11-28 13:38:47 +05:00
23e51d3be8 Merge pull request #1191 from titoreinaldo/contrib/w64-invariant-checks
[TEST-W64G-TIER-C-INVARIANTS] Check known graphics outputs before skipping or saving a reference
2026-11-28 08:47:26 +01:00
d64f12b53d Merge main into TEST-1700, wave32 VS halves wording (#804)
Conflict in docs/design.md: this branch rewords the "Wave64 graphics: partition invariance
(SHADER-10)" row; main left that row as it was and added the SHADER-W64-WQM-UVOTE row after it.
Kept this branch's SHADER-10 row and main's new row below it. runtime/test/shaders/w64_graphics.py
merged without conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:36:18 -05:00
49eca8d5ed w64 graphics: validate known Tier C outputs before skipping or saving
Check partition-invariant words against the fixture expectation even when both widths or the saved reference share the same wrong value. Reject an invalid single-width draw before it can replace a reference.

Reproduced with synthetic fragment readbacks on Windows on an RTX 3070 and Intel Arc Graphics. Codex-assisted.
2026-11-24 19:41:50 +00:00
f03418595c wave64_halves: a vote on a scalar compare under whole-quad EXEC is no lane vote (SHADER-W64-WQM-UVOTE)
A pixel shader that needs derivatives starts with s_wqm_b64 exec, exec, and LLVM branches on wave-uniform conditions
inside that region as it does anywhere: v_cmp_* sN of scalars, s_and_b64 vcc, exec, s[N:N+1], s_cbranch_vccnz.
SHADER-10 took that for no lane vote only while EXEC was the launch mask, so here it was unsafe-vote-branch.

A compare of immediates and scalars is the same in every lane, so its mask is every lane of EXEC or none; the whole
quads of the launch mask have a lane in every 32-lane half that runs (a quad never straddles the halves). The analysis
carries "EXEC is the whole quads of the launch mask" as a dataflow fact, set by s_wqm_b64 exec, exec under the launch
mask and dropped by every other EXEC write. VGPR sources stay refused there, and so does a path on which a scalar was
read out of a uniform VGPR from a lane the launch mask may not have written.

Corpus (1.0.2.1, all 26,503, on top of SHADER-W64-SDST-PAIR): 452 pixel shaders go from tier C to A, none moves the
other way: C 7,741 to 7,289.

Tests: tests/semantic/test_wave64_halves_wqm_uvote.py; GPU fixture ps_w64_a_wqm_uniform_vote (RTX 4070 Ti, 620.70.06).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 11:47:35 -06:00
fc5d08b8c6 Compare tier C references against a verified 32-wide draw (TEST-W64G-REF-DEFAULT) 2026-11-24 22:23:26 +05:00
a213a232b8 w64_graphics, design: add the GFX1201 measurement and explicit wave starts from old upstream PR 7354 (TEST-1700)
Combines old upstream PR 7354 into this change: the wave64 and wave32 VS
waves start at vertices 0, 64, 126, 190 ... and 0, 32, 64, 96, 126 ...,
and on an RX 9070 XT (GFX1201, RDNA4, RADV Mesa 26.2.6) every wave32 wave
lies inside one half of a wave64 wave, measured on GFX1201 by sperm in
old upstream PR 7354. Both "GFX12 not measured" clauses now cite that
measurement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 08:58:53 -05:00
91adf9e317 w64_graphics, design: the wave32 VS run is the halves of the wave64 waves, not a repacking (TEST-1700)
vs_w64_c_lane_id over 960 vertices on RADV Mesa 26.3.1 gives the same
packing on a gfx1036 iGPU (Raphael) and an RX 7900 XTX (NAVI31, RDNA3):
waves of 64, 62, 64, 62 ... at wave64 and 32, 32, 32, 30 ... with
gewave32, a period of 126 vertices both ways, and every vertex's wave32
lane equal to its wave64 lane & 31. So the 32-lane run is the cut into
halves, not "a repacking ... a stricter test". Say what was measured,
on which devices, and note the lane ^ 2 trap for new VS fixtures.

Found by sskver. w64_graphics.py: 29/29 ok on both GPUs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 08:57:33 -05:00
Luc
2191b71de6 w64_graphics: a vk_harness timeout fails that fixture; the rest still run (#9764)
A draw that hung past subprocess.run's 120 s timeout raised TimeoutExpired out
of main(), so a multi-fixture run ended in a traceback and never reported the
fixtures after it. main() now reports "vk_harness timed out after 120 s" for
that fixture, goes on, and still exits 1. The test drives main() and check()
with a vk_harness that times out on its first call.

Fixes old #9764
2026-11-24 07:30:44 +05:30
f6998eb578 Validate Wave64 graphics results before saving references 2026-11-23 17:07:32 -05:00
82c6e08dd5 w64_graphics: fail when a subgroup probe fails (#4890)
Squash-merged after review of PR #4890 - TEST: fail wave64 graphics checks on subgroup probe errors
2026-11-23 08:10:58 -06:00
326417ae3e Merge pull request #4601 from plentilha
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:16:19 -05:00
3de1652947 Merge pull request #4138 from tedin7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:11:39 -05:00
c11eec4e7c Merge pull request #2998 from kapitche
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:06:36 -05:00
7680301628 Merge remote-tracking branch 'origin/main' into w64-idea
# Conflicts:
#	docs/design.md
#	runtime/test/shaders/w64_graphics.py
#	tests/semantic/test_wave64_halves.py
#	tests/test_wave64_halves_fixtures.py
#	tools/wave64_halves.py
2026-11-23 04:50:52 +01:00
9eee64d8a7 wave64_halves: allow tainted lane selector on uniform v_readlane_b32 (SHADER-314) 2026-11-23 00:02:50 -03:00
d76b715f7e w64_graphics: skip fixtures that need many live lanes on the measured fragment width (ps_live_width), not the reported subgroup size 2026-11-22 19:38:57 -05:00
8c15367820 wave64_halves: a vote on a wave-uniform compare is not a lane vote (new SHADER item) 2026-11-23 00:33:30 +01:00
d42f8b4631 Merge pull request #2674 from Linnard Alex Brown Jr.
# Conflicts:
#	docs/design.md
2026-11-22 16:59:33 -05:00
6f01e2d6ea Merge pull request #3265 from wxrrry 2026-11-22 15:16:19 -05:00
50ccfe4cf6 Merge pull request #2997 from Vonsek 2026-11-22 15:13:55 -05:00
d65ef538b5 Merge pull request #2260 from Linnard Alex Brown Jr.
# Conflicts:
#	docs/design.md
2026-11-22 15:10:26 -05:00
cc4231d34b wave64_halves: tier A for the early exit of a pixel kill
A wave64 pixel shader that kills pixels with `s_andn2_b64 live, live, exec/vcc` and branches with
`s_cbranch_scc0` to a block that only empties EXEC from that mask, exports and ends was tier C
unsafe-vote-branch. It is exact on 32-wide subgroups: a half whose live mask is empty writes nothing in
the exit and discards its pixels, and in the wave its lanes stay off to the end.

The rule accepts it only when:
- the branch tests the mask's own "not empty": the last SCC writer is a 64-bit logic op into that mask
  (or s_cmp_lg_u64 mask, 0) and nothing rewrites the mask before the branch (or vccz/vccnz);
- the exit only sets EXEC from that mask (or 0), exports and ends: no other code, store or successor;
- the run side narrows EXEC into the mask's whole quads before anything but mask arithmetic runs and
  keeps it inside on every path, loops included (a must-dataflow over narrowings and copies, unions and
  s_wqm of registers known to be inside);
- no `exp ... vm` can run before the vote (a latched vm export would keep the pixels alive in the wave).

Also: s_mov_b64 / s_cselect_b64 of a lane mask no longer tag SCC as a vote on their destination (they
do not write SCC); the branch could take a lane-count compare for a vote and come out tier A.

Tests: classification of the kill (wqm + s_and, v_cmpx + s_mov, direct s_and / s_mov / s_wqm exec,
exit through exec 0, an if/endif after it) and near misses (exit with code, a store, an SGPR write,
another mask, a jump back; a run side that does not narrow or widens again; the mask rewritten after
the vote; SCC = mask == 0; a vm export before the vote; a shared exit), and 64 vs 2x32 vertex runs.
GPU fixture ps_w64_a_discard: RX 580 (RADV, required size 64) and RTX 5070 (32, against the 580
reference) equal the derived words.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:03:30 -05:00
c0012240eb test/w64_graphics: reject unknown fixture names with exit 1 (TEST-649) 2026-11-22 22:56:48 +03:00
4b71b65588 fix(test): check stable wave64 reference words
Across-device Tier C checks could pass while a partition-invariant export was wrong. Require the stable words to match the saved wave64 run.
2026-11-22 20:02:54 +01:00
10b88e8580 TEST-433: the skip message states the measured cause (16 live lanes behind a reported 32)
Measured by kapitche: Intel UHD 770 reports gl_SubgroupSize 32 in the fragment stage but runs 16 live invocations, so tiers A and B (32 or 64 live lanes) cannot hold. The skip keeps its condition (minimum subgroup below 32); deriving it from a measured live width is a follow-up.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:01:33 -05:00
654c5360af Revert "TEST-433: skip only devices whose subgroups are all narrower than 32 (the Intel 16-wide premise was wrong)"
This reverts commit e215380e1e.
2026-11-22 14:01:12 -05:00
e215380e1e TEST-433: skip only devices whose subgroups are all narrower than 32 (the Intel 16-wide premise was wrong)
The reporter corrected the probe: Intel UHD 770 reports a subgroup size of 32, so its tier A failures have an unknown cause and must not be skipped; only a device whose largest subgroup is below 32 (llvmpipe) is.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:00:50 -05:00
093b6c622a TEST-433: skip the tier A/B pixel fixtures where the fragment subgroup is narrower than 32 and cannot be required
Intel UHD 770 reports fragment subgroup 8..32 but runs pixel shaders 16 wide and cannot be held to 32, so reads
across 16 lanes (permlane, swizzle, bpermute) fail there. Tiers A and B mean exact on 32- or 64-lane subgroups.

The SHADER-10 row also loses the stale text the merge of #2260 left in it: the pre-TEST-319 A list (bpermute and
permlane "not GPU-tested here"), "Corpus coverage is not measured here", "the corpus ones are wave32", "geometry
shaders are not tested" and a repeated sentence, which the census and the GS fixtures (TEST-251) now contradict.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:59:11 -05:00
13c5ee6209 Merge pull request #2550 from comp 2026-11-22 13:16:05 -05:00
03d390fb95 Reject unexpected output changes in cross-device Tier C wave64 checks 2026-11-22 10:25:54 -07:00
8f1370ce4a Merge pull request #2260 from Linnard Alex Brown Jr.
# Conflicts:
#	docs/design.md
2026-11-22 11:43:33 -05:00
03b38d8419 TEST-319: an RX 580 (one subgroup size, 64) is the 64-lane reference; all 24 fixtures checked on an RTX 5070 against it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:24:13 -05:00
fd2050071a TEST-251: GPU checks of wave64 geometry shaders, and no false tier C for a GS's ring address
rdna2spirv maps a legacy GS's LDS write to an output slot from its
offset alone and drops the VGPR address (the lane's GSVS area), but
wave64_halves read that address as the store's data, so a GS whose lane
id only forms its GSVS base was tier C lane-id. It now checks only the
data operands of a GS ds_write.

w64_graphics.py draws gs_w64_a_ring and gs_w64_c_lane_id at wave64 and
wave32 (RADV_PERFTEST=gewave32), build.py builds gs_* fixtures with
gs_tri's signatures, docs/testing.md explains how to run and extend the
wave64 graphics checks, and docs/design.md records the rule and that the
corpus GS are written for wave64. Checked on an RX 9070 XT (GFX1201) and
a Ryzen 9800X3D iGPU (GFX1036), RADV Mesa 26.3.1: 23/23.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:03:34 +03:00
56998dcd23 TEST-319: GPU fixtures for wave64 graphics permutes; lane-id bpermute addresses are tier A
ps_w64_a_permlane, ps_w64_a_swizzle and ps_w64_a_bpermute check v_permlane16/x16, ds_swizzle
(quad-permute, swap, broadcast) and ds_bpermute in a wave64 pixel shader with words that only
depend on the 2x2 quad layout of fragment lanes. They give the derived words on an RTX 5070.

wave64_halves.py called a ds_bpermute/ds_permute whose address comes from the lane id tier C
(lane-id). The id is 0..63 in the wave and 0..31 in a half, equal modulo 32 lanes, and a wave64
permute uses address bits 2..6 of its half only, so an address that is the same modulo 128
bytes reads the same lane. The classifier now tracks that modulus through sums, differences,
bitwise ops with invariant values and left shifts; shifts by less than 2, right shifts and the
low count alone stay tier C. Classification and wave-interpreter tests (64 lanes against two
waves of 32) cover the rule and its near misses.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:45:05 -05:00
2828e0c892 TEST-251: GPU checks of wave64 vertex shaders split into two 32-lane halves
RADV runs the VS stage as wave64 by default and as wave32 with
RADV_PERFTEST=gewave32, so w64_graphics.py now draws seven vs_w64_*
fixtures (tiers A, B and C) both ways and compares the words each vertex
stores to the heap. vs_w64_c_lane_id is the probe that the wave size
changed. vk_harness gets VKH_VERTICES to draw enough vertices to fill
waves. Checked on an RX 9070 XT (GFX1201) and a Ryzen 9800X3D iGPU
(GFX1036), RADV Mesa 26.3.1: 21/21.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:36:08 +03:00
ce305ec6b3 Translator: wave64 VS/PS/GS on 32-wide subgroups when the halves can't tell (SHADER-10)
tools/wave64_halves.py classifies each wave64 VS/PS/GS by partition
invariance: A exact as translated, B exact by construction (waterfall loops,
wave-aggregated atomics up to slot order, readfirstlane/readlane of values
that are the same in every lane), C not exact (lane counts/ranks/ids,
readlane of varying data, stale scalars behind votes, masks as data, ...).
index.json gets wave64_graphics, wave64_graphics_reasons and
wave64_graphics_idioms; --wave64-graphics warn|error|off (error refuses
tier C). One rewrite: readlane of a proven-uniform VGPR reads the own copy.
--census prints tier counts from an index.json. ps_w64_* fixtures,
w64_graphics.py (fragment subgroup size required 64 vs 32) and semantic
tests; vk_harness gets VKH_HEAP_DUMP and a subgroup-size report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:03:37 +01:00