[PR #822] tests: build.py and check.py pick the f16 interpolation fallback from the device (TEST-CHECK-F16-FALLBACK) #861

Open
opened 2026-11-26 20:19:18 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/822
Author: @hugo0024
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: check-f16-fallback


📝 Commits (1)

  • 1bca051 tests: build.py and check.py pick the f16 interpolation fallback from the device (TEST-CHECK-F16-FALLBACK)

📊 Changes

4 files changed (+151 additions, -15 deletions)

View changed files

📝 docs/testing.md (+7 -4)
📝 runtime/test/shaders/build.py (+33 -5)
📝 runtime/test/shaders/check.py (+29 -3)
📝 tests/test_shader_build_fallbacks.py (+82 -3)

📄 Description

Claimed in the coordination issue as: TEST-CHECK-F16-FALLBACK (claim)

What and why

scripts/run_gpu_tests.py and make_game.py translate with --f16-interp-fallback by themselves where tools/vk_subgroup_info.py reports per_vertex_inputs false (MoltenVK). runtime/test/shaders/build.py and check.py did so only with LEONIDA_F16_INTERP_FALLBACK=1. So the two-step form on a Mac built ps_ij_computed and ps_interp_f16_high for PerVertexKHR inputs, and check.py reported both as "vk_harness failed or returned no pixels". Every Apple record lists those two as check.py-only failures (#552, #564, #785).

Both scripts now ask the device when the variable is unset, the way they already do for the barycentric fallback:

  • build.py: f16_interp_fallback() replaces the two == "1" reads (the translator flag, and leaving ps_ij_computed out).
  • check.py: F16_HALVES comes from the same rule, so the two scripts agree on how the shaders were translated.
  • The variable takes 1/0 (and true/false, yes/no, on/off), as run_gpu_tests.py reads it. Before, only 1 meant anything here.
  • A device that gives no answer leaves the fallback off, as before.
  • docs/testing.md: the two paragraphs that said build.py translates with the flag only when the variable is 1.

run_gpu_tests.py is unchanged. The open claim for computed I/J pairs under this fallback (comment) is a translator change and is not touched here.

Tested

Apple M5, MoltenVK 1.4.2, at main d0da7dade. The two-step form, build.py then check.py:

LEONIDA_F16_INTERP_FALLBACK Before After
unset 281 built; 175 of 220 pass, 39 skipped, 6 failed 280 built; 176 of 220 pass, 40 skipped, 4 failed
0 same as unset 281 built; 175 of 220 pass, 39 skipped, 6 failed
1 280 built; 176 of 220 pass, 40 skipped, 4 failed same as before
  • The two failures that go away are ps_interp_f16_high (now ok) and ps_ij_computed (now SKIP, and not built). The four left are cs_fma_fused, cs_imgload_tfe, cs_imgload_d16_tfe and the intermittent ps_imgatomic (#543), which passed in the 1 run after the change, giving 177 there.
  • After the change, the modules built with the variable unset are byte-identical to those built with 1 (280 of 280).
  • tests/test_shader_build_fallbacks.py: 8 tests OK. The probe is pinned in run_build, so the file no longer depends on the GPU of the machine running it. Without the source change the three new tests fail.
  • run_gpu_tests.py: 184/249 passed, 61 skipped, 4 failed (the same four; 185 when ps_imgatomic passes). ctest: 72/72.
  • Translator suite: 465 files, 6108 tests, 0 files failed. pytest files: 1868 passed, 18 skipped, as on main.
  • Standard-library loop: 484 files, 2 failed, tests/test_tool_startup.py and tests/test_tool_stdout_encoding.py. Both fail the same way on untouched main d0da7dade, over tools/native_pso_hashes.py.
  • tests/test_docs_*.py and tests/test_i18n_index.py pass.

Not tested: a device without VK_KHR_fragment_shader_barycentric (llvmpipe, NVIDIA Pascal), where per_vertex_inputs is false too. There the two-step form now takes the path run_gpu_tests.py already takes: vertex shaders also export the decoded halves, ps_interp_f16_high reads them and ps_ij_computed is left out. The CMake fixtures built through build.py follow the same rule; on this Mac ctest passes with them.

GPUs tested: Apple M5 (8-core GPU), MoltenVK 1.4.2, macOS 27.2.1 (26B131)

AI-assisted: yes

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.

🤖 Generated with Claude Code


🔄 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/822 **Author:** [@hugo0024](https://github.com/hugo0024) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `check-f16-fallback` --- ### 📝 Commits (1) - [`1bca051`](https://github.com/ubiquitarianism/leonida/commit/1bca0519b6ed09c8cc5bddb27c424dac12d10ecb) tests: build.py and check.py pick the f16 interpolation fallback from the device (TEST-CHECK-F16-FALLBACK) ### 📊 Changes **4 files changed** (+151 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `docs/testing.md` (+7 -4) 📝 `runtime/test/shaders/build.py` (+33 -5) 📝 `runtime/test/shaders/check.py` (+29 -3) 📝 `tests/test_shader_build_fallbacks.py` (+82 -3) </details> ### 📄 Description Claimed in the coordination issue as: TEST-CHECK-F16-FALLBACK ([claim](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7133634583)) ### What and why `scripts/run_gpu_tests.py` and `make_game.py` translate with `--f16-interp-fallback` by themselves where `tools/vk_subgroup_info.py` reports `per_vertex_inputs` false (MoltenVK). `runtime/test/shaders/build.py` and `check.py` did so only with `LEONIDA_F16_INTERP_FALLBACK=1`. So the two-step form on a Mac built `ps_ij_computed` and `ps_interp_f16_high` for PerVertexKHR inputs, and `check.py` reported both as "vk_harness failed or returned no pixels". Every Apple record lists those two as `check.py`-only failures (#552, #564, #785). Both scripts now ask the device when the variable is unset, the way they already do for the barycentric fallback: - `build.py`: `f16_interp_fallback()` replaces the two `== "1"` reads (the translator flag, and leaving `ps_ij_computed` out). - `check.py`: `F16_HALVES` comes from the same rule, so the two scripts agree on how the shaders were translated. - The variable takes `1`/`0` (and `true`/`false`, `yes`/`no`, `on`/`off`), as `run_gpu_tests.py` reads it. Before, only `1` meant anything here. - A device that gives no answer leaves the fallback off, as before. - `docs/testing.md`: the two paragraphs that said `build.py` translates with the flag only when the variable is `1`. `run_gpu_tests.py` is unchanged. The open claim for computed I/J pairs under this fallback ([comment](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7130173128)) is a translator change and is not touched here. ### Tested Apple M5, MoltenVK 1.4.2, at `main` `d0da7dade`. The two-step form, `build.py` then `check.py`: | `LEONIDA_F16_INTERP_FALLBACK` | Before | After | |---|---|---| | unset | 281 built; 175 of 220 pass, 39 skipped, 6 failed | 280 built; 176 of 220 pass, 40 skipped, 4 failed | | `0` | same as unset | 281 built; 175 of 220 pass, 39 skipped, 6 failed | | `1` | 280 built; 176 of 220 pass, 40 skipped, 4 failed | same as before | - The two failures that go away are `ps_interp_f16_high` (now `ok`) and `ps_ij_computed` (now `SKIP`, and not built). The four left are `cs_fma_fused`, `cs_imgload_tfe`, `cs_imgload_d16_tfe` and the intermittent `ps_imgatomic` (#543), which passed in the `1` run after the change, giving 177 there. - After the change, the modules built with the variable unset are byte-identical to those built with `1` (280 of 280). - `tests/test_shader_build_fallbacks.py`: 8 tests OK. The probe is pinned in `run_build`, so the file no longer depends on the GPU of the machine running it. Without the source change the three new tests fail. - `run_gpu_tests.py`: 184/249 passed, 61 skipped, 4 failed (the same four; 185 when `ps_imgatomic` passes). `ctest`: 72/72. - Translator suite: 465 files, 6108 tests, 0 files failed. pytest files: 1868 passed, 18 skipped, as on `main`. - Standard-library loop: 484 files, 2 failed, `tests/test_tool_startup.py` and `tests/test_tool_stdout_encoding.py`. Both fail the same way on untouched `main` `d0da7dade`, over `tools/native_pso_hashes.py`. - `tests/test_docs_*.py` and `tests/test_i18n_index.py` pass. Not tested: a device without `VK_KHR_fragment_shader_barycentric` (llvmpipe, NVIDIA Pascal), where `per_vertex_inputs` is false too. There the two-step form now takes the path `run_gpu_tests.py` already takes: vertex shaders also export the decoded halves, `ps_interp_f16_high` reads them and `ps_ij_computed` is left out. The CMake fixtures built through `build.py` follow the same rule; on this Mac `ctest` passes with them. GPUs tested: Apple M5 (8-core GPU), MoltenVK 1.4.2, macOS 27.2.1 (26B131) AI-assisted: yes ### 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. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#861
No description provided.