At ~22 fps the renderer thread needs ~37 ms a frame: a second limit next to the GPU, a third of it the index-slot reads at Execute #44

Closed
opened 2026-12-01 04:00:20 +00:00 by github-bot · 5 comments
Owner

@⁠Mhyster on GitHub · 2026-12-01 03:59 UTC · original

One window of vk.log's profile lines (60 presents, standing in the world, unprofiled, default build):

label ms in the window per present
live: all events (total) 2,213 (4,947 events) 36.9
live: call Execute (incl. run_list, submit) 1,938 (1,080 calls) 32.3
live: run_list (total) 1,100 18.3
live: slot_reads at Execute (index slots) 719 (686 passes) 12.0
rec: draw/dispatch recording (incl. pipeline build, pre_op) 449 7.5
live: slot_reads in lists 302 (694,358) 5.0

The thread itself: 75.2 % of a core (per-thread sampling over the same run), fps ~21.8, GPU busy ~85 %. So the renderer alone would hold the frame near 27 fps with an infinitely fast GPU; scenes with more draws (2.4x in the drops to 10-15 fps seen earlier) add to exactly this work.

The GPU side does not move fps on its own either. A play-only measurement switch that skips the structure builder's dispatches (as VKB_NO_RTBUILD did before 2026-11-29; rays then find nothing) took the RT/GI class from ~12 to 8.4 ms and the builder classes (~2.2 ms) out of the serialised frame, and fps went from ~21.8 to 22.4 at the same spot.

Slot reads in numbers (5 s windows, the house spot of the same save, same build): ~23M slot reads, 66 % slot-cache hits, ~2.2M that resolve to no view, all of them inside the view heaps and missing although cached. The per-read cost in vkback is already small (slot_reads 9.8 % and Paged::holds 7.8 % of the thread in a flat perf profile: ~30 ns a read for those two, ~60 ns with all the label holds); the volume is what costs, which points at fewer reads rather than faster ones (TASKS.md "the descriptor heap as one array"). A cross-list dedupe on the PE side would need vkback's uncaches (forget_slots) fed back, since the PE side cannot see them.

Seen on: 1da3463: 2dd59da with the open PRs #22 and #29 merged, just-another-dude84/VKtory@324542c cherry-picked, a local translator version bump, and #47 and #48; the not-a-view counts and the builder-off run on local builds of the same tree with a counter or the switch added. Not rechecked on 73ee0ab. RX 9070 XT 16 GB, Ryzen 5 9600X, Mesa 26.3.1. (Corrected 2026-12-01: this line first named only #47's and #48's changes.)

🤖 Generated with Claude Code

