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

Open
github-bot wants to merge 1 commit from github-bot/gh-1039 into main AGit
Owner

@⁠YaBulochka on GitHub · 2026-11-24 17:06 UTC · original
YaBulochka:feat/fixtures-batch4 → main · +1543 −4 · 22 files · 1 commits · open

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:

  • cs_w32_sdst_exec (#218): all eight carry/sign-out ops under EXEC = 0xAAAAAAAA with uniform carrying operands; every sdst is 0xAAAAAAAA (16 set lanes | 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.
  • cs_global_atomic32_{int,rtn,float,x2} (#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.
  • cs_w32_clamp32 / cs_w32_clamp16 (#265): v_add/sub/subrev_nc_u32, v_add/sub_nc_i32, the 16-bit _nc_ forms and the six carry ops with clamp.
  • cs_w32_mad_denorm (#379/#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 (#381): all 16 predicates in both v_cmp_*_f64 and v_cmpx_*_f64, four predicates per eight-word dump.

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.)
**@⁠YaBulochka** on GitHub · 2026-11-24 17:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1039) `YaBulochka:feat/fixtures-batch4` → `main` · +1543 −4 · 22 files · 1 commits · open 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: - `cs_w32_sdst_exec` (#218): all eight carry/sign-out ops under `EXEC = 0xAAAAAAAA` with uniform carrying operands; every sdst is `0xAAAAAAAA` (`16` set lanes `| 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. - `cs_global_atomic32_{int,rtn,float,x2}` (#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. - `cs_w32_clamp32` / `cs_w32_clamp16` (#265): `v_add/sub/subrev_nc_u32`, `v_add/sub_nc_i32`, the 16-bit `_nc_` forms and the six carry ops with `clamp`. - `cs_w32_mad_denorm` (#379/#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` (#381): all 16 predicates in both `v_cmp_*_f64` and `v_cmpx_*_f64`, four predicates per eight-word dump. 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 - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] 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.)
Nine wave32 fixtures for the docs/design.md rows that had no GPU check:

- cs_w32_sdst_exec (#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} (#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 (#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 (#379/#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 (#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 98fa503f.

AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:34:45 +00:00
Author
Owner

@⁠robot00f on GitHub · 2026-11-25 16:07 UTC · original

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)

**@⁠robot00f** on GitHub · 2026-11-25 16:07 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1039#issuecomment-7167618054) 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)
This pull request has changes conflicting with the target branch.
  • runtime/test/shaders/check.py
  • scripts/run_gpu_tests.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1039/head:github-bot/gh-1039'
git switch 'github-bot/gh-1039'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1039'
git switch 'github-bot/gh-1039'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1039'
git switch 'github-bot/gh-1039'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1039'
git switch 'main'
git merge --squash 'github-bot/gh-1039'
git switch 'main'
git merge --ff-only 'github-bot/gh-1039'
git switch 'main'
git merge 'github-bot/gh-1039'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.