Skip to content

test(gpu): cover EXEC-masked sdst, global atomics, clamp, the mad flush and f64 compares - #1039

Open
YaBulochka wants to merge 1 commit into
ProjectLeonida:mainfrom
YaBulochka:feat/fixtures-batch4
Open

YaBulochka wants to merge 1 commit into
ProjectLeonida:mainfrom
YaBulochka:feat/fixtures-batch4

Conversation

@YaBulochka

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: carried over from the closed original repository (branch feat/fixtures-batch4); no new claim

Depends on: none. Overlaps #1012 (v_cmp_*_f64 / v_cmpx_*_f64 readback), #173 (ds_mskor, integer clamp), #373 (v_mac_legacy_f32) and #411/#413 (global atomics). Each of those rows also has a fixture here; whichever lands first, the other can drop the row it covered.

What and why

Nine wave32 GPU fixtures for docs/design.md rows that had no GPU check:

Registered in check.py (WAVE32_DUMPS, WAVE32_LANE_DUMPS, CS_DUMPS) and scripts/run_gpu_tests.py; tests/semantic/test_batch4_gpu_fixtures.py replays the disassembly in the interpreter and keeps the headers, CS_DUMPS and the runner table in step. The .s fixtures are generated from the author's hand-written .asm sources (not game dumps) and --check is clean. docs/design.md rows 218, 226, 265, 379, 380 and 381 and docs/shader_validation.md name the fixtures.

Tested

  • python3 -m unittest discover -s tests/semantic -p "test_batch4_gpu_fixtures.py": 3 tests, OK.
  • python3 -m pytest tests/test_shader_checks.py -x -q: 91 passed, 393 subtests passed.
  • python3 tests/semantic/regen_fixtures.py --check: clean.
  • GPU (the author's measurement, not repeated here): gfx1036, RADV RAPHAEL_MENDOCINO, Mesa 27.0.0-devel; 9/9 fixtures and 72/72 words exact through both runners.

AI-assisted: yes.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No new rule; the existing rows now name the GPU confirmation.)

…sh and f64 compares

Nine wave32 fixtures for the docs/design.md rows that had no GPU check:

