Optimizations for RTX 5070 Ti + Ryzen 5 5600X, part 2: on v2026.11.30.03 #4481

Closed
github-bot wants to merge 119 commits from github-bot/gh-4480 into main AGit
Owner

@⁠erickbobd on GitHub · 2026-11-30 20:58 UTC · original
erickbobd:rtx5070ti-5600x-optimizations-2 → main · +19702 −1198 · 98 files · 119 commits · closed without merging

Continues #831 (RTX 5070 Ti 16 GB + Ryzen 5 5600X + 32 GB RAM), now on top of v2026.11.30.01.

What is in it

  • The trustno1-novo2 fork's performance work, merged first into v2026.11.29.05 and then into v2026.11.30.01. Every switch is off by default:
    • pipelines: VICTORY_PIPELINE_WAIT_ONCE, VICTORY_PIPELINE_WAIT_BACKLOG, VICTORY_PIPELINE_SLOW_WORKERS;
    • textures and staging: VICTORY_TEXTURE_LOOK_ONCE, VICTORY_TEXTURE_READ_AHEAD, VICTORY_STAGING_NO_ZERO;
    • card copies and files: VICTORY_SEND_COPIED_FIND, VICTORY_FILES_BUFFERED;
    • refreshes: VICTORY_REFRESH_SET, VICTORY_TITLE_WRITE_RANGE, VICTORY_UNDER_PARTS, VICTORY_PLACED_CONSTANTS;
    • VICTORY_PAGE_SKIP: a hash per 4 KiB piece, so a refresh skips pieces the title rewrote with the same bytes.
  • A DirectStorage decoded-request cache (VICTORY_DSTORAGE_CACHE=all|bcpack, VICTORY_DSTORAGE_CACHE_GB).
  • Diagnostics behind VICTORY_REFRESH_TOP=1:
    • refresh by copy, by host copy;
    • the submitting thread's refresh spreads;
    • pieces by kind;
    • write-watch askings of 4 MB or more, timed by stage.
  • VICTORY_TRANSLATOR_PIN (build time) keeps a build's translator identity, so a merge that translates the same way reuses its shader cache and pipeline library.

Measured

Standing in the world, the same 2-minute stretch replayed with VICTORY_INPUT_REPLAY, runs interleaved, with the same executable and the switches on or off:

frame base FPS refresh on the submitting thread
30.01 + all of the above 51.0 / 49.8 ms 19.6 / 20.1 14.4 / 12.9 ms
30.01 as released (victory play defaults) 55.8 / 55.2 ms 17.9 / 18.1 19.1 / 18.1 ms

The fork switches plus VICTORY_PAGE_SKIP take off about 5 ms a frame (~10 %).

Where the frame still goes

On this CPU the submitting thread is the limit. Its refreshes cost 70–90 ms of CPU a frame across the helpers, and only ~12 ms of that is copying. Most of the rest is write tracking of view memory:

  • ~160 refreshes a frame over large guarded ranges, about 3.6 GB of range in all;
  • guard() and VirtualProtect under the global guards lock, about 18 ms of CPU.

VICTORY_GUARD_HOT made it worse: 50 ms gave 65.8 ms a frame, 200 ms gave 117.9.

Opened as a backup of this work; nothing is meant to change default behaviour.

🤖 Generated with Claude Code

