[PR #1037] tests: GPU fixtures for the packed 16-bit integer ops #1074

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

📋 Pull Request Information

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

Base: main ← Head: feat/fixtures-batch3


📝 Commits (1)

  • 45a3728 tests: GPU fixtures for the packed 16-bit integer ops

📊 Changes

9 files changed (+270 additions, -3 deletions)

View changed files

📝 docs/design.md (+1 -1)
📝 docs/shader_validation.md (+2 -0)
📝 runtime/test/shaders/check.py (+5 -1)
➕ runtime/test/shaders/cs_pk_int16_i.asm (+49 -0)
➕ runtime/test/shaders/cs_pk_int16_u.asm (+46 -0)
📝 scripts/run_gpu_tests.py (+5 -1)
➕ tests/semantic/fixtures/disasm/cs_pk_int16_i.s (+25 -0)
➕ tests/semantic/fixtures/disasm/cs_pk_int16_u.s (+23 -0)
➕ tests/semantic/test_pk_int16_gpu_fixtures.py (+114 -0)

📄 Description

Claimed in the coordination issue as: carried over from the closed original repository (branch feat/fixtures-batch3); no new claim

Depends on: none. Overlaps #366 (v_pk_add_u16 / v_pk_mad_i16) and #171/#853 (cs_w32_pk_rel_ext); this PR covers all eleven integer forms in two fixtures with the full op_sel/op_sel_hi/clamp grid and CPU fixtures, so the overlapping rows can be dropped from whichever lands second.

What and why

Two wave32 GPU fixtures for the packed 16-bit integer ops in docs/design.md:

  • cs_pk_int16_u: the six u16 forms (v_pk_add/sub_u16, v_pk_mul_lo_u16, v_pk_mad_u16, v_pk_max/min_u16) with op_sel/op_sel_hi and clamp on add and sub;
  • cs_pk_int16_i: the five i16 forms with op_sel/op_sel_hi and clamp on add, sub and mad.

Each header derives its eight words. Both are registered in check.py and scripts/run_gpu_tests.py; tests/semantic/test_pk_int16_gpu_fixtures.py runs the same disassembly through the translator and the interpreter and checks the headers, CS_DUMPS and the runner table against it. docs/design.md and docs/shader_validation.md name the fixtures and the measured result. The .s files under tests/semantic/fixtures/disasm/ are generated from the author's hand-written .asm sources by tests/semantic/regen_fixtures.py (the marker-based mechanism already on main), not a dump from the game.

Tested

  • python3 -m unittest discover -s tests/semantic -p "test_pk_int16_gpu_fixtures.py": 3 tests, OK.
  • python3 -m pytest tests/test_shader_checks.py -x -q: 91 passed, 333 subtests passed.
  • python3 tests/semantic/regen_fixtures.py --check: clean.
  • GPU (the author's measurement, not repeated here): gfx1036, RADV RAPHAEL_MENDOCINO, Mesa 27.0.0-devel, 2/2 fixtures, 16/16 words exact.

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. (No new rule; the existing row now names the GPU confirmation.)

🔄 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/1037 **Author:** [@YaBulochka](https://github.com/YaBulochka) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/fixtures-batch3` --- ### 📝 Commits (1) - [`45a3728`](https://github.com/ubiquitarianism/leonida/commit/45a3728176b6a97813d127e23568e67354d20596) tests: GPU fixtures for the packed 16-bit integer ops ### 📊 Changes **9 files changed** (+270 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+1 -1) 📝 `docs/shader_validation.md` (+2 -0) 📝 `runtime/test/shaders/check.py` (+5 -1) ➕ `runtime/test/shaders/cs_pk_int16_i.asm` (+49 -0) ➕ `runtime/test/shaders/cs_pk_int16_u.asm` (+46 -0) 📝 `scripts/run_gpu_tests.py` (+5 -1) ➕ `tests/semantic/fixtures/disasm/cs_pk_int16_i.s` (+25 -0) ➕ `tests/semantic/fixtures/disasm/cs_pk_int16_u.s` (+23 -0) ➕ `tests/semantic/test_pk_int16_gpu_fixtures.py` (+114 -0) </details> ### 📄 Description Claimed in the coordination issue as: carried over from the closed original repository (branch `feat/fixtures-batch3`); no new claim Depends on: none. Overlaps #366 (`v_pk_add_u16` / `v_pk_mad_i16`) and #171/#853 (`cs_w32_pk_rel_ext`); this PR covers all eleven integer forms in two fixtures with the full `op_sel`/`op_sel_hi`/`clamp` grid and CPU fixtures, so the overlapping rows can be dropped from whichever lands second. ### What and why Two wave32 GPU fixtures for the packed 16-bit integer ops in `docs/design.md`: - `cs_pk_int16_u`: the six u16 forms (`v_pk_add/sub_u16`, `v_pk_mul_lo_u16`, `v_pk_mad_u16`, `v_pk_max/min_u16`) with `op_sel`/`op_sel_hi` and `clamp` on add and sub; - `cs_pk_int16_i`: the five i16 forms with `op_sel`/`op_sel_hi` and `clamp` on add, sub and mad. Each header derives its eight words. Both are registered in `check.py` and `scripts/run_gpu_tests.py`; `tests/semantic/test_pk_int16_gpu_fixtures.py` runs the same disassembly through the translator and the interpreter and checks the headers, `CS_DUMPS` and the runner table against it. `docs/design.md` and `docs/shader_validation.md` name the fixtures and the measured result. The `.s` files under `tests/semantic/fixtures/disasm/` are generated from the author's hand-written `.asm` sources by `tests/semantic/regen_fixtures.py` (the marker-based mechanism already on main), not a dump from the game. ### Tested - `python3 -m unittest discover -s tests/semantic -p "test_pk_int16_gpu_fixtures.py"`: 3 tests, OK. - `python3 -m pytest tests/test_shader_checks.py -x -q`: 91 passed, 333 subtests passed. - `python3 tests/semantic/regen_fixtures.py --check`: clean. - GPU (the author's measurement, not repeated here): gfx1036, RADV `RAPHAEL_MENDOCINO`, Mesa 27.0.0-devel, 2/2 fixtures, 16/16 words exact. 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. (No new rule; the existing row now names the GPU confirmation.) --- <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#1074
No description provided.