Optimizations for RTX 5070 Ti + Ryzen 5 5600X #831

Open
github-bot wants to merge 107 commits from github-bot/gh-831 into main AGit
Owner

@⁠erickbobd on GitHub · 2026-11-28 07:28 UTC · original
erickbobd:rtx5070ti-5600x-optimizations → main · +23995 −714 · 94 files · 104 commits · open

Everything I play with on an RTX 5070 Ti + Ryzen 5 5600X, against main, so you can pick what is useful. It is not meant to be merged whole: it bundles open PRs from other people, which keep their own commits and credit.

Bridge over the bay
Dive shop parking lot
Marina by the overpass

Series X profile, DLAA at 2560x1440, DLSS model K, DLSS 5 Neural Rendering, DLSS Frame Generation 3X. The profile played with is now DLSS Quality instead of DLAA: DLAA leaves white blocks indoors (Findings below).

The full write-up, with every number and switch, is in contrib/rtx5070ti-ryzen5600x/README.md.

Results

On this PC the layer is CPU-bound: the 8 list-translation threads use ~456 ms of CPU per ~76 ms frame (about six cores of a 5600X), the submitting thread works 58-67 ms of each frame, and the card is only 30-45 % busy (Series S, DLSS Quality). So DLAA and the DLSS model cost almost nothing in frame rate here. DLSS 5 run every frame did cost some, in light scenes on Series X with DLAA; see below.

The screenshots' settings, two sessions (34 and 17 min, no crash) 11.5-12.6 fps rendered, about 35-38 fps shown with frame generation 3X (19,671 -> 57,400 and 4,412 -> 13,202 frames)
The five CPU fixes below, fixed-spot A/B on PR #18 (Series S), ~7 min per run 12.50 -> 12.74 fps (+2 %); the submitting thread's work per frame 67.4 -> 57.8 ms (-14 %), its join wait 5.2 -> 1.8 ms, card idle behind it 30.4 -> 17.8 ms
Refreshes with 8 helper threads instead of 4 (heavy scenes, same session) 22.6 -> 15.2 ms a frame; rendered fps +2 to +6 % by scene weight (below)
cargo test --release -p victory-gpu --lib 594 passed, 0 failed

The submitting thread lost 14 % of its work but the frame moved 2 %: with six cores, the list-translation threads are the next limit.

What this branch has that main does not

From others (open PRs, merged with main up to v2026.11.28.01):

  • #18 (Kemerd, with D Everett Hinton's merge of upstream into it): -Fast, send thread, pipelines from pieces, refresh sets, title write ranges, key rebinding, 21:9.
  • #145 (Walid ben miled): the AVX2 compare for refresh and copy-back runs.
  • #181 (BE29ZZ and the people credited there): pooled shadow::exact() buffers behind a read-locked cache.

Conflicts were resolved by keeping both sides; for example, the F1 menu has PR #18's key rebinding together with upstream's save sharing, save-at-once and Series S picture row. The README lists each resolution.

Ours (each has a switch back):

Change Switch Why
A caller of the kept threads runs only its own jobs while it waits (shadow.rs) VICTORY_WIDE_OWN=0 The submitting thread took other callers' 1 MiB compares while the frame waited for its own
Front refreshes to the threads, longest first (host.rs) VICTORY_REFRESH_BIG_FIRST=0 The join no longer waits for one long span taken last
Short spin for the guards' lock (watch.rs) VICTORY_GUARDS_SPIN_US=0 Held 7-18 us, but a sleeping waiter woke ~130 us later on a busy CPU
A host list's own scratch buffers are not waited for (host.rs) VICTORY_LIST_BUFFERS_WAIT=1 Only the list being recorded names them; a 10-minute run waited 45,200 times (25 s)
No new reference when a descriptor slot keeps the same resource (descriptor/host.rs) none AddRef/Release per draw from all recording threads
Sampler runs share slots, 1024-slot pool (pipeline/host.rs) VICTORY_PIPELINE_SAMPLER_REUSE=1 The 256-slot pool filled while loading: 864 library bypasses -> 0
F1: NEURAL RENDERING (INSERT), off by default (play.rs, main.rs, menu.rs) F1 DLSS 5 Neural Rendering through the OptiScaler DLSS5 mod (below)
Planning the card's steps: does_of() sizes its vectors for every step at once (host/card_steps.rs) none Growing them each submission was 0.85 ms a frame
Retired objects into 8 queues, one per thread, not one lock (host.rs) none The pool threads making constant views stood in line for it: 0.8 ms a frame
F1: SKIP SAME PAGES (TEST): a refresh passes over 4 KiB pieces whose 64-bit hash says they are the same bytes (shadow.rs) VICTORY_PAGE_SKIP=1 82.5 % of the pieces a refresh took again were the same; only copies no shader is declared to write
F1: HELPER THREADS (TEST): AUTO / 6 / 8 helpers for the refreshes, live (shadow.rs) VICTORY_WIDE_THREADS Refreshes 22.6 -> 15.2 ms with 8 in heavy scenes
F1: GUARDS LOCK SPIN (TEST): 25 / 100 us / off, live (watch.rs) VICTORY_GUARDS_SPIN_US No measurable effect at 100 us
Whole-page check of rewritten pages, stats only (shadow.rs) VICTORY_REFRESH_SPLIT=1 How much of what a refresh copies is the same bytes, and how fast both sides read
F1: CONSTANTS AFTER COPIES (TEST): a constant whose bytes the list's latest placed copy produced is copied card to card at its place, into a pooled 64 KiB buffer (host/placed_constants.rs) VICTORY_PLACED_CONSTANTS=1 The submitting thread waited for ~8 such 32-byte constants a frame (4.7-7.3 ms); +1.5 % (below)

Tried and left off because they were slower here: batched resource retirement with raised helper priority (-12 %), list-held descriptors (-6 %), and VICTORY_PORT_CONSTANTS (5-7 fps). (The retirement queues above are another thing: the same objects, at the same time, one queue per thread.)

Host-copy refreshes, measured before building (28 Nov, evening)

