Files
VIctory-xmem/docs/DIAGNOSTICS.md
coil111 68b370ad5a framegen: ML frame generation from the driver (VICTORY_FIDELITYFX_FRAMEGEN=4)
Mode 4 runs AMD's driver ML frame generation (4.x, from amdxcffx64) on the
direct path (no proxy swap chain), with the world camera decoded from the
title's velocity pass for PrepareV2. Falls back to the built-in 3.x
generator on the direct path when ML is unavailable. The driver provider
requires a prefix that reports Windows 11 (./setup.sh win11).

Measured on RX 9070 XT, Ryzen 7 9800X3D, 3840x2160 output from 1920x1080,
RT on, one route, single short runs:
- generator dispatch GPU time (median): 3.1.6 0.95 ms, ML 4.0.2 1.45 ms
- real fps with FG on (median of 1 s windows): ML 19.7, 3.1.6 21.5 (noisy;
  the GPU time difference alone predicts ~1%)
- camera matched for 3440 of 3441 generated frames
- disocclusion: the trail behind the driven car and the dark, blurry screen
  edges on camera turns that 3.1.6 shows at this base rate are gone
2026-12-04 13:58:17 -06:00

5.0 KiB

Diagnostics and development

Back to README

Build the diagnostics profile with:

PROFILE=diag ./build.sh
Setting Effect
VICTORY_PAGE_SAMPLE=1, VICTORY_LOOP_PROBE=<shader hash prefix> Samples pages visited by a selected BVH traversal shader (diagnostics build)
VICTORY_RT_STAMPS=1 GPU dispatch timings for comparing runs (diagnostics build)
VICTORY_RECORD, VICTORY_RECORD_FRAMES Diagnostics capture
VICTORY_SHADER_OPT=63 or 191 63: default shader optimization passes. 191: adds the experimental pass
VICTORY_NATIVE_GRAPHICS=1 Native pipeline variants
VICTORY_FIDELITYFX_FRAMEGEN_DEBUG=7 Frame-generation overlay bits, summed: 1 tear lines, 2 reset indicators, 4 debug view, 16 pacing lines (proxy only)

Performance analysis

tools/session-fps.sh [log] [min-draws]

Replace or omit the bracketed arguments. The tool summarizes in-world stats: frame samples: average, median, min, max, preparation time and copy time.

  • Compare runs with fixed paging settings, at the same save, output size and refresh rate.
  • The residency log gives the last pass duration and the number of pages demoted after a CPU access within two seconds of promotion.
  • BVH page samples locate shader accesses and report residency at readback.
  • Present timing reports successful render presents, generated frames and optional display timestamps. One timestamp sample can cover several display presents.
  • At 60 Hz with one generated frame per rendered frame, the target render interval is about 33.3 ms.
  • With VICTORY_FIDELITYFX_FRAMEGEN_DIRECT=1 or =4, the stats: fg_direct log line counts presents and shows where real frames landed; pose and no_pose count frames with and without a camera pose while the ML generator is live (0 otherwise).

Guest-memory latency benchmark

Run the ignored GPU test with the Windows-target test runner and a Windows SDK DXC. Under Wine, use the same patched vkd3d-proton and RADV as the game.

PKG=victory-gpu ./build.sh test --lib host::rtbench::bench_title_memory_reads -- --ignored --nocapture > guest-reads.log
grep '^{"benchmark":"rt_guest_reads"' guest-reads.log > guest-reads.jsonl

On Windows, use cargo test --release -p victory-gpu --lib host::rtbench::bench_title_memory_reads -- --ignored --nocapture.

The test uses the same deterministic node bytes and verifies the entire output against the first case at each depth. It compares uniform and nonuniform descriptor access, a root SRV without a directory lookup, and device-local versus CPU-visible L0 allocations. Verify the actual heap placement in a driver trace. The directory remains device-local on both runs. Each timing row contains GPU timestamp milliseconds and elapsed host milliseconds for recording, submitting and waiting. These intervals overlap. The output validation pass is outside the timing samples. A not_run record indicates that the GPU or DXC was unavailable.

For a gameplay baseline, record the exact revision, driver, GPU, Series X profile, native render and output sizes, RT/FG state, cache state and save or route. Use an instrumentation-off run for frame times and a separate diagnostics run for timing attribution. VICTORY_BENCH=rt is the PortWatch comparison preset with FSR at 4K output. Use play with verified internal resolution for native comparisons.

Native graphics and shader passes

With VICTORY_NATIVE_GRAPHICS=1, native 0x1c8 pipelines cache variants by target format, depth, sample count and topology. The NGG translator accepts fixed procedural triangles with 3 vertices, 1 primitive and connectivity 0,1,2.

Shader cache keys include VICTORY_SHADER_OPT. When comparing 63 with 191, use the same capture with warm pipelines and check both the image and the GPU frame time.

Compare BVH arena update batching

The arena update prelude batches independent page updates by default. Set VICTORY_BVH_ARENA_BATCH=0 to restore one UAV barrier per update.

Compare an Xbox frame with a VIctory recording

Compare a completed VICTORY_RECORD capture with Xbox frame PNGs:

victory replay compare-xbox capture-1 xbox-frames --out comparison
  • Match game build, scene, camera, output dimensions, SDR color space and frame order.
  • Supply one opaque 8-bit RGB PNG per recorded present, or a directory with frame-1.png to frame-N.png.
  • The report directory must be new. Open comparison/index.html to see each Xbox reference, recorded VIctory image and difference mask.
  • By default any RGB difference counts. --threshold 3 highlights pixels where any channel differs by more than 3.
  • The replay traces up to six regional peak differences per frame. Click an image for coordinates, or probe exact pixels on a new run with --pixel 640,360 --pixel 900,500.
  • Probes observe the presented texture and show the last observed change. Use replay --pixel to follow a final copy back to an intermediate texture. Writes of identical values are not observable.
  • Image comparison works from the PNGs even when GPU replay is unavailable.