Repository navigation
make_game: a GPU probe that can't tell keeps the automatic fallback flags of a finished translation - #3656
Conversation
…lags of a finished translation main() turns --f16-interp-fallback and --pc-tail-ubo on when vk_subgroup_info.py says the runtime's GPU needs them. When the probe could not tell (any error, or its 60 s timeout) the flags were simply absent, so shaders() saw a changed flag set, logged "the fallback flags are now none ...: translating again" and translated the whole corpus without them; the next run that could ask translated it a third time. When the probe can't tell, a flag the existing translation was made with now stays on, and the log says so. A probe that answers still decides, a folder translated without the flag gets none from a failed probe, and the flags the user passes are compared as before. wave64 `auto` already keeps its mode for the same reason. The main() wiring tests now build into an empty --out instead of the user's default folder, since main() reads the recorded flags. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Second check on Windows at I also checked an interrupted-translation state with a flags file but no index. This head carried the saved flags into the retry, so the behavior also covers an unfinished translation with recorded flags. A first attempt with no cached flags still added none. No hardware probe was run. AI-assisted. |
|
Reviewed and tested
Review: I read the new AI-assisted (Claude Code); I checked the results. |
sds-228
left a comment
There was a problem hiding this comment.
Code review of a82f814: no issues found. A probe with no answer now keeps only the two automatic flags actually recorded in translator_flags.txt; an answered probe still decides, and a folder translated without a flag gains none. The added cases cover both flags independently, the no-flag baseline and an unrelated user flag. Code read only.
AI-assisted (OpenCode).
Claimed in the coordination issue as: new BUILD item, claim in #3574 (no ID yet)
What was wrong
main()turns--f16-interp-fallbackand--pc-tail-uboon by itself whentools/vk_subgroup_info.pysays the runtime's GPU needs them. When the probe can't tell (runtime_gpu_per_vertex()/runtime_gpu_max_push_constants()returnNoneon any error and on the 60 s timeout), the flag is simply absent.shaders()then compares the flags withspirv/translator_flags.txt, logs "the fallback flags are now none (the shaders were translated with ...): translating again" and translates the whole corpus without them. The next run that can ask the GPU translates it a third time.Reproduced on
mainf847748c(my own run) with the realmain()andshaders()on one work folder, only the probe and the subprocesses mocked: probe says no / can't tell / says no again / says no gives translations with(f16, pc-tail),(),(f16, pc-tail), none: three translations where one is enough. The new testtest_a_probe_that_cannot_tell_keeps_both_automatic_flagsruns the same sequence. wave64autoalready keeps its mode in this situation (keep_emulated); the fallback flags had nothing like it.The change
translator_flags.txt) stays on, and the log says so: "couldn't ask the GPU the runtime would use whether it needs ; the shaders were translated with it and it stays on instead of translating them all again (a run that can ask the GPU decides again)".translator_flags.txtdoes not record whether a flag came from the probe or from the command line, so a user who passed--pc-tail-uboonce and then drops it keeps it for as long as the probe can't answer.MainWiringTest.run_mainnow builds into an empty--out:main()reads the recorded flags, and the default folder is the user's own.Not changed:
docs/design.mdsays these flags are on by themselves where the GPU needs them, which is still true.Tested
Windows 11, Python 3.13, no GPU or game files involved (probe and tools mocked):
python -I tests/test_make_game_translator_flags.py: 25 tests OK (5 new inProbeFailureKeepsAutomaticFlagsTest, which also re-runs the 4RecordedFlagsTestcases it inherits its folder set-up from). Withmain'smake_game.py: 3 failures and 1 error, all four in the new class.tests/test_make_game_*.pyfiles withpython -I: OK.python -m compileall -q make_game.py tests,python -I make_game.py --help,python -I tests/test_text_write_line_endings.py: OK.Noneis mocked.An independent run by a second session reproduced the test counts above before this was opened.
Overlap with open pull requests (trial merges): conflicts with #3302 in
make_game.pyandtests/test_make_game_translator_flags.py, and with #3086 intests/test_make_game_translator_flags.py; clean with #3484 and #3092. Neither is needed by this one; whichever lands second rebases.AI-assisted (Claude Code).
🤖 Generated with Claude Code