Each idea got a ceiling from a CPU profile and the log first, a stats-only build where it could, and only then a live F1 switch to compare standing still (heavy scene: Series X, DLSS Quality, frame generation 3X, ~95 ms a frame).

  • Most of what a refresh copies is the same bytes again. The write watch names the pages the title wrote, not those it changed: of 1 rewritten page in 256 compared whole (whole-page-check.py), 82.5 % of the 4 KiB pieces were equal. Comparing against the CPU side would cost more than copying (it reads at 4.0 GB/s), so SKIP SAME PAGES keeps a 64-bit hash per piece (XXH3's long loop, AVX2) and skips only copies no shader is declared to write: upstream's VICTORY_SEND_CHANGED lost the room's indirect light where the title writes a value again over what a shader changed on the card.
  • It works, but the frame barely moves: sent up to the card 40 -> 23 MB a frame, the card copies 15.0 -> 15.2 ms (they cost per call, not per byte), and a refresh still has to read title memory to know (41.7 MB in 9.6 ms of threads either way). 1-3 % at most. No visual problem in ~10 minutes with it on.
  • Planning the card's steps: the two cuts above, ~2 ms (11.8 -> 9.9 ms at 50-60k calls, 13.3 -> 10.7 ms at 60-75k).
  • The refresh runs in parallel but stalls: its five threads each spend ~12.5 ms a frame in it, on a processor a quarter of that time (~7.4 ms a frame in line for the guards' lock, which holds VirtualProtect calls; ~7.8 ms copying title memory while not running; the journal's lock; the batch queue). More helpers (compare-switches.py, one session, switches changed while moving between scenes, compared by scene weight):
Calls per frame 4 helpers 8 helpers
50-60k 10.44 fps 10.69 fps (+2.3 %)
60-70k 9.04 fps 9.56 fps (+5.8 %)
Refreshes, >= 60k calls 22.6 ms 15.2 ms

The refreshes are clearly shorter; the frame gains less, and how much is not settled by so few seconds (the wait for flights swung between 4 and 29 ms between places). The example settings now have 8 helpers and the skip on.

Constants that read a placed copy (28 Nov, night)

A diagnostics build that only logged the refusals found the submitting thread waiting ~7.5 ms a frame for a few 32-byte constant buffers that read what a copy placed earlier in the same list had just written on the card. CONSTANTS AFTER COPIES copies those bytes card to card at the constant's place instead; a CPU copy, a declared shader write or an unknown step in between keeps the old fill. Standing still (Series X, DLSS Quality, frame generation 3X, DLSS 5), with diagnostics' VICTORY_AB switching it every 45 s (compare-ab-phases.py):

Off On Frame rate
A new buffer per copy 65.5 ms 64.35 ms +1.8 %
Pooled buffers, back after the list's fence 61.3 ms 60.4 ms +1.5 %

The wait went 4.7 -> 0 ms and making the copies 10.7 -> 0.05 ms, with no hang or D3D12 error, but the frame gained no more: in this profile the card was 80-87 % busy and the submitting thread already waited ~10.8 ms a frame for it (it was ~31 % on 27 Nov, before DLSS 5 and frame generation 3X). CPU waits taken out now buy at most the card's idle time. Off by default in the code; the profile played here (example settings) has it on.

DLSS 5 Neural Rendering (experimental): the F1 switch loads Skynizz/optiscaler-dlss5 1.3.0 (GPL-3.0) as a mod, the way MFG Unlocker is loaded, before the device and Streamline. Insert opens its menu (presets, passes, cache interval, placement, strengths); F6 compares optimised, vanilla and off.

To keep frame generation on (3X: 16 rendered -> 48 shown), two things were needed:

  • OptiScaler's own frame generation is off (nofg).
  • NVIDIA's nvngx_dlss*.dll are where it looks for them. It stands in for NGX for Streamline; without them, Streamline turned DLSS-G off.

contrib/.../setup-neural-rendering.ps1 sets this up. NVIDIA's model is not included.

What it costs. From the play logs, in scenes of the same weight: the CPU loses nothing (same ~9 us per list call), but the model, run every frame on the title's own queue, made the submitting thread wait for the card whenever the title read memory the card writes mid-frame (9-13 ms per frame against 4-5). That was -10 to -22 % rendered fps in light scenes, where DLAA at 1440p already keeps the card near its limit, and nothing in heavy ones.

The settings were then compared live: measure-neural-rendering.ps1 switches them every 36 s through OptiScaler's dlssnr-set.txt (A B C D E E D C B A). This test was static: a closed indoor scene (Jason's bathroom), character and camera still, only to compare the settings against each other. A first run was discarded (a GPU miner was running). The scene's weight still swung between ~26k and ~50k calls per frame by itself, so each setting is read at the same weight from a fit of frame time and card wait against calls per frame:

DLSS 5 28k calls (light) 36k calls 45k calls (heavy)
Off 18.9 fps, wait 1.6 ms 15.5 fps, 1.3 ms 12.9 fps, 1.0 ms (few seconds)
Every frame, before DLAA (played) 14.2 fps, 17.9 ms 14.3 fps, 12.5 ms 14.4 fps, 6.4 ms
Every 2nd frame 17.0 fps, 12.8 ms 15.2 fps, 12.0 ms 13.6 fps, 11.1 ms
Every 2nd frame, model at 80 % 13.8 fps, 7.1 ms 14.4 fps, 6.2 ms 15.0 fps, 5.1 ms
Own compute queue, every 3rd frame, after DLAA 16.8 fps, 4.1 ms 15.6 fps, 3.3 ms 14.6 fps, 2.4 ms

The model on its own compute queue every third frame (CacheAsync=true, CacheInterval=3, PreSr=false) waited least, close to off, and is best or level at every weight. In light scenes it costs -11 % against off, where every frame cost -25 %. The setup script now writes it. Its look in motion was not measured (its edit arrives two frames later, along the motion vectors).

