[PR #135] [CLOSED] Tests: GPU coverage for v_cmp_class_f16/f64, v_fmamk/fmaak_f16, v_cvt_pknorm_*_f16 and v_mac_legacy_f32 #185

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/135
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: old-pr/9865


📝 Commits (1)

  • 78afb4e Tests: GPU coverage for v_cmp_class_f16/f64, v_fmamk/fmaak_f16, v_cvt_pknorm_*_f16 and v_mac_legacy_f32

📊 Changes

4 files changed (+138 additions, -10 deletions)

View changed files

📝 docs/design.md (+5 -5)
📝 runtime/test/shaders/check.py (+5 -2)
➕ runtime/test/shaders/cs_vfloat_ext.asm (+122 -0)
📝 scripts/run_gpu_tests.py (+6 -3)

📄 Description

Carried over from old PR 9865 by KoLolX3 in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9865, 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.
KoLolX3: 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):

docs/design.md marks these float VALU rows Not GPU-verified: the translations were CPU-checked (and, except v_mac_legacy_f32, the instructions measured on hardware), but the SPIR-V the translator emits had never run on a GPU. No open PR adds a fixture for them.

This adds runtime/test/shaders/cs_vfloat_ext.asm (one lane, laid out like cs_lds_b64_cmpst.asm; 16-bit VOP2 destinations preset to 0xA5A5A5A5):

word op case expected
0 v_cmp_class_f16 one bit per case: sNaN in {sNaN}, -denormal in {-denormal}, +1.0 in {+inf} (miss), -inf in {-inf} 0x0000000B
1 v_cmp_class_f64 -0 in {-0}, qNaN in {sNaN} (miss), smallest +denormal in {+denormal}, +inf in {+inf} 0x0000000D
2 v_fmamk_f16 1.5 * K(2.0) + 0.5, high half kept 0xA5A54300
3 v_fmaak_f16 (1 + 2^-10) * 3.0 + K(0): one rounding to the even 0x4202 0xA5A54202
4 v_cvt_pknorm_i16_f16 0.5 -> 16383.5 rounds to even 16384; -inf -> -32767 0x80014000
5 v_cvt_pknorm_u16_f16 NaN -> 0; 2.0 clamps to 65535 0xFFFF0000
6 v_mac_legacy_f32 legacy 0 * +inf = +0, plus D = 2.0 0x40000000
7 v_mac_legacy_f32 1.5 * 2.0 + D (0.25) 0x40500000

The words are derived in the .asm header from the rows. The fixture is registered in check.py and scripts/run_gpu_tests.py next to cs_lds_atomics_ext. The five rows (including the separate v_cmp_class_f64 row) keep their marker and add a "GPU-checked by" note. The v_mac_legacy_f32 note says it checks the translated SPIR-V, not the opcode on silicon (no RDNA2 desktop part has it).

