Files
foxhound/docs/findings.md
readmet3xt-lab 824ca88403 Comments and docs: scenes named in general terms
Measurements in comments, the findings, the status table and the README named the kind of scene they came from. They now say a heavy scene, a busy area, the first minutes, positional sound sources, a small display surface. Comments and docs only; no change of behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 11:15:06 +05:30

9.7 KiB

What was learned on the RX 7900 XTX (2026-11-23 to 2026-11-25)

One PC: i9-12900K (8 fast cores, 8 slow ones, 24 threads), 64 GB, Radeon RX 7900 XTX 24 GB, Windows 11, 1440p, Series X profile. Figures are of diagnostics builds with a screenshot a second. Scenes are not the same from run to run, so read differences under about 5 % as nothing. What a switch does is in the comment where it is read.

Where a frame goes

Median of whole runs, same part of the first scene: 280 ms, then 124, 103, 75, now 46-65. In a water scene 46-53 ms.

The program needs 33 ms. Of a 55 ms frame on the water:

  • The thread that prepares submissions: 48 ms. It is the wall. Steps of the lists 18 (refreshes of host copies 10), steps done on the card 7, waiting for descriptor records 6, asking the write watch 5, copies in the card's memory 4, the program's bytes under shader writes 4.
  • The card: about 41 ms busy, the next wall.
  • List calls: 36,000 a frame, 230 ms of work spread over eight threads. In a street chase 67,000 calls and 430 ms.
  • Descriptor records copied as plain bytes: 400,000 slots looked at, 40,000 mirrored a frame, most of them empty.
  • Landing what shaders wrote: 16 MB a frame put as dwords, on a thread of its own.

The one idea behind most of it

On the console the CPU and the graphics processor share memory. Here they do not, so everything one writes and the other reads must be noticed and moved. Every large cost is one of four: noticing writes of the program (write watch, guards), noticing writes of shaders (hashes on the card, compares on the CPU), moving them, and waiting until an order is safe. Gains came from making each of them narrower (dwords, not pages), wider (threads, AVX2) or later (on the card, behind the frame), in that order of size:

What Frame before after
Descriptor records of draws' tables left to the draws 280 ms about 124
Our hash passes over card copies, 64 threads a piece card 79 ms 66
Preparing on a thread of its own, refreshes and records spread 103 75
List calls written down and translated by eight threads (VICTORY_THIN) 75 68
Submissions joined, card steps, textures sent ahead 68 about 63
Title bytes under shader writes compared with AVX2 on six threads 14 ms of it 4-7
Stores into guarded memory looked at first, fewer guards reset 69 ms of threads' time about 6

(Each figure is from the run in which it was measured; they overlap and do not add up.)

Faults found, and what they were

  • Floating objects sank. The water's height and displacement maps are textures that compute passes write and the program's physics sample on the CPU. They were never brought back to title memory. Fixed by Geckomacabre's read-back as merged in fxceless/victory-fork f5c03f3b; on by default here (VICTORY_TEXTURE_BACK=0: off). With it they stay up through a whole run; without it sank in every one.
  • A device loss about every 16 minutes: a page fault inside a texture made in the same tenth of a second. A slot showed it before its upload had run. VICTORY_SHOW_AFTER=1; none in the sessions since (likely fixed, not proven).
  • A rare lost write (6 of 200 runs of a stress test): a view was mapped between our look at its guards and our lock, and views were opened one after another. None in 603 runs after.
  • Blocky patches: indirect dispatches cut at 65,535 groups.
  • Square holes and dashed edges in shadows: pixel shaders that read their quad's neighbours with wave reads; on AMD helper lanes take no part in them.
  • Cube reflections too blurred, wrong materials: DXIL's Log is base 2, and normalized buffer codes were one step off.
  • Every ray missed: the dispatch flag that says counts are threads, not groups.

