Skip to content

run_game_wine.sh: keep the drivers' shader cache from run to run (WINE-RUN-SHADER-CACHE) - #2436

Open
kawaii-shakal wants to merge 2 commits into
ProjectLeonida:mainfrom
kawaii-shakal:wine-run-shader-cache
Open

kawaii-shakal wants to merge 2 commits into
ProjectLeonida:mainfrom
kawaii-shakal:wine-run-shader-cache

Conversation

@kawaii-shakal

Copy link
Copy Markdown
Contributor

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.sh exported XDG_CACHE_HOME=$RUN/session/cache, a new folder in each run folder. NVIDIA's
GLCache and Mesa's shader cache live under XDG_CACHE_HOME, so every launch started with an empty driver cache and
compiled its pipelines again.

  • The caller's XDG_CACHE_HOME is used when it is set; --cache DIR names a folder instead. Both are kept from run
    to run.
  • --cache fresh, or neither of the two, gives the old behaviour: a new folder in the run folder, for a cold-cache
    measurement.
  • The first line of the printed summary says which (shader cache: kept in DIR or shader cache: fresh).
  • --help and docs/linux_proton.md describe 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's
    cache kept across two runs (the stub wine appends to nvidia/GLCache, and the second run finds the first's
    line); --cache DIR and --cache fresh over a caller's XDG_CACHE_HOME.
  • Ubuntu 24.04 container, bash 5.2, Python 3.12. No Wine, GPU or game.

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption.
  • A new translator rule is in the contract table of docs/design.md. (n/a: no translator change)

🤖 Generated with Claude Code

…ache, or the caller's XDG_CACHE_HOME)

Finding by z3r0rc in ProjectLeonida#1608: the launcher set XDG_CACHE_HOME to a new folder in each run folder, so NVIDIA's GLCache
(and Mesa's shader cache) started empty on every launch. The caller's XDG_CACHE_HOME is now used when it is set,
--cache DIR names one, and --cache fresh keeps the old cold-cache behaviour. session.txt says which.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JPqXc6svM4pbBagTsVEYA3
@kirigayakazima

Copy link
Copy Markdown
Contributor

#2436 | head 6fe0124 | 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 02f71cc; compileall=0; node viewer_streaming=0) | Windows 11, Python 3.14.7, no game files | AI-assisted: yes, Antigravity (Gemini)

  • Clean merge onto main 02f71ccfe7; scripts/check_no_game_data.py passed (0).
  • Note: tests/test_run_game_wine.py is Linux-only (fcntl / bash / Wine stub), so all 12 tests skip on Windows once main is merged. A Linux runner still needs to verify the live Red -> Green XDG_CACHE_HOME assertions for VERIFY-2436.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants