[PR #302] [CLOSED] tests: GPU fixture cs_w32_vcmp64_null for 64-bit integer v_cmp/v_cmpx null sources #354

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

📋 Pull Request Information

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

Base: main ← Head: old-pr/10034


📝 Commits (1)

  • 1f82097 tests: GPU fixture cs_w32_vcmp64_null for 64-bit integer v_cmp/v_cmpx null sources

📊 Changes

4 files changed (+123 additions, -5 deletions)

View changed files

📝 docs/design.md (+1 -1)
📝 runtime/test/shaders/check.py (+5 -2)
➕ runtime/test/shaders/cs_w32_vcmp64_null.asm (+112 -0)
📝 scripts/run_gpu_tests.py (+5 -2)

📄 Description

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

Summary

Adds a wave32 compute GPU fixture runtime/test/shaders/cs_w32_vcmp64_null.asm verifying the docs/design.md contract row "Null sources in 64-bit integer VALU compares" (v_cmp / v_cmpx relations eq, ne, lt, le, gt, ge on u64/i64, e32/e64, null in src0, src1, or both, partial EXEC masking, v_cmpx narrowing EXEC while leaving VCC untouched) on an NVIDIA GeForce RTX 3070, wires it into runtime/test/shaders/check.py and scripts/run_gpu_tests.py, and updates the corresponding docs/design.md contract row (keeping no corpus count).

Claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116958170

What cs_w32_vcmp64_null.asm checks

Wave32 group (32,1,1) assigns each lane i a 64-bit value by i & 3: 0, +1, 2^32, and 2^63 (-2^63 signed). Each lane ORs 1 << lane into LDS for each active mask bit and lane 0 stores eight 32-bit words:

  • out[0] (0x11111111): v_cmp_eq_u64_e32 vcc_lo, null, v[2:3]
  • out[1] (0x77777777): v_cmp_ge_i64_e64 s8, v[2:3], null
  • out[2] (0x66666666): v_cmp_lt_i64_e32 vcc_lo, null, v[2:3]
  • out[3] (0x88888888): v_cmp_gt_i64_e64 s10, null, v[2:3]
  • out[4] (0x00EE00EE): v_cmp_gt_u64_e64 s11, v[2:3], null under EXEC = 0x00FF00FF
  • out[5] (0x5555AAAA): v_cmp_le_u64_e64 null, null | v_cmp_ne_i64_e64 null, null under EXEC = 0x5555AAAA
  • out[6] (0x08888888): EXEC after v_cmpx_lt_i64_e64 v[2:3], null under EXEC = 0x0FFFFFFF
  • out[7] (0x96A53C69): VCC preserved untouched after v_cmpx_lt_i64_e64

Hardware & Environment

  • OS: Windows 11 Pro 64-bit (10.0.26300)
  • GPU: NVIDIA GeForce RTX 3070 (Ampere, 8 GiB, subgroup 32..32)
  • Driver / Vulkan: NVIDIA 621.24, Vulkan 1.4.357
  • Toolchain: llvm-mc 23.1.6, spirv-as / spirv-val 2026.4, vk_compute_test.exe built with MSVC 19.51

Testing

  • python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_w32_vcmp64_null --require-pass → 1/1 passed (PASS cs_w32_vcmp64_null 286331153 2004318071 1717986918 2290649224 15597806 1431677610 143165576 2527411305)
  • LEONIDA_W64_EMULATE=1 python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_w32_vcmp64_null --require-pass → 1/1 passed (identical output)
  • python -I runtime/test/shaders/build.py <scratch> cs_w32_vcmp64_null + check.py → cs_w32_vcmp64_null ok
  • python -m unittest discover -s tests/semantic -p test_vcmp64_null_src.py → 6/6 OK
  • python -I tests/test_run_gpu_tests.py (62/62 OK), tests/test_gpu_build_dir.py (18/18 OK), tests/test_design_contract_rows.py (5/5 OK), tests/test_docs_encoding.py (1/1 OK), tests/test_docs_table_rows.py (2/2 OK)
  • python -m compileall -q runtime/test/shaders/check.py scripts/run_gpu_tests.py → clean
  • python -I scripts/check_no_game_data.py runtime/test/shaders/cs_w32_vcmp64_null.asm runtime/test/shaders/check.py scripts/run_gpu_tests.py docs/design.md → clean, LF-only verified

Checklist

  • No game data, keys, decryption, or online services included
  • AI-assisted: yes
  • Claimed in the coordination issue (#9677)

🔄 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/302 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `old-pr/10034` --- ### 📝 Commits (1) - [`1f82097`](https://github.com/ubiquitarianism/leonida/commit/1f82097ce353d10f2d1e8378a32a1ff230c2fe98) tests: GPU fixture cs_w32_vcmp64_null for 64-bit integer v_cmp/v_cmpx null sources ### 📊 Changes **4 files changed** (+123 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+1 -1) 📝 `runtime/test/shaders/check.py` (+5 -2) ➕ `runtime/test/shaders/cs_w32_vcmp64_null.asm` (+112 -0) 📝 `scripts/run_gpu_tests.py` (+5 -2) </details> ### 📄 Description > Carried over from **old PR 10034** by `ramon-victor` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/10034`, 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. > `ramon-victor`: 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): ## Summary Adds a wave32 compute GPU fixture `runtime/test/shaders/cs_w32_vcmp64_null.asm` verifying the `docs/design.md` contract row **"Null sources in 64-bit integer VALU compares"** (`v_cmp` / `v_cmpx` relations `eq`, `ne`, `lt`, `le`, `gt`, `ge` on `u64`/`i64`, `e32`/`e64`, `null` in `src0`, `src1`, or both, partial `EXEC` masking, `v_cmpx` narrowing `EXEC` while leaving `VCC` untouched) on an NVIDIA GeForce RTX 3070, wires it into `runtime/test/shaders/check.py` and `scripts/run_gpu_tests.py`, and updates the corresponding `docs/design.md` contract row (keeping `no corpus count`). Claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116958170 ### What `cs_w32_vcmp64_null.asm` checks Wave32 group (`32,1,1`) assigns each lane `i` a 64-bit value by `i & 3`: `0`, `+1`, `2^32`, and `2^63` (`-2^63` signed). Each lane ORs `1 << lane` into LDS for each active mask bit and lane 0 stores eight 32-bit words: - `out[0]` (`0x11111111`): `v_cmp_eq_u64_e32 vcc_lo, null, v[2:3]` - `out[1]` (`0x77777777`): `v_cmp_ge_i64_e64 s8, v[2:3], null` - `out[2]` (`0x66666666`): `v_cmp_lt_i64_e32 vcc_lo, null, v[2:3]` - `out[3]` (`0x88888888`): `v_cmp_gt_i64_e64 s10, null, v[2:3]` - `out[4]` (`0x00EE00EE`): `v_cmp_gt_u64_e64 s11, v[2:3], null` under `EXEC = 0x00FF00FF` - `out[5]` (`0x5555AAAA`): `v_cmp_le_u64_e64 null, null | v_cmp_ne_i64_e64 null, null` under `EXEC = 0x5555AAAA` - `out[6]` (`0x08888888`): `EXEC` after `v_cmpx_lt_i64_e64 v[2:3], null` under `EXEC = 0x0FFFFFFF` - `out[7]` (`0x96A53C69`): `VCC` preserved untouched after `v_cmpx_lt_i64_e64` ## Hardware & Environment - **OS**: Windows 11 Pro 64-bit (10.0.26300) - **GPU**: NVIDIA GeForce RTX 3070 (Ampere, 8 GiB, subgroup 32..32) - **Driver / Vulkan**: NVIDIA `621.24`, Vulkan `1.4.357` - **Toolchain**: `llvm-mc` 23.1.6, `spirv-as` / `spirv-val` 2026.4, `vk_compute_test.exe` built with MSVC 19.51 ## Testing - `python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_w32_vcmp64_null --require-pass` → `1/1 passed` (`PASS cs_w32_vcmp64_null 286331153 2004318071 1717986918 2290649224 15597806 1431677610 143165576 2527411305`) - `LEONIDA_W64_EMULATE=1 python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_w32_vcmp64_null --require-pass` → `1/1 passed` (identical output) - `python -I runtime/test/shaders/build.py <scratch> cs_w32_vcmp64_null` + `check.py` → `cs_w32_vcmp64_null ok` - `python -m unittest discover -s tests/semantic -p test_vcmp64_null_src.py` → 6/6 OK - `python -I tests/test_run_gpu_tests.py` (62/62 OK), `tests/test_gpu_build_dir.py` (18/18 OK), `tests/test_design_contract_rows.py` (5/5 OK), `tests/test_docs_encoding.py` (1/1 OK), `tests/test_docs_table_rows.py` (2/2 OK) - `python -m compileall -q runtime/test/shaders/check.py scripts/run_gpu_tests.py` → clean - `python -I scripts/check_no_game_data.py runtime/test/shaders/cs_w32_vcmp64_null.asm runtime/test/shaders/check.py scripts/run_gpu_tests.py docs/design.md` → clean, LF-only verified ## Checklist - [x] No game data, keys, decryption, or online services included - [x] AI-assisted: yes - [x] Claimed in the coordination issue (`#9677`) --- <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:36 +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#354
No description provided.