**@⁠Mhyster** on GitHub · 2026-12-01 03:59 UTC · [original](https://github.com/vktory6/VKtory/issues/44) One window of vk.log's profile lines (60 presents, standing in the world, unprofiled, default build): | label | ms in the window | per present | |---|---|---| | live: all events (total) | 2,213 (4,947 events) | 36.9 | | live: call Execute (incl. run_list, submit) | 1,938 (1,080 calls) | 32.3 | | live: run_list (total) | 1,100 | 18.3 | | **live: slot_reads at Execute (index slots)** | **719 (686 passes)** | **12.0** | | rec: draw/dispatch recording (incl. pipeline build, pre_op) | 449 | 7.5 | | live: slot_reads in lists | 302 (694,358) | 5.0 | The thread itself: 75.2 % of a core (per-thread sampling over the same run), fps ~21.8, GPU busy ~85 %. So the renderer alone would hold the frame near 27 fps with an infinitely fast GPU; scenes with more draws (2.4x in the drops to 10-15 fps seen earlier) add to exactly this work. The GPU side does not move fps on its own either. A play-only measurement switch that skips the structure builder's dispatches (as `VKB_NO_RTBUILD` did before 2026-11-29; rays then find nothing) took the RT/GI class from ~12 to 8.4 ms and the builder classes (~2.2 ms) out of the serialised frame, and fps went from ~21.8 to 22.4 at the same spot. Slot reads in numbers (5 s windows, the house spot of the same save, same build): ~23M slot reads, 66 % slot-cache hits, ~2.2M that resolve to no view, all of them inside the view heaps and missing although cached. The per-read cost in vkback is already small (`slot_reads` 9.8 % and `Paged::holds` 7.8 % of the thread in a flat perf profile: ~30 ns a read for those two, ~60 ns with all the label holds); the volume is what costs, which points at fewer reads rather than faster ones (TASKS.md "the descriptor heap as one array"). A cross-list dedupe on the PE side would need vkback's uncaches (`forget_slots`) fed back, since the PE side cannot see them. Seen on: 1da3463: 2dd59da with the open PRs #22 and #29 merged, just-another-dude84/VKtory@324542c cherry-picked, a local translator version bump, and #47 and #48; the not-a-view counts and the builder-off run on local builds of the same tree with a counter or the switch added. Not rechecked on 73ee0ab. RX 9070 XT 16 GB, Ryzen 5 9600X, Mesa 26.3.1. *(Corrected 2026-12-01: this line first named only #47's and #48's changes.)* 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 04:00:20 +00:00
Author
Owner

@⁠Mhyster on GitHub · 2026-12-01 04:39 UTC · original

More numbers for this, from a run of the same build with VKB_LAT (standing at the same spot, unprofiled; 3,974 frames over 188 world s; frames.py, with autopress's "in the world" line given to it as autorun.txt):

  • Frame: mean 47.2 ms (21.2 fps), p50 46.2, p90 66.6, p99 82.4 ms; 83 % of frames over 33.3 ms.
  • Per frame (mean): renderer busy 37.9 ms, GPU busy 37.5 ms, title wait 7.0 ms.
  • Frames over 33.3 ms by class: gpu 2,419 (41.7 s above the line), render:slots/descriptors 782 (14.4 s); title:io 31, title:heap-sync 24, render:texture/stream 14.
  • The longest frame (187 ms) waited 94.7 ms in remap in queue order: present waits for the remapper.

The title's side of the same slots (frec lines over the last 3,900 frames, and victory-gpu's sync line):

  • The title's frame: tframeus mean 47.4 ms (p50 45.6, p90 58.1); hsyncus mean 13.9 ms (p50 13.7, p90 17.2).
  • sync_heaps per frame: 328.7 changed heap pages, 673,080 slots looked at, 170,382 mirrored; 13.12 ms = 1.50 asking, 1.90 reading and comparing, 9.70 making. The records pool has 3 threads here (cores::scaled(6, 1) on 12 logical processors).

So the ~170k slots the title rewrites each frame cost ~13 ms on its submitting thread before they reach vkback, then ~12.5 ms at Execute on the renderer: ~25 ms of CPU a frame across two threads. "The descriptor heap as one array" would take out both halves.

Seen on: 1da3463: 2dd59da with the open PRs #22 and #29 merged, just-another-dude84/VKtory@324542c cherry-picked, a local translator version bump, and #47 and #48. Not rechecked on 73ee0ab. RX 9070 XT 16 GB, Ryzen 5 9600X, Mesa 26.3.1.

🤖 Generated with Claude Code

**@⁠Mhyster** on GitHub · 2026-12-01 04:39 UTC · [original](https://github.com/vktory6/VKtory/issues/44#issuecomment-7300954065) More numbers for this, from a run of the same build with `VKB_LAT` (standing at the same spot, unprofiled; 3,974 frames over 188 world s; `frames.py`, with autopress's "in the world" line given to it as `autorun.txt`): - Frame: mean 47.2 ms (21.2 fps), p50 46.2, p90 66.6, p99 82.4 ms; 83 % of frames over 33.3 ms. - Per frame (mean): **renderer busy 37.9 ms, GPU busy 37.5 ms**, title wait 7.0 ms. - Frames over 33.3 ms by class: gpu 2,419 (41.7 s above the line), render:slots/descriptors 782 (14.4 s); title:io 31, title:heap-sync 24, render:texture/stream 14. - The longest frame (187 ms) waited 94.7 ms in `remap in queue order: present waits for the remapper`. The title's side of the same slots (`frec` lines over the last 3,900 frames, and victory-gpu's sync line): - The title's frame: `tframeus` mean 47.4 ms (p50 45.6, p90 58.1); `hsyncus` mean **13.9 ms** (p50 13.7, p90 17.2). - `sync_heaps` per frame: 328.7 changed heap pages, 673,080 slots looked at, 170,382 mirrored; 13.12 ms = 1.50 asking, 1.90 reading and comparing, **9.70 making**. The records pool has 3 threads here (`cores::scaled(6, 1)` on 12 logical processors). So the ~170k slots the title rewrites each frame cost ~13 ms on its submitting thread before they reach vkback, then ~12.5 ms at Execute on the renderer: ~25 ms of CPU a frame across two threads. "The descriptor heap as one array" would take out both halves. Seen on: 1da3463: 2dd59da with the open PRs #22 and #29 merged, just-another-dude84/VKtory@324542c cherry-picked, a local translator version bump, and #47 and #48. Not rechecked on 73ee0ab. RX 9070 XT 16 GB, Ryzen 5 9600X, Mesa 26.3.1. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 07:34 UTC · original

Thanks for the numbers. They make the case for "Descriptor heap as one array, not seven typed ones" on both threads, so I added them to that task in github.com/vktory6/VKtory@5169307 (renderer ~12 ms at Execute, plus ~13 ms of sync_heaps on the title's thread).

**@⁠vktory6** on GitHub · 2026-12-01 07:34 UTC · [original](https://github.com/vktory6/VKtory/issues/44#issuecomment-7304233828) Thanks for the numbers. They make the case for "Descriptor heap as one array, not seven typed ones" on both threads, so I added them to that task in https://github.com/vktory6/VKtory/commit/5169307 (renderer ~12 ms at Execute, plus ~13 ms of `sync_heaps` on the title's thread).
Author
Owner

@⁠TheRifai on GitHub · 2026-12-02 10:38 UTC · original

A local A/B/B/A on current main (d59b4f8) adds a data point for the two-thread descriptor cost in this issue. The repo already contains "renderer port #2" (VICTORY_PORT_DESCRIPTORS): it patches the title's descriptor-record stores so sync_heaps learns which slots changed instead of reading whole changed heap pages. It was off by default; I A/B'd it on the house save rt3, 110 s per run, GE-Proton11-16, warm store, RT on, no validation:

Run Path FPS Frame ms Renderer ms hsyncus mean in slow frames
A1 default 27.53 36.35 21.29 9.09 ms
B1 port on 29.11 34.37 19.65 6.46 ms
B2 port on 29.33 34.14 19.84 6.70 ms
A2 default 27.59 36.31 21.31 8.38 ms

That is ~+1.6 fps, −2.1 ms/frame, renderer −1.6 ms, and ~2 ms less title-side heap-sync time. No new loud kinds or fallback/fault lines; a validation run with the port on had only the four known VUIDs. So narrowing "which slots changed" is worth ~2 ms on each side here, before the larger one-array design lands. I proposed enabling the existing path by default in PR #201; no code is copied from other forks.

Evidence: /home/shlong/Documents/VKtory-capture/port-ab-{A1,B1,B2,A2}/ and port-val/. Validation runs were not used for the timings.

**@⁠TheRifai** on GitHub · 2026-12-02 10:38 UTC · [original](https://github.com/vktory6/VKtory/issues/44#issuecomment-7342777020) A local A/B/B/A on current main (`d59b4f8`) adds a data point for the two-thread descriptor cost in this issue. The repo already contains "renderer port #2" (`VICTORY_PORT_DESCRIPTORS`): it patches the title's descriptor-record stores so `sync_heaps` learns which slots changed instead of reading whole changed heap pages. It was off by default; I A/B'd it on the house save `rt3`, 110 s per run, GE-Proton11-16, warm store, RT on, no validation: | Run | Path | FPS | Frame ms | Renderer ms | `hsyncus` mean in slow frames | |---|---|---:|---:|---:|---:| | A1 | default | 27.53 | 36.35 | 21.29 | 9.09 ms | | B1 | port on | 29.11 | 34.37 | 19.65 | 6.46 ms | | B2 | port on | 29.33 | 34.14 | 19.84 | 6.70 ms | | A2 | default | 27.59 | 36.31 | 21.31 | 8.38 ms | That is ~+1.6 fps, −2.1 ms/frame, renderer −1.6 ms, and ~2 ms less title-side heap-sync time. No new loud kinds or fallback/fault lines; a validation run with the port on had only the four known VUIDs. So narrowing "which slots changed" is worth ~2 ms on each side here, before the larger one-array design lands. I proposed enabling the existing path by default in PR #201; no code is copied from other forks. Evidence: `/home/shlong/Documents/VKtory-capture/port-ab-{A1,B1,B2,A2}/` and `port-val/`. Validation runs were not used for the timings.
Author
Owner

@⁠TheRifai on GitHub · 2026-12-02 17:56 UTC · original

Data point after main 88d66ae removed the port-2 descriptor-store patches (TASKS "Slim victory-gpu"): A/B/B/A against bc86e65 on the reference card, RX 9070 XT / RADV 26.3.1, GE-Proton11-16, Series X 3840x2160, house rt3, warm store, 75 s per run, keys W/I at 20/45 s, VKB_LAT=1.

Run Build Mean fps slot_reads at Execute per slow frame slow frames
A1 bc86e65 29.10 9.74 ms 82
B1 88d66ae 28.40 11.54 ms 57 (only 788 frames — bad startup, excluded)
B2 88d66ae 29.98 11.66 ms 70
A2 bc86e65 28.93 10.19 ms 85

fps is unchanged within spread; the one valid patched arm has ~1.5 ms more slot_reads per slow frame, so removing the title-store patches did not buy back the renderer time their +1.6 fps A/B had measured. That matches the maintainer's note in TASKS: the win came from not reading whole changed heap pages, and the fix belongs in heap sync without patching title code. No new VUIDs or loud kinds in any arm. Evidence: /home/shlong/Documents/VKtory-capture/regress88-{A1,B1,B2,A2}/.

**@⁠TheRifai** on GitHub · 2026-12-02 17:56 UTC · [original](https://github.com/vktory6/VKtory/issues/44#issuecomment-7353796745) Data point after main `88d66ae` removed the port-2 descriptor-store patches (TASKS "Slim victory-gpu"): A/B/B/A against `bc86e65` on the reference card, RX 9070 XT / RADV 26.3.1, GE-Proton11-16, Series X 3840x2160, house `rt3`, warm store, 75 s per run, keys W/I at 20/45 s, `VKB_LAT=1`. | Run | Build | Mean fps | `slot_reads at Execute` per slow frame | slow frames | |---|---|---:|---:|---:| | A1 | `bc86e65` | 29.10 | 9.74 ms | 82 | | B1 | `88d66ae` | 28.40 | 11.54 ms | 57 (only 788 frames — bad startup, excluded) | | B2 | `88d66ae` | 29.98 | 11.66 ms | 70 | | A2 | `bc86e65` | 28.93 | 10.19 ms | 85 | fps is unchanged within spread; the one valid patched arm has ~1.5 ms more `slot_reads` per slow frame, so removing the title-store patches did not buy back the renderer time their +1.6 fps A/B had measured. That matches the maintainer's note in TASKS: the win came from not reading whole changed heap pages, and the fix belongs in heap sync without patching title code. No new VUIDs or loud kinds in any arm. Evidence: `/home/shlong/Documents/VKtory-capture/regress88-{A1,B1,B2,A2}/`.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-02 18:38 UTC · original

Thanks for both runs. The first A/B is the measurement behind "fix it in the heap sync" in "Slim victory-gpu". The second one went into the same item: github.com/vktory6/VKtory@a58cd901dd

A note on reading the second one: port 2 was off by default on bc86e65 too, so the A/B compares two default paths, and "no change" is what we'd expect. It confirms the deletion cost nothing. The +1.5 ms of slot_reads comes from a single valid arm, too thin to judge. The renderer and heap-sync numbers from this issue are in "Descriptor heap as one array, not seven typed ones", which is where the fix will land, so I'm closing this. Thanks.

**@⁠vktory6** on GitHub · 2026-12-02 18:38 UTC · [original](https://github.com/vktory6/VKtory/issues/44#issuecomment-7354923269) Thanks for both runs. The first A/B is the measurement behind "fix it in the heap sync" in "Slim victory-gpu". The second one went into the same item: https://github.com/vktory6/VKtory/commit/a58cd901ddf9004fdcbc8a1a936f868cca0e0e5d A note on reading the second one: port 2 was off by default on `bc86e65` too, so the A/B compares two default paths, and "no change" is what we'd expect. It confirms the deletion cost nothing. The +1.5 ms of `slot_reads` comes from a single valid arm, too thin to judge. The renderer and heap-sync numbers from this issue are in "Descriptor heap as one array, not seven typed ones", which is where the fix will land, so I'm closing this. Thanks.
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/vktory6--VKtory#44
No description provided.