Tests: GPU coverage for v_add/sub_nc_i16, 16-bit min3/max3/med3 and v_pk_add_u16/v_pk_mad_i16 #366

Closed
KoLolX3 wants to merge 1 commit from upstream-pr/366 into main
KoLolX3 commented 2026-11-24 03:56:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KoLolX3 on 2026-11-24T03:56:40Z.


Adds a synthetic GPU fixture for 16-bit integer add/sub, min/max/median and packed add/multiply-add translations.

Rebased on main 3f81d46a; the runner conflict retains the current cs_w64x_cmp_sdst registration. Removed stale “Not GPU-verified” text where the fixture adds verification.

Tested on AMD Radeon RX 7900 XT (RADV NAVI31, Mesa 26.3.1, Linux): the fixture translated and passed spirv-val, and all eight expected words matched with subgroup size 32 in native and LEONIDA_W64_EMULATE=1 builds. python -I tests/test_run_gpu_tests.py passed 68 tests; the semantic suite passed 6,279 tests in 487 files. Compileall, make_game.py --help, check_no_game_data.py on changed files and git diff --check passed. Synthetic fixtures only, no game files.

AI-assisted: yes (Claude Code and OpenAI Codex).

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5465787960 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/366). Originally posted by [KoLolX3](https://github.com/KoLolX3) on 2026-11-24T03:56:40Z. --- Adds a synthetic GPU fixture for 16-bit integer add/sub, min/max/median and packed add/multiply-add translations. Rebased on `main` `3f81d46a`; the runner conflict retains the current `cs_w64x_cmp_sdst` registration. Removed stale “Not GPU-verified” text where the fixture adds verification. Tested on AMD Radeon RX 7900 XT (RADV NAVI31, Mesa 26.3.1, Linux): the fixture translated and passed `spirv-val`, and all eight expected words matched with subgroup size 32 in native and `LEONIDA_W64_EMULATE=1` builds. `python -I tests/test_run_gpu_tests.py` passed 68 tests; the semantic suite passed 6,279 tests in 487 files. Compileall, `make_game.py --help`, `check_no_game_data.py` on changed files and `git diff --check` passed. Synthetic fixtures only, no game files. AI-assisted: yes (Claude Code and OpenAI Codex).
Sangonapou commented 2026-11-24 05:05:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Sangonapou on 2026-11-24T05:05:52Z.


Tested 8df9db0b on NVIDIA GeForce RTX 3080 Ti Laptop (Ampere, subgroup 32..32), NVIDIA 621.24, Vulkan 1.4.357, Windows 11 Pro (build 26300): pass

Runtime built at this head with scripts\build_runtime.ps1 (MSVC 19.51, VS Build Tools 2026); llvm-mc 23.1.6 (conda-forge), SPIRV-Tools 2026.4, Vulkan SDK 1.4.363.0. No game files.

  • run_gpu_tests.py --filter cs_valu16_ext --require-pass: PASS native and with LEONIDA_W64_EMULATE=1 (0xa5a57fff 0x8000a5a5 0xa5a58000 0xa5a50003 0x3fffb 0x3c00c000 0xffff0008 0x7000c).
  • Full suite: 258 shaders, 258 translated, 258 pass spirv-val; native 198/249 passed, 49 skipped; emulated 230/249 passed, 17 skipped, i.e. main plus this fixture. The only failures, cs_imgload_tfe and cs_imgload_d16_tfe, fail identically on main ece4ba5b on this card (main: native 197/248, emulated 229/248), the same pair as #31 / #336.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7122620466 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/366#issuecomment-7122620466). Originally posted by [Sangonapou](https://github.com/Sangonapou) on 2026-11-24T05:05:52Z. --- Tested 8df9db0b on NVIDIA GeForce RTX 3080 Ti Laptop (Ampere, subgroup 32..32), NVIDIA 621.24, Vulkan 1.4.357, Windows 11 Pro (build 26300): pass Runtime built at this head with `scripts\build_runtime.ps1` (MSVC 19.51, VS Build Tools 2026); `llvm-mc` 23.1.6 (conda-forge), SPIRV-Tools 2026.4, Vulkan SDK 1.4.363.0. No game files. - `run_gpu_tests.py --filter cs_valu16_ext --require-pass`: PASS native and with `LEONIDA_W64_EMULATE=1` (`0xa5a57fff 0x8000a5a5 0xa5a58000 0xa5a50003 0x3fffb 0x3c00c000 0xffff0008 0x7000c`). - Full suite: 258 shaders, 258 translated, 258 pass spirv-val; native 198/249 passed, 49 skipped; emulated 230/249 passed, 17 skipped, i.e. `main` plus this fixture. The only failures, `cs_imgload_tfe` and `cs_imgload_d16_tfe`, fail identically on `main` `ece4ba5b` on this card (main: native 197/248, emulated 229/248), the same pair as #31 / #336.
ohshitwaddup commented 2026-11-24 18:13:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ohshitwaddup on 2026-11-24T18:13:47Z.


Independent hardware verification of cs_valu16_ext, plus three documentation defects. The fixture is correct — all eight words reproduce exactly. Everything below the verification is about the docs/design.md row text.

Verified on a second card

RX 6900 XT (RDNA2 / GFX1030, Navi 21, PCI 1002:73bf), RADV NAVI21, Mesa 26.2.4, Vulkan 1.4.354, Nobara Linux 44, kernel 7.2.10, subgroup 32..64, run at VKC_SUBGROUP_SIZE=32:

device: AMD Radeon RX 6900 XT (RADV NAVI21) (subgroup 32..64)
compute subgroup size: 32
1 groups x 64: 0 mismatches
out[0..7] = 2779086847 2147526053 2779086848 2779054083 262139 1006682112 4294901768 458764

= 0xA5A57FFF 0x8000A5A5 0xA5A58000 0xA5A50003 0x0003FFFB 0x3C00C000 0xFFFF0008 0x0007000C — 8/8 exact against check.py and the header. Your record is an RX 7900 XT (RADV NAVI31, Mesa 26.3.1); mine is RDNA2 on a different driver, so the words now hold across two AMD generations.

As with the other Vulkan fixtures this executes the translator's SPIR-V (gfx1013 assembly → rdna2spirv.py → SPIR-V), which is what design.md means by "GPU-checked" elsewhere.

Three defects in the row edits

Each of these rows now reads, in one sentence:

**Not GPU-verified.** GPU-checked by `runtime/test/shaders/cs_valu16_ext.asm` (…
one lane, on an RX 7900 XT, RADV NAVI31, Mesa 26.3.1, Linux, native wave64 and `LEONIDA_W64_EMULATE=1`)

1. "native wave64" is not what ran. The fixture declares ; mattr: +wavefrontsize32,-wavefrontsize64 with ; group: 32,1,1, and cs_valu16_ext is listed in WAVE32_LANE_DUMPS, so both check.py and run_gpu_tests.py pin VKC_SUBGROUP_SIZE=32. My run above confirms compute subgroup size: 32. If "native wave64" is meant as "on a device whose native wave is 64" (the 7900 XT is), that is not what the words say — please use native (wave32) and LEONIDA_W64_EMULATE=1.

2. The stale "Not GPU-verified" survives, immediately followed by "GPU-checked by" in the same row. That is self-contradictory, and it means the PR does not yet achieve its own stated purpose of flipping these rows. It appears on all three:

  • Packed 16-bit integer ops (v_pk_add/sub_u16/i16, …)
  • v_add_nc_i16, v_sub_nc_i16
  • v_min3_f16, v_max3_f16, v_min3_i16, …

3. Nothing else. The arithmetic, the coverage claims (both clamp ends, op_sel writing the high half, the wrap without clamp, the unwritten half kept) all match what the fixture actually exercises — I checked the words against the claimed cases and they line up.

Summary

The eight expected words are correct and I reproduced them on RDNA2. Fix items 1 and 2 and all three rows are honest. I would like to see this merged.

AI-assisted: yes (Hermes Agent) — built the PR head, ran the fixture on an RX 6900 XT, and verified each defect above.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7140344617 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/366#issuecomment-7140344617). Originally posted by [ohshitwaddup](https://github.com/ohshitwaddup) on 2026-11-24T18:13:47Z. --- Independent hardware verification of `cs_valu16_ext`, plus three documentation defects. **The fixture is correct — all eight words reproduce exactly.** Everything below the verification is about the `docs/design.md` row text. ## Verified on a second card RX 6900 XT (RDNA2 / GFX1030, Navi 21, PCI 1002:73bf), RADV NAVI21, Mesa 26.2.4, Vulkan 1.4.354, Nobara Linux 44, kernel 7.2.10, subgroup 32..64, run at `VKC_SUBGROUP_SIZE=32`: ``` device: AMD Radeon RX 6900 XT (RADV NAVI21) (subgroup 32..64) compute subgroup size: 32 1 groups x 64: 0 mismatches out[0..7] = 2779086847 2147526053 2779086848 2779054083 262139 1006682112 4294901768 458764 ``` = `0xA5A57FFF 0x8000A5A5 0xA5A58000 0xA5A50003 0x0003FFFB 0x3C00C000 0xFFFF0008 0x0007000C` — **8/8 exact** against `check.py` and the header. Your record is an RX 7900 XT (RADV NAVI31, Mesa 26.3.1); mine is RDNA2 on a different driver, so the words now hold across two AMD generations. As with the other Vulkan fixtures this executes the translator's SPIR-V (gfx1013 assembly → `rdna2spirv.py` → SPIR-V), which is what `design.md` means by "GPU-checked" elsewhere. ## Three defects in the row edits Each of these rows now reads, in one sentence: ``` **Not GPU-verified.** GPU-checked by `runtime/test/shaders/cs_valu16_ext.asm` (… one lane, on an RX 7900 XT, RADV NAVI31, Mesa 26.3.1, Linux, native wave64 and `LEONIDA_W64_EMULATE=1`) ``` **1. "native wave64" is not what ran.** The fixture declares `; mattr: +wavefrontsize32,-wavefrontsize64` with `; group: 32,1,1`, and `cs_valu16_ext` is listed in `WAVE32_LANE_DUMPS`, so both `check.py` and `run_gpu_tests.py` pin `VKC_SUBGROUP_SIZE=32`. My run above confirms `compute subgroup size: 32`. If "native wave64" is meant as "on a device whose native wave is 64" (the 7900 XT is), that is not what the words say — please use `native (wave32) and LEONIDA_W64_EMULATE=1`. **2. The stale "Not GPU-verified" survives**, immediately followed by "GPU-checked by" in the same row. That is self-contradictory, and it means the PR does not yet achieve its own stated purpose of flipping these rows. It appears on all three: - Packed 16-bit integer ops (`v_pk_add/sub_u16/i16`, …) - `v_add_nc_i16`, `v_sub_nc_i16` - `v_min3_f16`, `v_max3_f16`, `v_min3_i16`, … **3. Nothing else.** The arithmetic, the coverage claims (both clamp ends, `op_sel` writing the high half, the wrap without `clamp`, the unwritten half kept) all match what the fixture actually exercises — I checked the words against the claimed cases and they line up. ## Summary The eight expected words are correct and I reproduced them on RDNA2. Fix items 1 and 2 and all three rows are honest. I would like to see this merged. AI-assisted: yes (Hermes Agent) — built the PR head, ran the fixture on an RX 6900 XT, and verified each defect above.
MoonEyes commented 2026-11-28 02:52:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T02:52:54Z.


Hi @KoLolX3, thanks for this pull request. It currently conflicts with main (conflicting file(s): runtime/test/shaders/check.py, scripts/run_gpu_tests.py), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7232653308 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/366#issuecomment-7232653308). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T02:52:54Z. --- Hi @KoLolX3, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `runtime/test/shaders/check.py`, `scripts/run_gpu_tests.py`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here. AI-assisted (Claude Code, Claude Opus 5.5).
aslan2142 commented 2026-12-01 11:43:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:43:10Z.

Review: CHANGES_REQUESTED


Conflicts with main (in docs/design.md, runtime/test/shaders/check.py, and scripts/run_gpu_tests.py) with failing stale CI. Please rebase onto current main, address the three docs/design.md row defects flagged during independent verification above, and trigger a fresh green CI pass.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130541690 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/366#pullrequestreview-6130541690). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:43:10Z. **Review:** CHANGES_REQUESTED --- Conflicts with `main` (in `docs/design.md`, `runtime/test/shaders/check.py`, and `scripts/run_gpu_tests.py`) with failing stale CI. Please rebase onto current `main`, address the three `docs/design.md` row defects flagged during independent verification above, and trigger a fresh green CI pass. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 16:29:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:29:38Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7317698034 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/366#issuecomment-7317698034). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:29:38Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!366
No description provided.