Profiling map: the three dominant bottlenecks in heavy scenes (submission-thread CPU prep, mid-game pipeline compiles, GPU wait/texture streaming) — RTX 5070 Ti session data #529

Open
opened 2026-11-27 17:03:09 +00:00 by PeppeBeard · 1 comment
PeppeBeard commented 2026-11-27 17:03:09 +00:00 (Migrated from github.com)
Contributor

Imported from LooperSalty/AnyXboxX. Originally posted by PeppeBeard on 2026-11-27T17:03:09Z.


Consolidated bottleneck map from three instrumented sessions tonight (RTX 5070 Ti 16 GB, 32 GB RAM, 16 logical CPUs, Series X profile, 1920x1080, warm cache on rounds 2-3, built from a445308). All numbers below are from the per-frame host meter lines in the game logs. Posting because the three problems interact and I think ranking them helps decide what to work on next.

1. The submission thread has no headroom (dominant in heavy scenes)

In 5,000-7,000 draw scenes the frame is ~37 ms and the submitting thread's work accounts for the large majority of it, almost all CPU-side preparation: ~12-17 ms list translation across all 12 thin threads, ~4 ms refresh work, ~2.8 ms descriptor task waits, ~1.5 ms data copies — while the actual driver call is ~0.25 ms and the card reports only ~10% busy. The card is idle-behind-us 7-9 ms of each frame. Frame time scales with scene demand, dropping to ~17 fps in these scenes. Related open work: #510 (helper priority), #494 (allocator reclaim).

2. Mid-game pipeline compilation still bites with a warm cache

First launch on a new base: 1,400-1,900 pipelines compiling mid-world, fps down to ~3. That part recovers after the cache warms (1 GB library saved, 2,900 loaded on later runs). But even on a warm cache, entering new areas/effects produces isolated stutters and 300-600 draws dropped per frame waiting for host pipelines; our 1%-low readings of 2-6 fps come partly from this. Pre-compilation only covers pipelines already encountered. Related open work: #507.

Practical mitigation that helped us: deliberately driving heavy areas once on a throwaway session after every update, so the warm cache catches them before real play.

3. GPU waits, readbacks and streaming bursts blur the frame pacing

Copy-back per frame ran 16-27 ms in heavy scenes (measured on the relay), landing ~4 ms, present waits ~10 ms (SUBMIT_FRAMES=1), and texture streaming arrives in bursts (one frame carried a 299 MB texture upload). Average fps looks acceptable while frame timing swings. Testing note: issue #413 measured VICTORY_OCEAN_READBACK=0 cutting copy-back from 57 MB/67 ms to 3 MB/8 ms per frame on an RTX 3080 Ti — we have just set it user-level on this machine and will report the delta on the same route.

Data from tonight's sessions (wide-copy confirmed on for round 3)

Draws/frame median fps (off) median fps (wide-copy on)
1k-3k 24.3 19.6
3k-6k pooled 14.7 (3k+) 21.2
6k-10k pooled 14.7 (3k+) 17.5

All-3k+ pooled: 14.7 → ~20 fps with #500's VICTORY_WIDE_COPY=1 (details in the #500 comment). Copy throughput improved to ~7-8 GB/s effective, but the remaining bottleneck shifted to points 1 and 3 above — which is what motivated this write-up.

