feat(shader): record places, record ranges and guest load clusters on by default #518

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

@⁠ChainedTears on GitHub · 2026-12-04 20:54 UTC · original
ChainedTears:feat/translator-switches-default → main · +26 −20 · 5 files · 1 commits · open

Turns on three translator switches by default; each still turns off with =0:

  • VICTORY_CLUSTER_GUEST_LOADS (default 1)
  • VICTORY_RECORD_PLACES (default 1; 2 and 0 as before)
  • VICTORY_RECORD_RANGES (default 1)

run.conf.default and docs/SETTINGS.md say the same. The shader cache already keys on all three, so existing caches stay valid for anyone who sets them to 0. Everyone else gets their shaders prepared again once.

Follows up #517.

Why

On an AMD Ryzen AI Max+ 395 (Radeon 8060S, RDNA 3.5, 128 GB, RADV from Mesa main with the repo's patch), these three switches together were the only full-quality gain I found in a day of A/B runs.

Setup: Series X profile, 2560x1440 output (1706x960 rendered), default render scale, ray tracing on, Proton Experimental. The benchmark is the first 3 minutes after loading the "Gone Fishing" save (cutscene, world-gated, the same save restored before each run), plus the boat gameplay that follows it.

runs avg fps (mean) 1 % low
defaults 25.1, 26.4, 26.8, 26.6 26.2 ~11.6
the three switches 29.2, 28.7, 29.1, 28.6, 28.0, 28.7, 28.6, 29.0, 28.8 28.7 ~12.2
boat gameplay, defaults 28.9, 28.1, 29.0 28.7 ~16.3
boat gameplay, the three switches 30.1, 30.9, 31.2 30.7 ~17.3

That's about +9.7 % in the cutscene and +7 % in gameplay (3 runs each). With the Series S profile they gave +6.5 %. Screenshots at 20-second steps look the same, and I saw no GPU hang I could tie to them in about 50 runs. The random device-removed resets, about 1 in 12 runs, happen with or without them.

What to weigh

The doc comments name the assumptions:

  • Under RECORD_RANGES, a record copied by halves reads as an empty view; the comment says no title is known to do that.
  • RECORD_PLACES=2 (typed buffers) stays opt-in; only level 1 (textures, whose console descriptors are always copied whole) becomes the default.

I've only measured on this one AMD APU and this one title. If they were kept opt-in for a reason this doesn't cover (other GPUs, other titles), closing this in favour of a preset is fine too.

Tests

cargo test -p victory-shader --lib passes with the new defaults.

**@⁠ChainedTears** on GitHub · 2026-12-04 20:54 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/518) `ChainedTears:feat/translator-switches-default` → `main` · +26 −20 · 5 files · 1 commits · open Turns on three translator switches by default; each still turns off with `=0`: - `VICTORY_CLUSTER_GUEST_LOADS` (default `1`) - `VICTORY_RECORD_PLACES` (default `1`; `2` and `0` as before) - `VICTORY_RECORD_RANGES` (default `1`) `run.conf.default` and `docs/SETTINGS.md` say the same. The shader cache already keys on all three, so existing caches stay valid for anyone who sets them to `0`. Everyone else gets their shaders prepared again once. Follows up #517. ### Why On an AMD Ryzen AI Max+ 395 (Radeon 8060S, RDNA 3.5, 128 GB, RADV from Mesa main with the repo's patch), these three switches together were the only full-quality gain I found in a day of A/B runs. Setup: Series X profile, 2560x1440 output (1706x960 rendered), default render scale, ray tracing on, Proton Experimental. The benchmark is the first 3 minutes after loading the "Gone Fishing" save (cutscene, world-gated, the same save restored before each run), plus the boat gameplay that follows it. | | runs | avg fps (mean) | 1 % low | |---|---|---|---| | defaults | 25.1, 26.4, 26.8, 26.6 | 26.2 | ~11.6 | | the three switches | 29.2, 28.7, 29.1, 28.6, 28.0, 28.7, 28.6, 29.0, 28.8 | 28.7 | ~12.2 | | boat gameplay, defaults | 28.9, 28.1, 29.0 | 28.7 | ~16.3 | | boat gameplay, the three switches | 30.1, 30.9, 31.2 | 30.7 | ~17.3 | That's about +9.7 % in the cutscene and +7 % in gameplay (3 runs each). With the Series S profile they gave +6.5 %. Screenshots at 20-second steps look the same, and I saw no GPU hang I could tie to them in about 50 runs. The random device-removed resets, about 1 in 12 runs, happen with or without them. ### What to weigh The doc comments name the assumptions: - Under `RECORD_RANGES`, a record copied by halves reads as an empty view; the comment says no title is known to do that. - `RECORD_PLACES=2` (typed buffers) stays opt-in; only level 1 (textures, whose console descriptors are always copied whole) becomes the default. I've only measured on this one AMD APU and this one title. If they were kept opt-in for a reason this doesn't cover (other GPUs, other titles), closing this in favour of a preset is fine too. ### Tests `cargo test -p victory-shader --lib` passes with the new defaults.
VICTORY_CLUSTER_GUEST_LOADS, VICTORY_RECORD_PLACES (level 1) and
VICTORY_RECORD_RANGES now apply unless set to 0. Together they were worth
about +9.7 % at full quality on a Radeon 8060S (Series X profile, 1440p,
ray tracing on). run.conf.default and docs/SETTINGS.md follow; the typed
buffer places test pins ranges off, as it assumed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 20:54:53 +00:00
Author
Owner

