Repository navigation
Conversation
|
Independent GPU verification — verified, no regressions found (AI-assisted, verified by a Devin subagent on real hardware; no game data used). Tested head Semantic suite (CPU):
AMD Radeon iGPU (gfx1035, driver 24.10.24) —
NVIDIA RTX 4070 SUPER —
The stricter whole-word waterfall proof ( |
…ADER-WATERFALL-FULL-WORD) The tier B waterfall proof says that every lane the compare selects holds the word v_readfirstlane read. cmp_tag took any v_cmp_eq_* of the scalar against its VGPR as that proof. A float equality selects +0.0 and -0.0 together, and a 16-bit or SDWA compare ignores part of the word, so the wave runs lanes with another word under the first lane's scalar while a 32-lane half reads its own first lane: the program is not partition invariant, and was recorded as tier B. Take only v_cmp_eq_u32 / v_cmp_eq_i32 (and the v_cmpx forms), without SDWA, DPP, modifiers or abs/neg on a source. Anything else is no waterfall and the loop is tier C. A 64-bit equality is not taken either, which is conservative. tests/semantic/test_wave64_halves.py runs the loop on 64 lanes and on two waves of 32 with two words that compare equal in part: with v_cmp_eq_f32, v_cmp_eq_u16, v_cmp_eq_i16, v_cmp_eq_u32_sdwa, v_cmpx_eq_f32 and v_cmpx_eq_u16 the runs differ and the tier is C; with v_cmp_eq_u32, v_cmp_eq_i32 and their v_cmpx forms they are equal and the tier stays B. With the tools of the base commit the six partial compares report tier B. The semantic suite and the Python CI files add no failing file. The corpus census was not re-run and no GPU was used. The restriction follows Marvisak/VIctory's waterfall check (GPL-3.0, commit b1c8306), which takes an unmodified u32 or i32 equality and also a 64-bit one. AI-assisted (Claude Code). Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2ed5ced to
2e13336
Compare
|
Thanks for the independent GPU runs. #984 brought the whole-word classifier into main. I rebased onto AI-assisted. |
Rebased onto
bfef489cat2e133360. Main already has the classifier from #984. This diff adds the expanded whole-word comparison tests and clarifies the contract. The focused suite passed 128 tests. Earlier GPU results refer to the earlier head.Claimed in the coordination issue as: SHADER-WATERFALL-FULL-WORD (claim).
Part of the split of #984 into small pull requests.
Depends on: none
Overlaps: #984 is the parent integration. #1257 (open,
TEST-WATERFALL-DESCRIPTOR) adds a CPU test that each lane fetches from its own descriptor-table entry in a waterfall loop; the integration's own table-execution test, its fixture and the interpreter support it needs are therefore not in this pull request, which keeps only the proof fix and its regression test. #805, #1091, #187 and #508 (open) also edittools/wave64_halves.py; none of them changes the waterfall compare incmp_tag(#1091 adds a method just above it).What and why
tools/wave64_halves.pydecides whether a wave64 vertex, pixel or geometry shader gives the same results when its wave is cut into two 32-lane halves, and the translator records the answer aswave64_graphicsA/B/C. Tier B includes the waterfall loop: read a word from the first active lane, select the lanes that hold the same word, run the body with that scalar, retire them, repeat. The proof is that every selected lane holds the word that was read.cmp_tagaccepted anyv_cmp_eq_*of the scalar against the VGPR it was read from as that proof. That is only true for an equality of the whole unmodified 32-bit word:v_cmp_eq_f32takes +0.0 and −0.0 as equal. With lanes 0..31 at +0.0 and lanes 32..63 at −0.0, the wave runs all 64 lanes with the bits of lane 0, while the second half reads −0.0 from its own first lane.v_cmp_eq_u16/_i16and an SDWA compare of the low halves ignore the high half in the same way.In each case the two runs differ, and the shader was still recorded as tier B, the tier the module describes as invariant by construction.
The change takes only
v_cmp_eq_u32andv_cmp_eq_i32(and theirv_cmpxforms,_e32or_e64), with no SDWA or DPP, no modifier and noabs/negon a source. Any other compare tags no waterfall, so the loop is tier C with the reasonscross-laneandtainted-exec. A 64-bit equality is no longer taken either; that is conservative, since it does imply the low word.The restriction follows Marvisak/VIctory's waterfall check (GPL-3.0, commit
b1c8306), which takes an unmodifiedu32ori32equality and also a 64-bit one; it is credited in the source and in the contract row.What this does not do
wave64_graphics), a warning by default and an error only with--wave64-graphics error.docs/design.md(35 waterfall idioms) were not re-run.v_readfirstlane,v_cmp_eq_u32,s_and_saveexec_b64, a body, EXEC restored) is recorded as tier B with the idiomwaterfallalthough the lanes outside the first lane's group are handled by a half and not by the wave (64 lanes against two waves of 32 differ). That is the same on the base commit and needs its own change.Tested
Linux (CachyOS, kernel 7.3.5), Python 3.14, SPIRV-Tools v2026.4. Based on
6293c1c4f.python3 -I tests/semantic/test_wave64_halves.py: 127 tests pass. The newtest_waterfall_needs_whole_word_integer_equalityruns the loop on the wave interpreter with 64 lanes and with two waves of 32, lanes 0..31 holding one word and lanes 32..63 another. Forv_cmp_eq_f32andv_cmpx_eq_f32(words 0 / 0x80000000) and forv_cmp_eq_u16,v_cmp_eq_i16,v_cmpx_eq_u16andv_cmp_eq_u32_sdwawithWORD_0selects (words 0 / 0x10000) the wave writes 0 to all 64 lanes, the halves write the second word to lanes 32..63, and the tier is C. Forv_cmp_eq_u32_e32,v_cmp_eq_i32_e32,v_cmp_eq_u32_e64,v_cmpx_eq_u32_e32andv_cmpx_eq_i32_e32on the same words both runs give each lane its own word and the tier is B. Thev_cmpxloops narrow EXEC from a copy saved at the head of the loop.LEONIDA_TOOLS_DIR=<export of 6293c1c4f>/tools): 6 failing subtests, the six partial compares, each'B' != 'C'after the two runs were seen to differ. The five integer controls pass there too.python3 -I scripts/run_semantic_tests.py tests/semantic -p 'test_wave64_halves*.py' -j 1: 175 tests, OK.python3 -I -m pytest -q tests/test_wave64_halves_fixtures.py: 10 passed (the*_w64_*GPU fixtures keep their tiers; their three waterfalls compare withv_cmp_eq_u32_e32).tests/test_*.pyoutsidetests/semanticwithpython3 -I <file>, or pytest where it has no__main__;python3 -I scripts/run_semantic_tests.py tests/semantic -j 2; the tracked-file guard) on the committed tree: one failing file,tests/test_imhex_patterns.py, which fails on the base commit too (the same 6 of its 9 tests). Semantic suite: 470 files, 6,169 tests, 0 files failed (base: 470 files, 6,168 tests, 0 failed).python3 -I scripts/check_no_game_data.py: passes.Not run: a GPU (
runtime/test/shaders/w64_graphics.py), the corpus census, native Windows or macOS, the runtime build (no C++ or build file changes).GPUs tested: none (wave interpreter on the CPU only).
AI-assisted: yes (Claude Code). The numbers above come from runs on the machine named.
Checklist
6293c1c4f, one commit.docs/design.md("Wave64 graphics: the waterfall compare"), with how it was checked and what is not measured.🤖 Generated with Claude Code