**@⁠erickbobd** on GitHub · 2026-11-30 20:58 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4480) `erickbobd:rtx5070ti-5600x-optimizations-2` → `main` · +19702 −1198 · 98 files · 119 commits · closed without merging Continues #831 (RTX 5070 Ti 16 GB + Ryzen 5 5600X + 32 GB RAM), now on top of **v2026.11.30.01**. ## What is in it - The trustno1-novo2 fork's performance work, merged first into v2026.11.29.05 and then into v2026.11.30.01. Every switch is **off by default**: - pipelines: `VICTORY_PIPELINE_WAIT_ONCE`, `VICTORY_PIPELINE_WAIT_BACKLOG`, `VICTORY_PIPELINE_SLOW_WORKERS`; - textures and staging: `VICTORY_TEXTURE_LOOK_ONCE`, `VICTORY_TEXTURE_READ_AHEAD`, `VICTORY_STAGING_NO_ZERO`; - card copies and files: `VICTORY_SEND_COPIED_FIND`, `VICTORY_FILES_BUFFERED`; - refreshes: `VICTORY_REFRESH_SET`, `VICTORY_TITLE_WRITE_RANGE`, `VICTORY_UNDER_PARTS`, `VICTORY_PLACED_CONSTANTS`; - `VICTORY_PAGE_SKIP`: a hash per 4 KiB piece, so a refresh skips pieces the title rewrote with the same bytes. - A DirectStorage decoded-request cache (`VICTORY_DSTORAGE_CACHE=all|bcpack`, `VICTORY_DSTORAGE_CACHE_GB`). - Diagnostics behind `VICTORY_REFRESH_TOP=1`: - refresh by copy, by host copy; - the submitting thread's refresh spreads; - pieces by kind; - write-watch askings of 4 MB or more, timed by stage. - `VICTORY_TRANSLATOR_PIN` (build time) keeps a build's translator identity, so a merge that translates the same way reuses its shader cache and pipeline library. ## Measured Standing in the world, the same 2-minute stretch replayed with `VICTORY_INPUT_REPLAY`, runs interleaved, with the same executable and the switches on or off: | | frame | base FPS | refresh on the submitting thread | |---|---|---|---| | 30.01 + all of the above | 51.0 / 49.8 ms | 19.6 / 20.1 | 14.4 / 12.9 ms | | 30.01 as released (`victory play` defaults) | 55.8 / 55.2 ms | 17.9 / 18.1 | 19.1 / 18.1 ms | The fork switches plus `VICTORY_PAGE_SKIP` take off about 5 ms a frame (~10 %). ## Where the frame still goes On this CPU the submitting thread is the limit. Its refreshes cost 70–90 ms of CPU a frame across the helpers, and only ~12 ms of that is copying. Most of the rest is write tracking of view memory: - ~160 refreshes a frame over large guarded ranges, about 3.6 GB of range in all; - `guard()` and `VirtualProtect` under the global guards lock, about 18 ms of CPU. `VICTORY_GUARD_HOT` made it worse: 50 ms gave 65.8 ms a frame, 200 ms gave 117.9. Opened as a backup of this work; nothing is meant to change default behaviour. 🤖 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.
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 CPU profile of a Ryzen 5 5600X (6 cores, 12 logical processors) had the
submitting thread on the CPU 25 of the 95 ms of a frame and standing the
rest, much of it off the CPU in its own code, while the process used about
4.6 of the 12 logical processors; every frame waits for that thread.

VICTORY_FUNNEL_CORE=1 gives the last physical core to it alone (the
process's default CPU sets are every other core's) at the highest
priority; =2 also puts the send thread on that core's other logical
processor. Off undoes only what on did. F1 FUNNEL CORE (TEST) changes it
live, to compare standing still. Scheduling only: nothing drawn changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This reverts commit 8feaee0. Measured live at one spot (log 161143, only
in-world seconds): at the same scene weight 12.88 -> 12.13 fps (on) and
11.79 (on with the send thread) at 62k list calls a frame, 11.33 -> 11.05
and 10.59 at 68k; the submitting thread's work a frame rose from 67 to
80-87 ms. Taking a whole core away from the other threads cost more than
the submitting thread gained.

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]>
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]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fork performance switches behind their own VICTORY_* names (off by default),
the DirectStorage cache, refresh by copy diagnostics, and the
WIDE_OWN/SCOPED_QUEUE tests with refresh spread counters.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fork's performance switches (off by default) on 30.01, the translator
pinned to 30.01's (build-aqui.cmd) so its shader cache and pipelines serve.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 20:59:34 +00:00
github-bot changed title from Optimizations for RTX 5070 Ti + Ryzen 5 5600X, part 2: on v2026.11.30.01 to Optimizations for RTX 5070 Ti + Ryzen 5 5600X, part 2: on v2026.11.30.03 2026-11-30 22:13:42 +00:00
Author
Owner

@⁠erickbobd on GitHub · 2026-11-30 22:12 UTC · original

Updated to v2026.11.30.03 (merged; two small conflicts). Measured on the same 2-minute stretch, interleaved: 30.03 + these switches 53.5 / 56.9 ms with the new default VICTORY_PIPELINE_WAIT_ALL (single frames of 9.8 s and 55 s); with VICTORY_PIPELINE_WAIT_ALL=0 53.8 / 52.7 ms and no long stops, against 30.01 + these switches 49.6 / 53.6 / 52.8 ms. The translator change of 30.03 made 6,817 of 83,559 known pipelines again (16 min preload); the rest were reused by content.

**@⁠erickbobd** on GitHub · 2026-11-30 22:12 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4480#issuecomment-7293507659) Updated to v2026.11.30.03 (merged; two small conflicts). Measured on the same 2-minute stretch, interleaved: 30.03 + these switches 53.5 / 56.9 ms with the new default `VICTORY_PIPELINE_WAIT_ALL` (single frames of 9.8 s and 55 s); with `VICTORY_PIPELINE_WAIT_ALL=0` 53.8 / 52.7 ms and no long stops, against 30.01 + these switches 49.6 / 53.6 / 52.8 ms. The translator change of 30.03 made 6,817 of 83,559 known pipelines again (16 min preload); the rest were reused by content.
Author
Owner

@⁠IRennie74 on GitHub · 2026-11-30 22:38 UTC · original

Two things I noticed, plus a data point from a similar CPU:

  • big_first() (crates/victory-gpu/src/host.rs:13812, VICTORY_REFRESH_BIG_FIRST, on by default) has no caller on the branch. cargo clippy -- -D warnings will refuse it as dead code. CI has not run on this head (the CI run is waiting for approval), so that has not shown yet. If it is meant to be wired in, note it is the one switch here that is on by default, which goes against the "every switch off by default" in the description.
  • Cargo.lock changes (blake3 added to victory-hle). The lockfile is hashed into VICTORY_TRANSLATOR (crates/victory-gpu/build.rs), so merging this as is invalidates every user's shader cache and pipeline library. VICTORY_TRANSLATOR_PIN does not help them, because it is a build-time variable.

On a Ryzen 5 5600X with an RTX 3060 (#4555), cutting refresh time alone has not shown up in fps. VICTORY_DIRTY_PAGES + LIST_SUMMARY took refreshes from 12.7 to 10.9 ms, but the submitting thread's total went only from 40.2 to 39.7 ms, and fps stayed within noise. Other stages absorbed the savings on a CPU this close to its limit. Your 51 vs 55.8 ms is interleaved on the same stretch, so it may well hold. Still, if you split it up, it would help to know which of the switches carries the 5 ms. VICTORY_GUARD_HOT was worse for us too: 50 ms gave 18.0 fps against 18.1-18.6, and 200 ms gave 12.0-12.7.

Your note on VICTORY_PIPELINE_WAIT_ALL (single frames of 9.8 s and 55 s after the 30.03 translator change) is worth an issue of its own. It is on by default on main, and anyone updating gets the same cold pipelines.

**@⁠IRennie74** on GitHub · 2026-11-30 22:38 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4480#issuecomment-7294120334) Two things I noticed, plus a data point from a similar CPU: - `big_first()` (`crates/victory-gpu/src/host.rs:13812`, `VICTORY_REFRESH_BIG_FIRST`, on by default) has no caller on the branch. `cargo clippy -- -D warnings` will refuse it as dead code. CI has not run on this head (the CI run is waiting for approval), so that has not shown yet. If it is meant to be wired in, note it is the one switch here that is on by default, which goes against the "every switch off by default" in the description. - `Cargo.lock` changes (`blake3` added to victory-hle). The lockfile is hashed into `VICTORY_TRANSLATOR` (`crates/victory-gpu/build.rs`), so merging this as is invalidates every user's shader cache and pipeline library. `VICTORY_TRANSLATOR_PIN` does not help them, because it is a build-time variable. On a Ryzen 5 5600X with an RTX 3060 (#4555), cutting refresh time alone has not shown up in fps. `VICTORY_DIRTY_PAGES` + `LIST_SUMMARY` took refreshes from 12.7 to 10.9 ms, but the submitting thread's total went only from 40.2 to 39.7 ms, and fps stayed within noise. Other stages absorbed the savings on a CPU this close to its limit. Your 51 vs 55.8 ms is interleaved on the same stretch, so it may well hold. Still, if you split it up, it would help to know which of the switches carries the 5 ms. `VICTORY_GUARD_HOT` was worse for us too: 50 ms gave 18.0 fps against 18.1-18.6, and 200 ms gave 12.0-12.7. Your note on `VICTORY_PIPELINE_WAIT_ALL` (single frames of 9.8 s and 55 s after the 30.03 translator change) is worth an issue of its own. It is on by default on main, and anyone updating gets the same cold pipelines.
Author
Owner

@⁠CowboyBingus on GitHub · 2026-12-01 00:17 UTC · original

You should probably break this down into individual components and open those as PRs. I highly doubt anyone here is going to be able to review 40,000 lines of code across two PRs. 98 file changes means this is going to break pretty much every time main moves.

**@⁠CowboyBingus** on GitHub · 2026-12-01 00:17 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4480#issuecomment-7296162493) You should probably break this down into individual components and open those as PRs. I highly doubt anyone here is going to be able to review 40,000 lines of code across two PRs. 98 file changes means this is going to break pretty much every time `main` moves.
A copy into a placed twin whose format is of another family (BC3 over BC7,
BC7 over BC6H, the same 16-byte blocks) made D3D12 refuse the list's Close
(0x80070057, upstream #3911 #3320): the game ended after 20-30 minutes. From
a buffer the footprint is read as the twin's format; texture to texture the
twin is left out (twin_copy_left_out).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot closed this pull request 2026-12-01 18:43:29 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:40 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:40 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4480#issuecomment-7321335965) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

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!4481
No description provided.