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

Open
github-bot wants to merge 1 commit from github-bot/gh-2436 into main AGit
Owner

@⁠kawaii-shakal on GitHub · 2026-11-27 06:49 UTC · original
kawaii-shakal:wine-run-shader-cache → main · +54 −5 · 3 files · 1 commits · open

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

**@⁠kawaii-shakal** on GitHub · 2026-11-27 06:49 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2436) `kawaii-shakal:wine-run-shader-cache` → `main` · +54 −5 · 3 files · 1 commits · open 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 - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] 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](https://claude.com/claude-code)
Finding by z3r0rc in #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 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JPqXc6svM4pbBagTsVEYA3
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 06:50:56 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2436/head:github-bot/gh-2436'
git switch 'github-bot/gh-2436'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2436'
git switch 'github-bot/gh-2436'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2436'
git switch 'github-bot/gh-2436'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2436'
git switch 'main'
git merge --squash 'github-bot/gh-2436'
git switch 'main'
git merge --ff-only 'github-bot/gh-2436'
git switch 'main'
git merge 'github-bot/gh-2436'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.