[PR #180] [MERGED] check: mesh gradient check fails NaN readbacks and judges ms_wave_info_s3 on 32-wide devices (OLD-5262, OLD-5273) #231

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/180
Author: @ItsMrDubey
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism

Base: main ← Head: reviewbd-test-checks


📝 Commits (2)

  • 0e0db89 check: a NaN in the mesh gradient readback is a failing pixel
  • e1e6343 check: ms_wave_info_s3 is judged on a 32-wide device, only ms_w64x_ballot needs 64 lanes

📊 Changes

2 files changed (+48 additions, -4 deletions)

View changed files

📝 runtime/test/shaders/check.py (+8 -4)
📝 tests/test_shader_checks.py (+40 -0)

📄 Description

Claimed in the coordination issue as: OLD-5262, OLD-5273 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7119646964)

What and why

Both are in mesh_w64x_test of runtime/test/shaders/check.py, the standalone judge of ms_w64x_ballot and ms_wave_info_s3.

  • old #5262: a pixel counted as wrong only when abs(got - want) > 1e-3. That comparison is false for NaN, so a readback full of NaN passed. Now every component has to be within the tolerance (abs(got - want) <= 1e-3), and NaN fails. run_gpu_tests.py already rejects non-finite frames in frame_problem.
  • old #5273: on a device with no 64-wide subgroup, the check returned None ("SKIP (full 64-wide compute subgroups unavailable)") for both shaders. ms_wave_info_s3 doesn't depend on the subgroup width: the translator sets its s3[27:24] wave id from LocalInvocationIndex >> 6 (test_mesh_s3_wave_id_emits_local_index_shift_and_bfe). run_gpu_tests.py already judges it on every device and skips only ms_w64x_ballot. The standalone check now does the same: only ms_w64x_ballot still needs 64 lanes (or LEONIDA_W64_EMULATE=1).

Two commits, one per ID. They change neighbouring lines of the same function, so they're in one PR.

Tested

Windows 11, Python 3.11.9, no GPU needed. A fake vk_harness (patched subprocess.run) writes the 64x64 RGBA32F readback and prints the device's subgroup range.

  • Before, on origin/main: an all-NaN readback for ms_w64x_ballot on a 32..64 device returned '' (pass). Correct and wrong ms_wave_info_s3 frames on a 32..32 device both returned None (skip).
  • After: 4096 of 4096 pixels differ (blue nan ...). On 32..32, the correct frame gives '' and the wrong one fails. ms_w64x_ballot on 32..32 still returns None.
  • New MeshGradientChecks in tests/test_shader_checks.py. On origin/main, 2 of its 3 tests fail. With the fix, python -I tests/test_shader_checks.py passes all 87 tests.
  • python -I tests/test_gpu_unsupported_stage.py, test_gpu_blocked_program.py, test_run_gpu_tests.py, test_gpu_build_dir.py, test_gpu_test_timeout.py, test_run_gpu_pixel_checks.py, test_partial_wave_subgroup.py, test_bary_persp_oracle.py, test_build_runtime_fallback.py and test_sampler_lod_probe.py all pass. So do python -m pytest tests/test_mesh_compute.py tests/test_f16_hw_words.py (44 passed, 18 skipped).
  • python -I scripts/check_no_game_data.py on both changed files: clean.

AI-assisted: yes

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • No new translator rule, so nothing to add to the contract table of docs/design.md.

🔄 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/180 **Author:** [@ItsMrDubey](https://github.com/ItsMrDubey) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Base:** `main` ← **Head:** `reviewbd-test-checks` --- ### 📝 Commits (2) - [`0e0db89`](https://github.com/ubiquitarianism/leonida/commit/0e0db89c68193964ede0fd850bfea747e4a4124c) check: a NaN in the mesh gradient readback is a failing pixel - [`e1e6343`](https://github.com/ubiquitarianism/leonida/commit/e1e6343b9af5723a693251610454c501b66eed54) check: ms_wave_info_s3 is judged on a 32-wide device, only ms_w64x_ballot needs 64 lanes ### 📊 Changes **2 files changed** (+48 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `runtime/test/shaders/check.py` (+8 -4) 📝 `tests/test_shader_checks.py` (+40 -0) </details> ### 📄 Description Claimed in the coordination issue as: OLD-5262, OLD-5273 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7119646964) ### What and why Both are in `mesh_w64x_test` of `runtime/test/shaders/check.py`, the standalone judge of `ms_w64x_ballot` and `ms_wave_info_s3`. - old #5262: a pixel counted as wrong only when `abs(got - want) > 1e-3`. That comparison is false for NaN, so a readback full of NaN passed. Now every component has to be within the tolerance (`abs(got - want) <= 1e-3`), and NaN fails. `run_gpu_tests.py` already rejects non-finite frames in `frame_problem`. - old #5273: on a device with no 64-wide subgroup, the check returned `None` ("SKIP (full 64-wide compute subgroups unavailable)") for both shaders. `ms_wave_info_s3` doesn't depend on the subgroup width: the translator sets its `s3[27:24]` wave id from `LocalInvocationIndex >> 6` (`test_mesh_s3_wave_id_emits_local_index_shift_and_bfe`). `run_gpu_tests.py` already judges it on every device and skips only `ms_w64x_ballot`. The standalone check now does the same: only `ms_w64x_ballot` still needs 64 lanes (or `LEONIDA_W64_EMULATE=1`). Two commits, one per ID. They change neighbouring lines of the same function, so they're in one PR. ### Tested Windows 11, Python 3.11.9, no GPU needed. A fake `vk_harness` (patched `subprocess.run`) writes the 64x64 RGBA32F readback and prints the device's subgroup range. - Before, on `origin/main`: an all-NaN readback for `ms_w64x_ballot` on a `32..64` device returned `''` (pass). Correct and wrong `ms_wave_info_s3` frames on a `32..32` device both returned `None` (skip). - After: `4096 of 4096 pixels differ (blue nan ...)`. On `32..32`, the correct frame gives `''` and the wrong one fails. `ms_w64x_ballot` on `32..32` still returns `None`. - New `MeshGradientChecks` in `tests/test_shader_checks.py`. On `origin/main`, 2 of its 3 tests fail. With the fix, `python -I tests/test_shader_checks.py` passes all 87 tests. - `python -I tests/test_gpu_unsupported_stage.py`, `test_gpu_blocked_program.py`, `test_run_gpu_tests.py`, `test_gpu_build_dir.py`, `test_gpu_test_timeout.py`, `test_run_gpu_pixel_checks.py`, `test_partial_wave_subgroup.py`, `test_bary_persp_oracle.py`, `test_build_runtime_fallback.py` and `test_sampler_lod_probe.py` all pass. So do `python -m pytest tests/test_mesh_compute.py tests/test_f16_hw_words.py` (44 passed, 18 skipped). - `python -I scripts/check_no_game_data.py` on both changed files: clean. AI-assisted: yes ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] No new translator rule, so nothing to add to the contract table of `docs/design.md`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:17:12 +01:00
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#231
No description provided.