Frame budget: where the time goes in the prison yard (RTX 5090, Linux/Wine), and which PRs move it #3425

Open
opened 2026-11-27 01:07:18 +00:00 by github-bot · 1 comment
Owner

@⁠neonbyte1 on GitHub · 2026-11-27 00:45 UTC · original

A frame budget for one fixed scene, so that performance PRs can be ranked by what they actually remove. Measured numbers only; I'll keep this updated as runs and PRs land. Others' rows for other GPUs/OSes are welcome in the same form.

Setup: RTX 5090 (driver 620.73.04), Linux, GE-Proton11-14 Wine with its vkd3d-proton. main (63bcca4) plus the unmerged PRs this setup needs to render the world (#2723, #439, #233, #320, #2118, #2703, #2101, #1129, #2312), plus #2958, #3120 (overlap on), #2309, #2461, #3353/#3378, #3313. GTA VI's opening prison yard, a warm shader cache, diag build. Untimed numbers are medians of the last 30 frame-rate lines of a 600 s run; timed numbers come from VICTORY_GPU_TIMING=1 (which turns overlap off), with every command in the table rather than the log's top 25.

The title caps itself at 30 fps (#2469), so the target is 33.3 ms.

Where we are

Stack Frame fps On the GPU Preparing Copy-back
Base above 553-563 ms 1.8 438-443 63 48-50
+ #3312 (VRAM shadow buffers) 386 2.6 245 85 52
+ #3318 372 2.7 243 81 49

The CPU side and the GPU side run one after the other: with #3312 every submission waits for its own copy lists, so #3120's overlap no longer helps.

CPU side: ~136 ms per frame (best stack + #3341 + #2472)

Part ms/frame Where Open PRs aimed at it
Copy-back of marked pages (2,813 pages, 101 MB) 50.7 shadow.rs copy-back #3246, #3320, #3343 (+#3341 measured slower here)
Refresh change checks + memcpy 23.9 shadow.rs/host.rs refresh path #3305, #3289, #3387
Descriptor heap mirroring (384k slots) 18.1 HostHeap::sync_slots none found
#3312's two waited-for copy lists per submission ~14 upload_vram_copies / readback_vram_copies none yet (see below)
Bindless upload list 10.1 bindless::uploads none found
Title copies, heap steps, the rest ~15

One lock, watch::GUARDS, is held ~49 ms/frame by our own paths, and the title spends 52 ms in its write-fault handler queueing behind it.

GPU side: 155 ms of commands per frame (timed)

Class ms/frame Commands/frame
G-buffer draws (mesh + pixel) 51.9 1,869
Indirect-argument clamps 35.4 4,909
Shadow draws (mesh only) 21.8 1,885
Indirect compute 21.7 920
Other dispatches 10.2 3,394
Preludes and the rest ~14

The untimed "on the GPU" figure (~240 ms) is mostly not GPU work: lists take ~176 ms of wall time, the rest is the CPU waiting on synchronous copies. With #3312 in, GatherCopy (41 ms) and the BVH trace (28 ms) left the top of the table.

Findings so far:

  • Clamps: #2472's batched clamp never runs under Wine: its shader fails Wine's D3DCompile (E5005 'Load' on RWByteAddressBuffer, [RootSignature] ignored), so every log shows no batched argument clamp: falling back to inline. #3197's window shader has the same problem. A Wine-compilable version plus #3197 is being measured.
  • Write marks off saves ~0.7 ms of GPU time on this stack: with #2958 and #3312 they're no longer a GPU cost.
  • Read marks off isn't a usable measurement: VRAM fills to 32 GB and everything slows 2x, so it measures memory pressure, not the atomics.

Per-PR results on this setup

PR Effect here Note
#2958 871 → 673 ms coalesced view marks
#3120 ~16% less frame time (before #3312) overlap
#3312 553-563 → 386 ms biggest single gain; makes submissions synchronous
#3318 386 → 372 ms
#2465 (port) 871 → 665 ms alone; nothing extra on top of #2958
#2848 +30 ms preparing bisect running
#3341 copy-back +5-7 ms in two independent pairs
#2472 no effect: shader doesn't compile under Wine fix being measured
#2051 with #3312: deferred refreshes skip the VRAM upload, the title later crashes fix being measured; whichever of #2051/#3312 lands second needs it

Still being measured: asynchronous read-back on top of #3312 (to restore the overlap), batched clamps (#2472 fix + #3197), #3387, #3343, #3305, #3289, #3320, #3246, and two small CPU fixes (heap mirroring, bindless uploads).

AI-assisted (Claude); measured on my machine, no game data shared.

**@⁠neonbyte1** on GitHub · 2026-11-27 00:45 UTC · [original](https://github.com/Marvisak/VIctory/issues/3425) A frame budget for one fixed scene, so that performance PRs can be ranked by what they actually remove. Measured numbers only; I'll keep this updated as runs and PRs land. Others' rows for other GPUs/OSes are welcome in the same form. **Setup:** RTX 5090 (driver 620.73.04), Linux, GE-Proton11-14 Wine with its vkd3d-proton. `main` (`63bcca4`) plus the unmerged PRs this setup needs to render the world (#2723, #439, #233, #320, #2118, #2703, #2101, #1129, #2312), plus #2958, #3120 (overlap on), #2309, #2461, #3353/#3378, #3313. GTA VI's opening prison yard, a warm shader cache, diag build. Untimed numbers are medians of the last 30 frame-rate lines of a 600 s run; timed numbers come from `VICTORY_GPU_TIMING=1` (which turns overlap off), with every command in the table rather than the log's top 25. The title caps itself at 30 fps (#2469), so the target is 33.3 ms. ## Where we are | Stack | Frame | fps | On the GPU | Preparing | Copy-back | |---|---|---|---|---|---| | Base above | 553-563 ms | 1.8 | 438-443 | 63 | 48-50 | | + #3312 (VRAM shadow buffers) | 386 | 2.6 | 245 | 85 | 52 | | + #3318 | **372** | **2.7** | 243 | 81 | 49 | The CPU side and the GPU side run one after the other: with #3312 every submission waits for its own copy lists, so #3120's overlap no longer helps. ## CPU side: ~136 ms per frame (best stack + #3341 + #2472) | Part | ms/frame | Where | Open PRs aimed at it | |---|---|---|---| | Copy-back of marked pages (2,813 pages, 101 MB) | 50.7 | `shadow.rs` copy-back | #3246, #3320, #3343 (+#3341 measured slower here) | | Refresh change checks + memcpy | 23.9 | `shadow.rs`/`host.rs` refresh path | #3305, #3289, #3387 | | Descriptor heap mirroring (384k slots) | 18.1 | `HostHeap::sync_slots` | none found | | #3312's two waited-for copy lists per submission | ~14 | `upload_vram_copies` / `readback_vram_copies` | none yet (see below) | | Bindless upload list | 10.1 | `bindless::uploads` | none found | | Title copies, heap steps, the rest | ~15 | | | One lock, `watch::GUARDS`, is held ~49 ms/frame by our own paths, and the title spends 52 ms in its write-fault handler queueing behind it. ## GPU side: 155 ms of commands per frame (timed) | Class | ms/frame | Commands/frame | |---|---|---| | G-buffer draws (mesh + pixel) | 51.9 | 1,869 | | Indirect-argument clamps | 35.4 | 4,909 | | Shadow draws (mesh only) | 21.8 | 1,885 | | Indirect compute | 21.7 | 920 | | Other dispatches | 10.2 | 3,394 | | Preludes and the rest | ~14 | | The untimed "on the GPU" figure (~240 ms) is mostly not GPU work: lists take ~176 ms of wall time, the rest is the CPU waiting on synchronous copies. With #3312 in, `GatherCopy` (41 ms) and the BVH trace (28 ms) left the top of the table. Findings so far: - **Clamps:** #2472's batched clamp never runs under Wine: its shader fails Wine's `D3DCompile` (`E5005 'Load' on RWByteAddressBuffer`, `[RootSignature]` ignored), so every log shows `no batched argument clamp: falling back to inline`. #3197's window shader has the same problem. A Wine-compilable version plus #3197 is being measured. - **Write marks off** saves ~0.7 ms of GPU time on this stack: with #2958 and #3312 they're no longer a GPU cost. - **Read marks off** isn't a usable measurement: VRAM fills to 32 GB and everything slows 2x, so it measures memory pressure, not the atomics. ## Per-PR results on this setup | PR | Effect here | Note | |---|---|---| | #2958 | 871 → 673 ms | coalesced view marks | | #3120 | ~16% less frame time (before #3312) | overlap | | #3312 | 553-563 → 386 ms | biggest single gain; makes submissions synchronous | | #3318 | 386 → 372 ms | | | #2465 (port) | 871 → 665 ms alone; nothing extra on top of #2958 | | | #2848 | +30 ms preparing | bisect running | | #3341 | copy-back +5-7 ms in two independent pairs | | | #2472 | no effect: shader doesn't compile under Wine | fix being measured | | #2051 | with #3312: deferred refreshes skip the VRAM upload, the title later crashes | fix being measured; whichever of #2051/#3312 lands second needs it | Still being measured: asynchronous read-back on top of #3312 (to restore the overlap), batched clamps (#2472 fix + #3197), #3387, #3343, #3305, #3289, #3320, #3246, and two small CPU fixes (heap mirroring, bindless uploads). _AI-assisted (Claude); measured on my machine, no game data shared._
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:07:18 +00:00
Author
Owner

@⁠Dathinel on GitHub · 2026-11-27 01:15 UTC · original

A row for a small card, with a different tree and scene, so it compares only loosely. RTX 3050 Laptop 4 GB (32-lane waves), Ryzen 7 7435HS, 24 GB RAM, Windows 11 native, Series S profile, a cool_fox-lineage tree, outdoor free play by a boat. Frame 150 to 154 ms (6.5 to 6.7 fps): 65 preparing, 70 on the GPU, 26 copy-back, in series. That is after skipping the 41 bvh_skinning programs and both CS_Primary_GatherCopy variants. Before the skips, a batch timing that does not serialise the frame gave 128.5 ms of commands: GatherCopy 49.7 in one command, bvh_skinning:* 23.0, each G-buffer family under 4. One run per figure; night not checked with the skips.

https://github.com/Dathinel/victory-4gb/issues/4

No game files or captures attached. Written with AI assistance (Claude Code).

**@⁠Dathinel** on GitHub · 2026-11-27 01:15 UTC · [original](https://github.com/Marvisak/VIctory/issues/3425#issuecomment-7207143028) A row for a small card, with a different tree and scene, so it compares only loosely. RTX 3050 Laptop 4 GB (32-lane waves), Ryzen 7 7435HS, 24 GB RAM, Windows 11 native, Series S profile, a cool_fox-lineage tree, outdoor free play by a boat. Frame 150 to 154 ms (6.5 to 6.7 fps): 65 preparing, 70 on the GPU, 26 copy-back, in series. That is after skipping the 41 `bvh_skinning` programs and both `CS_Primary_GatherCopy` variants. Before the skips, a batch timing that does not serialise the frame gave 128.5 ms of commands: `GatherCopy` 49.7 in one command, `bvh_skinning:*` 23.0, each G-buffer family under 4. One run per figure; night not checked with the skips. https://github.com/Dathinel/victory-4gb/issues/4 No game files or captures attached. Written with AI assistance (Claude Code).
This discussion has been locked. Commenting is limited to contributors.
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/Marvisak--VIctory#3425
No description provided.