Measured improvements: 2.5 -> 11 fps, 30.8 -> 3 GB, GPU 0 -> 58 ms (with patches) #3859

Open
opened 2026-11-29 20:54:00 +00:00 by Mdemets · 0 comments
Mdemets commented 2026-11-29 20:54:00 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by Mdemets on 2026-11-29T20:54:00Z.


Measured improvements over the original build (2026-11-29)

Full evidence, commands and corrections: https://github.com/Mdemets/victory-status
(findings/2026-11-29-world-render.md)

metric original build after the changes
world frame rate 2.5-3.5 fps 10.3-11.4 fps (3-4x)
frame time 290-406 ms 88-97 ms
GPU busy time (card timestamps) 0-5 ms (reported 0.0) 41.6-58.2 ms
host memory (private) 30.8 GB - pages on a 32 GB machine ~3 GB
draws per frame 5,055-6,614 5,551-6,594 (unchanged)
copies per frame 83-206 MB 40-45 MB

What changed

  1. Draw grouping (DirectRun) - consecutive draws whose host state did not change are bound once and replayed with a single ExecuteIndirect, instead of re-running prepare/bind/tables per draw (43-50 us -> ~11 us per draw). Patch in the tree as directrun-stage1.patch (766 lines, 4 files), behind VICTORY_DIRECT_RUN=1; the default path is unchanged.
  2. Buffer residency (VICTORY_RELEASE_IDLE_BUFFERS=1) - the runtime kept a full host copy of every drawn title buffer forever (shadow.rs says "some 25 GB in play"); the existing release sweep was off by default. Turning it on took private bytes from 30.8 GB to ~3 GB.
  3. GPU timing made real - 0.0 on the GPU was a CPU-side wait. The timestamp path is #[cfg(feature = "diagnostics")] and additionally needs VICTORY_D3D12_DRED=1; with --profile diag --features diagnostics + VICTORY_GPU_TIMING=1 the card reports 41.6-58.2 ms per world frame.

What did not work (kept in the record)

  • early-pipeline seeding from slow-pipelines.txt: raised pipelines in flight (395-412 -> 495-517), reverted;
  • VICTORY_INDIRECT_MERGE=1: 92% of executions are structurally unmergeable (binding/pipeline changes between them);
  • whole-buffer copy diffing: measured no reduction in copied bytes;
  • adapter selection was never WARP - the device is the RTX 4070 SUPER (vendor=4318 device=10115).

Remaining budget of a 97 ms frame

GPU 41.6-58.2 ms, preparing 27.7-29.7 ms (copies 8.6-9.6, textures ~1), copying back 7.1-7.6 ms.
Stage 2 (indexed draws, root-constant-only changes, mesh dispatches admitted to the same grouping) is in progress.


Measured on an i9-14900KF / 32 GB / RTX 4070 SUPER, Xbox Series package 1.0.2.1, runs capped at 600 s.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6684021353 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/3859). Originally posted by [Mdemets](https://github.com/Mdemets) on 2026-11-29T20:54:00Z. --- ## Measured improvements over the original build (2026-11-29) Full evidence, commands and corrections: **https://github.com/Mdemets/victory-status** (`findings/2026-11-29-world-render.md`) | metric | original build | after the changes | |---|---|---| world frame rate | **2.5-3.5 fps** | **10.3-11.4 fps** (3-4x) | frame time | 290-406 ms | **88-97 ms** | GPU busy time (card timestamps) | **0-5 ms** (reported `0.0`) | **41.6-58.2 ms** | host memory (private) | **30.8 GB** - pages on a 32 GB machine | **~3 GB** | draws per frame | 5,055-6,614 | **5,551-6,594 (unchanged)** | copies per frame | 83-206 MB | **40-45 MB** | ### What changed 1. **Draw grouping (`DirectRun`)** - consecutive draws whose host state did not change are bound once and replayed with a single `ExecuteIndirect`, instead of re-running `prepare`/`bind`/`tables` per draw (43-50 us -> ~11 us per draw). Patch in the tree as `directrun-stage1.patch` (766 lines, 4 files), behind `VICTORY_DIRECT_RUN=1`; the default path is unchanged. 2. **Buffer residency (`VICTORY_RELEASE_IDLE_BUFFERS=1`)** - the runtime kept a full host copy of every drawn title buffer forever (`shadow.rs` says "some 25 GB in play"); the existing release sweep was off by default. Turning it on took private bytes from 30.8 GB to ~3 GB. 3. **GPU timing made real** - `0.0 on the GPU` was a CPU-side wait. The timestamp path is `#[cfg(feature = "diagnostics")]` and additionally needs `VICTORY_D3D12_DRED=1`; with `--profile diag --features diagnostics` + `VICTORY_GPU_TIMING=1` the card reports 41.6-58.2 ms per world frame. ### What did not work (kept in the record) - early-pipeline seeding from `slow-pipelines.txt`: raised pipelines in flight (395-412 -> 495-517), reverted; - `VICTORY_INDIRECT_MERGE=1`: 92% of executions are structurally unmergeable (binding/pipeline changes between them); - whole-buffer copy diffing: measured no reduction in copied bytes; - adapter selection was never WARP - the device is the RTX 4070 SUPER (`vendor=4318 device=10115`). ### Remaining budget of a 97 ms frame GPU 41.6-58.2 ms, preparing 27.7-29.7 ms (copies 8.6-9.6, textures ~1), copying back 7.1-7.6 ms. Stage 2 (indexed draws, root-constant-only changes, mesh dispatches admitted to the same grouping) is in progress. --- Measured on an i9-14900KF / 32 GB / RTX 4070 SUPER, Xbox Series package 1.0.2.1, runs capped at 600 s.
Sign in to join this conversation.
No labels
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.

Reference
Marvisak/VIctory#3859
No description provided.