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

Open
opened 2026-11-26 20:20:00 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1039
Author: @YaBulochka
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: feat/fixtures-batch4


📝 Commits (1)

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

📊 Changes

22 files changed (+1543 additions, -4 deletions)

View changed files

📝 docs/shader_validation.md (+34 -0)
📝 runtime/test/shaders/check.py (+23 -3)
➕ runtime/test/shaders/cs_global_atomic32_float.asm (+66 -0)
➕ runtime/test/shaders/cs_global_atomic32_int.asm (+71 -0)
➕ runtime/test/shaders/cs_global_atomic32_rtn.asm (+72 -0)
➕ runtime/test/shaders/cs_global_atomic32_x2.asm (+69 -0)
➕ runtime/test/shaders/cs_w32_clamp16.asm (+58 -0)
➕ runtime/test/shaders/cs_w32_clamp32.asm (+51 -0)
➕ runtime/test/shaders/cs_w32_mad_denorm.asm (+54 -0)
➕ runtime/test/shaders/cs_w32_sdst_exec.asm (+140 -0)
➕ runtime/test/shaders/cs_w32_vcmp_f64.asm (+173 -0)
📝 scripts/run_gpu_tests.py (+17 -1)
➕ tests/semantic/fixtures/disasm/cs_global_atomic32_float.s (+50 -0)
➕ tests/semantic/fixtures/disasm/cs_global_atomic32_int.s (+54 -0)
➕ tests/semantic/fixtures/disasm/cs_global_atomic32_rtn.s (+54 -0)
➕ tests/semantic/fixtures/disasm/cs_global_atomic32_x2.s (+56 -0)
➕ tests/semantic/fixtures/disasm/cs_w32_clamp16.s (+41 -0)
➕ tests/semantic/fixtures/disasm/cs_w32_clamp32.s (+36 -0)
➕ tests/semantic/fixtures/disasm/cs_w32_mad_denorm.s (+38 -0)
➕ tests/semantic/fixtures/disasm/cs_w32_sdst_exec.s (+117 -0)

...and 2 more files

📄 Description

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.)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1039 **Author:** [@YaBulochka](https://github.com/YaBulochka) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/fixtures-batch4` --- ### 📝 Commits (1) - [`4589472`](https://github.com/ubiquitarianism/leonida/commit/4589472436855ebdb2dac6b75e062a0d78bd319d) test(gpu): cover EXEC-masked sdst, global atomics, clamp, the mad flush and f64 compares ### 📊 Changes **22 files changed** (+1543 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `docs/shader_validation.md` (+34 -0) 📝 `runtime/test/shaders/check.py` (+23 -3) ➕ `runtime/test/shaders/cs_global_atomic32_float.asm` (+66 -0) ➕ `runtime/test/shaders/cs_global_atomic32_int.asm` (+71 -0) ➕ `runtime/test/shaders/cs_global_atomic32_rtn.asm` (+72 -0) ➕ `runtime/test/shaders/cs_global_atomic32_x2.asm` (+69 -0) ➕ `runtime/test/shaders/cs_w32_clamp16.asm` (+58 -0) ➕ `runtime/test/shaders/cs_w32_clamp32.asm` (+51 -0) ➕ `runtime/test/shaders/cs_w32_mad_denorm.asm` (+54 -0) ➕ `runtime/test/shaders/cs_w32_sdst_exec.asm` (+140 -0) ➕ `runtime/test/shaders/cs_w32_vcmp_f64.asm` (+173 -0) 📝 `scripts/run_gpu_tests.py` (+17 -1) ➕ `tests/semantic/fixtures/disasm/cs_global_atomic32_float.s` (+50 -0) ➕ `tests/semantic/fixtures/disasm/cs_global_atomic32_int.s` (+54 -0) ➕ `tests/semantic/fixtures/disasm/cs_global_atomic32_rtn.s` (+54 -0) ➕ `tests/semantic/fixtures/disasm/cs_global_atomic32_x2.s` (+56 -0) ➕ `tests/semantic/fixtures/disasm/cs_w32_clamp16.s` (+41 -0) ➕ `tests/semantic/fixtures/disasm/cs_w32_clamp32.s` (+36 -0) ➕ `tests/semantic/fixtures/disasm/cs_w32_mad_denorm.s` (+38 -0) ➕ `tests/semantic/fixtures/disasm/cs_w32_sdst_exec.s` (+117 -0) _...and 2 more files_ </details> ### 📄 Description 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.) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1077
No description provided.