run_game_wine.sh: keep the drivers' shader cache from run to run (WINE-RUN-SHADER-CACHE) #2436
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2436
Loading…
Reference in a new issue
No description provided.
Delete branch "wine-run-shader-cache"
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?
Pull request successfully merged and closed
Claimed in the coordination issue as: WINE-RUN-SHADER-CACHE (finding by z3r0rc in #1608, its shader-cache part)
What and why
scripts/run_game_wine.shexportedXDG_CACHE_HOME=$RUN/session/cache, a new folder in each run folder. NVIDIA'sGLCacheand Mesa's shader cache live underXDG_CACHE_HOME, so every launch started with an empty driver cache andcompiled its pipelines again.
XDG_CACHE_HOMEis used when it is set;--cache DIRnames a folder instead. Both are kept from runto run.
--cache fresh, or neither of the two, gives the old behaviour: a new folder in the run folder, for a cold-cachemeasurement.
shader cache: kept in DIRorshader cache: fresh).--helpanddocs/linux_proton.mddescribe it.Not in this PR: the compile-gate defaults from the same finding (
LEONIDA_COMPILE_HELPER,LEONIDA_ASYNC_PIPELINES),which need a retail run to judge.
Tested
tests/test_run_game_wine.py, three new cases against the script's stubs: a fresh cache by default; the caller'scache kept across two runs (the stub
wineappends tonvidia/GLCache, and the second run finds the first'sline);
--cache DIRand--cache freshover a caller'sXDG_CACHE_HOME.AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly.docs/design.md. (n/a: no translator change)🤖 Generated with Claude Code
#2436 | head 6fe01249f668cbc5b5b659d5fc91e87c754f81f7 | python -I tests/test_run_game_wine.py | red: ModuleNotFoundError: No module named 'fcntl' (PR branch predates main's Windows skip guard) | green: OK (skipped=12 on Windows 11 after merging main's Linux-only guard) | full suite: same as main (514/521 standalone stdlib tests passed, 0 new failures vs main 02f71ccfe7; compileall=0; node viewer_streaming=0) | Windows 11, Python 3.14.7, no game files | AI-assisted: yes, Antigravity (Gemini)
main02f71ccfe7;scripts/check_no_game_data.pypassed (0).tests/test_run_game_wine.pyis Linux-only (fcntl/bash/ Wine stub), so all 12 tests skip on Windows oncemainis merged. A Linux runner still needs to verify the live Red -> GreenXDG_CACHE_HOMEassertions forVERIFY-2436.Linux verification for
VERIFY-2436on CachyOS (kernel 7.3.6-3, Bash 5.3.20, Python 3.14.10). Heade73386f5merged cleanly intomainat1bc055e6.I ran the same current
python -I tests/test_run_game_wine.py -vfixture before and after, changing only which runner it called. On baremainwith the PR fixture, 9 passed and the 3 new cases failed as expected. The old runner ignores the caller's cache, rejects--cacheand uses the expected fresh directory without the new status line. With the PR, 12/12 passed with no skips. That covers the default fresh cache, the caller's cache surviving two stub launches, and both forms of the explicit override (directory orfresh).The cases ran offline with Wine stubs. No game files or GPU work were needed. AI-assisted with Codex.
Tested
e73386f5bmerged (no commit) withmainaa918e5d9: Python 3.12.4, Windows 11 10.0.26300, CPU only.check_no_game_data.pyis clean.tests/test_run_game_wine.pyskips all of its 12 tests on Windows (it needsbashand Wine). Green and red can't be observed on this machine, so this is diff reading only.AI-assisted (Claude Code).
Independent verification on Windows 11 (
10.0.26200, x64, Git Bash +Python 3.12.10&Python 3.14.5) withe73386f5bcmerged ontoorigin/main(0efc2bd43d,0merge conflicts):scripts/run_game_wine.sh):origin/main):bash scripts/run_game_wine.sh --cache freshexits2(run_game_wine.sh: unknown argument: --cache (see --help)).e73386f5bcmerged ontoorigin/main):bash -n scripts/run_game_wine.shexits0,bash scripts/run_game_wine.sh --helpexits0and documents--cache DIR|fresh, andbash scripts/run_game_wine.sh --cache ""exits2(run_game_wine.sh: --cache needs a value (see --help)).python -I -B tests/test_run_game_wine.py:Ran 12 tests,OK (skipped=12)on Windows under bothPython 3.12.10andPython 3.14.5(matching the Linux-only guard).python -I tests/test_docs_table_rows.py(2/2),python -I tests/test_docs_repeated_lines.py(3/3),python -I tests/test_ci_registration.py(18/18), andpython -I tests/test_text_write_line_endings.py(3/3) all exited0;test_docs_cli_flags.pyandtest_docs_links.pyadd0issues ondocs/linux_proton.mdorscripts/run_game_wine.sh.git diff --checkandpython -I scripts/check_no_game_data.pyacross all 3 touched files exited0.AI-assisted.
Thanks, all three addressed in 206bb4b6:
--cache freshnow unsetsMESA_SHADER_CACHE_DIR,MESA_GLSL_CACHE_DIRand__GL_SHADER_DISK_CACHE_PATH, so a fresh run is cold whatever the caller had set; with a kept cache the caller's variables stay and win over the XDG root.--helpanddocs/linux_proton.mdsay both.test_a_fresh_cache_drops_the_drivers_own_cache_variableschecks the stub sees none of them under fresh and the caller's values under a kept cache.session/cachein a run folder that is accepted again, andsession.txtis written anew on each launch (>), so there is oneshader cache:line;test_a_fresh_cache_is_empty_in_an_accepted_run_folder.--cache fresh.Linux, Python 3.13:
tests/test_run_game_wine.py14/14 (the two new tests fail with the old script),tests/test_run_game_wine_safety.py3/3, also withXDG_CACHE_HOMEnaming a regular file. Merges cleanly into main d762b139.AI-assisted (Claude Code); I ran the tests and checked the results.
Generated by Claude Code
Reviewed head diff against
main:scripts/run_game_wine.shcleanly adds--cache DIR|fresh(defaulting to callerXDG_CACHE_HOMEorfresh), unsets driver-specific cache overrides and clearssession/cacheonfreshruns, records the active cache mode insession.txt, updatesdocs/linux_proton.md, and adds unit test coverage intests/test_run_game_wine.pyandtests/test_run_game_wine_safety.py. Clean-room verified and all CI checks green.(AI-assisted review.)