[PR #36] GPU fixture for v_mqsad_u32_u8 through the translated path (TEST-644) #89

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

📋 Pull Request Information

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

Base: main ← Head: old-pr/4669


📝 Commits (3)

  • bfdb0bb GPU fixture for v_mqsad_u32_u8 through the translated path (TEST-644)
  • 2590c16 docs/design.md: v_mqsad_u32_u8 GPU-checked on RDNA2, Blackwell and MoltenVK too
  • 9339b41 Merge main into test/mqsad-gpu

📊 Changes

4 files changed (+52 additions, -4 deletions)

View changed files

📝 docs/design.md (+1 -1)
📝 runtime/test/shaders/check.py (+3 -1)
➕ runtime/test/shaders/cs_w32_mqsad_u32.asm (+44 -0)
📝 scripts/run_gpu_tests.py (+4 -2)

📄 Description

Carried over from old PR 4669 by rafaelpssz in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/4669, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
rafaelpssz: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

TEST-644, the v_mqsad_u32_u8 part (claim). The ds_wrxchg2 part is already run by cs_w32_new_ops.asm on main, and the open #3208 and #2003 add fixtures for it, so it is left to them.

What

The v_mqsad_u32_u8 row of docs/design.md was hardware-verified on RDNA2 (native, through hw_oracle), but the translated path had never run on a GPU (Not GPU-verified). This adds the fixture:

  • runtime/test/shaders/cs_w32_mqsad_u32.asm runs v_mqsad_u32_u8 twice. S0 = 0x88776655_44332211. S1 = 0x40005000, whose bytes 0 and 2 are zero, so the masked SAD has to skip them.
    • A, in place (D = S2): S2 = {0xFFFFFFF0, 1, 2, 3}, so accumulator 0 wraps at 32 bits.
    • B, D over S0 (v[2:5] over v[2:3]): this only gives the expected words if every source is read before the first write, as the row says.
  • The expected words are derived step by step in the .asm header from the ISA pseudocode, and checked by the same formula in Python: 0x22 0x33 0x34 0x3F 0x132 0x232 0x332 0x43C.
  • It is registered in runtime/test/shaders/check.py and scripts/run_gpu_tests.py next to cs_w32_new_ops, as a wave32 fixture.
  • The row in docs/design.md is now GPU-checked.

Tested (RTX 3060, Ampere, driver 616.64, Windows 11)

  • run_gpu_tests.py --filter cs_w32_mqsad_u32: translated, passes spirv-val, PASS (34 51 52 63 306 562 818 1084). It also passes with LEONIDA_W64_EMULATE=1.
  • tests/test_run_gpu_tests.py, test_run_gpu_tests_paths.py (20), test_shader_checks.py (83), test_ctest_registration.py, test_docs_design_rows.py and test_docs_links.py pass, and git diff --check is clean.

Since then it has also passed on an AMD RX 6700 XT (RDNA2), an RTX 5070 Ti and an Apple M2 (MoltenVK); the row says so (6db3a228).

Thanks

  • @Kam471 for the RTX 5070 Ti run (Blackwell): the same eight words.
  • @justr4mzi for the AMD RX 6700 XT run (RDNA2, under validation), which makes it hardware-exact as well.
  • @bobcatchris for the Apple M2 / MoltenVK run, with a negative control on the base.
  • @rgvxsthi for the AMD RX 9070 run (RDNA4, LLPC).
  • @JRamos1993 for the RTX 5090 run.
  • @gertify for the Intel UHD 630 run (Mesa ANV).
  • @epzlo for the AMD RX 7600 run (RADV, RDNA3).
  • @carlos-seiffert: tested on RTX 2060.
  • @LukeOsland1 for the RTX 4070 Ti SUPER run (the same eight words) and the corpus count: none of the 26,503 shader listings uses the instruction.

🔄 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/36 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/4669` --- ### 📝 Commits (3) - [`bfdb0bb`](https://github.com/ubiquitarianism/leonida/commit/bfdb0bbe8c9cf873fea0f7a23544a083d3938929) GPU fixture for v_mqsad_u32_u8 through the translated path (TEST-644) - [`2590c16`](https://github.com/ubiquitarianism/leonida/commit/2590c1604dd7147e10e386775e8b166defe41821) docs/design.md: v_mqsad_u32_u8 GPU-checked on RDNA2, Blackwell and MoltenVK too - [`9339b41`](https://github.com/ubiquitarianism/leonida/commit/9339b41169cb449a154362f76e8a835bf56920eb) Merge main into test/mqsad-gpu ### 📊 Changes **4 files changed** (+52 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+1 -1) 📝 `runtime/test/shaders/check.py` (+3 -1) ➕ `runtime/test/shaders/cs_w32_mqsad_u32.asm` (+44 -0) 📝 `scripts/run_gpu_tests.py` (+4 -2) </details> ### 📄 Description > Carried over from **old PR 4669** by `rafaelpssz` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/4669`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `rafaelpssz`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): TEST-644, the `v_mqsad_u32_u8` part ([claim](https://github.com/ItsNotRexed/Leonida/issues/4571#issuecomment-7091122243)). The `ds_wrxchg2` part is already run by `cs_w32_new_ops.asm` on `main`, and the open `#3208` and `#2003` add fixtures for it, so it is left to them. ### What The `v_mqsad_u32_u8` row of `docs/design.md` was hardware-verified on RDNA2 (native, through `hw_oracle`), but the translated path had never run on a GPU (**Not GPU-verified**). This adds the fixture: - `runtime/test/shaders/cs_w32_mqsad_u32.asm` runs `v_mqsad_u32_u8` twice. S0 = `0x88776655_44332211`. S1 = `0x40005000`, whose bytes 0 and 2 are zero, so the masked SAD has to skip them. - **A, in place (D = S2):** S2 = {0xFFFFFFF0, 1, 2, 3}, so accumulator 0 wraps at 32 bits. - **B, D over S0** (`v[2:5]` over `v[2:3]`): this only gives the expected words if every source is read before the first write, as the row says. - The expected words are derived step by step in the `.asm` header from the ISA pseudocode, and checked by the same formula in Python: `0x22 0x33 0x34 0x3F 0x132 0x232 0x332 0x43C`. - It is registered in `runtime/test/shaders/check.py` and `scripts/run_gpu_tests.py` next to `cs_w32_new_ops`, as a wave32 fixture. - The row in `docs/design.md` is now **GPU-checked**. ### Tested (RTX 3060, Ampere, driver 616.64, Windows 11) - `run_gpu_tests.py --filter cs_w32_mqsad_u32`: translated, passes `spirv-val`, **PASS** (`34 51 52 63 306 562 818 1084`). It also passes with `LEONIDA_W64_EMULATE=1`. - `tests/test_run_gpu_tests.py`, `test_run_gpu_tests_paths.py` (20), `test_shader_checks.py` (83), `test_ctest_registration.py`, `test_docs_design_rows.py` and `test_docs_links.py` pass, and `git diff --check` is clean. Since then it has also passed on an AMD RX 6700 XT (RDNA2), an RTX 5070 Ti and an Apple M2 (MoltenVK); the row says so (`6db3a228`). ### Thanks - `@Kam471` for the RTX 5070 Ti run (Blackwell): the same eight words. - `@justr4mzi` for the AMD RX 6700 XT run (RDNA2, under validation), which makes it hardware-exact as well. - `@bobcatchris` for the Apple M2 / MoltenVK run, with a negative control on the base. - `@rgvxsthi` for the AMD RX 9070 run (RDNA4, LLPC). - `@JRamos1993` for the RTX 5090 run. - `@gertify` for the Intel UHD 630 run (Mesa ANV). - `@epzlo` for the AMD RX 7600 run (RADV, RDNA3). - `@carlos-seiffert`: tested on RTX 2060. - `@LukeOsland1` for the RTX 4070 Ti SUPER run (the same eight words) and the corpus count: none of the 26,503 shader listings uses the instruction. --- <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#89
No description provided.