tests: GPU fixture cs_w32_min3_med3_16 for 16-bit min3/max3/med3 #144

Closed
github-bot wants to merge 1 commit from gh-pr/144/head into gh-pr/144/base
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:28 UTC · original
ubiquitarianism:old-pr/9876 → main · +89 −4 · 4 files · 1 commits · closed without merging

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

Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116716878

What and why

Adds the hand-written wave32 compute GPU fixture runtime/test/shaders/cs_w32_min3_med3_16.asm (wired into runtime/test/shaders/check.py and scripts/run_gpu_tests.py) to GPU-verify the docs/design.md contract row for v_min3_f16, v_max3_f16, v_min3_i16, v_min3_u16, v_max3_i16, v_max3_u16, v_med3_i16 and v_med3_u16, and updates that row in docs/design.md.

Each of the eight ops writes one dword (out[0..7]) from lane 0:

  • out[0] (v_min3_f16): qNaN ignoring, -0.0 < +0.0 ordering, op_sel:[1,0,1,0], destination high half 0xCAFE preserved (0xCAFE8000)
  • out[1] (v_max3_f16): source neg and abs, qNaN ignoring, VOP3 clamp, op_sel:[0,1,0,1], destination low half 0xBEEF preserved (0x3C00BEEF)
  • out[2] (v_min3_i16): signed ordering (-32768, -1, 32767), op_sel:[1,0,1,0], destination high half preserved (0x12348000)
  • out[3] (v_max3_i16): signed ordering (-1, 5, -32768), op_sel:[0,1,0,1], destination low half preserved (0x00055678)
  • out[4] (v_min3_u16): unsigned ordering (32768, 65535, 32767), op_sel:[1,1,0,0], destination high half preserved (0x9ABC7FFF)
  • out[5] (v_max3_u16): unsigned ordering (5, 32768, 65535), op_sel:[0,0,1,1], destination low half preserved (0xFFFFDEF0)
  • out[6] (v_med3_i16): signed median of (-10, 5, -32768) → -10, op_sel:[0,1,1,0], destination high half preserved (0x4321FFF6)
  • out[7] (v_med3_u16): unsigned median of the exact same three 16-bit bit patterns (0xFFF6, 0x0005, 0x8000) → 0x8000, op_sel:[0,1,1,1], destination low half preserved (0x80008765)

