test(gpu): cover EXEC-masked sdst, global atomics, clamp, the mad flush and f64 compares #1039

Closed
YaBulochka wants to merge 1 commit from upstream-pr/1039 into main
YaBulochka commented 2026-11-24 17:06:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by YaBulochka on 2026-11-24T17:06:42Z.


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

Depends on: none. Overlaps #1012 (v_cmp_*_f64 / v_cmpx_*_f64 readback), #173 (ds_mskor, integer clamp), #373 (v_mac_legacy_f32) and #411/#413 (global atomics). Each of those rows also has a fixture here; whichever lands first, the other can drop the row it covered.

What and why

Nine wave32 GPU fixtures for docs/design.md rows that had no GPU check:

  • cs_w32_sdst_exec (#218): all eight carry/sign-out ops under EXEC = 0xAAAAAAAA with uniform carrying operands; every sdst is 0xAAAAAAAA (16 set lanes | 1 << 8), so inactive lanes write 0 and active ones write their bit. The six *_co_* forms and both v_mad_*64 ops are covered.
  • cs_global_atomic32_{int,rtn,float,x2} (#226): the first global-atomic fixtures in the corpus — add/sub/smin/umin/smax/umax/and/or; xor/swap/inc/dec and four glc returns; fmin/fmax on 1.0/2.0, a qNaN and -0/+0 plus cmpswap hit and miss; and/or/xor/swap_x2 on 8-byte elements.
  • cs_w32_clamp32 / cs_w32_clamp16 (#265): v_add/sub/subrev_nc_u32, v_add/sub_nc_i32, the 16-bit _nc_ forms and the six carry ops with clamp.
  • cs_w32_mad_denorm (#379/#380): subnormal operand and subnormal product for v_mad_f32, v_mac_f32, v_mad_legacy_f32 and v_mac_legacy_f32, one clamp case and a non-flushing control.
  • cs_w32_vcmp_f64 (#381): all 16 predicates in both v_cmp_*_f64 and v_cmpx_*_f64, four predicates per eight-word dump.

Registered in check.py (WAVE32_DUMPS, WAVE32_LANE_DUMPS, CS_DUMPS) and scripts/run_gpu_tests.py; tests/semantic/test_batch4_gpu_fixtures.py replays the disassembly in the interpreter and keeps the headers, CS_DUMPS and the runner table in step. The .s fixtures are generated from the author's hand-written .asm sources (not game dumps) and --check is clean. docs/design.md rows 218, 226, 265, 379, 380 and 381 and docs/shader_validation.md name the fixtures.

Tested

  • python3 -m unittest discover -s tests/semantic -p "test_batch4_gpu_fixtures.py": 3 tests, OK.
  • python3 -m pytest tests/test_shader_checks.py -x -q: 91 passed, 393 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; 9/9 fixtures and 72/72 words exact through both runners.

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 rows now name the GPU confirmation.)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5476775147 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1039). Originally posted by [YaBulochka](https://github.com/YaBulochka) on 2026-11-24T17:06:42Z. --- Claimed in the coordination issue as: carried over from the closed original repository (branch `feat/fixtures-batch4`); no new claim Depends on: none. Overlaps #1012 (`v_cmp_*_f64` / `v_cmpx_*_f64` readback), #173 (`ds_mskor`, integer clamp), #373 (`v_mac_legacy_f32`) and #411/#413 (global atomics). Each of those rows also has a fixture here; whichever lands first, the other can drop the row it covered. ### What and why Nine wave32 GPU fixtures for `docs/design.md` rows that had no GPU check: - `cs_w32_sdst_exec` (#218): all eight carry/sign-out ops under `EXEC = 0xAAAAAAAA` with uniform carrying operands; every sdst is `0xAAAAAAAA` (`16` set lanes `| 1 << 8`), so inactive lanes write 0 and active ones write their bit. The six `*_co_*` forms and both `v_mad_*64` ops are covered. - `cs_global_atomic32_{int,rtn,float,x2}` (#226): the first global-atomic fixtures in the corpus — add/sub/smin/umin/smax/umax/and/or; xor/swap/inc/dec and four `glc` returns; fmin/fmax on 1.0/2.0, a qNaN and -0/+0 plus cmpswap hit and miss; and/or/xor/swap_x2 on 8-byte elements. - `cs_w32_clamp32` / `cs_w32_clamp16` (#265): `v_add/sub/subrev_nc_u32`, `v_add/sub_nc_i32`, the 16-bit `_nc_` forms and the six carry ops with `clamp`. - `cs_w32_mad_denorm` (#379/#380): subnormal operand and subnormal product for `v_mad_f32`, `v_mac_f32`, `v_mad_legacy_f32` and `v_mac_legacy_f32`, one `clamp` case and a non-flushing control. - `cs_w32_vcmp_f64` (#381): all 16 predicates in both `v_cmp_*_f64` and `v_cmpx_*_f64`, four predicates per eight-word dump. Registered in `check.py` (`WAVE32_DUMPS`, `WAVE32_LANE_DUMPS`, `CS_DUMPS`) and `scripts/run_gpu_tests.py`; `tests/semantic/test_batch4_gpu_fixtures.py` replays the disassembly in the interpreter and keeps the headers, `CS_DUMPS` and the runner table in step. The `.s` fixtures are generated from the author's hand-written `.asm` sources (not game dumps) and `--check` is clean. `docs/design.md` rows 218, 226, 265, 379, 380 and 381 and `docs/shader_validation.md` name the fixtures. ### Tested - `python3 -m unittest discover -s tests/semantic -p "test_batch4_gpu_fixtures.py"`: 3 tests, OK. - `python3 -m pytest tests/test_shader_checks.py -x -q`: 91 passed, 393 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; 9/9 fixtures and 72/72 words exact through both runners. 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 rows now name the GPU confirmation.)
robot00f commented 2026-11-25 16:07:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by robot00f on 2026-11-25T16:07:46Z.


Independent verification on Windows + NVIDIA Pascal (discrete GPU with hardware shaderFloat64, 32-wide subgroups), complementing the RADV gfx1036 measurement in the description.

Tested 4589472436855ebdb2dac6b75e062a0d78bd319d merged cleanly onto origin/main (b0f3d399, 0 conflicts across all 22 touched/added files).

Host: Windows 10 Pro 10.0.19045, NVIDIA GeForce GTX 1050 Ti (Pascal class, 4 GB), driver 582.28, Vulkan 1.4.312 (VK_LOADER_LAYERS_DISABLE=~implicit~).

CPU & doc checks

  • python -I scripts/check_no_game_data.py on all 22 changed files → exit 0
  • python -I tests/semantic/regen_fixtures.py --check → clean
  • python -I tests/semantic/test_batch4_gpu_fixtures.py -v → 3/3 OK
  • python -I tests/test_shader_checks.py → 88/88 OK
  • python -I tests/test_docs_links.py (16/16) and python -I tests/test_docs_table_rows.py (2/2) → OK

GPU results (9/9 fixtures, 72/72 words exact, 3/3 deterministic runs)

Ran each of the nine new wave32 compute fixtures 3 times through scripts/run_gpu_tests.py --build runtime/build --filter <fixture> --require-pass, plus in the full run_gpu_tests.py pass and through runtime/test/shaders/build.py + runtime/test/shaders/check.py (9/9 translated, 9/9 spirv-val, 9/9 ok):

Fixture Dumped words (out[0..7]) Status
cs_w32_sdst_exec 272 272 272 272 272 272 272 272 3/3 PASS
cs_global_atomic32_int 2147483652 2 4294967291 3 3 4294967291 4026593280 4279238415 3/3 PASS
cs_global_atomic32_rtn 4294967295 3405705229 6 4 286331153 256 61680 43690 3/3 PASS
cs_global_atomic32_float 1065353216 1073741824 1077936128 0 67 66 85 85 3/3 PASS
cs_global_atomic32_x2 4026593280 252645135 4279238415 4294967295 1431655765 3989547399 2863315899 3435978205 3/3 PASS
cs_w32_clamp32 4294967295 0 0 2147483647 2147483648 3 12 0 3/3 PASS
cs_w32_clamp16 3735945215 3735879680 3735879680 4294967295 4294967295 0 0 0 3/3 PASS
cs_w32_mad_denorm 0 0 0 0 1088421888 0 0 0 3/3 PASS
cs_w32_vcmp_f64 12 12 12 12 0 0 15 15 (0xC 0xC 0xC 0xC 0 0 0xF 0xF) 3/3 PASS

One minor wording note (non-blocking): the commit message and PR body state that docs/design.md rows 218, 226, 265, 379, 380 and 381 also name the fixtures, whereas the diff only updates docs/shader_validation.md (which also keeps the PR conflict-free against docs/design.md churn).

AI-assisted: yes (Antigravity)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7167618054 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1039#issuecomment-7167618054). Originally posted by [robot00f](https://github.com/robot00f) on 2026-11-25T16:07:46Z. --- Independent verification on Windows + NVIDIA Pascal (discrete GPU with hardware `shaderFloat64`, 32-wide subgroups), complementing the RADV `gfx1036` measurement in the description. Tested `4589472436855ebdb2dac6b75e062a0d78bd319d` merged cleanly onto `origin/main` (`b0f3d399`, 0 conflicts across all 22 touched/added files). **Host:** Windows 10 Pro 10.0.19045, NVIDIA GeForce GTX 1050 Ti (Pascal class, 4 GB), driver 582.28, Vulkan 1.4.312 (`VK_LOADER_LAYERS_DISABLE=~implicit~`). ### CPU & doc checks - `python -I scripts/check_no_game_data.py` on all 22 changed files → exit 0 - `python -I tests/semantic/regen_fixtures.py --check` → clean - `python -I tests/semantic/test_batch4_gpu_fixtures.py -v` → 3/3 OK - `python -I tests/test_shader_checks.py` → 88/88 OK - `python -I tests/test_docs_links.py` (16/16) and `python -I tests/test_docs_table_rows.py` (2/2) → OK ### GPU results (9/9 fixtures, 72/72 words exact, 3/3 deterministic runs) Ran each of the nine new wave32 compute fixtures 3 times through `scripts/run_gpu_tests.py --build runtime/build --filter <fixture> --require-pass`, plus in the full `run_gpu_tests.py` pass and through `runtime/test/shaders/build.py` + `runtime/test/shaders/check.py` (9/9 translated, 9/9 `spirv-val`, 9/9 `ok`): | Fixture | Dumped words (`out[0..7]`) | Status | |---|---|---| | `cs_w32_sdst_exec` | `272 272 272 272 272 272 272 272` | 3/3 PASS | | `cs_global_atomic32_int` | `2147483652 2 4294967291 3 3 4294967291 4026593280 4279238415` | 3/3 PASS | | `cs_global_atomic32_rtn` | `4294967295 3405705229 6 4 286331153 256 61680 43690` | 3/3 PASS | | `cs_global_atomic32_float` | `1065353216 1073741824 1077936128 0 67 66 85 85` | 3/3 PASS | | `cs_global_atomic32_x2` | `4026593280 252645135 4279238415 4294967295 1431655765 3989547399 2863315899 3435978205` | 3/3 PASS | | `cs_w32_clamp32` | `4294967295 0 0 2147483647 2147483648 3 12 0` | 3/3 PASS | | `cs_w32_clamp16` | `3735945215 3735879680 3735879680 4294967295 4294967295 0 0 0` | 3/3 PASS | | `cs_w32_mad_denorm` | `0 0 0 0 1088421888 0 0 0` | 3/3 PASS | | `cs_w32_vcmp_f64` | `12 12 12 12 0 0 15 15` (`0xC 0xC 0xC 0xC 0 0 0xF 0xF`) | 3/3 PASS | One minor wording note (non-blocking): the commit message and PR body state that `docs/design.md` rows 218, 226, 265, 379, 380 and 381 also name the fixtures, whereas the diff only updates `docs/shader_validation.md` (which also keeps the PR conflict-free against `docs/design.md` churn). AI-assisted: yes (Antigravity)
MoonEyes commented 2026-11-28 17:57:57 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T17:57:57Z.


Hi @YaBulochka, 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:7243424118 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1039#issuecomment-7243424118). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T17:57:57Z. --- Hi @YaBulochka, 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:45:24 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


Conflicts with main in runtime/test/shaders/check.py and scripts/run_gpu_tests.py, with failing stale CI. Please rebase onto current main to resolve the conflicts and trigger a fresh green CI pass.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130579477 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1039#pullrequestreview-6130579477). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:45:24Z. **Review:** CHANGES_REQUESTED --- Conflicts with `main` in `runtime/test/shaders/check.py` and `scripts/run_gpu_tests.py`, with failing stale CI. Please rebase onto current `main` to resolve the conflicts and trigger a fresh green CI pass. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 17:22:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T17:22:02Z.


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:7319184951 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1039#issuecomment-7319184951). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T17:22:02Z. --- 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!1039
No description provided.