Known issue: 2 of 3 test starts stalled in the intro (dynamic descriptor slots ran out once OptiScaler made its DLSS feature, then the title's watchdog +0x23cf683 ended the run). Starts that get past the intro played for 17 and 34 minutes. A native integration without OptiScaler's hooks would avoid this; it is not attempted here.

Findings on this hardware

  • DLAA on Series S crashes at load. The scene goes from 1280x720 to 1920x1080 and the title's console-sized allocator breaks (0x80000003 at +0x2219650, 3 of 3 starts). On Series X, DLAA at 2560x1440 runs.
  • DLAA on Series X leaves white blocks indoors. With the scene at the whole 2560x1440, rooms lit by a sunny window (Jason's house) get tile-sized white blocks with pieces of the view outside in them, always in the lower and right part of the picture. They show on main (9ce3cf9, none of this branch) with the same F1 choices too, and go away with DLSS Quality (scene 1706x960), both with main's defaults and with every other choice of this profile kept (light estimate 1, frame generation 3X, model K). Ruled out by runs: the reflection stand-in (off in all of them), the water's tiled light (VICTORY_WATER_LIGHT=0), a cache (a separate copy with its own build and older caches showed them too). A guess, not proven: one of the title's tile lists is sized for the console's resolution and its last tiles keep what the memory held.
  • A start failure in about one start in three, every build (0xc0000005 at +0x2215c35). Starting again works.
  • The in-game warm-up restart drops the launcher's -More options, so it can come back on another profile.
  • Background programs matter on six cores. A sync client took ~8 % of the CPU.

contrib/rtx5070ti-ryzen5600x

File What it is
scripts/play.ps1 The wrapper around play-foxhound.ps1 used for all of the above: a warm-up start with the same options, reopening after the known start failure, a timer for fixed-spot runs
scripts/setup-neural-rendering.ps1 DLSS 5 setup
scripts/measure-neural-rendering.ps1 Times five DLSS 5 settings live at one spot (F8 in the game; play.ps1 -MeasureNeural)
scripts/compare-neural-rendering.py Frame rate and card waits per DLSS 5 setting, at the same scene weight
scripts/close-background-apps.ps1 Closes background programs before playing
scripts/compare-logs.py Fixed-spot comparison with standard errors
scripts/whole-page-check.py How much of what a refresh copies is the same bytes (VICTORY_REFRESH_SPLIT=1)
scripts/compare-switches.py Frame rate and the submitting thread's parts per F1 test-switch setting, at the same scene weight
config/victory-settings.example.txt The F1 choices played with (DLSS Quality, 8 helpers, skip on; the screenshots were DLAA)

🤖 Generated with Claude Code

**@⁠erickbobd** on GitHub · 2026-11-28 07:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/831) `erickbobd:rtx5070ti-5600x-optimizations` → `main` · +23995 −714 · 94 files · 104 commits · open Everything I play with on an **RTX 5070 Ti + Ryzen 5 5600X**, against `main`, so you can pick what is useful. It is not meant to be merged whole: it bundles open PRs from other people, which keep their own commits and credit. ![Bridge over the bay](https://raw.githubusercontent.com/erickbobd/VIctory-NVIDIA/rtx5070ti-5600x-optimizations/contrib/rtx5070ti-ryzen5600x/images/in-game-bridge.webp) ![Dive shop parking lot](https://raw.githubusercontent.com/erickbobd/VIctory-NVIDIA/rtx5070ti-5600x-optimizations/contrib/rtx5070ti-ryzen5600x/images/in-game-dive-shop.webp) ![Marina by the overpass](https://raw.githubusercontent.com/erickbobd/VIctory-NVIDIA/rtx5070ti-5600x-optimizations/contrib/rtx5070ti-ryzen5600x/images/in-game-marina.webp) *Series X profile, DLAA at 2560x1440, DLSS model K, DLSS 5 Neural Rendering, DLSS Frame Generation 3X. The profile played with is now DLSS Quality instead of DLAA: DLAA leaves white blocks indoors (Findings below).* The full write-up, with every number and switch, is in [`contrib/rtx5070ti-ryzen5600x/README.md`](https://github.com/erickbobd/VIctory-NVIDIA/blob/rtx5070ti-5600x-optimizations/contrib/rtx5070ti-ryzen5600x/README.md). ## Results On this PC the layer is **CPU-bound**: the 8 list-translation threads use ~456 ms of CPU per ~76 ms frame (about six cores of a 5600X), the submitting thread works 58-67 ms of each frame, and the card is only 30-45 % busy (Series S, DLSS Quality). So DLAA and the DLSS model cost almost nothing in frame rate here. DLSS 5 run every frame did cost some, in light scenes on Series X with DLAA; see below. | | | |---|---| | The screenshots' settings, two sessions (34 and 17 min, no crash) | **11.5-12.6 fps rendered, about 35-38 fps shown** with frame generation 3X (19,671 -> 57,400 and 4,412 -> 13,202 frames) | | The five CPU fixes below, fixed-spot A/B on PR #18 (Series S), ~7 min per run | **12.50 -> 12.74 fps** (+2 %); the submitting thread's work per frame **67.4 -> 57.8 ms** (-14 %), its join wait 5.2 -> 1.8 ms, card idle behind it 30.4 -> 17.8 ms | | Refreshes with 8 helper threads instead of 4 (heavy scenes, same session) | **22.6 -> 15.2 ms** a frame; rendered fps +2 to +6 % by scene weight (below) | | `cargo test --release -p victory-gpu --lib` | **594 passed, 0 failed** | The submitting thread lost 14 % of its work but the frame moved 2 %: with six cores, the list-translation threads are the next limit. ## What this branch has that `main` does not **From others (open PRs, merged with `main` up to v2026.11.28.01):** - **#18** (Kemerd, with D Everett Hinton's merge of upstream into it): `-Fast`, send thread, pipelines from pieces, refresh sets, title write ranges, key rebinding, 21:9. - **#145** (Walid ben miled): the AVX2 compare for refresh and copy-back runs. - **#181** (BE29ZZ and the people credited there): pooled `shadow::exact()` buffers behind a read-locked cache. Conflicts were resolved by keeping both sides; for example, the F1 menu has PR #18's key rebinding together with upstream's save sharing, save-at-once and Series S picture row. The README lists each resolution. **Ours (each has a switch back):** | Change | Switch | Why | |---|---|---| | A caller of the kept threads runs only its own jobs while it waits (`shadow.rs`) | `VICTORY_WIDE_OWN=0` | The submitting thread took other callers' 1 MiB compares while the frame waited for its own | | Front refreshes to the threads, longest first (`host.rs`) | `VICTORY_REFRESH_BIG_FIRST=0` | The join no longer waits for one long span taken last | | Short spin for the guards' lock (`watch.rs`) | `VICTORY_GUARDS_SPIN_US=0` | Held 7-18 us, but a sleeping waiter woke ~130 us later on a busy CPU | | A host list's own scratch buffers are not waited for (`host.rs`) | `VICTORY_LIST_BUFFERS_WAIT=1` | Only the list being recorded names them; a 10-minute run waited 45,200 times (25 s) | | No new reference when a descriptor slot keeps the same resource (`descriptor/host.rs`) | none | AddRef/Release per draw from all recording threads | | Sampler runs share slots, 1024-slot pool (`pipeline/host.rs`) | `VICTORY_PIPELINE_SAMPLER_REUSE=1` | The 256-slot pool filled while loading: 864 library bypasses -> 0 | | **F1: NEURAL RENDERING (INSERT)**, off by default (`play.rs`, `main.rs`, `menu.rs`) | F1 | DLSS 5 Neural Rendering through the OptiScaler DLSS5 mod (below) | | Planning the card's steps: `does_of()` sizes its vectors for every step at once (`host/card_steps.rs`) | none | Growing them each submission was 0.85 ms a frame | | Retired objects into 8 queues, one per thread, not one lock (`host.rs`) | none | The pool threads making constant views stood in line for it: 0.8 ms a frame | | **F1: SKIP SAME PAGES (TEST)**: a refresh passes over 4 KiB pieces whose 64-bit hash says they are the same bytes (`shadow.rs`) | `VICTORY_PAGE_SKIP=1` | 82.5 % of the pieces a refresh took again were the same; only copies no shader is declared to write | | **F1: HELPER THREADS (TEST)**: AUTO / 6 / 8 helpers for the refreshes, live (`shadow.rs`) | `VICTORY_WIDE_THREADS` | Refreshes 22.6 -> 15.2 ms with 8 in heavy scenes | | **F1: GUARDS LOCK SPIN (TEST)**: 25 / 100 us / off, live (`watch.rs`) | `VICTORY_GUARDS_SPIN_US` | No measurable effect at 100 us | | Whole-page check of rewritten pages, stats only (`shadow.rs`) | `VICTORY_REFRESH_SPLIT=1` | How much of what a refresh copies is the same bytes, and how fast both sides read | | **F1: CONSTANTS AFTER COPIES (TEST)**: a constant whose bytes the list's latest placed copy produced is copied card to card at its place, into a pooled 64 KiB buffer (`host/placed_constants.rs`) | `VICTORY_PLACED_CONSTANTS=1` | The submitting thread waited for ~8 such 32-byte constants a frame (4.7-7.3 ms); +1.5 % (below) | Tried and left off because they were slower here: batched resource retirement with raised helper priority (-12 %), list-held descriptors (-6 %), and `VICTORY_PORT_CONSTANTS` (5-7 fps). (The retirement queues above are another thing: the same objects, at the same time, one queue per thread.) ## Host-copy refreshes, measured before building (28 Nov, evening) Each idea got a ceiling from a CPU profile and the log first, a stats-only build where it could, and only then a live F1 switch to compare standing still (heavy scene: Series X, DLSS Quality, frame generation 3X, ~95 ms a frame). - **Most of what a refresh copies is the same bytes again.** The write watch names the pages the title wrote, not those it changed: of 1 rewritten page in 256 compared whole (`whole-page-check.py`), **82.5 %** of the 4 KiB pieces were equal. Comparing against the CPU side would cost more than copying (it reads at 4.0 GB/s), so SKIP SAME PAGES keeps a 64-bit hash per piece (XXH3's long loop, AVX2) and skips only copies no shader is declared to write: upstream's `VICTORY_SEND_CHANGED` lost the room's indirect light where the title writes a value again over what a shader changed on the card. - **It works, but the frame barely moves:** sent up to the card 40 -> 23 MB a frame, the card copies 15.0 -> 15.2 ms (they cost per call, not per byte), and a refresh still has to read title memory to know (41.7 MB in 9.6 ms of threads either way). 1-3 % at most. No visual problem in ~10 minutes with it on. - **Planning the card's steps:** the two cuts above, ~2 ms (11.8 -> 9.9 ms at 50-60k calls, 13.3 -> 10.7 ms at 60-75k). - **The refresh runs in parallel but stalls:** its five threads each spend ~12.5 ms a frame in it, on a processor a quarter of that time (~7.4 ms a frame in line for the guards' lock, which holds `VirtualProtect` calls; ~7.8 ms copying title memory while not running; the journal's lock; the batch queue). More helpers (`compare-switches.py`, one session, switches changed while moving between scenes, compared by scene weight): | Calls per frame | 4 helpers | 8 helpers | |---|---|---| | 50-60k | 10.44 fps | 10.69 fps (+2.3 %) | | 60-70k | 9.04 fps | 9.56 fps (+5.8 %) | | Refreshes, >= 60k calls | 22.6 ms | **15.2 ms** | The refreshes are clearly shorter; the frame gains less, and how much is not settled by so few seconds (the wait for flights swung between 4 and 29 ms between places). The example settings now have 8 helpers and the skip on. ## Constants that read a placed copy (28 Nov, night) A diagnostics build that only logged the refusals found the submitting thread waiting ~7.5 ms a frame for a few **32-byte constant buffers** that read what a copy placed earlier in the same list had just written on the card. CONSTANTS AFTER COPIES copies those bytes card to card at the constant's place instead; a CPU copy, a declared shader write or an unknown step in between keeps the old fill. Standing still (Series X, DLSS Quality, frame generation 3X, DLSS 5), with diagnostics' `VICTORY_AB` switching it every 45 s (`compare-ab-phases.py`): | | Off | On | Frame rate | |---|---|---|---| | A new buffer per copy | 65.5 ms | 64.35 ms | +1.8 % | | Pooled buffers, back after the list's fence | 61.3 ms | 60.4 ms | **+1.5 %** | The wait went 4.7 -> 0 ms and making the copies 10.7 -> 0.05 ms, with no hang or D3D12 error, but the frame gained no more: in this profile **the card was 80-87 % busy** and the submitting thread already waited ~10.8 ms a frame for it (it was ~31 % on 27 Nov, before DLSS 5 and frame generation 3X). CPU waits taken out now buy at most the card's idle time. Off by default in the code; the profile played here (example settings) has it on. **DLSS 5 Neural Rendering (experimental):** the F1 switch loads [Skynizz/optiscaler-dlss5](https://github.com/Skynizz/optiscaler-dlss5) 1.3.0 (GPL-3.0) as a mod, the way MFG Unlocker is loaded, before the device and Streamline. **Insert** opens its menu (presets, passes, cache interval, placement, strengths); **F6** compares optimised, vanilla and off. To keep **frame generation on** (3X: 16 rendered -> 48 shown), two things were needed: - OptiScaler's own frame generation is off (`nofg`). - NVIDIA's `nvngx_dlss*.dll` are where it looks for them. It stands in for NGX for Streamline; without them, Streamline turned DLSS-G off. `contrib/.../setup-neural-rendering.ps1` sets this up. NVIDIA's model is not included. **What it costs.** From the play logs, in scenes of the same weight: the CPU loses nothing (same ~9 us per list call), but the model, run every frame on the title's own queue, made the submitting thread wait for the card whenever the title read memory the card writes mid-frame (9-13 ms per frame against 4-5). That was -10 to -22 % rendered fps in light scenes, where DLAA at 1440p already keeps the card near its limit, and nothing in heavy ones. The settings were then compared live: `measure-neural-rendering.ps1` switches them every 36 s through OptiScaler's `dlssnr-set.txt` (A B C D E E D C B A). **This test was static:** a closed indoor scene (Jason's bathroom), character and camera still, only to compare the settings against each other. A first run was discarded (a GPU miner was running). The scene's weight still swung between ~26k and ~50k calls per frame by itself, so each setting is read at the same weight from a fit of frame time and card wait against calls per frame: | DLSS 5 | 28k calls (light) | 36k calls | 45k calls (heavy) | |---|---|---|---| | Off | 18.9 fps, wait 1.6 ms | 15.5 fps, 1.3 ms | 12.9 fps, 1.0 ms (few seconds) | | Every frame, before DLAA (played) | 14.2 fps, 17.9 ms | 14.3 fps, 12.5 ms | 14.4 fps, 6.4 ms | | Every 2nd frame | 17.0 fps, 12.8 ms | 15.2 fps, 12.0 ms | 13.6 fps, 11.1 ms | | Every 2nd frame, model at 80 % | 13.8 fps, 7.1 ms | 14.4 fps, 6.2 ms | 15.0 fps, 5.1 ms | | **Own compute queue, every 3rd frame, after DLAA** | **16.8 fps, 4.1 ms** | **15.6 fps, 3.3 ms** | **14.6 fps, 2.4 ms** | The model on its own compute queue every third frame (`CacheAsync=true`, `CacheInterval=3`, `PreSr=false`) waited least, close to off, and is best or level at every weight. In light scenes it costs -11 % against off, where every frame cost -25 %. The setup script now writes it. Its look in motion was not measured (its edit arrives two frames later, along the motion vectors). **Known issue:** 2 of 3 test starts stalled in the intro (dynamic descriptor slots ran out once OptiScaler made its DLSS feature, then the title's watchdog `+0x23cf683` ended the run). Starts that get past the intro played for 17 and 34 minutes. A native integration without OptiScaler's hooks would avoid this; it is not attempted here. ## Findings on this hardware - **DLAA on Series S crashes at load.** The scene goes from 1280x720 to 1920x1080 and the title's console-sized allocator breaks (`0x80000003` at `+0x2219650`, 3 of 3 starts). On Series X, DLAA at 2560x1440 runs. - **DLAA on Series X leaves white blocks indoors.** With the scene at the whole 2560x1440, rooms lit by a sunny window (Jason's house) get tile-sized white blocks with pieces of the view outside in them, always in the lower and right part of the picture. They show on `main` (9ce3cf9, none of this branch) with the same F1 choices too, and go away with DLSS Quality (scene 1706x960), both with `main`'s defaults and with every other choice of this profile kept (light estimate 1, frame generation 3X, model K). Ruled out by runs: the reflection stand-in (off in all of them), the water's tiled light (`VICTORY_WATER_LIGHT=0`), a cache (a separate copy with its own build and older caches showed them too). A guess, not proven: one of the title's tile lists is sized for the console's resolution and its last tiles keep what the memory held. - **A start failure in about one start in three, every build** (`0xc0000005` at `+0x2215c35`). Starting again works. - **The in-game warm-up restart drops the launcher's `-More` options**, so it can come back on another profile. - **Background programs matter on six cores.** A sync client took ~8 % of the CPU. ## `contrib/rtx5070ti-ryzen5600x` | File | What it is | |---|---| | `scripts/play.ps1` | The wrapper around `play-foxhound.ps1` used for all of the above: a warm-up start with the same options, reopening after the known start failure, a timer for fixed-spot runs | | `scripts/setup-neural-rendering.ps1` | DLSS 5 setup | | `scripts/measure-neural-rendering.ps1` | Times five DLSS 5 settings live at one spot (F8 in the game; `play.ps1 -MeasureNeural`) | | `scripts/compare-neural-rendering.py` | Frame rate and card waits per DLSS 5 setting, at the same scene weight | | `scripts/close-background-apps.ps1` | Closes background programs before playing | | `scripts/compare-logs.py` | Fixed-spot comparison with standard errors | | `scripts/whole-page-check.py` | How much of what a refresh copies is the same bytes (`VICTORY_REFRESH_SPLIT=1`) | | `scripts/compare-switches.py` | Frame rate and the submitting thread's parts per F1 test-switch setting, at the same scene weight | | `config/victory-settings.example.txt` | The F1 choices played with (DLSS Quality, 8 helpers, skip on; the screenshots were DLAA) | 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Ray tracing (VICTORY_RT_NATIVE=1): the title's seven builder calls pass
through a new interposer (victory-hle bvh_builder), the batched build
description is typed, builder pipelines are made ahead on the workers
instead of freezing the first build, the by-address memory is timed by
section, and structures get exact extents from the builder's own sizes.

Display: VICTORY_DISPLAY_WIDE=WxH patches the display mode to a wider
size with the 1440p output patch; VICTORY_ASPECT and VICTORY_UI_LETTERBOX
are included as they were.

Not behind a switch: the title's rate setting now follows the launcher's
VICTORY_FRAME_INTERVAL_US as well as VICTORY_FRAME_INTERVAL_MS, so game
speed is right under the frame cap; mod ambient and mod aspect each get
their own cfg(windows); get-nvidia-sdks.ps1 fetches only missing files
and can fetch the DLSS Ray Reconstruction files.

Diagnostics: VICTORY_PIPELINE_DUMP=<folder> records what the two
unimplemented pipeline creation methods were given; F1 menu item for
VICTORY_RT_NATIVE.

Documents: AGENTS.md and docs/broadside-format.md.
With the world streamed in there was no 64 MiB hole left in [4 GiB, 2^37) in two runs of three: the twentieth arena could not be had and every builder dispatch asked for it again, 5 to 18 s of every frame under the module's mutex, until the title's watchdog ended the run. Arenas and the directory are not found by address by any shader, so they fall back to anywhere below 2^40. A failure backs off for 30 frames, says why, and gives its reservation back.

Also: the first build's inputs are logged as dwords with VICTORY_RT_TRACE=1.
Off by default. With the switch: slReflexSleep at the frame's origin wait, simulation start after it, the controller input sample at the first GameInput reading of the frame, simulation end and render-submit start at the title's first ExecuteCommandLists, render-submit end and present start and end at our present, each frame under its own token. A periodic line reports Reflex's own state. Needs Streamline loaded (VICTORY_DLSS=1 or VICTORY_FRAMEGEN=1). docs/dlss.md has the switch, the log lines and a first-run checklist.

Compiled and unit-tested; not yet run against Streamline or the game.
The copies shaders trace through were held to 4 GiB of the card's memory whatever the card (VICTORY_MEMORY_CARD_MB unset); past it they went to the PC's memory with nothing said, and every step of every ray through them crossed the bus. Unset, the most is now 4 GiB or a quarter of the card's budget, the share the card copies of title buffers have. Not reached in the runs here (about 1.5 GiB in use): type-checked and tested, not shown in a run.
The budget of pages given a place from the faults is 2,048 for a run (a ray through a wrong structure goes anywhere). It was spent in the first minute of the world, and from then on no page a shader found empty was given a place (made=0 in every line) while 300 to 1,400 pages a frame were found empty. A page inside an extent the builder's calls named is a structure's by the title's own word: it and the rest of the structure are made ready, at most 1,024 pages a frame, and count against neither budget. A top level's instances bring the other pages of the structures they name, where the length is known and the pages have no place yet. The line now splits the pages found empty: below 4 GiB, in named structures, others from the budgets. Type-checked and tested; not yet run.
Run rt-8: the pages given a place inside structures the builder's calls named were none; of 330 to 420 pages a frame found empty, 17 to 58 were below 4 GiB and the rest title addresses outside every named structure, left empty with the run's budget (2,048) spent in ten seconds. Unset the budget is as before. The line adds: left with the run's budget spent, with the frame's spent, not the title's memory.
A draw or dispatch whose host pipeline is unmade took what was left of the
frame's 500 ms in every frame, whether or not a worker had the pipeline. With
the switch the wait is left out when the pipeline was first asked for longer
ago than the budget, or when no worker has it and the oldest requested
pipeline no worker has taken has stood for longer than the budget. A first use
behind a young line keeps its wait; passes over the screen keep their own.

=count only counts; with either value a line every five seconds says how many
waits began, how long they were, how many ran the whole budget and how many
were left out by each rule (first uses apart). Unset, only two times are noted
per pipeline and nothing else changes.

Compiled and tested (the decision and the line's front as pure parts); not
seen in a run.
The console's device has two pipeline-creation methods (slots 0x1c8 and
0x218) that take loose program pieces instead of a finished container.
Until now both answered E_NOTIMPL and the title went without those
pipelines.

With VICTORY_PIPELINE_PIECES=1, 0x218 makes a compute pipeline and 0x1c8
a graphics pipeline. Each stage's pieces (register packet, code,
metadata) are wrapped in a small container of ours so the existing
shader path, cache and save switch take them unchanged. A description
that is refused logs its reason once and answers as before. With the
switch unset nothing changes.

Not yet reviewed and not yet run in the game. Editing victory-shader
changes the translator fingerprint, so cached translations are redone
on the first run.
While pipelines are queued, draws that need one are dropped, so the
picture can be dark or patchy for a while after a translator change (run
10: about 600 queued at world entry, a black screen for a minute). The
corner line now carries a second line, SHADERS: n, while any are queued.
Past n queued, a draw's host pipeline is not waited for and the draw is
dropped at once. Run 5 spent the whole 500 ms wait budget in every frame
for two minutes with 470 queued (about 290 ms a frame), run 10 sat at
3 fps with 600 queued. Passes over the screen keep their own budget.
Unset by default.
# Conflicts:
#	crates/victory-gpu/src/pipeline/make.rs
VICTORY_MEMORY_LEAN, VICTORY_MEMORY_DIRTY, VICTORY_MEMORY_BUFFER_FAULTS (memory.rs),
VICTORY_REFRESH_PROBE_US and VICTORY_DECLARE_ACROSS_LISTS (host.rs, host/lean.rs),
VICTORY_LIBRARY_STATIC_SAMPLERS and the sampler-table groundwork (pipeline/), and
refusal counters in the card steps' line. Merged over the streaming patches in
memory.rs, both kept. Compiled only; not run in the game yet.
Reflex (VICTORY_REFLEX): the sleep and SimulationStart move from the origin
wait to the title's first input reading of a simulation; the next origin
wait takes that index, so submissions and the present carry it by token.
Frames with no simulation to take sleep at the origin wait as before.

Perf fixes: the lean pre-ask keeps a per-thread, per-frame refusal cache;
the dirty settle merges past four runs; step timing and declaration counting
run only with their switches. Compiled only.
Look-once counters count only whole reads; a staging piece is zero-filled
before the states lock; a read-ahead takes the texture's lock once; the
arenas thread is not raced by a second arena made under the mutex; the
root views' split no longer counts twice; report lines are written after
the mutex is let go; the copy finder's timing covers the look alone; the
slow workers' cap counts the screen workers. Checked and unit-tested.
Shown only while each is not zero, sampled once a second with the frame rate
so the box is not repainted every frame; VICTORY_FPS_LINE=0 hides them with it.
The HLE side publishes two atomics in victory_gpu::loading.
All off by default. Checked and unit-tested; not run in the game.
Compressed exports and 16-bit integer stores apply only to programs made from
pieces (a 0x200-range layout entry no title has); pixel programs from pieces
carry a 0x201 marker; DB_SHADER_CONTROL bits 9, 10 and 16 are refused by name;
compute groups are bounded as D3D12 bounds them (z at most 64, product 1024).
Ordinary shaders: byte-identical to 67d9598 over 19,104 cached containers.
Pieces containers that translate offline: 884 -> 1,339 of 2,964.
RR's ABI from the 2.14.16 headers with layout tests; the plugin's required
tags, version and optimal sizes are logged; RR does not draw yet: no guide
buffer is identified, and the targets log is how a run names them.
Super Resolution is unchanged. Checked and unit-tested.
The title is told HDR is there only when the switch is on and the primary
output reports it; its planes go to an R10G10B10A2 swap chain in the PQ
colour space with HDR metadata, SDR planes composed at paper white.
Checked and unit-tested; not run in the game.
The interface composite is placed in the middle of the wide picture
(VICTORY_UI_LETTERBOX unset is 16x9 on a wide run, 0 stretches it), the
swap chain and DLSS take the wide sizes, and the launcher has a wide pick.
Checked; not run in the game.
# Conflicts:
#	crates/victory-gpu/src/compose.rs
#	crates/victory-gpu/src/host/menu.rs
Fixes the cross_lane assertion on 61 compute programs made from pieces
(none ordinary: ordinary compute outputs byte-identical over 2,734).
21 of them now translate.
With VICTORY_PIPELINE_PIECES=1 the composite's hashes are ours, not the stock
ones, and the band never fired (menus stretched). A one-triangle draw with one
target blended premultiplied over is now taken as well, and each pipeline taken
is logged once. Checked and unit-tested; not run in the game.
1,121 pipelines with static samplers were made again by the driver in every
run (1,610 s of worker time, about 1.4 s each, longest 18 s) against about
5 ms for a load from the library.
# Conflicts:
#	crates/victory-hle/src/modules/mod.rs
At 5120x1440 the title's screen-sized memory leaves about 152 MiB in the
window list uploads must live in; the memory-by-address directory and a
memory arena took 80 MiB of it, the 19th upload arena could not be made,
allocate_upload returned null and the title's ray-tracing rehydrate hit an
invalid-parameter exit. With VICTORY_DISPLAY_WIDE set, those two are
reserved above 2^37 first; a failed upload allocation now logs a warning.
The crash log sat in the data folder, and players send the run's log, so
the report never reached us. A report now goes into the run's log too;
the first one of a run also copies that log and writes a small minidump
into the game's folder. Frames in title images carry the title's file
names instead of our prepared copies' hashes, and the title's last 64
debug lines are kept, enough to see past its own crash reporter.
An exe that exports D3D12SDKVersion and D3D12SDKPath gets Microsoft's
newer D3D12 runtime from a D3D12 folder next to it: shader model 6.6,
which Windows 10's own runtime lacks. The exports only go into a build
with the new agility feature: on Windows 11, an exe with them and no such
folder cannot make a device (0x887E0003, measured with a probe exe), the
reason upstream PR #10 stayed out. The launcher picks the Windows 10
build only on Windows 10, and only once D3D12Core.dll is in place: it
offers to download it from Microsoft's NuGet (1.620.2) and checks its
SHA-256 first.

Based on Marvisak/VIctory PR #175 and trustno1-coder/VIctory-NVIDIA PR #10.
With VICTORY_SEND_THREAD=1 the frame's copy into the back buffer goes to the
send thread, and Present was called right after on the presenting thread.
Without frame generation's proxy swap chain the present reached the queue
first and the copy then wrote a buffer the compositor held: device removed
0x887A002B within the first few submissions (players without frame
generation, and Reflex alone). Present now waits for the send thread
(0.03 ms a frame measured).

Crash files: the report goes to the logs in one write, and a second failure
waits for the first to finish its dump instead of cutting it to 0 bytes.

The keyboard's stand-in pad reads its keys from victory_gpu::keybinds
(VICTORY_KEY_<CONTROL>, defaults as before). The F1 menu lists every control:
Enter waits for the new key, Left/Right restore the default; changes apply at
once and are saved with the other settings.
- ffxQuery: when the title's shipping FSR4 gives no jitter phase count (it
  refuses sizes it has no tables for, or has no context), the title's jitter
  ring stays 0 long and it divides by zero (a player's crash at
  game+0x28f03e8). The count is now FidelityFX's own formula in that case;
  an answer of the DLL's own is kept.