- cs_w32_sdst_exec (ProjectLeonida#218): all eight carry/sign-out ops under
  EXEC = 0xAAAAAAAA with uniform carrying operands; every sdst is
  0xAAAAAAAA (word 272 = 16 lanes | lowest lane 1 << 8), so inactive
  lanes write 0 and active ones write their bit. The six *_co_* forms
  and both v_mad_*64 ops are covered, not just the two measured before.
- cs_global_atomic32_{int,rtn,float,x2} (ProjectLeonida#226): the first
  global_atomic fixtures in the corpus. add/sub/smin/umin/smax/umax/
  and/or; xor/swap/inc/dec and four glc returns; fmin/fmax on 1.0/2.0,
  a qNaN and -0/+0 plus cmpswap hit and miss; and/or/xor/swap_x2 on
  8-byte elements. SGPR-address form (vaddr, vdata, s[20:21]);
  global_atomic_cmpswap takes glc only with a single VGPR destination.
- cs_w32_clamp32 / cs_w32_clamp16 (ProjectLeonida#265): v_add/sub/subrev_nc_u32,
  v_add/sub_nc_i32, v_add/sub_nc_u16 and the six carry ops with clamp
  (the 16-bit forms use the _nc_ names: the gfx9 v_add_u16/v_subrev_u16
  do not assemble for gfx1013, and there is no v_subrev_nc_u16).
- cs_w32_mad_denorm (ProjectLeonida#379/ProjectLeonida#380): subnormal operand and subnormal
  product for v_mad_f32, v_mac_f32, v_mad_legacy_f32 and
  v_mac_legacy_f32, one clamp case and a non-flushing control.
- cs_w32_vcmp_f64 (ProjectLeonida#381): all 16 predicates in both v_cmp_*_f64 and
  v_cmpx_*_f64, four predicates per eight-word dump.

Registered in check.py, scripts/run_gpu_tests.py and
tests/semantic/regen_fixtures.py; tests/semantic/test_batch4_gpu_fixtures.py
runs the same disassembly in the interpreter and keeps the headers,
CS_DUMPS and the runner table in step. docs/design.md rows 218, 226,
265, 379, 380 and 381 and docs/shader_validation.md name the fixtures
and the measured result.

GPU: gfx1036 (RADV RAPHAEL_MENDOCINO, Mesa 27.0.0-devel), 9/9 fixtures
and 72/72 words exact through both runners (run_gpu_tests 211/226 pass,
15 skipped; check.py 194/197 pass, 3 skipped); the five pre-existing
test_loop_ballot_barrier failures in the semantic suite are also on
main 98fa503.

AI-assisted.
@robot00f

Copy link
Copy Markdown
Contributor

Independent verification on Windows + NVIDIA Pascal (discrete GPU with hardware shaderFloat64, 32-wide subgroups), complementing the RADV gfx1036 measurement in the description.

Tested 4589472436855ebdb2dac6b75e062a0d78bd319d merged cleanly onto origin/main (b0f3d399, 0 conflicts across all 22 touched/added files).

Host: Windows 10 Pro 10.0.19045, NVIDIA GeForce GTX 1050 Ti (Pascal class, 4 GB), driver 582.28, Vulkan 1.4.312 (VK_LOADER_LAYERS_DISABLE=~implicit~).

CPU & doc checks

  • python -I scripts/check_no_game_data.py on all 22 changed files → exit 0
  • python -I tests/semantic/regen_fixtures.py --check → clean
  • python -I tests/semantic/test_batch4_gpu_fixtures.py -v → 3/3 OK
  • python -I tests/test_shader_checks.py → 88/88 OK
  • python -I tests/test_docs_links.py (16/16) and python -I tests/test_docs_table_rows.py (2/2) → OK

GPU results (9/9 fixtures, 72/72 words exact, 3/3 deterministic runs)

Ran each of the nine new wave32 compute fixtures 3 times through scripts/run_gpu_tests.py --build runtime/build --filter <fixture> --require-pass, plus in the full run_gpu_tests.py pass and through runtime/test/shaders/build.py + runtime/test/shaders/check.py (9/9 translated, 9/9 spirv-val, 9/9 ok):

Fixture Dumped words (out[0..7]) Status
cs_w32_sdst_exec 272 272 272 272 272 272 272 272 3/3 PASS
cs_global_atomic32_int 2147483652 2 4294967291 3 3 4294967291 4026593280 4279238415 3/3 PASS
cs_global_atomic32_rtn 4294967295 3405705229 6 4 286331153 256 61680 43690 3/3 PASS
cs_global_atomic32_float 1065353216 1073741824 1077936128 0 67 66 85 85 3/3 PASS
cs_global_atomic32_x2 4026593280 252645135 4279238415 4294967295 1431655765 3989547399 2863315899 3435978205 3/3 PASS
cs_w32_clamp32 4294967295 0 0 2147483647 2147483648 3 12 0 3/3 PASS
cs_w32_clamp16 3735945215 3735879680 3735879680 4294967295 4294967295 0 0 0 3/3 PASS
cs_w32_mad_denorm 0 0 0 0 1088421888 0 0 0 3/3 PASS
cs_w32_vcmp_f64 12 12 12 12 0 0 15 15 (0xC 0xC 0xC 0xC 0 0 0xF 0xF) 3/3 PASS

One minor wording note (non-blocking): the commit message and PR body state that docs/design.md rows 218, 226, 265, 379, 380 and 381 also name the fixtures, whereas the diff only updates docs/shader_validation.md (which also keeps the PR conflict-free against docs/design.md churn).

AI-assisted: yes (Antigravity)

GTAVIB4GTAVI pushed a commit to GTAVIB4GTAVI/leonida that referenced this pull request Nov 26, 2026
…ions (DOC-SHADER-VALIDATION-DEDUP)

Repeated merges left "Packed 16-bit integer operations on RDNA2 (SHADER-302)" in the file four
times and "Pixel-shader ISA on the hardware" twice: 2d3369a (a merge of origin/main into
main) tripled SHADER-302 as SHADER-681's helper-lanes subsection came in, af1b3c9 merged
#3061 a second time, and #3499's --format table then landed in only one ps_oracle copy. One
SHADER-302 copy went in as a bare heading and its bullets in the middle of the RADV paragraphs.

Keep one of each, in the order a66a71f had them before the repeats, with the two real
additions in place: #3499's --format paragraph and table (0d58747) and SHADER-681's helper
lanes (58bc80c). Every kept line is main's own text; the only line dropped that is in no
remaining copy is the "Limits: ... mrt0 as RGBA32F only" line that 0d58747 itself replaced.
Deletions only, so ubiquitarianism#1037 and ubiquitarianism#1039 (which insert after the first SHADER-302 copy) still merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: coolpilot904 <andrewjsottile@icloud.com>
@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants