[GH #150] First minutes: 3 096 pipelines and 28.7 s of texture refresh, measured #150

Open
opened 2026-11-25 15:08:44 +00:00 by Logan-Gaillard · 1 comment
Logan-Gaillard commented 2026-11-25 15:08:44 +00:00 (Migrated from github.com)

Imported from Zettrox/ztrx. Originally posted by Logan-Gaillard on 2026-11-25T14:58:58Z.


Where the first minutes go, measured on one 300 s run (69cb, this repo, i7/U7 hybrid laptop, RTX 5070 Laptop 8 GB, 90b529f + local work).

Two separate costs, not one:

Window Pipelines created (first bind) Texture refresh (ms) ms/frame
0-80 s 34 60 33-46 (menu)
80-100 s 2 054 1 020 118
100-140 s 641 7 664 603 → 1 738
140-200 s 313 18 811 850 → 1 210
200-300 s 54 1 113 460 → 405

Totals: 3 096 pipelines created, 28.7 s of texture refresh accumulated over 160 samples, and the frame time settles around 400 ms once both are done. The world entry is therefore two bursts: shader/pipeline creation around the 90 s mark, then texture preparation from 100 to 200 s.

What we already know about the second burst (measured by @1mlesc, cross-checked by @AlexisLRC):

  • The slowest frame of a 600 s run was 3 313 ms, of which 1 258 ms of texture work, of which 1 199 ms waiting for the title's memory to hold still before reading it. The card was at 34 % during that first minute: the cost is on the host, not the GPU.
  • The same run moved 50 004 textures (18.7 GB) in the first minute at 71.7 MB/s; a run that looks "faster" was simply giving up (3.5 GB at 10.1 MB/s) and stalled its queue.
  • TextureQueue::due serves entries already looked at before new ones, and the pass takes at most 4 096 of them, so while more than 4 096 slots wait with nothing mapped, no new slot is looked at. That starves the new ones; it does not create the backlog.

What is not established, and should not be assumed: how many of the unmapped slots are actually sampled by a draw. The counter counts every slot the title wrote into its view heap, and the pass never consults the frame's draws. A counter "slots read by a draw and without mapped memory" would settle it.

Next steps on our side: a run with VICTORY_TEXTURE_NO_WAIT=1 (to size the 1 199 ms wait), and making the per-frame staging budgets configurable in this repo — they exist in victory-fork as VICTORY_TEXTURE_STAGE_MB, VICTORY_TEXTURE_STAGE_MS and VICTORY_TEXTURE_CATCHUP, but are constants here. On the pipeline side we are checking whether creation happens on the submission thread.

Credits: @1mlesc (textures, the 50 004/18.7 GB measurement, the queue-order analysis), @AlexisLRC (protocol review, and the observation that our ztrx builds had none of the texture fixes), PC1 (timeline, screenshots metric, bench).

<!-- greyfinch-sync:Zettrox/ztrx:issue:6607377397 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/issues/150). Originally posted by [Logan-Gaillard](https://github.com/Logan-Gaillard) on 2026-11-25T14:58:58Z. --- Where the first minutes go, measured on one 300 s run (`69cb`, this repo, i7/U7 hybrid laptop, RTX 5070 Laptop 8 GB, 90b529f + local work). Two separate costs, not one: | Window | Pipelines created (`first bind`) | Texture refresh (ms) | ms/frame | | --- | --- | --- | --- | | 0-80 s | 34 | 60 | 33-46 (menu) | | 80-100 s | **2 054** | 1 020 | 118 | | 100-140 s | 641 | 7 664 | 603 → 1 738 | | 140-200 s | 313 | 18 811 | 850 → 1 210 | | 200-300 s | 54 | 1 113 | 460 → 405 | Totals: **3 096 pipelines created**, **28.7 s of texture refresh** accumulated over 160 samples, and the frame time settles around 400 ms once both are done. The world entry is therefore two bursts: shader/pipeline creation around the 90 s mark, then texture preparation from 100 to 200 s. What we already know about the second burst (measured by @1mlesc, cross-checked by @AlexisLRC): - The slowest frame of a 600 s run was 3 313 ms, of which 1 258 ms of texture work, of which **1 199 ms waiting for the title's memory to hold still** before reading it. The card was at 34 % during that first minute: the cost is on the host, not the GPU. - The same run moved 50 004 textures (18.7 GB) in the first minute at 71.7 MB/s; a run that looks "faster" was simply giving up (3.5 GB at 10.1 MB/s) and stalled its queue. - `TextureQueue::due` serves entries already looked at before new ones, and the pass takes at most 4 096 of them, so while more than 4 096 slots wait with nothing mapped, no new slot is looked at. That starves the new ones; it does not create the backlog. What is not established, and should not be assumed: how many of the unmapped slots are actually sampled by a draw. The counter counts every slot the title wrote into its view heap, and the pass never consults the frame's draws. A counter "slots read by a draw and without mapped memory" would settle it. Next steps on our side: a run with `VICTORY_TEXTURE_NO_WAIT=1` (to size the 1 199 ms wait), and making the per-frame staging budgets configurable in this repo — they exist in victory-fork as `VICTORY_TEXTURE_STAGE_MB`, `VICTORY_TEXTURE_STAGE_MS` and `VICTORY_TEXTURE_CATCHUP`, but are constants here. On the pipeline side we are checking whether creation happens on the submission thread. Credits: @1mlesc (textures, the 50 004/18.7 GB measurement, the queue-order analysis), @AlexisLRC (protocol review, and the observation that our ztrx builds had none of the texture fixes), PC1 (timeline, screenshots metric, bench).
Logan-Gaillard commented 2026-11-25 15:08:46 +00:00 (Migrated from github.com)
Author

Imported from Zettrox/ztrx. Originally posted by Logan-Gaillard on 2026-11-25T15:00:42Z.


Follow-up from the same logs, and it sharpens the number above: the 2 054 pipelines in one 20 s window are translations, not creations.

The run reports its own counters:

shaders from the cache and translated so far hits=0 misses=3016

hits=0 means the shader cache was cold for that build, so all 3 096 shaders were translated from GFX10 to DXIL during the first ninety seconds. A run on the same executable a few minutes later reports hits=3181 misses=0. The pipeline burst is therefore a cold-cache burst, and it costs about a minute and a half of the load every time a new binary is built — which, during a day of iteration, is every time.

Being cold for a build is by design: the cache key is the BLAKE3 of the executable plus the translation settings (victory-gpu/src/shader_cache.rs), so a rebuilt translator never serves an old translation. That part is right.

What was not right is that the bench and the interactive launcher used two different cache directories:

Who Cache Size before the fix
the test runner %LOCALAPPDATA%\victory\cache (default) 56 files, 117 MB
the play launcher D:\GTA666\.victory\cache 59 079 files, 3 248 MB

So a build tested all afternoon still started cold the moment it was played: the bench's translations were written where the player never looks. Fixed on our side by pointing the runner at the same directory as the launcher (VICTORY_CACHE_DIR in the runner's environment, one line). After that, a build a test has run opens with hits=3xxx misses=0 instead of re-translating.