- clzero loops: stub areas are made near each loop that the ones so far
  cannot reach with a jmp rel32 (a title DLL far from the exe was left to
  the emulation; the test failed about one run in four for it).
- allocate_upload (thin lists) and the upload arenas say why they answer
  null, which the title's structure builder ends the run on ("Failed to
  allocate upload buffer", seen on a 32 GB PC).
- known.rs: a raw NUL in a test string written as \0 (the asset policy
  refused the file).
- README: how the frame pipeline was rebuilt, stage by stage.
- PLAY.cmd: one launcher for resolution (16:9, 32:9, 21:9, any width at
  1440 high), window or borderless fullscreen, console profile, DLSS,
  frame generation 2x-6x, NVIDIA Reflex, HDR10, frame cap, wide interface
  and speed. It names the crash files after a crash, and on Windows 10 it
  fetches Microsoft's D3D12 Agility SDK (checked by SHA-256) for
  victory-win10.exe.
- Present waits for the send thread: with VICTORY_SEND_THREAD=1 and no
  frame generation proxy, the present reached the queue before the frame's
  last copy and the device was removed (0x887A002B).
- Crash reports: crash-<run>.log and crash-<run>.dmp next to victory.exe,
  module names for title images, one write per report, and a second
  failure waits for the first dump.
- victory-win10.exe (feature `agility`): the D3D12 Agility SDK exports, so
  Windows 10 gets shader model 6.6.
- FidelityFX: a jitter phase count the title's FSR4 leaves unset is
  answered with FidelityFX's formula (the title divided by zero).
- clzero stubs: an area within jmp rel32 reach of each loop.
- Upload memory: the reason it is refused goes in the log.
- F1 menu: the keyboard stand-in pad's keys can be changed (live), and
  3440x1440 is a picture size; victory play --res ultrawide.
Shadow::take() -- the copy a refresh makes for a host copy, measured this session at
71.6 MB compared and 47.2 MB copied a frame over 1077 runs -- was calling the scalar
dword_runs(at, held, title, 0) even though word_runs() dispatches to word_runs_avx2()
for exactly this case (gap 0, word-aligned, equal lengths) and falls back to that same
scalar call when it cannot. Its only other user was send_changed, behind words_under().
Shadow::take gets the wide compare now.

Correctness: word_runs already has a round-trip test in this file (word_runs ==
dword_runs over random rounds) and it passes; the fallback is the identical scalar call,
so only the instruction used changes, never the runs reported.

Expected: the refresh's cost this session measured is dominated by comparing ~71.6 MB of
title memory against the CPU copy every frame; upstream's findings.md measured 14 -> 4-7 ms
from doing this compare with AVX2 on a sibling path. Verify with VICTORY_REFRESH_SPLIT=1:
the MB copied must not move, the ms in the submitting thread must.
put_changed(), which writes what shaders wrote back into title memory, also computed its
runs with the scalar dword_runs(.., 0) although word_runs() is that same call with the
AVX2 implementation when it can. Same fallback, same runs, wider instruction. The
copy-back path is the one measured at 34.8 -> 17.2 ms by WC_NO_BACK, so it is worth the
wide compare too.

