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
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?
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)
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.
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 forTUNEDThe 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_heapsfrom 17.2 ms to 0.2-0.6 ms a frame (fxceless/victory-fork#1083). I measured it on our tree (maina4453083), 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_heapsthen 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_benchon KainanP/AnyXboxXbench/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. Onesync_heapsfollows, 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 givessync_heapsmedians of 30 frames, then the median and range of 7 interleaved runs. Release build, RTX 4060 Laptop, quiet machine.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. WithVICTORY_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-gpulib suite, single-threaded, gives the same result with the switch off and on:--features diagnostics,VICTORY_D3D12_WARP=1): 522 passed.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
TUNEDor 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 withVICTORY_PORT_DESCRIPTORS=1on and off, comparing the descriptor line'ssync_heaps/asking times and therenderer port 2 … view records no store told ofcount. 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.