[PR #1036] test: GPU fixtures for masked SAD, v_swaprel and s_movrels #1073

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/1036
Author: @YaBulochka
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: feat/fixtures-batch2


📝 Commits (1)

  • 795ece6 test: GPU fixtures for masked SAD, v_swaprel and s_movrels

📊 Changes

11 files changed (+607 additions, -80 deletions)

View changed files

📝 docs/design.md (+45 -77)
📝 runtime/test/shaders/check.py (+7 -1)
➕ runtime/test/shaders/cs_movrels.asm (+59 -0)
➕ runtime/test/shaders/cs_msad_mqsad.asm (+62 -0)
➕ runtime/test/shaders/cs_swaprel.asm (+45 -0)
📝 scripts/run_gpu_tests.py (+10 -2)
➕ tests/semantic/fixtures/disasm/cs_movrels.s (+44 -0)
➕ tests/semantic/fixtures/disasm/cs_msad_mqsad.s (+41 -0)
➕ tests/semantic/fixtures/disasm/cs_swaprel.s (+33 -0)
➕ tests/semantic/test_msad_mqsad_fixture.py (+115 -0)
➕ tests/semantic/test_rel_addressing_fixture.py (+146 -0)

📄 Description

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

Depends on: none. Overlaps #364 (v_swaprel_b32, s_movrels_b32/b64), #171/#853 (cs_w32_pk_rel_ext: packed ints, the rel moves, ds_or/xor_b64), #179 (s_movrels_b64) and #36 (v_mqsad_u32_u8); this PR's fixtures are separate files with their own words and CPU fixtures, so whichever lands first, the other can drop the row it covered.

What and why

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

  • cs_msad_mqsad: v_msad_u8 and v_mqsad_u32_u8 — masked bytes, the sliding 64-bit windows and 32-bit accumulator wraps;
  • cs_swaprel: both M0 fields, ignored M0 bits and a self-swap;
  • cs_movrels: s_movrels_b32/b64, an overlapping destination and an unchanged SCC.

Each expected set of eight words is derived in the .asm header, registered in check.py (WAVE32_DUMPS, WAVE32_LANE_DUMPS, CS_DUMPS) and scripts/run_gpu_tests.py (the main table, the 64-bit exclusion and the skip list). tests/semantic/fixtures/disasm/*.s are the generated disassembly fixtures the semantic suite pins; they are the author's hand-written ISA programs, not a dump from the game. tests/semantic/test_msad_mqsad_fixture.py and test_rel_addressing_fixture.py replay the same words through the translator and spirv_mini_interp and keep the headers and both runner tables in step. docs/design.md rows for the three ops now name the fixtures.

Tested

  • python3 -m unittest discover -s tests/semantic: 6,175 tests, OK (3 skipped), on CPU in this environment.
  • python3 -m pytest tests/test_shader_checks.py -x -q: 91 passed, 333 subtests passed.
  • python3 tests/semantic/regen_fixtures.py --check: clean (the fixtures match the marked .asm sources).
  • GPU (the author's measurement, not repeated here): gfx1036, RADV, Mesa 27.0.0-devel, all three fixtures match their headers word for word.

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/1036 **Author:** [@YaBulochka](https://github.com/YaBulochka) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/fixtures-batch2` --- ### 📝 Commits (1) - [`795ece6`](https://github.com/ubiquitarianism/leonida/commit/795ece66e0401d61ef7d2624958f6539bd930cdd) test: GPU fixtures for masked SAD, v_swaprel and s_movrels ### 📊 Changes **11 files changed** (+607 additions, -80 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+45 -77) 📝 `runtime/test/shaders/check.py` (+7 -1) ➕ `runtime/test/shaders/cs_movrels.asm` (+59 -0) ➕ `runtime/test/shaders/cs_msad_mqsad.asm` (+62 -0) ➕ `runtime/test/shaders/cs_swaprel.asm` (+45 -0) 📝 `scripts/run_gpu_tests.py` (+10 -2) ➕ `tests/semantic/fixtures/disasm/cs_movrels.s` (+44 -0) ➕ `tests/semantic/fixtures/disasm/cs_msad_mqsad.s` (+41 -0) ➕ `tests/semantic/fixtures/disasm/cs_swaprel.s` (+33 -0) ➕ `tests/semantic/test_msad_mqsad_fixture.py` (+115 -0) ➕ `tests/semantic/test_rel_addressing_fixture.py` (+146 -0) </details> ### 📄 Description Claimed in the coordination issue as: carried over from the closed original repository (branch `feat/fixtures-batch2`); no new claim Depends on: none. Overlaps #364 (`v_swaprel_b32`, `s_movrels_b32/b64`), #171/#853 (`cs_w32_pk_rel_ext`: packed ints, the rel moves, `ds_or/xor_b64`), #179 (`s_movrels_b64`) and #36 (`v_mqsad_u32_u8`); this PR's fixtures are separate files with their own words and CPU fixtures, so whichever lands first, the other can drop the row it covered. ### What and why Three wave32 GPU fixtures for `docs/design.md` rows that had no Vulkan check: - `cs_msad_mqsad`: `v_msad_u8` and `v_mqsad_u32_u8` — masked bytes, the sliding 64-bit windows and 32-bit accumulator wraps; - `cs_swaprel`: both M0 fields, ignored M0 bits and a self-swap; - `cs_movrels`: `s_movrels_b32/b64`, an overlapping destination and an unchanged SCC. Each expected set of eight words is derived in the `.asm` header, registered in `check.py` (`WAVE32_DUMPS`, `WAVE32_LANE_DUMPS`, `CS_DUMPS`) and `scripts/run_gpu_tests.py` (the main table, the 64-bit exclusion and the skip list). `tests/semantic/fixtures/disasm/*.s` are the generated disassembly fixtures the semantic suite pins; they are the author's hand-written ISA programs, not a dump from the game. `tests/semantic/test_msad_mqsad_fixture.py` and `test_rel_addressing_fixture.py` replay the same words through the translator and `spirv_mini_interp` and keep the headers and both runner tables in step. `docs/design.md` rows for the three ops now name the fixtures. ### Tested - `python3 -m unittest discover -s tests/semantic`: 6,175 tests, OK (3 skipped), on CPU in this environment. - `python3 -m pytest tests/test_shader_checks.py -x -q`: 91 passed, 333 subtests passed. - `python3 tests/semantic/regen_fixtures.py --check`: clean (the fixtures match the marked `.asm` sources). - GPU (the author's measurement, not repeated here): gfx1036, RADV, Mesa 27.0.0-devel, all three fixtures match their headers word for word. 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#1073
No description provided.