Tests: 423 passed, 2 failed - the two pre-existing upstream ones. Build clean.
Replace the single global mutex and per-miss O(N) sweep/allocation in shadow::exact() with a lock-stratified cache and a power-of-two recycling pool:

- Concurrent cache hits take only an RwLock read guard (no serialization across list threads).
- Idle pruning is throttled and single-winner (CAS-guarded), sampling the GPU submission watermark (submissions + queued) AFTER evicting entries from the map so submissions begun before eviction are always covered.
- D3D12 buffer creation (shared_buffer) and overflow retirement (host::retire) run outside all locks; map and pool locks are never nested.
- Evicted buffers wait in quarantine for both 2 extra frames (4 frames total past last use) and completion of all GPU submissions started or queued at eviction before re-entering the ready pool.
- Pooled buffers round to power-of-two buckets (64 KiB min, 64 MiB max), zero all previously touched bytes before reuse, and drain ready buffers under host memory pressure in shadow::let_go_idle().
- Budget defaults to 256 MiB under limited host RAM else 320 MiB; VICTORY_EXACT_POOL_MB=0 disables both pooling and 64 KiB bucket rounding (keeps 256-byte rounding).

Design/measurements credited to @ToolxMaster and @Miquella135; review improvements from @adrianmjim; in-game RTX 3070 Ti validation by @Robotniq.
Kept from this fork where both changed the same code:
- memory by address keeps its arenas out of the shaders' reach (rt-2, rt-4),
  made ahead, with no other tried before ARENA_AGAIN frames;
