TEST-PK-MUL-GPUAV: size and verify the packed-multiply fixture for all lanes #481

Closed
csmith105 wants to merge 1 commit from upstream-pr/481 into main
csmith105 commented 2026-11-24 06:09:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by csmith105 on 2026-11-24T06:09:12Z.


Claimed in the coordination issue as: TEST-PK-MUL-GPUAV

What and why

cs_pk_mul_lo_const dispatches 32 lanes that each read/write four words, requiring 512 bytes. Both GPU runners used the harness default 256-byte output buffer and checked only the first eight console words. With GPU-assisted validation, stores from lane 16 onward go out of bounds even though those first words match the oracle (the outstanding finding reported with #382).

Use one shared fixture helper in both runners to allocate 128 words and compare every lane's readback. Keep nonzero harness exits and missing, short, or corrupt readbacks as failures. Shader translation, the synthetic shader, and global harness defaults are unchanged.

Tested

Native Windows 11, NVIDIA RTX 3080 10 GB, driver 610.88, SPIRV-Tools 2026.4, Khronos validation layer 1.4.357.0; wave64 emulation and GPU-assisted validation enabled:

  • Baseline default allocation: exit 1 with an out-of-bounds store at invocation 16, buffer size 256 bytes.
  • Same SPIR-V with the required allocation: exit 0; all 128 words match the fixture's recorded RDNA2 oracle.
  • Patched run_gpu_tests.py --filter cs_pk_mul_lo_const --require-pass using checked-in disassembly: 1/1 translated, 1/1 passed spirv-val, GPU pass with 128/128 exact words. Before/after SPIR-V is byte-identical.
  • Legacy shared fixture helper also passes on the GPU under the same settings.
  • Focused Python tests pass: fixture regression (3), shader checks (87), GPU runner (62), readback checks (1). They cover full allocation, validation environment/subgroup forwarding, corrupted final lane, incomplete/missing dump, and nonzero harness status.
  • Full translator semantic suite: 465 files / 6,104 tests, zero failed files in 393 seconds (python -I scripts/run_semantic_tests.py tests/semantic -j 8, SPIRV-Tools available). Compilation, CLI smoke, no-game-data checks and git diff --check also pass. Independent source review found no blockers.

GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 610.88, Windows 11 build 26300.

AI-assisted: yes, OpenAI Codex, supervised through csmith105's session.

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption, including in quoted logs.
  • Translator contract table: not applicable; no translator rule changes.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5467075716 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/481). Originally posted by [csmith105](https://github.com/csmith105) on 2026-11-24T06:09:12Z. --- Claimed in the coordination issue as: [TEST-PK-MUL-GPUAV](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7123460735) ### What and why `cs_pk_mul_lo_const` dispatches 32 lanes that each read/write four words, requiring 512 bytes. Both GPU runners used the harness default 256-byte output buffer and checked only the first eight console words. With GPU-assisted validation, stores from lane 16 onward go out of bounds even though those first words match the oracle (the outstanding finding reported with #382). Use one shared fixture helper in both runners to allocate 128 words and compare every lane's readback. Keep nonzero harness exits and missing, short, or corrupt readbacks as failures. Shader translation, the synthetic shader, and global harness defaults are unchanged. ### Tested Native Windows 11, NVIDIA RTX 3080 10 GB, driver 610.88, SPIRV-Tools 2026.4, Khronos validation layer 1.4.357.0; wave64 emulation and GPU-assisted validation enabled: - Baseline default allocation: exit 1 with an out-of-bounds store at invocation 16, buffer size 256 bytes. - Same SPIR-V with the required allocation: exit 0; all 128 words match the fixture's recorded RDNA2 oracle. - Patched `run_gpu_tests.py --filter cs_pk_mul_lo_const --require-pass` using checked-in disassembly: 1/1 translated, 1/1 passed spirv-val, GPU pass with 128/128 exact words. Before/after SPIR-V is byte-identical. - Legacy shared fixture helper also passes on the GPU under the same settings. - Focused Python tests pass: fixture regression (3), shader checks (87), GPU runner (62), readback checks (1). They cover full allocation, validation environment/subgroup forwarding, corrupted final lane, incomplete/missing dump, and nonzero harness status. - Full translator semantic suite: 465 files / 6,104 tests, zero failed files in 393 seconds (`python -I scripts/run_semantic_tests.py tests/semantic -j 8`, SPIRV-Tools available). Compilation, CLI smoke, no-game-data checks and `git diff --check` also pass. Independent source review found no blockers. GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 610.88, Windows 11 build 26300. AI-assisted: yes, OpenAI Codex, supervised through csmith105's session. ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption, including in quoted logs. - [x] Translator contract table: not applicable; no translator rule changes.
PierreEbele commented 2026-11-24 21:22:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-24T21:22:58Z.


Reviewed b402eca: ran tests/test_pk_mul_lo_gpu_fixture.py and tests/test_shader_checks.py in a
sandbox on the PR (3 and 87 tests pass) and against main (main's versions pass, the PR's versions
fail on main, so they test the change), plus compileall and imports of both touched scripts and
check_no_game_data.py (clean). A mocked-harness probe shows main passing cs_pk_mul_lo_const while
lane 31's word is flipped and the fixture writes past the harness's default 64-word heap, where this
PR allocates 128 words, checks all 32 lanes and fails the same input ("word 127: expected 0x00077f6c,
got 0x00077f6d"). On Mesa llvmpipe (software Vulkan) run_gpu_tests.py --filter cs_pk_mul_lo_const.asm passes with 128/128 dumped words exact. No findings; not run on a hardware GPU. AI-assisted review.

Recommendation: Merge

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7144855705 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/481#issuecomment-7144855705). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-24T21:22:58Z. --- Reviewed b402eca: ran tests/test_pk_mul_lo_gpu_fixture.py and tests/test_shader_checks.py in a sandbox on the PR (3 and 87 tests pass) and against main (main's versions pass, the PR's versions fail on main, so they test the change), plus compileall and imports of both touched scripts and check_no_game_data.py (clean). A mocked-harness probe shows main passing cs_pk_mul_lo_const while lane 31's word is flipped and the fixture writes past the harness's default 64-word heap, where this PR allocates 128 words, checks all 32 lanes and fails the same input ("word 127: expected 0x00077f6c, got 0x00077f6d"). On Mesa llvmpipe (software Vulkan) `run_gpu_tests.py --filter cs_pk_mul_lo_const.asm` passes with 128/128 dumped words exact. No findings; not run on a hardware GPU. AI-assisted review. **Recommendation:** Merge
MoonEyes commented 2026-11-27 23:19:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T23:19:52Z.


Hi @csmith105, thanks for this pull request. It currently conflicts with main (conflicting file(s): runtime/test/shaders/check.py, scripts/run_gpu_tests.py, tests/test_shader_checks.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:7230056775 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/481#issuecomment-7230056775). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-27T23:19:52Z. --- Hi @csmith105, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `runtime/test/shaders/check.py`, `scripts/run_gpu_tests.py`, `tests/test_shader_checks.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:43:45 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


Conflicts with main in runtime/test/shaders/check.py, scripts/run_gpu_tests.py, and tests/test_shader_checks.py (main already added PK_MUL_LO_ENV at scripts/run_gpu_tests.py:1095), and full CI checks have not run on current main. Please rebase onto current main to reconcile the 32-lane / 128-word pk_mul_lo_const_test check with main's PK_MUL_LO_ENV handling and trigger a fresh green CI pass.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130551664 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/481#pullrequestreview-6130551664). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:43:45Z. **Review:** CHANGES_REQUESTED --- Conflicts with `main` in `runtime/test/shaders/check.py`, `scripts/run_gpu_tests.py`, and `tests/test_shader_checks.py` (`main` already added `PK_MUL_LO_ENV` at `scripts/run_gpu_tests.py:1095`), and full CI checks have not run on current `main`. Please rebase onto current `main` to reconcile the 32-lane / 128-word `pk_mul_lo_const_test` check with `main`'s `PK_MUL_LO_ENV` handling and trigger a fresh green CI pass. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 17:20:50 +00:00 (Migrated from github.com)

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


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