tests: GPU fixture cs_w32_cvt_flr_rpi for v_cvt_flr_i32_f32 and v_cvt_rpi_i32_f32 #226

Closed
Andretuta wants to merge 1 commit from upstream-pr/226 into main
Andretuta commented 2026-11-24 02:48:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-24T02:48:37Z.


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

What and why

Adds the hand-written wave32 compute GPU fixture runtime/test/shaders/cs_w32_cvt_flr_rpi.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_cvt_flr_i32_f32 and v_cvt_rpi_i32_f32, and updates that row in docs/design.md.

Lane 0 stores eight dwords (out[0..7]):

  • out[0] (v_cvt_flr_i32_f32(-2.5)): 0xFFFFFFFD (-3; distinguishes floor from truncate)
  • out[1] (v_cvt_rpi_i32_f32(-2.5)): 0xFFFFFFFE (-2; floor(-2.5 + 0.5))
  • out[2] (v_cvt_rpi_i32_f32(0x3EFFFFFF)): 0x00000000 (0; exact floor(x + 0.5) without binary32 rounding of 0.49999997 + 0.5)
  • out[3] (v_cvt_rpi_i32_f32(0x4B000001)): 0x00800001 (8388609; exact without binary32 tie rounding to 8388610)
  • out[4] (v_cvt_rpi_i32_f32_e64(|-2.5|)): 0x00000003 (3; VOP3 abs modifier + half-up rounding)
  • out[5] (v_cvt_flr_i32_f32_e64(-(3.25))): 0xFFFFFFFC (-4; VOP3 neg modifier + floor)
  • out[6] (v_cvt_flr_i32_f32(+qNaN 0x7FC00000)): 0x7FFFFFFF (INT_MAX saturation by sign bit)
  • out[7] (v_cvt_rpi_i32_f32(-qNaN 0xFFC00000)): 0x80000000 (INT_MIN saturation by sign bit)

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_cvt_flr_rpi --require-pass: 1/1 translated, 1/1 spirv-val, PASS cs_w32_cvt_flr_rpi 4294967293 4294967294 0 8388609 3 4294967292 2147483647 2147483648 (1/1 passed).
  • LEONIDA_W64_EMULATE=1 python -I scripts/run_gpu_tests.py --build runtime\build --filter cs_w32_cvt_flr_rpi --require-pass: 1/1 translated, 1/1 spirv-val, 1/1 passed.
  • runtime/test/shaders/build.py + check.py for cs_w32_cvt_flr_rpi: cs_w32_cvt_flr_rpi ok.
  • python -m unittest discover -s tests/semantic -p test_alu_cvt_flr_rpi.py (4/4 OK), python -I tests/test_run_gpu_tests.py (OK), python -I tests/test_gpu_build_dir.py (OK), python -I tests/test_design_contract_rows.py (OK), python -I tests/test_docs_encoding.py (OK), python -I tests/test_docs_table_rows.py (OK).
  • python -I scripts/check_no_game_data.py runtime/test/shaders/cs_w32_cvt_flr_rpi.asm runtime/test/shaders/check.py scripts/run_gpu_tests.py docs/design.md — pass; LF-only line endings verified on all four files.

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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5465138825 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/226). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-24T02:48:37Z. --- > Carried over from **old PR 9960** by `ramon-victor` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9960`, 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-7116862079 ### What and why Adds the hand-written wave32 compute GPU fixture `runtime/test/shaders/cs_w32_cvt_flr_rpi.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_cvt_flr_i32_f32` and `v_cvt_rpi_i32_f32`, and updates that row in `docs/design.md`. Lane 0 stores eight dwords (`out[0..7]`): - `out[0]` (`v_cvt_flr_i32_f32(-2.5)`): `0xFFFFFFFD` (`-3`; distinguishes floor from truncate) - `out[1]` (`v_cvt_rpi_i32_f32(-2.5)`): `0xFFFFFFFE` (`-2`; `floor(-2.5 + 0.5)`) - `out[2]` (`v_cvt_rpi_i32_f32(0x3EFFFFFF)`): `0x00000000` (`0`; exact `floor(x + 0.5)` without binary32 rounding of `0.49999997 + 0.5`) - `out[3]` (`v_cvt_rpi_i32_f32(0x4B000001)`): `0x00800001` (`8388609`; exact without binary32 tie rounding to `8388610`) - `out[4]` (`v_cvt_rpi_i32_f32_e64(|-2.5|)`): `0x00000003` (`3`; VOP3 `abs` modifier + half-up rounding) - `out[5]` (`v_cvt_flr_i32_f32_e64(-(3.25))`): `0xFFFFFFFC` (`-4`; VOP3 `neg` modifier + floor) - `out[6]` (`v_cvt_flr_i32_f32(+qNaN 0x7FC00000)`): `0x7FFFFFFF` (`INT_MAX` saturation by sign bit) - `out[7]` (`v_cvt_rpi_i32_f32(-qNaN 0xFFC00000)`): `0x80000000` (`INT_MIN` saturation by sign bit) ### 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_cvt_flr_rpi --require-pass`: 1/1 translated, 1/1 `spirv-val`, `PASS cs_w32_cvt_flr_rpi 4294967293 4294967294 0 8388609 3 4294967292 2147483647 2147483648` (1/1 passed). - `LEONIDA_W64_EMULATE=1 python -I scripts/run_gpu_tests.py --build runtime\build --filter cs_w32_cvt_flr_rpi --require-pass`: 1/1 translated, 1/1 `spirv-val`, 1/1 passed. - `runtime/test/shaders/build.py` + `check.py` for `cs_w32_cvt_flr_rpi`: `cs_w32_cvt_flr_rpi ok`. - `python -m unittest discover -s tests/semantic -p test_alu_cvt_flr_rpi.py` (4/4 OK), `python -I tests/test_run_gpu_tests.py` (OK), `python -I tests/test_gpu_build_dir.py` (OK), `python -I tests/test_design_contract_rows.py` (OK), `python -I tests/test_docs_encoding.py` (OK), `python -I tests/test_docs_table_rows.py` (OK). - `python -I scripts/check_no_game_data.py runtime/test/shaders/cs_w32_cvt_flr_rpi.asm runtime/test/shaders/check.py scripts/run_gpu_tests.py docs/design.md` — pass; LF-only line endings verified on all four files. 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.
GeorgiyDemo commented 2026-11-24 07:32:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by GeorgiyDemo on 2026-11-24T07:32:28Z.