Tested on an AMD Radeon RX 7900 XT (RADV NAVI31, Mesa 26.3.1, subgroup 32..64), Artix Linux, llvm-mc 23.1.5:

  • cs_vfloat_ext passes with all eight words exact, native and with LEONIDA_W64_EMULATE=1.
  • Negative control: expecting the truncated 0x4201 for word 3 makes it FAIL.
  • Full scripts/run_gpu_tests.py suite, native and emulated: no failure except the known ms_wave_info_s3 flake (#6172).
  • The 50 test files that read check.py, run_gpu_tests.py, design.md or the shader fixtures: the same failure set as a clean worktree of the merge base (26, environment-only on this machine). The branch adds 2 passing tests and 12 subtests.

Resubmitted from #9601 (closed with the other outside PRs on 2026-11-23), rebased onto main 2d53a8055. Related: #9494, #9761 (merged), #9813. Synthetic fixture only, no game files. AI-assisted (Claude Code).

On the rebased branch, the full suite on this card also shows cs_imgload_tfe, cs_imgload_d16_tfe, cs_w32_exec_computed and cs_w64_exec_computed failing; they fail the same way on a clean worktree of main, so they are not this change.


🔄 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/135 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `old-pr/9865` --- ### 📝 Commits (1) - [`78afb4e`](https://github.com/ubiquitarianism/leonida/commit/78afb4eaa1ee5e459b489423387ba6ee97a0663d) Tests: GPU coverage for v_cmp_class_f16/f64, v_fmamk/fmaak_f16, v_cvt_pknorm_*_f16 and v_mac_legacy_f32 ### 📊 Changes **4 files changed** (+138 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+5 -5) 📝 `runtime/test/shaders/check.py` (+5 -2) ➕ `runtime/test/shaders/cs_vfloat_ext.asm` (+122 -0) 📝 `scripts/run_gpu_tests.py` (+6 -3) </details> ### 📄 Description > Carried over from **old PR 9865** by `KoLolX3` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9865`, 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. > `KoLolX3`: 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): `docs/design.md` marks these float VALU rows **Not GPU-verified**: the translations were CPU-checked (and, except `v_mac_legacy_f32`, the instructions measured on hardware), but the SPIR-V the translator emits had never run on a GPU. No open PR adds a fixture for them. This adds `runtime/test/shaders/cs_vfloat_ext.asm` (one lane, laid out like `cs_lds_b64_cmpst.asm`; 16-bit VOP2 destinations preset to `0xA5A5A5A5`): | word | op | case | expected | |---|---|---|---| | 0 | `v_cmp_class_f16` | one bit per case: sNaN in {sNaN}, -denormal in {-denormal}, +1.0 in {+inf} (miss), -inf in {-inf} | `0x0000000B` | | 1 | `v_cmp_class_f64` | -0 in {-0}, qNaN in {sNaN} (miss), smallest +denormal in {+denormal}, +inf in {+inf} | `0x0000000D` | | 2 | `v_fmamk_f16` | 1.5 * K(2.0) + 0.5, high half kept | `0xA5A54300` | | 3 | `v_fmaak_f16` | (1 + 2^-10) * 3.0 + K(0): one rounding to the even `0x4202` | `0xA5A54202` | | 4 | `v_cvt_pknorm_i16_f16` | 0.5 -> 16383.5 rounds to even 16384; -inf -> -32767 | `0x80014000` | | 5 | `v_cvt_pknorm_u16_f16` | NaN -> 0; 2.0 clamps to 65535 | `0xFFFF0000` | | 6 | `v_mac_legacy_f32` | legacy 0 * +inf = +0, plus D = 2.0 | `0x40000000` | | 7 | `v_mac_legacy_f32` | 1.5 * 2.0 + D (0.25) | `0x40500000` | The words are derived in the `.asm` header from the rows. The fixture is registered in `check.py` and `scripts/run_gpu_tests.py` next to `cs_lds_atomics_ext`. The five rows (including the separate `v_cmp_class_f64` row) keep their marker and add a "GPU-checked by" note. The `v_mac_legacy_f32` note says it checks the translated SPIR-V, not the opcode on silicon (no RDNA2 desktop part has it). Tested on an AMD Radeon RX 7900 XT (RADV NAVI31, Mesa 26.3.1, subgroup 32..64), Artix Linux, llvm-mc 23.1.5: - `cs_vfloat_ext` passes with all eight words exact, native and with `LEONIDA_W64_EMULATE=1`. - Negative control: expecting the truncated `0x4201` for word 3 makes it FAIL. - Full `scripts/run_gpu_tests.py` suite, native and emulated: no failure except the known `ms_wave_info_s3` flake (`#6172`). - The 50 test files that read `check.py`, `run_gpu_tests.py`, `design.md` or the shader fixtures: the same failure set as a clean worktree of the merge base (26, environment-only on this machine). The branch adds 2 passing tests and 12 subtests. Resubmitted from `#9601` (closed with the other outside PRs on 2026-11-23), rebased onto `main` `2d53a8055`. Related: `#9494`, `#9761` (merged), `#9813`. Synthetic fixture only, no game files. AI-assisted (Claude Code). On the rebased branch, the full suite on this card also shows `cs_imgload_tfe`, `cs_imgload_d16_tfe`, `cs_w32_exec_computed` and `cs_w64_exec_computed` failing; they fail the same way on a clean worktree of `main`, so they are not this change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:17:04 +01:00
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#185
No description provided.