Measurement notes (RTX 3080 Ti, Series S, first room): where the 97 ms go, what moved the frame and what did not #1311
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork#1311
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@LeonardoS11 on GitHub · 2026-11-26 13:35 UTC · original
Notes from two days of measuring on NVIDIA, in case they save someone else the same runs. Everything below is from an integration branch (main up to
006c353plus open fork PRs and our own changes), public at https://github.com/LeonardoS11/victory-fork/tree/port/v13 . Machine: RTX 3080 Ti 12 GB, 24 threads, Windows 11 26200. Scene: the first room of the prologue, Series S profile, about 4,400 draws, ray tracing off (VICTORY_RT_OFF=1,VICTORY_AMBIENT=0.8) unless said. One run per variant unless said; run-to-run spread is about ±3 ms. Not a request for anything; close it whenever.Where the frame is (96–97 ms). The title's render thread is inside
ExecuteCommandListsfor 91–94 ms of each frame, in 18 calls, with 0.0 ms waiting for the submission lock: serial work on one thread, not contention. The five recording threads spend 45–53 ms inside the layer's list calls and stand idle 30–45 ms a frame, so they are not on the critical path there. Of the 93 ms: about 60 preparing, about 19 syncing the view heap before it, 5–8 settling.What has to stay in order and what could overlap between submissions (per frame): in order about 47–50 ms (heap sync 19, write-watch asking 10.5, fills 6, settles 5–8, title buffer copies 2.4, card before the lists 2.5); overlappable about 36 ms (refreshes flushed 19, textures 7, shader writes declared 5, snapshots 2.5). So overlapping submissions perfectly would still leave about 20 fps in that room.
The one change that moved the frame: the write-watch asking's span.
GetWriteWatch's cost follows the span asked, not the pages found dirty (found pages +58 %, time +5 %). Asking once per reservation over its whole span cost 19–20 ms in 46 askings; ending an asking at a hole over 8 MiB (still never crossing a reservation) brought the kernel's part to about 2.8 ms and the frame from 106–116 to 96–97 ms.Things that cut their own slice and not the frame (each measured alone and together): in-place fills, the lookup cache of #1237 (off the recording threads, which have slack), the send-and-hash list in three steps (#1227), view memory asked of the guards once a submission, refresh copies split over threads (copies 25 → 12–17 ms), heap slots made on several threads (13 → 8.8 ms), the heap sync run ahead on a thread of its own (first form: 100 passes a frame, each asking the kernel beside the submission's own asking, which got dearer; capped at one pass per 8 ms it is worth about 3 ms). Best set: 89–93 ms.
VICTORY_ASYNC_SUBMIT=1withVICTORY_ASYNC_PRESENT=1does what it says for the title's thread (2.5 ms insideExecuteCommandListsa frame, from 88–93) but the one worker then does the same 75–85 ms in a row, so the frame stays (89). Under it the settles grow to 21–23 ms a frame, all of them "title memory changed under shader writes": the merge gives up for more than 512 changed runs about 1.5 times a frame, and the runs are 5–10 bytes each (a field per record), so no cap is enough (4,096: settles 10.5 ms; 65,536: the card does not take that many copies, frame 119).VICTORY_MERGE_GAP=16brings the settles to 2.5 ms but is not exact.Refreshes made ahead across queued submissions (helpers refresh what later submissions of the burst will need while the worker prepares the first ones): made ahead 19 % of the items with a coarse rule, 58 % with a finer one, the frame the same either way. In order, a refresh costs about 1.35 µs of journal lookup and 2 µs of copying per item for about 5,400 distinct copies a frame, 89 MB a frame copied as whole 64 KiB pages.
Two image defects found on the way. (1) The size-0 constant buffer view, merged as #1260. (2) #1130's
refresh_pages()compares offsets with addresses (commented there). And one of our own for anyone trying the same: with a texture's levels on demand, refreshing textures on several threads put off the detile but not the host step that reads its result, so the levels got no tiles and an alpha texture read zero.Device removals. Six in about 120 runs of these builds, all at the entry into the world, more often with the relay or asynchronous submission. The system log (nvlddmkm) shows two kinds: a shader's MMU fault (an address with no mapping, which fits a resource or tiles let go under a submission in flight), and a plain timeout. Not found yet;
VICTORY_D3D12_DRED=faultsruns are in progress.A measuring trap. Our summary took "world" samples as those over 100 ms a frame. Once the good frames dropped under 100 ms it averaged the loading instead and reported 200+ ms for a 97 ms run. Counting by draws (over 3,000) fixed it; worth checking in anyone's own scripts.
Written with Claude Code.