test_make_game_argparse: the shaders stage probes two GPUs the test does not mock #2818
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2818"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-01T01:30:24Z.
Claimed in the coordination issue as: TEST-ARGPARSE-GPU-PROBE-LIST
Depends on: #1885
What and why
JobsHandlingTest.test_custom_jobs_forwarded_to_shadersassertsfallbacks=(), but it mocks only four of the sixruntime_gpu_*probes the shaders stage consults. The two it leaves out are precisely the two that answerFalseon hardwaretools/vk_subgroup_info.py:50-55documents:denorm_flush_to_zero_f32— "where it is false (e.g. NVIDIA Vulkan drivers, which report VK_FALSE)"integer_dot_product— "false only on a Vulkan 1.2 device such as MoltenVK's"When a probe answers
False,make_game.pysets the fallback flag unconditionally rather than going throughkeep_recorded_fallback()(that path is only taken forNone), so the assertion sees a fallback the test never asked for:tests/test_make_game_translator_flags.py:212-217already mocks all six probes, so this is an incomplete copy of the same list rather than a deliberate difference. This change adds the two missing patches; nothing outside thewithblock changes.Depends on: #1885— that pull request insertsruntime_gpu_mesh_shaderinto the samewithheader, so the two conflict on one line. Whichever lands second rebases trivially; I did not reorder the existing probes to dodge it.Tested
No game files or particular hardware needed.
Before/after were measured on the same commit by stashing the change, so the single failure is attributable to the missing mocks.
runtime_gpu_*answers on the machine used (Mesa llvmpipe, LLVM 23.1.0, CPU Vulkan):per_vertex_inputs=False,barycentric_fallback=False,max_push_constants_size=256,mesh_draws_crash=False,integer_dot_product=True,denorm_flush_to_zero_f32=False. Only the last one produced the failure here;integer_dot_productis mocked too because the documented Vulkan 1.2 case would fail the same way.GPUs tested: n/a — no GPU tests. The reproduction runs against a CPU Vulkan device (Mesa llvmpipe) on Fedora Linux under a VM; no hardware GPU, vendor driver or OS driver was involved.
AI-assisted: yes — MiMo-V2.6-Flash (OpenCode), which located the failure, read
make_game.pyandtools/vk_subgroup_info.pyto establish the trigger conditions, and wrote the patch. The claim and this description were drafted by it as well.Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. — n/a, no translator rule in this change.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-01T01:36:02Z.
Verified by OreoFR on macOS 27.2.1, Apple M5 (MoltenVK), Python 3.12, head
872d2e753, maind920d850d. CPU only, no game.This is the failure I'd been seeing on this Mac all night (noted on #2792 as pre-existing on main).
MEASURED
tests/test_make_game_argparse.pygives 1 failure,JobsHandlingTest::test_custom_jobs_forwarded_to_shaders.Expected: … fallbacks=()vsActual: … fallbacks=('--no-ftz32',), the same diff you quote.make_game.runtime_gpu_denorm_ftz_f32()→Falseandmake_game.runtime_gpu_integer_dot_product()→True. So it's the FTZ probe that adds--no-ftz32here, the "where it is false" casetools/vk_subgroup_info.pydocuments.READ IN CODE
patch(...)calls, with the samereturn_value=Noneas the other four. The test now no longer depends on the machine's GPU. Nothing outside the test changes.AI-assisted: Claude Code
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-01T02:13:40Z.
Verified on Windows, and the control bites: the suite fails with
main's copy of the file.maind920d850d, cherry-picked (the branch is already atmain,merge-base=d920d850d), Python 3.13.14:So the two
patch(...)calls this adds are what the failing case needs, and nothing else in the file changed.What it fixes, in its own words: the shaders stage probes
runtime_gpu_integer_dot_productandruntime_gpu_denorm_ftz_f32, and those are answered per machine. Pinning both toNonemakes the stage's list of what it asks about independent of the card - which is the reason a test of an argument parser should not depend on a GPU probe. On this machine the failure is real and reproduces frommain's file, so the flake is not hypothetical.What I did not check: that those two functions are the only probes the stage can raise on. I ran the file, not the stage against several cards, and a third probe added later would put the dependence back.
AI-assisted: yes - DeepSeek v4.1 (flash), both arms run on the machine above.
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T04:23:36Z.
Review: COMMENTED
Verified independently on Windows with an NVIDIA card (RTX 4070 Ti SUPER:
denorm_flush_to_zero_f32=False,integer_dot_product=True,per_vertex_inputs=True), so this is the documented NVIDIA case and not an llvmpipe-only one.The main failure is the quoted one:
fallbacks=()expected,('--no-ftz32',)seen (test_custom_jobs_forwarded_to_shaders, line 372). Reproduced on thed920d850dbase and again on currentorigin/main86c30fcea(the three commits since do not touch the relevant files);git merge-treeagainst current main is clean.The claim holds and no coverage is dropped: the six patches match the probe list
test_make_game_translator_flags.pyalready uses (212-217), and the test still pins the exactpreflightandshaderskwargs,fallbacks=()included. Both fallback paths stay covered in that file (run_main(integer_dot=False), andtest_failed_ftz32_probe_keeps_the_recorded_choice). It is also the only test that asserted a literalfallbacks=(...)for a realmain()run — the neighbouring one usesANY— so nothing else has the same latent failure.Two nits, both non-blocking:
Falsefor denorm FTZ andmain()then adds--no-ftz32) would match the TEST-461 note above the neighbouring test.make_game.runtime_gpu_infoonce, the waytest_make_game_wave64.pydoes, would keep a future probe from reopening the same gap the way themesh_shaderprobe did here.Imported from ubiquitarianism/leonida. Originally posted by aegish-zagi on 2026-12-01T04:49:30Z.
Verification — VERIFY-2818
Verdict: PASS (with stated limit)
872d2e75344930b796b10c33e5b75e884addba81| merge state vs main: clean merge with current main5dd6d444fin a scratch worktree (merge commit01eba8f93), no conflicts. Diff is 1 file, +3/−1:tests/test_make_game_argparse.pyonly.python -I tests/test_make_game_argparse.pyNone, so main passes too. The failure the PR fixes is hardware-dependent (a probe answeringFalse, e.g. NVIDIA Vulkan / MoltenVK), which I cannot reproduce here — MEASURED locally, READ IN CODE for the failure path.make_game.pyconsults exactly sixruntime_gpu_*probes in the shaders stage (per_vertex, barycentric_fallback, max_push_constants, mesh_draws_crash, integer_dot_product, denorm_ftz_f32 — lines ~3754–3809). The test on main mocked only the first four; this PR adds the missingruntime_gpu_integer_dot_productandruntime_gpu_denorm_ftz_f32patches, matching the six-probe list already used intests/test_make_game_translator_flags.py:212-217. Where a probe isFalse,make_game.py:3801-3809sets the fallback unconditionally, which is exactly thefallbacks=('--no-ftz32',)failure described. No game data, no other files touched.AI-assisted: yes (Muse Wonder, Muse by Meta)
Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-01T05:17:50Z.
Measurement: with this pull request merged, every standalone test file in the repository passes
mainis at86c30fce(which already includes #2825 and #2827, the two reds from this morning). I built two trees and ran the same runner over both:main86c30fcemain+ this pull request (99e91882)The pass lists differ by exactly one line:
and the skip lists are identical, so nothing was traded away to make room for it. The merge itself is the one file, +3/−1, on top of
86c30fce.The one failure on
main, verbatim:fallbacks=('--no-ftz32',)— the probe this pull request mocks was answering from the machine.Scope of that claim
The runner executes every
tests/test_*.pythat imports nopytestand exposes a__main__block, aspython3 -I <file>, with a 300 s timeout each:So this is "every standalone test file", not the whole test suite: the 33 skipped are the pytest-based files and the ones with no
__main__, and it says nothing aboutctest, the Rust workspace,tests/semantic/, or the CI jobs themselves. I am not claimingmainis otherwise green — only that within this set, this pull request is the last thing standing between it and 638/638, and it closes that gap.Environment: Linux, Python 3.15, llvmpipe — the CI-shaped blind spot this pull request is about.
AI-assisted: yes — MiMo-V2.6-Flash (OpenCode). It built both trees, ran the two passes, diffed the lists and drafted this report.
Imported from ubiquitarianism/leonida. Originally posted by Neutron-0 on 2026-12-01T07:20:47Z.
Verified on Windows. The control here is how often the test reaches the real GPU, not whether it passes.
main640b0d0df, cherry-picked (one commit,872d2e753), Python 3.13.5:So this is not a fix of a failing test - it is a fix of a test that depends on the machine it runs on. Here is the measurement, with
make_game.runtime_gpu_infowrapped in a counter andJobsHandlingTest.test_custom_jobs_forwarded_to_shadersrun alone:Why the two calls matter:
runtime_gpu_integer_dot_product()andruntime_gpu_denorm_ftz_f32()(make_game.py:2184,2191) both askruntime_gpu_info(), which runstools/vk_subgroup_info.pyagainst the GPU the runtime would use. The answer is not a constant: when it saysFalsethe shaders stage turnsinteger_dot_fallback/no_ftz32on, and when it cannot tell,keep_recorded_fallback(make_game.py:2039) reads the flags recorded in the work folder - its own docstring says the probe answers differently from run to run (a GPU asleep or hidden, a missing Vulkan loader, its 60 s timeout). With the two probes mocked, the test asks the same question on every machine, which is what the other fourruntime_gpu_*mocks in the samewithblock already do.What I could not test: nothing else - the change is in the test file only. I did not translate a corpus or run the shaders stage for real; I ran the test file and measured which functions it reaches.
AI-assisted: yes - DeepSeek v4.1 (flash), both arms on the machine above.
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T07:30:36Z.
Verified by MoonEyes (another person than the author) on head
872d2e753merged withmain9372a4d4f: Windows 11, RTX 4060, Python 3.14.tests/test_make_game_argparse.py38 OK (1 of 38 fails onmainhere,test_custom_jobs_forwarded_to_shaders, the failure this fixes). Neighbours OK.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T08:01:48Z.
Merging. Head
872d2e753merges cleanly withmain501b3e6c5and does not force a rebase of #2566. CI green on this head and on main. KelboLive checked it on Windows (NVIDIA) on this head: test_make_game_argparse fails on main and passes here, no coverage dropped; I ran it on main + PR (Windows, Python 3.14): 38 tests OK. MoonEyes asked for this merge. A test only. Merged by MoonEyes.AI-assisted (Claude Code).