GPU: shader cache keyed by LOOPS_WAVE and LDS_FIRST_INIT; F8/F7 let texture copies go by hand #1437

Manually merged
github merged 2 commits from github-bot/gh-1437 into main 2026-11-29 00:27:58 +00:00 AGit
Owner

@⁠TolkoDev on GitHub · 2026-11-28 19:51 UTC · original
TolkoDev:pr/ours → main · +144 −22 · 5 files · 2 commits · merged 2026-11-29 00:24 UTC

Two independent changes, one commit each. Either can be taken alone.

1. Shader cache key

What was wrong. VICTORY_LOOPS_WAVE (emit/mod.rs) and VICTORY_LDS_FIRST_INIT (emit/lower.rs) change the translated code, but neither is in the cache key. A run with either one set can be served translations cached with it unset, and the other way round.

The change. Both names are added to the key's list of switches (+2 lines). Shaders are translated once more after this.

2. F8 / F7 let texture copies go by hand

Why. With the card full there is no way to ask, while playing, for idle host texture copies to be let go.

The change.

  • F8 forces one look of the idle sweep and of slot eviction: copies held by their texture alone go after 3 s idle, copies shown by table-read slots after 10 s.
  • F7 does the same after 1 s and 3 s, also for copies that just came back. It also drops idle texture staging buffers, trims spare scratch chunks and empties the process working set. Expect a long hitch.
  • Neither needs VICTORY_SLOT_EVICT. Each press logs what it let go. Without a press nothing is let go that was not before.
  • F7 rather than F9, which the diagnostics capture uses.

Limits. This does not fix black textures: slot eviction mostly cannot take textures that shaders pick by index.

Tested

Windows 10, on main at 923e38c. The checks do not all pass here, with or without this change.

  • victory-gpu tests, one process per test: 481 pass, 43 ignored, 67 abort the test process and 2 fail. The same 69 have the same outcomes on untouched main. cargo test --workspace stops at this package, so the packages after it were not reached.
  • CI's cargo clippy ... -D warnings fails on two findings in victory-shader/src/emit/lower.rs that main has too. For victory-gpu, with those two lints and deprecated allowed, the findings are those of main; none is in a changed line.
  • cargo xtask policy fails on the size of lower.rs, which is not changed here.
  • Two changed lines were rewrapped to rustfmt.toml after these runs; only cargo check -p victory-gpu was run again.

Not measured. How much memory a press frees, and any frame rate change. An earlier form of change 2 was built on v2026.11.28.01; this port to current main has not been run in the game.

**@⁠TolkoDev** on GitHub · 2026-11-28 19:51 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1437) `TolkoDev:pr/ours` → `main` · +144 −22 · 5 files · 2 commits · merged 2026-11-29 00:24 UTC Two independent changes, one commit each. Either can be taken alone. ## 1. Shader cache key **What was wrong.** `VICTORY_LOOPS_WAVE` (`emit/mod.rs`) and `VICTORY_LDS_FIRST_INIT` (`emit/lower.rs`) change the translated code, but neither is in the cache key. A run with either one set can be served translations cached with it unset, and the other way round. **The change.** Both names are added to the key's list of switches (+2 lines). Shaders are translated once more after this. ## 2. F8 / F7 let texture copies go by hand **Why.** With the card full there is no way to ask, while playing, for idle host texture copies to be let go. **The change.** - **F8** forces one look of the idle sweep and of slot eviction: copies held by their texture alone go after 3 s idle, copies shown by table-read slots after 10 s. - **F7** does the same after 1 s and 3 s, also for copies that just came back. It also drops idle texture staging buffers, trims spare scratch chunks and empties the process working set. Expect a long hitch. - Neither needs `VICTORY_SLOT_EVICT`. Each press logs what it let go. Without a press nothing is let go that was not before. - F7 rather than F9, which the diagnostics capture uses. **Limits.** This does not fix black textures: slot eviction mostly cannot take textures that shaders pick by index. ## Tested Windows 10, on `main` at 923e38c. The checks do not all pass here, with or without this change. - `victory-gpu` tests, one process per test: 481 pass, 43 ignored, 67 abort the test process and 2 fail. The same 69 have the same outcomes on untouched `main`. `cargo test --workspace` stops at this package, so the packages after it were not reached. - CI's `cargo clippy ... -D warnings` fails on two findings in `victory-shader/src/emit/lower.rs` that `main` has too. For `victory-gpu`, with those two lints and `deprecated` allowed, the findings are those of `main`; none is in a changed line. - `cargo xtask policy` fails on the size of `lower.rs`, which is not changed here. - Two changed lines were rewrapped to `rustfmt.toml` after these runs; only `cargo check -p victory-gpu` was run again. **Not measured.** How much memory a press frees, and any frame rate change. An earlier form of change 2 was built on v2026.11.28.01; this port to current `main` has not been run in the game.
Both change the translated code (emit/mod.rs, emit/lower.rs) but were not in the key, so a run with either set could be served translations cached with it unset, and the other way round. Shaders are translated once more after this.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
F8 forces one look of the idle sweep and of the slot eviction, whatever the room line says: copies held by their texture alone go after 3 s idle, those shown by table-read slots after 10 s. F7 does the same after 1 s and 3 s, also for copies that just came back, and drops idle texture staging buffers, trims spare scratch chunks and empties the working set. (F9 is taken by the diagnostics capture.)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 19:54:53 +00:00
github-bot changed title from Shader cache key fix; F8/F7 keys to let texture copies go by hand to GPU: shader cache keyed by LOOPS_WAVE and LDS_FIRST_INIT; F8/F7 let texture copies go by hand 2026-11-28 20:00:43 +00:00
github-bot referenced this pull request from a commit 2026-11-29 00:27:22 +00:00
github manually merged commit 6785b6c2b0 into main 2026-11-29 00:27:58 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!1437
No description provided.