Tested 2ae27e43 on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), against main d42773d07:

  • MoltenVK 1.4.2 (subgroup 4..32): cs_w32_cvt_flr_rpi PASS, words 4294967293 4294967294 0 8388609 3 4294967292 2147483647 2147483648.
  • KosmicKrisp (Mesa 26.3.1, subgroup 32..32): the same words, PASS.
  • 1 shader translated, 1 pass spirv-val.

Binaries from main (only check.py, run_gpu_tests.py and the fixture changed). llvm-mc 23.1.6. Synthetic fixtures only, no game data. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7125103137 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/226#issuecomment-7125103137). Originally posted by [GeorgiyDemo](https://github.com/GeorgiyDemo) on 2026-11-24T07:32:28Z. --- Tested `2ae27e43` on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), against `main` `d42773d07`: - **MoltenVK 1.4.2** (subgroup 4..32): `cs_w32_cvt_flr_rpi` PASS, words `4294967293 4294967294 0 8388609 3 4294967292 2147483647 2147483648`. - **KosmicKrisp** (Mesa 26.3.1, subgroup 32..32): the same words, PASS. - 1 shader translated, 1 pass `spirv-val`. Binaries from `main` (only `check.py`, `run_gpu_tests.py` and the fixture changed). llvm-mc 23.1.6. Synthetic fixtures only, no game data. AI-assisted.
ImLele69 commented 2026-11-24 11:37:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ImLele69 on 2026-11-24T11:37:18Z.


Tested on Linux, merged onto main 21625bca8 (PR head 2ae27e438, 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_cvt_flr_rpi: 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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7130333168 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/226#issuecomment-7130333168). Originally posted by [ImLele69](https://github.com/ImLele69) on 2026-11-24T11:37:18Z. --- Tested on Linux, merged onto `main` `21625bca8` (PR head `2ae27e438`, 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_cvt_flr_rpi`: 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).
aslan2142 commented 2026-12-01 11:42:43 +00:00 (Migrated from github.com)

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


Draft PR review note: this carried-over PR currently conflicts with main (in docs/design.md, runtime/test/shaders/check.py, and scripts/run_gpu_tests.py) and its CI run was cancelled. Please rebase onto current main, mark ready for review, and run fresh CI if you want to land cs_w32_cvt_flr_rpi.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7310025057 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/226#issuecomment-7310025057). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:42:43Z. --- Draft PR review note: this carried-over PR currently conflicts with `main` (in `docs/design.md`, `runtime/test/shaders/check.py`, and `scripts/run_gpu_tests.py`) and its CI run was cancelled. Please rebase onto current `main`, mark ready for review, and run fresh CI if you want to land `cs_w32_cvt_flr_rpi`. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 12:14:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T12:14:59Z.


Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review.

(AI-assisted triage.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7310863088 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/226#issuecomment-7310863088). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T12:14:59Z. --- Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review. *(AI-assisted triage.)*
aslan2142 commented 2026-12-01 12:58:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T12:58:37Z.

Review: CHANGES_REQUESTED


Now ready for review, requesting changes before merge:

  • Merge conflicts (CONFLICTING/DIRTY): conflicts with main in docs/design.md, runtime/test/shaders/check.py, and scripts/run_gpu_tests.py.
  • CI: checks from 2026-11-24 were cancelled. Please rebase onto current main and run fresh green CI.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6131711666 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/226#pullrequestreview-6131711666). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T12:58:37Z. **Review:** CHANGES_REQUESTED --- Now ready for review, requesting changes before merge: - **Merge conflicts (`CONFLICTING`/`DIRTY`)**: conflicts with `main` in `docs/design.md`, `runtime/test/shaders/check.py`, and `scripts/run_gpu_tests.py`. - **CI**: checks from 2026-11-24 were cancelled. Please rebase onto current `main` and run fresh green CI. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 16:29:09 +00:00 (Migrated from github.com)

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


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