Worth noting for anyone reading counters: most of those 3 248 MB are entries for older binaries, which an executable-hash key can never reuse. Not a leak — dead weight that can be dropped whenever the disk matters.

No claim of a frame-time win here: the same work still happens once per build. The win is that it now happens during a test instead of during the first minute of play.

<!-- greyfinch-sync:Zettrox/ztrx:comment:7166162627 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/issues/150#issuecomment-7166162627). Originally posted by [Logan-Gaillard](https://github.com/Logan-Gaillard) on 2026-11-25T15:00:42Z. --- Follow-up from the same logs, and it sharpens the number above: the 2 054 pipelines in one 20 s window are **translations, not creations**. The run reports its own counters: shaders from the cache and translated so far hits=0 misses=3016 `hits=0` means the shader cache was cold for that build, so all 3 096 shaders were translated from GFX10 to DXIL during the first ninety seconds. A run on the same executable a few minutes later reports `hits=3181 misses=0`. The pipeline burst is therefore a **cold-cache burst**, and it costs about a minute and a half of the load every time a new binary is built — which, during a day of iteration, is every time. Being cold for a build is by design: the cache key is the BLAKE3 of the executable plus the translation settings (`victory-gpu/src/shader_cache.rs`), so a rebuilt translator never serves an old translation. That part is right. What was not right is that the bench and the interactive launcher used **two different cache directories**: | Who | Cache | Size before the fix | | --- | --- | --- | | the test runner | `%LOCALAPPDATA%\victory\cache` (default) | 56 files, 117 MB | | the play launcher | `D:\GTA666\.victory\cache` | 59 079 files, 3 248 MB | So a build tested all afternoon still started cold the moment it was played: the bench's translations were written where the player never looks. Fixed on our side by pointing the runner at the same directory as the launcher (`VICTORY_CACHE_DIR` in the runner's environment, one line). After that, a build a test has run opens with `hits=3xxx misses=0` instead of re-translating. Worth noting for anyone reading counters: most of those 3 248 MB are entries for **older** binaries, which an executable-hash key can never reuse. Not a leak — dead weight that can be dropped whenever the disk matters. No claim of a frame-time win here: the same work still happens once per build. The win is that it now happens during a test instead of during the first minute of play.
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
Zettrox/ztrx#150
No description provided.