GPU tests: give cs_pk_mul_lo_const its 128 words, keep the exit message of a dump row (TEST-GPU-OOB-AND-HARNESS-MSG) #2453

Merged
Tyrannys merged 1 commit from upstream-pr/2453 into main 2026-11-27 20:47:23 +00:00
Tyrannys commented 2026-11-27 10:40:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Tyrannys on 2026-11-27T10:40:26Z.


Claimed in the coordination issue as: TEST-GPU-OOB-AND-HARNESS-MSG (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7215737750)

What and why

From @kevincommits' finding in #1608 (sections 2 and 3, under GPU-AV with LunarG SDK 1.4.363).

  • cs_pk_mul_lo_const wrote past its buffer. It runs 32 lanes that each store 16 bytes, which is 128 words. scripts/run_gpu_tests.py and runtime/test/shaders/check.py ran it without VKC_OUT_WORDS, so vk_compute_test gave it the default 64 words. Lanes 16-31 then wrote past the end through the buffer's device address (VUID-RuntimeSpirv-PhysicalStorageBuffer64-11819). This is the same kind of bug that 446270b08 and b9864d274 fixed. Both runners now pass VKC_OUT_WORDS=128 (check.PK_MUL_LO_ENV), and the fixture's Run: line says so. The expected words are unchanged.
  • run_gpu_tests.py dropped the failure message. The dump rows (the bounds group, cs_heap_init, cs_user_sgprs) showed the printed words whenever there were any. Under LEONIDA_VK_VALIDATION=1 the program prints the right words and then exits 1 for the validation errors, so the row said FAIL with the expected words and no reason. The new dump_result reports exit N: <program output> for a non-zero exit.

Not included: section 3, the s_barrier for the 8 single-lane LDS-atomic fixtures. The SDK on this PC (1.4.341) has no GPU-AV shared-memory data-race check: all 8 run with 0 validation errors under GPU-AV, before and after. So I can't show here that a change clears anything. It stays open for someone with SDK 1.4.363 or newer.

Tested

On Windows 11 with an RTX 4070 SUPER (NVIDIA 621.01) and Vulkan SDK 1.4.341. vk_compute_test, vk_store_test and vk_harness were built from this branch. The run used VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1, VK_KHRONOS_VALIDATION_VALIDATE_SYNC=true and LEONIDA_VK_VALIDATION=1.

  • vk_compute_test cs_pk_mul_lo_const.spv 1 dump, as on main: exit 1, 6 validation errors, all VUID-RuntimeSpirv-PhysicalStorageBuffer64-11819 (out-of-bounds writes from lanes 16+). With VKC_OUT_WORDS=128: exit 0, no validation errors, and exact words out[0..7] = 0x9e88 0x3675433 0x230000 0x77f6c twice.
  • run_gpu_tests.py --filter cs_pk_mul_lo_const:
    • on main: FAIL cs_pk_mul_lo_const 0x9e88 0x3675433 ..., the expected words with no reason, which is the reported bug;
    • with this change: PASS, 1/1.
  • CPU tests: tests/test_run_gpu_tests.py (74 OK) has a new DumpRowThatExitsNonZero with a fake process result. With main's run_gpu_tests.py and check.py it fails (3 failures). tests/test_shader_checks.py (88 OK) now checks that check.py passes VKC_OUT_WORDS=128.
  • Also run: tests/test_run_gpu_*.py (the other 6 files), tests/test_regen_fixtures.py and tests/test_text_write_line_endings.py all OK, and scripts/check_no_game_data.py on the changed files is clean.