@⁠Kal0s-design on GitHub · 2026-12-04 22:50 UTC · original

Checked 06b2f08 on native Windows (one NVIDIA desktop card plus WARP, didn't run the game).

victory-shader lib passes with the new defaults apart from size_tests::a_reused_descriptor_register_read_only_behind_its_flag, which fails on main here too because WARP only gives 4-lane waves. PR unset, PR with the three set to 0 and main unset give the same results test for test. Main with all three set to 1 adds one failure, a_typed_buffer_carries_its_places_only_when_asked, which is the case this PR handles by pinning CARRY_RANGES_HERE to false in that test. Most record and cluster tests set the switches through the thread-local overrides, so the suite alone doesn't go through the new env defaults.

So I also ran a throwaway test, since removed. It lowers the record programs from the lower.rs tests (texture with a raw UAV, typed buffer, constant buffer), the waterfall programs with records on and the guest load cluster program, and leaves the switches to the env. The PR defaults give the same DXIL as main with all three at 1, the PR with all three at 0 gives the same as main unset, and VICTORY_RECORD_PLACES=2 with the other two at 0 matches main with RECORD_PLACES=2. Every shader that lowered passed dxil.dll and made a PSO on the card with VICTORY_D3D12_DEBUG=1. WARP took all the ones without a fixed wave size, the clustered loads included. It turned down the WaveSize(32) builds for its 4-lane waves, and it does that on main too.

The cache side looks right to me. shader_cache.rs:121-138 only adds the three markers when they're on and none of them is in the raw env list above it, so =0 keeps a cache built on main and everyone else rebuilds once with no TRANSLATOR_VERSION bump. The host writes ranges through the same records_carry_ranges() (descriptor.rs:1127), so host and shaders change together.

Two small things. cluster_guest_loads (mod.rs:235) doesn't trim like shader.rs:189 and 248 do, so "0 " leaves it on, and for all three an empty value or anything other than 0 now means on. That includes old uncommented VICTORY_RECORD_PLACES= lines in run.conf, which run.sh exports empty. And with ranges on, RECORD_PLACES=2 gives the same code as 1 (lower.rs:12633-12636, typed buffers hash once their record carries the range). That was already true, but now it's the default combination, so SETTINGS.md could say 2 only matters together with RECORD_RANGES=0.

victory-gpu lib on the PR only hit the usual failures here (the two indirect host_list tests, the two host pipeline library loads and a flaky watch test). The victory-core menu tests pass with the new run.conf.default, choices 0|1|2 included.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-12-04 22:50 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/518#issuecomment-7426392996) Checked 06b2f08 on native Windows (one NVIDIA desktop card plus WARP, didn't run the game). victory-shader lib passes with the new defaults apart from size_tests::a_reused_descriptor_register_read_only_behind_its_flag, which fails on main here too because WARP only gives 4-lane waves. PR unset, PR with the three set to 0 and main unset give the same results test for test. Main with all three set to 1 adds one failure, a_typed_buffer_carries_its_places_only_when_asked, which is the case this PR handles by pinning CARRY_RANGES_HERE to false in that test. Most record and cluster tests set the switches through the thread-local overrides, so the suite alone doesn't go through the new env defaults. So I also ran a throwaway test, since removed. It lowers the record programs from the lower.rs tests (texture with a raw UAV, typed buffer, constant buffer), the waterfall programs with records on and the guest load cluster program, and leaves the switches to the env. The PR defaults give the same DXIL as main with all three at 1, the PR with all three at 0 gives the same as main unset, and VICTORY_RECORD_PLACES=2 with the other two at 0 matches main with RECORD_PLACES=2. Every shader that lowered passed dxil.dll and made a PSO on the card with VICTORY_D3D12_DEBUG=1. WARP took all the ones without a fixed wave size, the clustered loads included. It turned down the WaveSize(32) builds for its 4-lane waves, and it does that on main too. The cache side looks right to me. shader_cache.rs:121-138 only adds the three markers when they're on and none of them is in the raw env list above it, so =0 keeps a cache built on main and everyone else rebuilds once with no TRANSLATOR_VERSION bump. The host writes ranges through the same records_carry_ranges() (descriptor.rs:1127), so host and shaders change together. Two small things. cluster_guest_loads (mod.rs:235) doesn't trim like shader.rs:189 and 248 do, so "0 " leaves it on, and for all three an empty value or anything other than 0 now means on. That includes old uncommented `VICTORY_RECORD_PLACES=` lines in run.conf, which run.sh exports empty. And with ranges on, RECORD_PLACES=2 gives the same code as 1 (lower.rs:12633-12636, typed buffers hash once their record carries the range). That was already true, but now it's the default combination, so SETTINGS.md could say 2 only matters together with RECORD_RANGES=0. victory-gpu lib on the PR only hit the usual failures here (the two indirect host_list tests, the two host pipeline library loads and a flaky watch test). The victory-core menu tests pass with the new run.conf.default, choices 0|1|2 included. AI-assisted: yes
Author
Owner

@⁠luisaugustz on GitHub · 2026-12-05 13:30 UTC · original

Measured on RX 9070 XT + Ryzen 7 5800X (RADV, 4K output, FSR 4 Performance, ray tracing on).

Place Without With the three switches
Spawn 30.05 fps 31.6 fps (5 runs)
downtown route from #554 15.9 fps 16.4 fps (10 runs)

About +5 % in both places, and the picture is the same in the screenshots.

The first run with the switches prepared all 94,520 pipelines again. That took about 12 minutes here and added about 7.5 GB to the cache.

Details and the other runs are in #591.

**@⁠luisaugustz** on GitHub · 2026-12-05 13:30 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/518#issuecomment-7438790785) Measured on RX 9070 XT + Ryzen 7 5800X (RADV, 4K output, FSR 4 Performance, ray tracing on). | Place | Without | With the three switches | |---|---|---| | Spawn | 30.05 fps | 31.6 fps (5 runs) | | `downtown` route from #554 | 15.9 fps | 16.4 fps (10 runs) | About +5 % in both places, and the picture is the same in the screenshots. The first run with the switches prepared all 94,520 pipelines again. That took about 12 minutes here and added about 7.5 GB to the cache. Details and the other runs are in #591.
Author
Owner

@⁠arturbac on GitHub · 2026-12-05 17:27 UTC · original · edited 2026-12-05 17:29 UTC

Tested the three switches on an RX 7900 XTX (RDNA 3): about +8 % average fps.

Setup: Ryzen 9 9950X, RX 7900 XTX, Linux, GE-Proton 11-6, RADV from the repo's patched Mesa, Series X profile, 2560x1440 output. Build based on main at 2382b4c, with a few local changes for input and frame logging (nothing in the shader translator).

Method: two runs with the same short sequence after loading the game (same actions, roughly the same views). One with VICTORY_RECORD_PLACES=1, VICTORY_RECORD_RANGES=1 and VICTORY_CLUSTER_GUEST_LOADS=1, one with all three unset; nothing else changed. Frame times logged for every frame; the loading part at the start is left out.

30–60 s after start without with the three switches change
average fps 26.6 28.8 +8 %
median fps 29.6 32.2 +9 %
median frame work time 27.2 ms 26.0 ms −4 %

From 20 s on, the gain is +6.5 % average and +9 % median. Only one short run (about a minute) per variant, so the numbers are a rough indication, but they point the same way as the other measurements here.

Pipeline preparation: turning the switches on prepared all 94,583 pipelines again. The default number of warm processes is capped at 16, which on this 32-thread CPU kept half of it idle; with VICTORY_WARM_JOBS=31 the rate went from about 210 to about 560 pipelines a second, and the whole warm took about 4 minutes, with no bad or refused pipelines.

Both runs also had VICTORY_PAGE_MOVE_MB=128 and VICTORY_PAGES_SEEN=1 set (the usual settings on this machine).

**@⁠arturbac** on GitHub · 2026-12-05 17:27 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/518#issuecomment-7442177053) · edited 2026-12-05 17:29 UTC Tested the three switches on an RX 7900 XTX (RDNA 3): about +8 % average fps. **Setup:** Ryzen 9 9950X, RX 7900 XTX, Linux, GE-Proton 11-6, RADV from the repo's patched Mesa, Series X profile, 2560x1440 output. Build based on main at 2382b4c, with a few local changes for input and frame logging (nothing in the shader translator). **Method:** two runs with the same short sequence after loading the game (same actions, roughly the same views). One with `VICTORY_RECORD_PLACES=1`, `VICTORY_RECORD_RANGES=1` and `VICTORY_CLUSTER_GUEST_LOADS=1`, one with all three unset; nothing else changed. Frame times logged for every frame; the loading part at the start is left out. | 30–60 s after start | without | with the three switches | change | |---|---|---|---| | average fps | 26.6 | 28.8 | +8 % | | median fps | 29.6 | 32.2 | +9 % | | median frame work time | 27.2 ms | 26.0 ms | −4 % | From 20 s on, the gain is +6.5 % average and +9 % median. Only one short run (about a minute) per variant, so the numbers are a rough indication, but they point the same way as the other measurements here. **Pipeline preparation:** turning the switches on prepared all 94,583 pipelines again. The default number of warm processes is capped at 16, which on this 32-thread CPU kept half of it idle; with `VICTORY_WARM_JOBS=31` the rate went from about 210 to about 560 pipelines a second, and the whole warm took about 4 minutes, with no bad or refused pipelines. Both runs also had `VICTORY_PAGE_MOVE_MB=128` and `VICTORY_PAGES_SEEN=1` set (the usual settings on this machine).
This pull request has changes conflicting with the target branch.
  • docs/SETTINGS.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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