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

Manually merged
github merged 2 commits from gh-pr/180/head into gh-pr/180/base 2026-11-26 08:47:47 +00:00
Owner

@⁠ItsMrDubey on GitHub · 2026-11-24 02:36 UTC · original
ItsMrDubey:reviewbd-test-checks → main · +48 −4 · 2 files · 2 commits · merged 2026-11-24 03:28 UTC

Claimed in the coordination issue as: OLD-5262, OLD-5273 (#14)

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.
**@⁠ItsMrDubey** on GitHub · 2026-11-24 02:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/180) `ItsMrDubey:reviewbd-test-checks` → `main` · +48 −4 · 2 files · 2 commits · merged 2026-11-24 03:28 UTC Claimed in the coordination issue as: OLD-5262, OLD-5273 (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### 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`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:47:46 +00:00
github manually merged commit e1e6343b9a into gh-pr/180/base 2026-11-26 08:47:47 +00:00
Author
Owner

@⁠moffington on GitHub · 2026-11-24 03:03 UTC · original

Tested bddd3f50 against merge base 9ec34cdf on Linux with an RTX 3060, NVIDIA driver 615.78.08, and Vulkan reporting 32..32 subgroups.

  • ms_wave_info_s3 went from SKIP → PASS in standalone check.py. The GPU suite passed at both revisions with 4096/4096 exact pixels.
  • ms_w64x_ballot still skipped in both runners with wave64 emulation disabled.
**@⁠moffington** on GitHub · 2026-11-24 03:03 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/180#issuecomment-7120735950) Tested bddd3f50 against merge base 9ec34cdf on Linux with an RTX 3060, NVIDIA driver 615.78.08, and Vulkan reporting 32..32 subgroups. - ms_wave_info_s3 went from SKIP → PASS in standalone check.py. The GPU suite passed at both revisions with 4096/4096 exact pixels. - ms_w64x_ballot still skipped in both runners with wave64 emulation disabled.
This discussion has been locked. Commenting is limited to contributors.
No description provided.