Skip to content

fix: shader warm-up cache key, water read-back, frame shots, pipeline skip list, agent skills - #19

Merged
ShinniUwU merged 6 commits into
ProjectLeonidaL:mainfrom
ShinniUwU:pr/leonida-legacy
Nov 25, 2026
Merged

ShinniUwU merged 6 commits into
ProjectLeonidaL:mainfrom
ShinniUwU:pr/leonida-legacy

Conversation

@ShinniUwU

@ShinniUwU ShinniUwU commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #18. Six commits:

1. Agent skills (a003e58)

.claude/skills/systematic-debugging (obra/superpowers) and .claude/skills/tdd (mattpocock/skills), installed as plain files, plus skills-lock.json so anyone can restore them with npx skills experimental_install. One TypeScript sample is git-ignored because .ts is not on the asset-policy allowlist.

2. Shader warm-up lands in the run's cache, and the run scripts offer it (TODO P-7)

  • The bug: leonida translate --warm never opened the GPU, so it filed its translations under a different cache key than a run uses (the key includes the card's widest wave and view heap limit). A full warm-up translated 25,700 shaders that the game then ignored.
  • The fix: the warm-up makes the host device first and reads both values from it. LEONIDA_HOST_WAVE and LEONIDA_VIEW_LIMIT still override them. It also uses every core by default (it used 4 unless --jobs was given).
  • run-gta6.ps1 and measure-gta6.ps1 ask "Warm up now? [Y/n]" and warn that without it the game translates shaders mid-play and stutters. -WarmUp yes|no answers from the command line.
  • run-gta6.ps1 sets LEONIDA_LOG=warn unless it is already set, so the console shows warnings and errors only.
  • leonida translate prints a progress line every 1,000 containers (it printed nothing for about 90 s before).
  • The P-7 row is deleted from TODO.md.

3. Water texture read-back and frame shots from victory-fork

Cherry-picked from fxceless/victory-fork and renamed:

  • 895c0b8 and 04df435: textures that compute shaders write and the title reads on the CPU (the ocean height and displacement maps) are copied back into title memory. Upstream's note: boats read memory nothing wrote and sank.
  • 79cfdd9: frame shots built into the layer (LEONIDA_SHOT, diagnostics builds), a pipeline library the driver rejects is kept under another name instead of being saved over, LEONIDA_WINDOW_UPLOAD=1 (off by default), a DirectStorage fix for reads into physical pages, and =alt modes for two switches. Conflicts in host.rs and texture.rs took upstream's side (our code plus the alt mode); the README conflict kept ours. One new clippy warning it brought (a collapsible if in pipeline/library.rs) is fixed.

4. LEONIDA_SKIP_PIPELINES works in every build

A tester's RX 9070 crashes inside the AMD driver's compiler (amdxc64.dll, access violation) while the pipeline of compute shader 0a12de46c4d5db08 is made. That shader's DXIL passes Microsoft's validator here, so this looks like a driver bug (not confirmed). The switch only existed in diagnostics builds and only dropped draws. Now a pipeline with a listed shader is never handed to the driver, in release builds too. Workaround for that tester: LEONIDA_SKIP_PIPELINES=0a12de46c4d5db08.

5. shot-run.ps1

Runs the diagnostics build unattended, presses scripted keys (-Keys, LEONIDA_KEYS), takes frame shots at fixed frames (-ShotAt), and closes the game when the shots are written or after -Seconds. Shots go to %LOCALAPPDATA%\leonida\shots, outside the repository. They are game data and must never be posted.

6. Small fixes

  • The README said .un-gta6.ps1; it is .\run-gta6.ps1.
  • scripts/rename-from-upstream.ps1 skips CLAUDE.md and TODO.md, which name upstream on purpose.

Tested

On Windows 11 Pro, Ryzen 7 7800X3D, RTX 3080 12 GB, driver 621.24:

  • cargo check -p leonida --all-targets, release and --features diagnostics: both pass.
  • Tests: leonida-gpu 185 passed, leonida-hle 100, leonida-core 15, leonida 2, 0 failed. The old warp_budget_saturates... test (TODO C-2) passed in this run and failed in two earlier ones today, so it looks flaky.
  • cargo clippy --workspace --all-targets -- -D warnings, plain and --all-features: the same errors as main (TODO C-1, see C-1: resolve clippy warnings in leonida-gpu #20), none new.
  • cargo xtask policy: 221 files ok.
  • Warm-up: after the fix, a rerun reported the 3,094 shaders an earlier game run had made as "in the cache already". A second rerun found 25,696 in the cache and took 30.1 s on 16 threads.
  • PowerShell parser on run-gta6.ps1, measure-gta6.ps1 and shot-run.ps1: 0 errors each.
  • Not tested in the game: the water read-back, frame shots, shot-run.ps1 from start to finish, and the scripts' warm-up prompt. The skip list is not tested against the AMD crash, since there is no AMD card here.

Not in this pull request

Upstream VIctory's "descriptors joined by nested control flow" commits (59c78bb, ff47463, e8e9f0c, 54ab406) all conflict in leonida-shader, because victory-gta6 already has its own descriptor_phi for the same case. 40 programs still stop at "a descriptor chosen by control flow". That needs a hand merge and is left for a pull request of its own.

AI-assisted.

🤖 Generated with Claude Code

@ShinniUwU ShinniUwU changed the title chore: add the systematic-debugging and tdd agent skills fix: shader warm-up cache key, water read-back, frame shots, pipeline skip list, agent skills Nov 25, 2026
@ShinniUwU
ShinniUwU merged commit f552464 into ProjectLeonidaL:main Nov 25, 2026
1 check failed
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.

1 participant