GPUs tested: NVIDIA GeForce RTX 4070 SUPER (profile M, 12 GB desktop), driver 621.01, Windows 11, Vulkan SDK 1.4.341 validation layer with GPU-AV

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • 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. (n/a, no translator change)

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5525225918 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2453). Originally posted by [Tyrannys](https://github.com/Tyrannys) on 2026-11-27T10:40:26Z. --- Claimed in the coordination issue as: TEST-GPU-OOB-AND-HARNESS-MSG (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7215737750) ### What and why From @kevincommits' finding in #1608 (sections 2 and 3, under GPU-AV with LunarG SDK 1.4.363). - **`cs_pk_mul_lo_const` wrote past its buffer.** It runs 32 lanes that each store 16 bytes, which is 128 words. `scripts/run_gpu_tests.py` and `runtime/test/shaders/check.py` ran it without `VKC_OUT_WORDS`, so `vk_compute_test` gave it the default 64 words. Lanes 16-31 then wrote past the end through the buffer's device address (`VUID-RuntimeSpirv-PhysicalStorageBuffer64-11819`). This is the same kind of bug that 446270b08 and b9864d274 fixed. Both runners now pass `VKC_OUT_WORDS=128` (`check.PK_MUL_LO_ENV`), and the fixture's `Run:` line says so. The expected words are unchanged. - **`run_gpu_tests.py` dropped the failure message.** The dump rows (the bounds group, `cs_heap_init`, `cs_user_sgprs`) showed the printed words whenever there were any. Under `LEONIDA_VK_VALIDATION=1` the program prints the right words and then exits 1 for the validation errors, so the row said `FAIL` with the expected words and no reason. The new `dump_result` reports `exit N: <program output>` for a non-zero exit. Not included: section 3, the `s_barrier` for the 8 single-lane LDS-atomic fixtures. The SDK on this PC (1.4.341) has no GPU-AV shared-memory data-race check: all 8 run with 0 validation errors under GPU-AV, before and after. So I can't show here that a change clears anything. It stays open for someone with SDK 1.4.363 or newer. ### Tested On Windows 11 with an RTX 4070 SUPER (NVIDIA 621.01) and Vulkan SDK 1.4.341. `vk_compute_test`, `vk_store_test` and `vk_harness` were built from this branch. The run used `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1`, `VK_KHRONOS_VALIDATION_VALIDATE_SYNC=true` and `LEONIDA_VK_VALIDATION=1`. - `vk_compute_test cs_pk_mul_lo_const.spv 1 dump`, as on `main`: exit 1, `6 validation errors`, all `VUID-RuntimeSpirv-PhysicalStorageBuffer64-11819` (out-of-bounds writes from lanes 16+). With `VKC_OUT_WORDS=128`: exit 0, no validation errors, and exact words `out[0..7] = 0x9e88 0x3675433 0x230000 0x77f6c` twice. - `run_gpu_tests.py --filter cs_pk_mul_lo_const`: - on `main`: `FAIL cs_pk_mul_lo_const 0x9e88 0x3675433 ...`, the expected words with no reason, which is the reported bug; - with this change: `PASS`, 1/1. - CPU tests: `tests/test_run_gpu_tests.py` (74 OK) has a new `DumpRowThatExitsNonZero` with a fake process result. With `main`'s `run_gpu_tests.py` and `check.py` it fails (3 failures). `tests/test_shader_checks.py` (88 OK) now checks that `check.py` passes `VKC_OUT_WORDS=128`. - Also run: `tests/test_run_gpu_*.py` (the other 6 files), `tests/test_regen_fixtures.py` and `tests/test_text_write_line_endings.py` all OK, and `scripts/check_no_game_data.py` on the changed files is clean. GPUs tested: NVIDIA GeForce RTX 4070 SUPER (profile M, 12 GB desktop), driver 621.01, Windows 11, Vulkan SDK 1.4.341 validation layer with GPU-AV AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] 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. (n/a, no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
timbot103 commented 2026-11-27 11:41:16 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-27T11:41:16Z.


Independently verified head e2377070d on Windows 11 Pro 26200 with LunarG Vulkan SDK 1.4.363.0 + GPU-AV (LEONIDA_VK_VALIDATION=1, VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1), WSL llvm-mc 21.1.8, across both NVIDIA GeForce RTX 5080 (616.64) and AMD Radeon(TM) Graphics (25.10.30.02), no game files:

  • Before (origin/main @ 50ce8f51a, GPU-AV on SDK 1.4.363.0):
    • scripts/run_gpu_tests.py --filter cs_pk_mul_lo_const: FAIL (0/1 passed) on BOTH RTX 5080 and AMD Radeon — and as described in the PR, run_gpu_tests.py printed the matching hex words (0x9e88 0x3675433 ...) while silently dropping the validation error reason (vk_compute_test exited 1 under GPU-AV with default 64 words).
  • After (PR #2453 @ e2377070d, GPU-AV on SDK 1.4.363.0):
    • scripts/run_gpu_tests.py --filter cs_pk_mul_lo_const: PASS (1/1 passed) on BOTH RTX 5080 and AMD Radeon, 0 validation errors.
  • Unit tests:
    • tests/test_run_gpu_tests.py: 74/74 OK
    • tests/test_shader_checks.py: 88/88 OK

Clean, surgical fix — confirmed before/after on SDK 1.4.363.0 GPU-AV on both NVIDIA Blackwell and AMD Radeon. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7217360261 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2453#issuecomment-7217360261). Originally posted by [timbot103](https://github.com/timbot103) on 2026-11-27T11:41:16Z. --- Independently verified head `e2377070d` on Windows 11 Pro 26200 with **LunarG Vulkan SDK `1.4.363.0`** + **GPU-AV** (`LEONIDA_VK_VALIDATION=1`, `VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1`), WSL `llvm-mc 21.1.8`, across both **NVIDIA GeForce RTX 5080** (`616.64`) and **AMD Radeon(TM) Graphics** (`25.10.30.02`), no game files: - **Before (`origin/main` @ `50ce8f51a`, GPU-AV on SDK `1.4.363.0`):** - `scripts/run_gpu_tests.py --filter cs_pk_mul_lo_const`: **FAIL (`0/1 passed`) on BOTH RTX 5080 and AMD Radeon** — and as described in the PR, `run_gpu_tests.py` printed the matching hex words (`0x9e88 0x3675433 ...`) while silently dropping the validation error reason (`vk_compute_test` exited 1 under GPU-AV with default 64 words). - **After (PR `#2453` @ `e2377070d`, GPU-AV on SDK `1.4.363.0`):** - `scripts/run_gpu_tests.py --filter cs_pk_mul_lo_const`: **PASS (`1/1 passed`) on BOTH RTX 5080 and AMD Radeon**, 0 validation errors. - **Unit tests:** - `tests/test_run_gpu_tests.py`: **74/74 OK** - `tests/test_shader_checks.py`: **88/88 OK** Clean, surgical fix — confirmed before/after on SDK `1.4.363.0` GPU-AV on both NVIDIA Blackwell and AMD Radeon. AI-assisted.
Andretuta commented 2026-11-27 20:47:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-27T20:47:20Z.

Review: APPROVED


Verified locally at e2377070d merged with main on Windows 10 / NVIDIA GeForce RTX 3060 12 GB (driver 617.14):

  • cs_pk_mul_lo_const passes spirv-val and 1/1 on the RTX 3060 harness.
  • test_run_gpu_tests.py (74), shader checker tests (88), fixture tests (7), and line-ending/write tests (3) all pass.
  • Independent GPU-AV check also confirmed on RTX 5080 and AMD; the hosted Runtime failures are the shared base issues (#2055, vk_xdxr_postbuild_readback, macOS).

AI-assisted review.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6093209205 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2453#pullrequestreview-6093209205). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-27T20:47:20Z. **Review:** APPROVED --- Verified locally at `e2377070d` merged with `main` on Windows 10 / NVIDIA GeForce RTX 3060 12 GB (driver 617.14): - `cs_pk_mul_lo_const` passes `spirv-val` and 1/1 on the RTX 3060 harness. - `test_run_gpu_tests.py` (74), shader checker tests (88), fixture tests (7), and line-ending/write tests (3) all pass. - Independent GPU-AV check also confirmed on RTX 5080 and AMD; the hosted Runtime failures are the shared base issues (`#2055`, `vk_xdxr_postbuild_readback`, macOS). AI-assisted review.
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!2453
No description provided.