RTX 5070 Ti: where a world frame's ~230 ms go, and what bare_command_cost says about the indirect clamp #696
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#696
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?
@FrancescoGelosoEterea on GitHub · 2026-11-25 04:38 UTC · original
These are measurements, not a fix. Some of them answer the question in
310c6eb'sbare_command_costtest ("whether that is what we put around a command or what the card takes for one"), on an NVIDIA card.Setup:
VICTORY_SPLIT_LDS=1 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024, relay at its default.1.
bare_command_coston the 5070 Ticargo test -p victory-gpu --release -- --ignored bare_command_cost --nocaptureon310c6eb:On this card, the clamp as it is recorded (i) costs about 9 times the bare pass (h). With about 6,000 indirect records a frame in the world, that is roughly 25 ms of card time a frame in waits alone.
2. Where the frame goes
main310c6ebplus #51, #158, #368, #522, #592 and older open PRs: 4.30 fps, 232 ms a frame.The three add up, so they barely overlap. "Submissions sent ahead per frame: 30.6 in 12.4 settles, 153.6 ms waiting for the card in them". All 12.4 settles are counted as "title memory read", but only 1.4 of them are broken down (0.4 by a buffer copy, 1.0 by a fill of upload memory, 0 by a texture). The other ~11 a frame have no cause in that line. With #522 in the tree, the "fill of upload memory" one is still there.
3. The card's time by command (timing run)
VICTORY_GPU_TIMING=1 VICTORY_D3D12_DRED=1. This was on an older stack (2119b0eplus open PRs). Timing turns the late wait (and so the relay) off, so these numbers are only comparable with each other.Direct mesh draws of the same programs cost about 6 µs, indirect ones about 15 µs. The 8–9 µs gap is in line with the clamp and its two waits (section 1), plus more work in flight to drain in the game.
Heaviest single entries, in ms a frame:
MS_VS_LinearDepthPreSkin+PS_LinearDepth: 9.0 (838 commands)MS_VS_PedTransformPreSkinD+PS_DeferredPedTexturedNC: 7.9shadowmask:CS_GenerateShadowMasks_Checkerboard_NoHair: 7.3 (one dispatch, up to 16 ms)indirect_light_probes:CS_Primary_RegisterAllocationRequests: 5.7 (one dispatch, up to 10 ms)MS_VS_CascadeShadows_draw: 5.2 (381 commands)indirect_diffuse_lighting:CS_ScreenProbes_EvaluateRayRequests_RayBinning: 2.9 (up to 14 ms)4.
VICTORY_BARRIER_TEST=indirectin the gameWithout the two waits, the picture visibly broke: arguments read before the title's pass wrote them, as expected. The fps and per-command numbers did not settle the question: the run's scene differed (4,624 draws a frame against 7,770). So I would not read anything into the game runs here; section 1 is the clean number.
Suggestion
Clamp a buffer's records once, after the title's pass that writes them, with one pair of waits for many draws instead of a pair per record. That is what
VICTORY_INDIRECT_WINDOW=1does for a window of records. On this card it gave no measured gain and some artifacts earlier, on a much older tree. I have not looked at why yet.🤖 Generated with Claude Code
@HrHd on GitHub · 2026-11-25 09:15 UTC · original
Adding a different angle on the same budget, from an 8 GB RTX 4060 Ti: the fixed per-frame cost, not the draws, sets the floor.
A pause menu here runs 16-18 fps at 11-13 draws. At the world's measured rate (~0.1 ms a draw) that many draws is 1-2 ms, so ~55 ms of the ~60 ms menu frame is fixed cost (submit, wait, present, copies) before anything is drawn.
The world then adds the draws on top: 5,000 draws x ~0.1 ms is ~500 ms, which is why 20 fps needs roughly an order of magnitude off the per-draw side, not just pixels. Confirming that, a render-scale clamp that halves every target took per-draw from 0.105 to 0.059-0.108 ms and the frame from ~500 to ~390-480 ms - real, but a 30-40% lever, not 10x.
The counters underneath, per frame: 787 waits for earlier shader writes, 6,321 indirect commands bounded, 150-280 hash passes over 1,000-1,700 pieces. So the clamp, the write-hunt and the indirect compaction are additive, but only the last two are order-of-magnitude shaped.
One more negative worth having: halving the 8-bit full-frame target (so the present copy shrinks too) breaks the letterbox bars and softens the whole frame, because the bars and overlays are laid out in that target's own pixels. The present stays 4K unless the overlay pass is lifted out of it.
@HLVM04 on GitHub · 2026-11-25 08:17 UTC · original · edited 2026-11-25 09:44 UTC
Some numbers from a second RTX 5070 Ti (16 GB, Ryzen 7 9800X3D, Windows 11, NVIDIA 616.64), on a newer tree:
9376fd6, Series X profile, diagnostics build,VICTORY_CARD_WINDOWS_MB=4096, otherwise defaults (relay on). Scripted Enter input, about 3–4 minutes in the world, median of the frame lines after the first 60 s. One run per setting, so the scene is not identical between rows.VICTORY_CARD_REHASH_RUNS=1VICTORY_CARD_FETCH_INFLIGHT=1VICTORY_CARD_REHASH_RUNS=1: hash passes went from 1,071 to 316 a frame (pieces hashed 3,006 → 1,651), with no change in frame time. Those passes are not where the card's time goes on this card.VICTORY_CARD_FETCH_INFLIGHT=1: same as the commit message says. The copy-back thread's fetch wait went to 0 ms, but it then waited about 189 ms a frame for the card with nothing to land. In this run the frame got slower, not faster. That may be the scene, since it is one run, but there was no gain.VICTORY_GPU_TIMING=1 VICTORY_D3D12_DRED=1, same tree):No device loss in any of these runs.
Edited: the first version of this table had a wrong "on the GPU" column (a parsing error on my side picked up the MB-copied figure). The columns above are the frame lines' own means after the first 60 s.
@iGoldenNinja on GitHub · 2026-11-25 15:05 UTC · original
A native RTX 5080 follow-up on the title-memory read waits in section 2. I added opt-in attribution by the first blocking read's kind and requested size to renderer
92a72df(diagnostic commitcbcdedab). This run used Windows 11 Pro build 26200.9974, NVIDIA 617.14, Ryzen 9 5900X, 32 GB, Series X, default relay 2 and DRED. It stayed at the first prison window.Those reports span 73.523 seconds and attribute 37.751 seconds to the first blocker; the 480-byte group is 10.51% of that wall interval. PresentMon measured 2.968 displayed FPS and 405.738 ms P99 over the 75-second visual window. During world entry the existing safeguard caught a changed 2,048-byte speculative read and restored waiting.
One wait can serve several reads or overlap other work, and before/after checks can finish in the next reporting interval. These numbers locate the waits in this configuration. The experiment kept required synchronization enabled and did not measure a speedup. Pinned report and diagnostic source
@regiumlepidi on GitHub · 2026-11-25 23:49 UTC · original
Another RTX 5070 Ti data point (16 GB, Ryzen 7 9800X3D, 48 GB, Windows 11, NVIDIA 617.42), Series S profile, diagnostics build, scripted Enter only (no gameplay input), 25 minutes from boot.
Tree: fx
6d20eed+ Xeltax/VIckyfx-heapmap-8d(a87db3a, the NVIDIA descriptor heap map) merged, plus a port of upstream'stranslate --cache --pipelinespre-build (PR to follow). Switches: the README's run-279 set (VICTORY_CARD_HASH_LEN=1,VICTORY_CARD_WINDOWS_MB=2048,VICTORY_TEXTURE_BACK=1, card buffers 64 KB / 1280 MB) +VICTORY_SHADER_OPT=0+ VIcky's 14VICTORY_WAVE_DEEP_SKIPS_NOThashes.Two things changed between the runs (switch set and pre-built pipelines), so this does not separate them; the made/loaded counts suggest most of the stall time was pipeline creation. One
drvwatchevent (driver error in the system log) early in each run, recovered by turning the suspect paths off, no removal.Disclosure: run, merged and written up with an AI assistant (Claude Code); numbers are from the run's own frame lines.
@regiumlepidi on GitHub · 2026-11-26 02:58 UTC · original
Update to my comment above: same RTX 5070 Ti, same setup (scripted Enter only, 25 min from boot through the opening cutscene to player control), now on fx
bcce702merged with Xeltax/VIckyfx-heapmap-8d, pipelines pre-built (#1226).6d20eed+ heap map, Series S0b97896-era + heap map, Series Xbcce702+ heap map, Series SNotes:
a35c557(target format variants) changed nothing visible here. A blocky, low-resolution patch on one wall at the right of the frame stays, as does a row of small blocky tiles along the bottom edge in the Series X profile. Both are steady, not flicker.VICTORY_THIN. There it shows intermittent near-white exposure frames in long sessions (246 of 1,757), which this tree does not show (details in avatarmanz/VIctory-7900XTX#62).Run and measured with Claude Code; no game data attached.
@regiumlepidi on GitHub · 2026-11-26 04:45 UTC · original
One more data point, because it changes how numbers from before
ca8ce8aread: on this PC, Windows' Auto HDR notice set off the driver watch in every earlier run. That turned the paths under suspicion off for the whole session.Same card, setup and scene as above. Series S, 25 min, pipelines pre-built,
VICTORY_CARD_WINDOWS_MB=1024.paths under suspicion are offlinesca8ce8a(combo ate14af24)ca8ce8a(combo at4bebd87)The other commits in that range (
4d0c634dynamic slots across the cursor,6aed078opt-in, tests, saves) may add to it. But the GPU-wait drop lines up with the watch no longer firing. So anyone on Windows 11 with Auto HDR on who measured beforeca8ce8awas probably measuring with the suspect paths off. SettingVICTORY_DRIVER_WATCH=0on older trees should show the same thing.Run and measured with Claude Code; no game data attached.