Tested

  • GPU / driver / OS: NVIDIA GeForce RTX 3070 (Ampere, subgroup 32..32), driver 621.24, Vulkan 1.4.357, Windows 11 Pro 26H2 (26300.9974), llvm-mc 23.1.6 (conda-forge llvm-tools), SPIRV-Tools 2026.4, MSVC 19.51.36260.0.
  • python -I scripts/run_gpu_tests.py --build runtime\build --filter cs_w32_min3_med3_16 --require-pass: 1/1 translated, 1/1 spirv-val, PASS cs_w32_min3_med3_16 3405676544 1006681839 305430528 349816 2596044799 4294958832 1126301686 2147518309 (1/1 passed).
  • LEONIDA_W64_EMULATE=1 python -I scripts/run_gpu_tests.py --build runtime\build --filter cs_w32_min3_med3_16 --require-pass: 1/1 translated, 1/1 spirv-val, 1/1 passed.
  • runtime/test/shaders/build.py + check.py for cs_w32_min3_med3_16: cs_w32_min3_med3_16 ok.
  • python -I tests/test_run_gpu_tests.py (62/62 OK), python -I tests/test_gpu_build_dir.py (18/18 OK), python -m compileall -q runtime/test/shaders/check.py scripts/run_gpu_tests.py.
  • python -I scripts/check_no_game_data.py runtime/test/shaders/cs_w32_min3_med3_16.asm runtime/test/shaders/check.py scripts/run_gpu_tests.py docs/design.md — pass; all modified/added files verified LF-only.

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.
**@⁠Andretuta** on GitHub · 2026-11-24 02:28 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/144) `ubiquitarianism:old-pr/9876` → `main` · +89 −4 · 4 files · 1 commits · closed without merging > Carried over from **old PR 9876** by `ramon-victor` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9876`, 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): Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116716878 ### What and why Adds the hand-written wave32 compute GPU fixture `runtime/test/shaders/cs_w32_min3_med3_16.asm` (wired into `runtime/test/shaders/check.py` and `scripts/run_gpu_tests.py`) to GPU-verify the `docs/design.md` contract row for `v_min3_f16`, `v_max3_f16`, `v_min3_i16`, `v_min3_u16`, `v_max3_i16`, `v_max3_u16`, `v_med3_i16` and `v_med3_u16`, and updates that row in `docs/design.md`. Each of the eight ops writes one dword (`out[0..7]`) from lane 0: - `out[0]` (`v_min3_f16`): qNaN ignoring, `-0.0 < +0.0` ordering, `op_sel:[1,0,1,0]`, destination high half `0xCAFE` preserved (`0xCAFE8000`) - `out[1]` (`v_max3_f16`): source `neg` and `abs`, qNaN ignoring, VOP3 `clamp`, `op_sel:[0,1,0,1]`, destination low half `0xBEEF` preserved (`0x3C00BEEF`) - `out[2]` (`v_min3_i16`): signed ordering `(-32768, -1, 32767)`, `op_sel:[1,0,1,0]`, destination high half preserved (`0x12348000`) - `out[3]` (`v_max3_i16`): signed ordering `(-1, 5, -32768)`, `op_sel:[0,1,0,1]`, destination low half preserved (`0x00055678`) - `out[4]` (`v_min3_u16`): unsigned ordering `(32768, 65535, 32767)`, `op_sel:[1,1,0,0]`, destination high half preserved (`0x9ABC7FFF`) - `out[5]` (`v_max3_u16`): unsigned ordering `(5, 32768, 65535)`, `op_sel:[0,0,1,1]`, destination low half preserved (`0xFFFFDEF0`) - `out[6]` (`v_med3_i16`): signed median of `(-10, 5, -32768)` → `-10`, `op_sel:[0,1,1,0]`, destination high half preserved (`0x4321FFF6`) - `out[7]` (`v_med3_u16`): unsigned median of the exact same three 16-bit bit patterns `(0xFFF6, 0x0005, 0x8000)` → `0x8000`, `op_sel:[0,1,1,1]`, destination low half preserved (`0x80008765`) ### Tested - **GPU / driver / OS**: NVIDIA GeForce RTX 3070 (Ampere, subgroup 32..32), driver `621.24`, Vulkan `1.4.357`, Windows 11 Pro 26H2 (`26300.9974`), `llvm-mc` `23.1.6` (conda-forge `llvm-tools`), `SPIRV-Tools` `2026.4`, MSVC `19.51.36260.0`. - `python -I scripts/run_gpu_tests.py --build runtime\build --filter cs_w32_min3_med3_16 --require-pass`: 1/1 translated, 1/1 `spirv-val`, `PASS cs_w32_min3_med3_16 3405676544 1006681839 305430528 349816 2596044799 4294958832 1126301686 2147518309` (1/1 passed). - `LEONIDA_W64_EMULATE=1 python -I scripts/run_gpu_tests.py --build runtime\build --filter cs_w32_min3_med3_16 --require-pass`: 1/1 translated, 1/1 `spirv-val`, 1/1 passed. - `runtime/test/shaders/build.py` + `check.py` for `cs_w32_min3_med3_16`: `cs_w32_min3_med3_16 ok`. - `python -I tests/test_run_gpu_tests.py` (62/62 OK), `python -I tests/test_gpu_build_dir.py` (18/18 OK), `python -m compileall -q runtime/test/shaders/check.py scripts/run_gpu_tests.py`. - `python -I scripts/check_no_game_data.py runtime/test/shaders/cs_w32_min3_med3_16.asm runtime/test/shaders/check.py scripts/run_gpu_tests.py docs/design.md` — pass; all modified/added files verified LF-only. 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:46:18 +00:00
github-bot closed this pull request 2026-11-26 08:46:18 +00:00
Author
Owner

@⁠ImLele69 on GitHub · 2026-11-24 11:37 UTC · original

Tested on Linux, merged onto main 21625bca8 (PR head 8656629f8, merges cleanly).

GPU: NVIDIA GeForce RTX 2070 SUPER (Turing, subgroup 32), proprietary driver 620.70.06, Fedora 44, llvm-mc 22.1.8, SPIRV-Tools 2026.1.

Run This PR main alone
run_gpu_tests.py native 198/249 passed, 49 skipped 197/248 passed, 49 skipped
LEONIDA_W64_EMULATE=1 230/249 passed, 17 skipped 229/248 passed, 17 skipped
run_semantic_tests.py tests/semantic 465 files, 6108 tests, 0 files failed in 95 s with 16 jobs 465 files, 6108 tests, 0 files failed

New fixture cs_w32_min3_med3_16: PASS in both modes.

The only failures in both runs are the known cs_imgload_tfe / cs_imgload_d16_tfe pair (#31), as on main. No regressions.

AI-assisted: yes (Claude Code ran the build and tests on my machine; numbers are the runners' own output).

**@⁠ImLele69** on GitHub · 2026-11-24 11:37 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/144#issuecomment-7130333739) Tested on Linux, merged onto `main` `21625bca8` (PR head `8656629f8`, merges cleanly). GPU: NVIDIA GeForce RTX 2070 SUPER (Turing, subgroup 32), proprietary driver 620.70.06, Fedora 44, llvm-mc 22.1.8, SPIRV-Tools 2026.1. | Run | This PR | `main` alone | |---|---|---| | `run_gpu_tests.py` native | 198/249 passed, 49 skipped | 197/248 passed, 49 skipped | | `LEONIDA_W64_EMULATE=1` | 230/249 passed, 17 skipped | 229/248 passed, 17 skipped | | `run_semantic_tests.py tests/semantic` | 465 files, 6108 tests, 0 files failed in 95 s with 16 jobs | 465 files, 6108 tests, 0 files failed | New fixture `cs_w32_min3_med3_16`: PASS in both modes. The only failures in both runs are the known `cs_imgload_tfe` / `cs_imgload_d16_tfe` pair (#31), as on `main`. No regressions. AI-assisted: yes (Claude Code ran the build and tests on my machine; numbers are the runners' own output).
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-24 19:18 UTC · original

This carry-over of old upstream PR 9876 has been taken over in #1053, so I'm closing this draft as #17 describes. The branch old-pr/9876 stays.

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

**@⁠aslan2142** on GitHub · 2026-11-24 19:18 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/144#issuecomment-7141895794) This carry-over of old upstream PR 9876 has been taken over in #1053, so I'm closing this draft as #17 describes. The branch `old-pr/9876` stays. AI-assisted (Claude Code, Claude Opus 5.5).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.