- upload.rs: upstream's pool and early pieces for memory shaders read by
  address, our out-of-reach reservations (wide outputs try above 2^37
  first), and upstream's process-heap upload in place of null, logged once
  with what Windows said;
- the F1 menu's key rows, with upstream's about lines and link below;
- Ray Reconstruction's switch, Reflex's warning, HDR10's swap chain
  metadata, 21:9 as a picture size.

Taken from upstream: build.rs. Every exe now exports the Agility SDK
variables and asks for the version of the D3D12Core.dll beside it, or for
Windows' own runtime without one; d3d12.dll loads on first use. That covers
what the `agility` feature and victory-win10.exe were for, so src/agility.rs
is gone and the feature is kept empty for the release steps.

Crash files keep their crash-<time>-<process> names with the new
victory-nvidia-play- log names, so the launchers still find them.
Brings this branch up to date with upstream main (already merged on the
fork, so this pull request has no conflicts) and adds:
- upload.rs: upstream's pool and early pieces, plus reservations out of the
  shaders' reach for memory no shader reads by address (32:9 and 21:9 left
  too little room below 2^37), and the process-heap upload in place of null;
- pipelines from pieces: pixel system inputs, partial-channel stores, and
  views from the resource heap (VICTORY_HEAP_VIEW=1);
- array texture LOD queries (image_get_lod on spatial coordinates only);
- crash files keep their crash-<time>-<process> names with the
  victory-nvidia-play- run logs.
The README stays upstream's.
Conflicts kept both sides: sampler tables (PR 18) before the fixed
static-sampler order (upstream); upstream's ray activation default (no
magenta probes) and water light; wide output and the changed-copy error;
key rebinding (PR 18) and save sharing / save at once (upstream) in the F1
menu, actions counted after the key lines; keyboard pad keys by position
with rebinding; -Fast and -FrameGenReady in the menu's restart.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- VICTORY_PIPELINE_SAMPLER_REUSE: contained sampler runs share slots, 1024-slot pool
- watch: short spin for the guards' lock (VICTORY_GUARDS_SPIN_US)
- host: list scratch buffers not waited for (VICTORY_LIST_BUFFERS_WAIT)
- shadow: a wide caller runs only its own batch (VICTORY_WIDE_OWN), VICTORY_WIDE_THREADS
- host: front refreshes to the threads longest first (VICTORY_REFRESH_BIG_FIRST)
- descriptor: keep_ref, no clone when the slot keeps the same resource

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both sides had added a refusal counter of their own; upstream's list and its
log line are left out for PR 18's fixed REASONS table, which its log and test use.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two test menus the merge joined without a conflict had only one side's fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The F1 menu's visible rows count PR 18's key lines; Series X picture keeps
PR 18's 32:9 and 21:9 sizes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_NEURAL=1 loads Skynizz's OptiScaler DLSS5 build (an optiscaler-dlss5
folder beside victory.exe or above it, or VICTORY_NEURAL_DIR) as MFG Unlocker
is loaded, before the device and Streamline, in both `play` and `run`. Its
own frame generation is off in its ini; NVIDIA's through our Streamline stays.
Insert opens its menu. Off by default.

First runs (28/11): with the NVIDIA DLLs where it looks, DLSS-G stays on (16
rendered, 48 shown at 3X) and the model runs; 2 of 3 starts stalled in the
intro (dynamic descriptor slots ran out, then the title's watchdog).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A report of one PC (where the frame goes, the A/B of the five CPU fixes, the
sessions behind the screenshots, known issues) and the helpers it was played
with: a launcher wrapper (warm-up start, reopen after the known start failure,
timer), the DLSS 5 neural rendering setup, a background-app closer and a log
comparison script. Nothing here is built into the layer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The play logs (Series X, DLAA 2560x1440, frame generation 3X) with and
without DLSS 5, in scenes of the same weight: the CPU loses nothing, but
the model, run every frame on the title's queue, made the submitting
thread wait for the card whenever the title read memory the card writes
mid-frame (9-13 ms per frame against 4-5): -10 to -22 % rendered fps in
light scenes, none in heavy ones.

measure-neural-rendering.ps1 switches five DLSS 5 settings live through
OptiScaler's dlssnr-set.txt (A B C D E E D C B A, 36 s each, F8 starts
it; play.ps1 -MeasureNeural), and compare-neural-rendering.py reads the
game's log for each, fitting frame time and card wait against calls per
frame. A static run in a closed indoor scene: the model on its own
compute queue every third frame waited least (2-4 ms against 1-2 off)
and was best or level at every scene weight, so setup-neural-rendering
now writes CacheAsync=true, CacheInterval=3, PreSr=false.

