Repository navigation
Conversation
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Clean-Room Peer Review for PR #822 (tests: build.py and check.py pick the f16 interpolation fallback from the device)
Excellent cross-platform graphics test harness parity:
- Device Probe Alignment: Reconciles
untime/test/shaders/build.py and check.py with scripts/run_gpu_tests.py by querying ools/vk_subgroup_info.py for per_vertex_inputs support. - MoltenVK & Metal Parity: Automatically selects --f16-interp-fallback on devices lacking PerVertexKHR decoration (e.g., MoltenVK on macOS/Metal), gracefully skipping ps_ij_computed and allowing ps_interp_f16_high to pass without requiring manual env vars.
- Explicit Override Controls: Respects LEONIDA_F16_INTERP_FALLBACK=1 (force on) and
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Clean-room verified (zero game data). Device probe fallback for 16-bit interpolation without PerVertexKHR (MoltenVK) cleanly mirrors run_gpu_tests.py. Unit tests pass (tests/test_shader_build_fallbacks.py: 5/5 PASS).
… the device (TEST-CHECK-F16-FALLBACK) 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). build.py and check.py only did so 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 failed. Both scripts now ask the device when the variable is unset, the way they already do for the barycentric fallback, and take 1/0 (true/false, yes/no, on/off) as run_gpu_tests.py does. On an Apple M5 (MoltenVK 1.4.2) check.py goes from 175 of 220 pass, 39 skipped, 6 failed to 176 pass, 40 skipped, 4 failed: ps_interp_f16_high passes and ps_ij_computed is a SKIP. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
d0e7a36 to
1bca051
Compare
|
This conflicts with #1444 in def barycentric_fallback():
...
return False
# A comment line a .asm carries when llvm-mc cannot assemble it (cs_dpp_cmp.asm: a VOPC compare in DPP form).
# scripts/run_gpu_tests.py has the same line; tests/test_shader_build_text_only.py checks that the two agree.
TEXT_ONLY_MARK = "; run_gpu_tests: text only, llvm-mc has no gfx1013 encoding for an instruction here"
def text_only_listing(name, raw):
... # unchanged from #1444
def f16_interp_fallback_override():
... # unchanged from this PR
def f16_interp_fallback():
... # unchanged from this PRChecked on an Apple M3 (macOS 26.5.1) with both merged that way on |
Claimed in the coordination issue as: TEST-CHECK-F16-FALLBACK (claim)
What and why
scripts/run_gpu_tests.pyandmake_game.pytranslate with--f16-interp-fallbackby themselves wheretools/vk_subgroup_info.pyreportsper_vertex_inputsfalse (MoltenVK).runtime/test/shaders/build.pyandcheck.pydid so only withLEONIDA_F16_INTERP_FALLBACK=1. So the two-step form on a Mac builtps_ij_computedandps_interp_f16_highfor PerVertexKHR inputs, andcheck.pyreported both as "vk_harness failed or returned no pixels". Every Apple record lists those two ascheck.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 leavingps_ij_computedout).check.py:F16_HALVEScomes from the same rule, so the two scripts agree on how the shaders were translated.1/0(andtrue/false,yes/no,on/off), asrun_gpu_tests.pyreads it. Before, only1meant anything here.docs/testing.md: the two paragraphs that saidbuild.pytranslates with the flag only when the variable is1.run_gpu_tests.pyis 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
maind0da7dade. The two-step form,build.pythencheck.py:LEONIDA_F16_INTERP_FALLBACK01ps_interp_f16_high(nowok) andps_ij_computed(nowSKIP, and not built). The four left arecs_fma_fused,cs_imgload_tfe,cs_imgload_d16_tfeand the intermittentps_imgatomic(GPU test: ps_imgatomic loses atomic updates intermittently on MoltenVK 1.4.2 (Apple M5 Pro); KosmicKrisp passes #543), which passed in the1run after the change, giving 177 there.1(280 of 280).tests/test_shader_build_fallbacks.py: 8 tests OK. The probe is pinned inrun_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 whenps_imgatomicpasses).ctest: 72/72.main.tests/test_tool_startup.pyandtests/test_tool_stdout_encoding.py. Both fail the same way on untouchedmaind0da7dade, overtools/native_pso_hashes.py.tests/test_docs_*.pyandtests/test_i18n_index.pypass.Not tested: a device without
VK_KHR_fragment_shader_barycentric(llvmpipe, NVIDIA Pascal), whereper_vertex_inputsis false too. There the two-step form now takes the pathrun_gpu_tests.pyalready takes: vertex shaders also export the decoded halves,ps_interp_f16_highreads them andps_ij_computedis left out. The CMake fixtures built throughbuild.pyfollow the same rule; on this Macctestpasses with them.GPUs tested: Apple M5 (8-core GPU), MoltenVK 1.4.2, macOS 27.2.1 (26B131)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🤖 Generated with Claude Code