Happy to contribute fixed-route measurement pairs for any of the three if useful.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:issue:6651077337 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/issues/529). Originally posted by [PeppeBeard](https://github.com/PeppeBeard) on 2026-11-27T17:03:09Z. --- Consolidated bottleneck map from three instrumented sessions tonight (RTX 5070 Ti 16 GB, 32 GB RAM, 16 logical CPUs, Series X profile, 1920x1080, warm cache on rounds 2-3, built from a445308). All numbers below are from the per-frame host meter lines in the game logs. Posting because the three problems interact and I think ranking them helps decide what to work on next. ## 1. The submission thread has no headroom (dominant in heavy scenes) In 5,000-7,000 draw scenes the frame is ~37 ms and the submitting thread's work accounts for the large majority of it, almost all CPU-side preparation: ~12-17 ms list translation across all 12 thin threads, ~4 ms refresh work, ~2.8 ms descriptor task waits, ~1.5 ms data copies — while the actual driver call is ~0.25 ms and the card reports only ~10% busy. The card is idle-behind-us 7-9 ms of each frame. Frame time scales with scene demand, dropping to ~17 fps in these scenes. Related open work: #510 (helper priority), #494 (allocator reclaim). ## 2. Mid-game pipeline compilation still bites with a warm cache First launch on a new base: 1,400-1,900 pipelines compiling mid-world, fps down to ~3. That part recovers after the cache warms (1 GB library saved, 2,900 loaded on later runs). But even on a warm cache, entering new areas/effects produces isolated stutters and 300-600 draws dropped per frame waiting for host pipelines; our 1%-low readings of 2-6 fps come partly from this. Pre-compilation only covers pipelines already encountered. Related open work: #507. Practical mitigation that helped us: deliberately driving heavy areas once on a throwaway session after every update, so the warm cache catches them before real play. ## 3. GPU waits, readbacks and streaming bursts blur the frame pacing Copy-back per frame ran 16-27 ms in heavy scenes (measured on the relay), landing ~4 ms, present waits ~10 ms (SUBMIT_FRAMES=1), and texture streaming arrives in bursts (one frame carried a 299 MB texture upload). Average fps looks acceptable while frame timing swings. Testing note: issue #413 measured VICTORY_OCEAN_READBACK=0 cutting copy-back from 57 MB/67 ms to 3 MB/8 ms per frame on an RTX 3080 Ti — we have just set it user-level on this machine and will report the delta on the same route. ## Data from tonight's sessions (wide-copy confirmed on for round 3) | Draws/frame | median fps (off) | median fps (wide-copy on) | |---|---|---| | 1k-3k | 24.3 | 19.6 | | 3k-6k | pooled 14.7 (3k+) | 21.2 | | 6k-10k | pooled 14.7 (3k+) | 17.5 | All-3k+ pooled: 14.7 → ~20 fps with #500's VICTORY_WIDE_COPY=1 (details in the #500 comment). Copy throughput improved to ~7-8 GB/s effective, but the remaining bottleneck shifted to points 1 and 3 above — which is what motivated this write-up. Happy to contribute fixed-route measurement pairs for any of the three if useful.
KainanP commented 2026-11-27 17:11:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LooperSalty/AnyXboxX. Originally posted by KainanP on 2026-11-27T17:11:18Z.


VICTORY_PORT_DESCRIPTORS=1 (renderer port 2): measured on main, not proposing it for TUNED

The base already has renderer port 2, off by default. It was a candidate for the submitting-thread headroom in point 1 above. On an RTX 3070 fork tree it took sync_heaps from 17.2 ms to 0.2-0.6 ms a frame (fxceless/victory-fork#1083). I measured it on our tree (main a4453083), and on this base it gives no useful synthetic gain. It also has a known correctness cost, so I am not opening a launcher PR.

What it does. The six record stores in the title's table fillers (1.0.2.1 offsets, checked byte for byte; victory-loader/src/descriptor_sites.rs) are patched to set a byte for each slot they write. sync_heaps then reads only the marked slots instead of every changed 64 KiB page. A fallback reads 16 written pages a frame and asks the write watch every 8 frames. Without the patched sites (another build, or no title) working() is false and nothing changes.

Bench. The bench is ignored test descriptor::sync_bench::port_sync_bench on KainanP/AnyXboxX bench/port-descriptors-sync (dd515f03). It is ported from our VIctory heap-sync benches. The heap is placed and write-watched, with 2^20 slots (737,855 mirrored after the host cap). Each frame writes 48 records as bytes into each of 200 random pages, about 9,600 changed slots. One sync_heaps follows, either alone or while 5 title threads write placed buffer views every 20 µs. With the switch on, the bench copies mark their slots the same way the patched stores do. The table gives sync_heaps medians of 30 frames, then the median and range of 7 interleaved runs. Release build, RTX 4060 Laptop, quiet machine.

scenario port off port on
9.6k changed slots, alone 2.44 ms (2.24-3.12) 2.68 ms (2.39-3.09)
9.6k changed slots, 5 title threads 3.15 ms (2.86-3.84) 3.10 ms (3.02-4.33)
200 written pages, no record changed, alone 0.261 ms 0.076 ms
same, 5 title threads 0.401 ms 0.084 ms
Intel UHD spot check (3 runs), 9.6k slots, 5 threads 3.70 ms 4.03 ms
Intel UHD, pages only, 5 threads 0.398 ms 0.092 ms

The port only removes the page scan: about 0.2-0.3 ms here, because the in-place AVX2 compare (VICTORY_SYNC_IN_PLACE, on by default since 2026-11-26) already makes the scan cheap. Making the changed descriptors (about 2.4-3 ms for 9.6k) costs the same either way. With VICTORY_SYNC_IN_PLACE=0, the port is still no faster (3.48 vs 3.68 ms with threads, 3 runs). The title threads' wait in view writes is 0.1-0.3 ms in every row. The 17 ms on the 3070 tree is therefore most likely the page pass of a tree without these changes. The source comment's in-game figure, "5-7 ms of the 15-16 asking the watch" (run port1-3), may still be real on this base, but a synthetic bench cannot show it. Only a game log can.

Correctness.

  • Every record whose copy was marked is seen by the very next sync, and null views are made from it: 0 lost and 0 stale over all runs, with the switch on or off, on RTX and Intel.

  • A writer the patches miss is the known gap. The source comment counts 110-250 view records a frame with no mark in game (run pop-1), and says that looking at every page instead cost 15-25 ms and did not stop trees and palms flickering. In the bench, 2 % unmarked copies (about 150 a frame) took a median of 4 frames to land and up to 31 frames. After the run, about 2,200 were still unseen and needed 21 more quiet frames. With the switch off, every one lands in the same sync.

  • avatarmanz/VIctory-7900XTX#240 (RADV) saw a steady-state gain (154 → 103 ms), but the first minutes while the level streams in were much slower: 698 ms against about 160.

  • The victory-gpu lib suite, single-threaded, gives the same result with the switch off and on:

    • RTX 4060 Laptop: 466 passed.
    • WARP (--features diagnostics, VICTORY_D3D12_WARP=1): 522 passed.
    • Intel UHD: 465 passed, 1 failed in both. The failure is anisotropic_heap_sampler_reads_the_requested_mip, which already fails on this iGPU in raw D3D12.

    The suite proves little either way, because no title sites are patched in it.

Conclusion. On this base, port 2 removes at most about 0.3 ms of synthetic sync per frame. It costs stale views for up to about 1 s from any writer the patches miss, and streaming was slower on RADV. Putting it in TUNED or the 8 GB preset would be a correctness trade-off with no measured benefit to justify it. An in-game A/B could still change this if the watch query really is 5-7 ms in game. That would be the same route with VICTORY_PORT_DESCRIPTORS=1 on and off, comparing the descriptor line's sync_heaps/asking times and the renderer port 2 … view records no store told of count. Until someone runs that, I'd leave it off.

AI use: bench, runs and this write-up by Claude Code (Claude Opus 5.5), reviewed against the logs on my machine; no game data used.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7224126399 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/issues/529#issuecomment-7224126399). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-27T17:11:18Z. --- ## `VICTORY_PORT_DESCRIPTORS=1` (renderer port 2): measured on main, not proposing it for `TUNED` The base already has renderer port 2, off by default. It was a candidate for the submitting-thread headroom in point 1 above. On an RTX 3070 fork tree it took `sync_heaps` from 17.2 ms to 0.2-0.6 ms a frame ([fxceless/victory-fork#1083](https://github.com/fxceless/victory-fork/issues/1083#issuecomment-7205101829)). I measured it on our tree (main `a4453083`), and on this base it gives no useful synthetic gain. It also has a known correctness cost, so I am not opening a launcher PR. **What it does.** The six record stores in the title's table fillers (1.0.2.1 offsets, checked byte for byte; `victory-loader/src/descriptor_sites.rs`) are patched to set a byte for each slot they write. `sync_heaps` then reads only the marked slots instead of every changed 64 KiB page. A fallback reads 16 written pages a frame and asks the write watch every 8 frames. Without the patched sites (another build, or no title) `working()` is false and nothing changes. **Bench.** The bench is ignored test `descriptor::sync_bench::port_sync_bench` on [KainanP/AnyXboxX `bench/port-descriptors-sync`](https://github.com/KainanP/AnyXboxX/tree/bench/port-descriptors-sync) (dd515f03). It is ported from our VIctory heap-sync benches. The heap is placed and write-watched, with 2^20 slots (737,855 mirrored after the host cap). Each frame writes 48 records as bytes into each of 200 random pages, about 9,600 changed slots. One `sync_heaps` follows, either alone or while 5 title threads write placed buffer views every 20 µs. With the switch on, the bench copies mark their slots the same way the patched stores do. The table gives `sync_heaps` medians of 30 frames, then the median and range of 7 interleaved runs. Release build, RTX 4060 Laptop, quiet machine. | scenario | port off | port on | |---|---:|---:| | 9.6k changed slots, alone | 2.44 ms (2.24-3.12) | 2.68 ms (2.39-3.09) | | 9.6k changed slots, 5 title threads | 3.15 ms (2.86-3.84) | 3.10 ms (3.02-4.33) | | 200 written pages, no record changed, alone | 0.261 ms | 0.076 ms | | same, 5 title threads | 0.401 ms | 0.084 ms | | Intel UHD spot check (3 runs), 9.6k slots, 5 threads | 3.70 ms | 4.03 ms | | Intel UHD, pages only, 5 threads | 0.398 ms | 0.092 ms | The port only removes the page scan: about 0.2-0.3 ms here, because the in-place AVX2 compare (`VICTORY_SYNC_IN_PLACE`, on by default since 2026-11-26) already makes the scan cheap. Making the changed descriptors (about 2.4-3 ms for 9.6k) costs the same either way. With `VICTORY_SYNC_IN_PLACE=0`, the port is still no faster (3.48 vs 3.68 ms with threads, 3 runs). The title threads' wait in view writes is 0.1-0.3 ms in every row. The 17 ms on the 3070 tree is therefore most likely the page pass of a tree without these changes. The source comment's in-game figure, "5-7 ms of the 15-16 asking the watch" (run port1-3), may still be real on this base, but a synthetic bench cannot show it. Only a game log can. **Correctness.** - Every record whose copy was marked is seen by the very next sync, and null views are made from it: 0 lost and 0 stale over all runs, with the switch on or off, on RTX and Intel. - A writer the patches miss is the known gap. The source comment counts 110-250 view records a frame with no mark in game (run pop-1), and says that looking at every page instead cost 15-25 ms and did not stop trees and palms flickering. In the bench, 2 % unmarked copies (about 150 a frame) took a median of 4 frames to land and up to 31 frames. After the run, about 2,200 were still unseen and needed 21 more quiet frames. With the switch off, every one lands in the same sync. - avatarmanz/VIctory-7900XTX#240 (RADV) saw a steady-state gain (154 → 103 ms), but the first minutes while the level streams in were much slower: 698 ms against about 160. - The `victory-gpu` lib suite, single-threaded, gives the same result with the switch off and on: - RTX 4060 Laptop: 466 passed. - WARP (`--features diagnostics`, `VICTORY_D3D12_WARP=1`): 522 passed. - Intel UHD: 465 passed, 1 failed in both. The failure is `anisotropic_heap_sampler_reads_the_requested_mip`, which already fails on this iGPU in raw D3D12. The suite proves little either way, because no title sites are patched in it. **Conclusion.** On this base, port 2 removes at most about 0.3 ms of synthetic sync per frame. It costs stale views for up to about 1 s from any writer the patches miss, and streaming was slower on RADV. Putting it in `TUNED` or the 8 GB preset would be a correctness trade-off with no measured benefit to justify it. An in-game A/B could still change this if the watch query really is 5-7 ms in game. That would be the same route with `VICTORY_PORT_DESCRIPTORS=1` on and off, comparing the descriptor line's `sync_heaps`/asking times and the `renderer port 2 … view records no store told of` count. Until someone runs that, I'd leave it off. _AI use: bench, runs and this write-up by Claude Code (Claude Opus 5.5), reviewed against the logs on my machine; no game data used._
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
LooperSalty/AnyXboxX#529
No description provided.