Measured and not worth it

  • Unordered early pipelines for everything (AMD's compiler crashed).
  • Series S profile, smaller textures, a second drawing queue, ASYNC_SUBMIT off.
  • Mapping pages on sixteen threads: no more pages mapped, frames longer.
  • Scalar buffer loads four dwords a call (VICTORY_SHADER_OPT=127): no gain on this card.
  • Wave sizes, fused multiply-adds, fast reciprocals, raw picked buffers, leaving out barriers: nothing to 0.1 ms each. Exact RDNA float rules (VICTORY_RDNA_FLOAT): 0.8 ms.
  • Running the console's shader code natively on the card: the Windows driver takes no raw code, the two generations differ, and a Vulkan host layer ends at the same compiler. What is left to gain from shader code was guessed at under 1 ms.
  • An on-screen panel of numbers (VICTORY_PANEL): it helps finding where a frame goes but costs some, so it is off and F3 shows it.

What is next

  1. The preparing thread: split what one submission does over two threads in a row; ask for the next submission while this one is sent; view the card's own buffers where fills copy them now.
  2. The card: small buffers' copies in its own memory (VICTORY_CARD_BUFFERS_MIN_KB=64, after fxceless c36971b2; not measured here yet), and the passes that run for nothing without rays.
  3. Stalls: 270-660 s of a session were full of frames over 200 ms, almost all while new pipelines were made. victory warm, and a quarter of the workers for the slow ones.
  4. Outdoor flicker: suspected to be one bad indirect record that uses up its list's budget, so that every later draw of it is empty. The log's frame line counts them; VICTORY_INDIRECT_REST=0 is the experiment.
  5. Memory, 40-46 GB private: lists' allocators 9 GB, windows 7, uploads 4 (VICTORY_MEMORY_MAP=1 lists it).

The other repositories, compared

Read up to 2026-11-25: Marvisak/VIctory, fxceless/victory-fork, DexNom/VIctory, Belobug/VIctory-Belobug-AMD, FQY55kai/ZJOU-VICTORY. What was taken is in the history, each commit naming its source. In short:

  • Marvisak's commits hardly apply any more; nearly all of what they fix is here, often another way. Taken: nearest normalized codes, d16 views, shader model flags.
  • fxceless: the base. Newest taken: texture read-back, small buffers on the card, hashes over a buffer's own bytes.
  • DexNom: thread counts of ray dispatches, cube gradients, joined sparse ranges.
  • Belobug: pipeline workers for screen passes, the ambient stand-in's idea, pipeline and constant buffer bookkeeping (romainhedouin).
  • ZJOU: render targets not set again; some shader corrections are being looked at.

What was learned on a 12 GB RTX card (2026-11-28)

One PC: a 12 GB RTX card with 32 GB RAM, Series X profile, 1440p, DLSS Quality. Short launches from one save (80 s, measured in the first minutes), timelines of 60 frames 55 s and 70 s after the start, a stack profile of 12 s in a heavy scene, and one played session of 20 minutes.

Where a frame goes now

Gameplay standing still holds the program's 33.3 ms. What is over it:

  • A scene's first seconds: frames of 40 to 100 ms. In their chains: the program's own threads, streaming requests (16 workers unpack what the console's hardware unpacks; below normal priority already), the program's page mapping calls, threads woken with no processor free, texture refreshes.
  • Heavy scenes (6,000 to 10,000 draws): the submitting thread needs 32 to 37 ms a frame, 18 to 25 fps. Its profile has no single place left: the refreshes spread over helpers and the wait for them about 30 %, the guards' lock about 10 %, the write watch 8 %, the driver and the runtime about 25 %.
  • Long play: the card stands at its budget (11.3 GB in use of 11.0), 1.1 to 1.9 GB of that free inside texture blocks, and textures go to the PC's memory (24,000 of them, 2.4 GB, in 20 minutes).

Found and fixed

What Before After
Retired objects released by the thread that tells the program the card is done that stage 533 ms in 60 frames, 12 stalls of 10-27 ms about 100 ms, none or one
Single-channel one-level textures uploaded by every list every frame 21 % of the submitting thread, frames 48-69 ms 2 %, 33-43 ms
Stores into guarded memory (VICTORY_STORE_BESIDE, VICTORY_GUARD_HOT) guards waited for 8.7 ms a frame, protections 14.3 ms 2.5 ms, 8.7 ms

What the thread that releases retired objects does, counted: 1.0 to 1.5 million slot references a second at about 40 ns each, and at a scene's start some 4,700 objects whose last reference it is, 0.1 to several ms each (2.2 s of 5 s). The count is cheap; the end of host objects is what costs.

Measured and not worth it

  • VICTORY_PORT_CONSTANTS=1: constant fills 4,693 to 68 a frame and the submitting thread 31.5 to 27.5 ms, but the frame 34.3 to 37.2 ms and the card 98 % busy (it reads the program's memory over the bus).
  • VICTORY_WC_BAR=1 (buffers in card memory the CPU maps): flicker, broken faces.
  • VICTORY_COPY_BESIDE=1: textures waiting 3,800 to 13,000, slower frames.
  • VICTORY_GUARD_HOT alone: nothing; with VICTORY_STORE_BESIDE a little.
  • VICTORY_DSTORAGE_WORKERS=8 in place of 16: each request three times shorter, no fewer long frames.
  • mimalloc for the layer's own code, and the fills' destinations read in one walk: no change in frame time (the allocator's share of the submitting thread's samples, about a tenth in an older profile, is gone).
  • List translation: its eight threads are about 90 % idle. It is not a limit.
  • A pass of clippy's performance lints over the workspace: nothing in the paths a frame runs.

The program's own settings

Its graphics settings object (the one that holds the frame rate) differs between the console profiles in some 38 fields: levels of 1 to 3 on Series X where Series S has 0 or 1, one scale of 1.0 against 0.8, the output size. VICTORY_SETTINGS_DUMP writes them out; VICTORY_SETTINGS_SET sets single ones, for finding which of them a lighter profile at the Series X output size could use.