Also a third screenshot (the marina).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 14:28:33 +00:00
With the scene at the whole 2560x1440, rooms lit by a sunny window get
tile-sized white blocks with pieces of the view outside in them, always
in the lower and right part of the picture. They show on main (9ce3cf9)
with the same F1 choices and go away with DLSS Quality, with main's
defaults and with every other choice of this profile kept. Not the
reflection stand-in, the water's tiled light or a cache. The example F1
choices are DLSS Quality now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Stats only, under VICTORY_REFRESH_SPLIT=1: one rewritten page in 256 is
compared whole with the copy's CPU side, 4 KiB at a time, before the copy
overwrites it, split by whether a shader could have made the card's side
differ, and both reads are timed. Changes nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A refresh copies again every 4 KiB piece the write watch names, but the
title mostly writes the same bytes: 82.5 % of the pieces taken again in a
heavy scene were equal to the copy's CPU side (whole-page check, 1 page in
256). With VICTORY_PAGE_SKIP=1, or F1 SKIP SAME PAGES (TEST), a refresh
keeps a 64-bit hash of each piece it copied (XXH3's long loop, AVX2) and
passes over a whole piece whose hash is the one the CPU side holds: not
written there, not sent to the card; what is copied goes up joined across
gaps of up to two pieces. Only copies no shader was declared to write and
whose CPU side nothing but refreshes wrote (a landing, merge, copy back or
placed copy marks a copy as written by others for good); a copy that does
not hash forgets the pieces it takes. Off: as before.

Planning the card's steps, which every frame waits for: does_of() sizes its
two vectors for every step at once (0.85 ms a frame went to growing them),
and retired objects go into 8 queues, one per thread, instead of one lock
the pool's threads stood in line for (0.8 ms a frame).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A profile of a heavy scene had the refresh spread well over its five
threads (four helpers and the submitting one, about 12.5 ms a frame each)
but each on a processor a quarter of that time: some 7.4 ms a frame in line
for the write guards' lock, 7.8 ms copying title memory while not running,
the rest in the journal's lock and the batch's queue.

F1 HELPER THREADS (TEST), VICTORY_WIDE_THREADS: at least 8 helpers are made
and as many as asked are used (AUTO: 3 of 8 processors, as before); those
not used sleep and are not woken. F1 GUARDS LOCK SPIN (TEST),
VICTORY_GUARDS_SPIN_US: how long a thread tries the guards' lock awake before
it sleeps (25 us, as before; 100; off). Both from the next use on, and
logged as "live switch: ..." with the start's values, so a run's stretches
can be compared standing still. Nothing drawn changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The README gains the evening's work on the refreshes: the whole-page check
(82.5 % of the 4 KiB pieces a refresh took again were the same bytes), what
skipping them did (40 -> 23 MB a frame sent up, the frame barely moved: the
cost is reading title memory and per-call), the two cuts in planning the
card's steps (~2 ms), the profile of the refresh's stalls (the guards' lock,
copies while not running, the journal's lock) and the helper-thread switch
(refreshes 22.6 -> 15.2 ms in heavy scenes with 8). The changes table, the
files and the test count follow; the example settings now have 8 helpers
and the skip on. whole-page-check.py and compare-switches.py read the
game's log for those measurements.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A constant buffer whose bytes the list's latest placed copy produced made
the submitting thread wait for that copy to land, then fill it from title
memory. With VICTORY_PLACED_CONSTANTS=1 (F1: CONSTANTS AFTER COPIES, off by
default) the list copies those bytes on the card, at its place, into a
private 64 KiB buffer the constant's shaders read. A CPU copy, a declared
shader write or an unknown step between the two falls back to the old fill,
as does anything past 128 steps or 32 constants a list. The buffers come
from a pool and go back only when the list is reset or dropped, after its
fence, like the upload chunks.

Standing still (Series X, DLSS Quality, frame generation 3X, DLSS 5), with
diagnostics' VICTORY_AB switching it every 45 s: the wait went from 4.7 ms
to 0 a frame and the frame from 61.3 to 60.4 ms (+1.5 %; a first version
that made a buffer per copy gave +1.8 %, its 10.7 ms of making them off the
frame's path). No hang or D3D12 error in either run. The card was 80-87 %
busy there, so CPU waits taken out now buy little.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The README gains the night's test: a diagnostics build found the submitting
thread waiting ~7.5 ms a frame for a few 32-byte constants that read what a
placed copy had just written on the card. CONSTANTS AFTER COPIES (F1, off by
default) copies them card to card at their place instead. Standing still
with VICTORY_AB switching it every 45 s: +1.8 % with a buffer per copy,
+1.5 % with pooled buffers (61.3 -> 60.4 ms; the wait 4.7 -> 0 ms), no hang
or D3D12 error. It is small because the card was 80-87 % busy in this
profile (DLSS 5, frame generation 3X), against ~31 % on 27 Nov. The changes
table, files and test count follow; compare-ab-phases.py reads a VICTORY_AB
run from the game's log.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The example settings turn CONSTANTS AFTER COPIES on, as the F1 profile
played with now does (+1.5 % standing still, no hang in two runs); the code
keeps it off by default and F1 turns it off live.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This pull request has changes conflicting with the target branch.
  • AGENTS.md
  • apps/victory/src/main.rs
  • apps/victory/src/native_1440p.rs
  • apps/victory/src/play.rs
  • apps/victory/src/run.rs
  • crates/victory-gpu/src/compose.rs
  • crates/victory-gpu/src/descriptor/host.rs
  • crates/victory-gpu/src/device.rs
  • crates/victory-gpu/src/draw.rs
  • crates/victory-gpu/src/host.rs
  • crates/victory-gpu/src/host/card_steps.rs
  • crates/victory-gpu/src/host/font.rs
  • crates/victory-gpu/src/host/menu.rs
  • crates/victory-gpu/src/host/place.rs
  • crates/victory-gpu/src/lib.rs
  • crates/victory-gpu/src/memory.rs
  • crates/victory-gpu/src/pipeline.rs
  • crates/victory-gpu/src/pipeline/host.rs
  • crates/victory-gpu/src/pipeline/library.rs
  • crates/victory-gpu/src/pipeline/make.rs
  • crates/victory-gpu/src/pool.rs
  • crates/victory-gpu/src/queue.rs
  • crates/victory-gpu/src/shadow.rs
  • crates/victory-gpu/src/streamline.rs
  • crates/victory-gpu/src/texture.rs
  • crates/victory-gpu/src/texture/ahead.rs
  • crates/victory-gpu/src/upload.rs
  • crates/victory-gpu/src/watch.rs
  • crates/victory-hle/src/modules/display.rs
  • crates/victory-hle/src/modules/dstorage.rs
  • crates/victory-hle/src/modules/files.rs
  • crates/victory-hle/src/modules/gameinput.rs
  • crates/victory-loader/src/console_insn.rs
  • crates/victory-loader/src/crash.rs
  • crates/victory-shader/src/emit/lower.rs
  • crates/victory-shader/src/emit/mod.rs
  • crates/victory-shader/src/emit/valu_tests.rs
  • crates/victory-shader/src/lib.rs
  • crates/victory-shader/src/native.rs
  • docs/dlss.md
  • scripts/get-nvidia-sdks.ps1
  • scripts/play-foxhound.ps1
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/831/head:github-bot/gh-831'
git switch 'github-bot/gh-831'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-831'
git switch 'github-bot/gh-831'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-831'
git switch 'github-bot/gh-831'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-831'
git switch 'main'
git merge --squash 'github-bot/gh-831'
git switch 'main'
git merge --ff-only 'github-bot/gh-831'
git switch 'main'
git merge 'github-bot/gh-831'
git push origin 'main'
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!831
No description provided.