GPU: cut per-slot lock churn, self-requeueing, and duplicate shadow lookups in sync_heaps and heap_buffers #1043

Open
github-bot wants to merge 1 commit from github-bot/gh-1043 into main AGit
Owner

@⁠UwUCammie on GitHub · 2026-11-25 17:15 UTC · original
UwUCammie:pr/sync-heaps-heap-buffers-opt → main · +393 −105 · 3 files · 1 commits · open

While profiling frame time on RX 7900 XT under Wine, sync_heaps was taking ~48–64 ms/frame on the submit thread and heap_buffers was taking ~82–147 ms/frame on the recording thread. Tracing the two loops turned up several pieces of redundant per-slot work:

What changed

  • Stop heap_buffers from re-queuing itself (mirror_heap_buffer): heap_buffers popped host.buffer_changes() and called host.mirror(index, handle, true), which called note_buffer and inserted every mirrored slot right back into self.changed for the next frame (~17k–19k unchanged slots/frame on our runs). Added HostHeap::mirror_heap_buffer passing record_change = false so the pass doesn't feed itself.
  • Avoid redundant per-slot locks in sync_heaps and note_buffer:
    • Added a 1-byte/slot AtomicU8 flag array (SLOT_IN_TEXTURES, SLOT_IN_PLACED, SLOT_IN_BUFFERS) on HostHeap so buffer slots don't lock self.textures, self.placed, or self.buffers when they aren't in those sets (or are already in buffers).
    • Batched self.made and self.changed locks once per page in mirror_copied_page instead of once per mirrored slot (~42k/frame).
    • Skipped calling view_at(0, 0) (which acquired VIEWS.read()) and skipped null_for + keep(index, None) when later && made[index] == 0 (the slot is already null from fill_null).
    • Reused one 64 KiB page_bytes buffer and one due: Vec across pages in sync_heaps instead of zero-filling and allocating per page.
  • Avoid duplicate shadow::find lookups in heap_buffers and buffer_copy:
    • buffer_copy now computes buffer_extent and shadow::find(base, width) once instead of twice when own_bytes doesn't match.
    • buffer_srv / buffer_uav return the resolved BufferCopy directly from make, so mirror_heap_buffer hands it straight back to heap_buffers without calling buffer_copy or host.shows a second time for freshly-made views.
    • heap_buffers updates ranges in place via get_mut instead of remove + insert, and pre-sizes spans.

Tested

  • RX 7900 XT, CachyOS Linux, Wine 11.22 + vkd3d-proton + RADV, 480–540 s gameplay passes (to frame 5100):
    • sync_heaps: 48.4 ms → 24.0–25.6 ms (~24 ms/frame saved on the submit thread).
    • heap_buffers: 102–147 ms (50k slots, ~18k unchanged churn) → 58.6–60.8 ms (29k slots, ~110 unchanged).
    • Overall gameplay frame time on VICTORY_RELAY=2 moved from 136–144 ms (~7.1 fps) down to 116–117 ms (8.5 fps, 97 ms shortest) alongside 465b94f + #1007, with 0 device removals and identical frame captures.
  • Cleanly builds (diag + victory-gpu tests) on 465b94f.
**@⁠UwUCammie** on GitHub · 2026-11-25 17:15 UTC · [original](https://github.com/fxceless/victory-fork/pull/1043) `UwUCammie:pr/sync-heaps-heap-buffers-opt` → `main` · +393 −105 · 3 files · 1 commits · open While profiling frame time on RX 7900 XT under Wine, `sync_heaps` was taking ~48–64 ms/frame on the submit thread and `heap_buffers` was taking ~82–147 ms/frame on the recording thread. Tracing the two loops turned up several pieces of redundant per-slot work: ### What changed - **Stop `heap_buffers` from re-queuing itself (`mirror_heap_buffer`):** `heap_buffers` popped `host.buffer_changes()` and called `host.mirror(index, handle, true)`, which called `note_buffer` and inserted every mirrored slot right back into `self.changed` for the next frame (~17k–19k unchanged slots/frame on our runs). Added `HostHeap::mirror_heap_buffer` passing `record_change = false` so the pass doesn't feed itself. - **Avoid redundant per-slot locks in `sync_heaps` and `note_buffer`:** - Added a 1-byte/slot `AtomicU8` flag array (`SLOT_IN_TEXTURES`, `SLOT_IN_PLACED`, `SLOT_IN_BUFFERS`) on `HostHeap` so buffer slots don't lock `self.textures`, `self.placed`, or `self.buffers` when they aren't in those sets (or are already in `buffers`). - Batched `self.made` and `self.changed` locks once per page in `mirror_copied_page` instead of once per mirrored slot (~42k/frame). - Skipped calling `view_at(0, 0)` (which acquired `VIEWS.read()`) and skipped `null_for` + `keep(index, None)` when `later && made[index] == 0` (the slot is already null from `fill_null`). - Reused one 64 KiB `page_bytes` buffer and one `due: Vec` across pages in `sync_heaps` instead of zero-filling and allocating per page. - **Avoid duplicate `shadow::find` lookups in `heap_buffers` and `buffer_copy`:** - `buffer_copy` now computes `buffer_extent` and `shadow::find(base, width)` once instead of twice when `own_bytes` doesn't match. - `buffer_srv` / `buffer_uav` return the resolved `BufferCopy` directly from `make`, so `mirror_heap_buffer` hands it straight back to `heap_buffers` without calling `buffer_copy` or `host.shows` a second time for freshly-made views. - `heap_buffers` updates `ranges` in place via `get_mut` instead of `remove` + `insert`, and pre-sizes `spans`. ### Tested - RX 7900 XT, CachyOS Linux, Wine 11.22 + vkd3d-proton + RADV, 480–540 s gameplay passes (to frame 5100): - `sync_heaps`: `48.4 ms` → `24.0–25.6 ms` (~24 ms/frame saved on the submit thread). - `heap_buffers`: `102–147 ms` (50k slots, ~18k unchanged churn) → `58.6–60.8 ms` (29k slots, ~110 unchanged). - Overall gameplay frame time on `VICTORY_RELAY=2` moved from `136–144 ms` (`~7.1 fps`) down to `116–117 ms` (`8.5 fps`, `97 ms` shortest) alongside `465b94f` + #1007, with 0 device removals and identical frame captures. - Cleanly builds (`diag` + `victory-gpu` tests) on `465b94f`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:56:32 +00:00
Author
Owner

@⁠Ym1r1710 on GitHub · 2026-11-25 17:48 UTC · original

Ran this on Windows, RTX 5080 + 7800X3D, on top of ca8829f (RELAY=2, QUEUE2, ASYNC_SUBMIT, INDIRECT_WINDOW, TEXTURE_NO_WAIT, COPY_PLAIN). The "heap buffers" pass time on the frame line went from about 27-36 ms to 12-16 ms per frame. Overall frame time didn't move here though (median ~126 ms vs ~122 ms before, inside my run-to-run noise), so the recording thread isn't what holds my frames back. Picture at world+250 and +400 is the same as before, no missing or wrong surfaces. Keeping it in my build.

**@⁠Ym1r1710** on GitHub · 2026-11-25 17:48 UTC · [original](https://github.com/fxceless/victory-fork/pull/1043#issuecomment-7170021301) Ran this on Windows, RTX 5080 + 7800X3D, on top of ca8829f (RELAY=2, QUEUE2, ASYNC_SUBMIT, INDIRECT_WINDOW, TEXTURE_NO_WAIT, COPY_PLAIN). The "heap buffers" pass time on the frame line went from about 27-36 ms to 12-16 ms per frame. Overall frame time didn't move here though (median ~126 ms vs ~122 ms before, inside my run-to-run noise), so the recording thread isn't what holds my frames back. Picture at world+250 and +400 is the same as before, no missing or wrong surfaces. Keeping it in my build.
Author
Owner

@⁠UwUCammie on GitHub · 2026-11-25 18:09 UTC · original

Thanks for testing it on Windows! Good to see heap buffers drop by more than half there too (27-36 -> 12-16 ms). Makes sense total frame time didn't move yet if the submit/landing thread is still the critical path in RELAY=2 — heap buffers runs on the recording side.

**@⁠UwUCammie** on GitHub · 2026-11-25 18:09 UTC · [original](https://github.com/fxceless/victory-fork/pull/1043#issuecomment-7170521348) Thanks for testing it on Windows! Good to see `heap buffers` drop by more than half there too (27-36 -> 12-16 ms). Makes sense total frame time didn't move yet if the submit/landing thread is still the critical path in `RELAY=2` — `heap buffers` runs on the recording side.
Author
Owner

@⁠Proudnoob4 on GitHub · 2026-11-25 18:28 UTC · original

Tested on Windows 10 (i5-13600K + RTX 4080 16 GB, driver 621.01, Series X, warm shader cache) bundled on top of Xeltax/VIcky vicky/rt (3fbc9cb8, live BVH RT) alongside #1014, #1015, #1029, #1044, #1058, and #1059 (so the delta is the combined stack, not #1043 in isolation).

RTX 4080 live-RT A/B (3fbc9cb8 warm 300s vs stacked 420s)

  • World FPS (>1000 draws): median 3.3 -> 5.05 fps (mean 2.46 -> 4.12, max 4.6 -> 5.7, steady tail 4.8–5.7 fps)
  • framelog usual frame: 278 ms -> 176–180 ms over last 64 (shortest 155 ms)
  • submit thread: 237.0 ms (user 187.5) -> 175.9–179.6 ms (user 97.2–114.2); card idle 188.8 -> 116.7–119.2 ms
  • heap buffers: 162.9–172.3 ms (on 3fbc9cb8) -> 120.6 ms (14.6–17.5 ms in the texture pass; 63,960–128,787 buffer slots looked at)
  • Visuals / stability: exit 0, clean cell window/yard capture with VICTORY_BVH_BUILDER=1 + VICTORY_BVH_COPY=skip.

Porting note for HEAP_MAP forks: when rebasing #1043 onto SlotMap (Xeltax/VIcky), slot_flags should be sized to titled (matching tabled) rather than count, empty_slot/reclaim/mirror_with_made should keep routing descriptor slot writes through host = made.host(index), and View::NullConstant in make() becomes Some((None, None)).cargo test -p victory-gpu descriptor passed locally with that adaptation.

AI-assisted benchmark and analysis (Gemini 4 Hydrogen).

**@⁠Proudnoob4** on GitHub · 2026-11-25 18:28 UTC · [original](https://github.com/fxceless/victory-fork/pull/1043#issuecomment-7170955614) Tested on Windows 10 (i5-13600K + RTX 4080 16 GB, driver 621.01, Series X, warm shader cache) bundled on top of `Xeltax/VIcky` `vicky/rt` (`3fbc9cb8`, live BVH RT) alongside #1014, #1015, #1029, #1044, #1058, and #1059 (so the delta is the combined stack, not #1043 in isolation). ### RTX 4080 live-RT A/B (`3fbc9cb8` warm 300s vs stacked 420s) - **World FPS (>1000 draws):** median `3.3 -> 5.05 fps` (mean `2.46 -> 4.12`, max `4.6 -> 5.7`, steady tail `4.8–5.7 fps`) - **`framelog` usual frame:** `278 ms -> 176–180 ms` over last 64 (`shortest 155 ms`) - **`submit thread`:** `237.0 ms (user 187.5) -> 175.9–179.6 ms (user 97.2–114.2)`; `card idle` `188.8 -> 116.7–119.2 ms` - **`heap buffers`:** `162.9–172.3 ms` (on `3fbc9cb8`) `-> 120.6 ms` (`14.6–17.5 ms` in the texture pass; `63,960–128,787` buffer slots looked at) - **Visuals / stability:** exit 0, clean cell window/yard capture with `VICTORY_BVH_BUILDER=1` + `VICTORY_BVH_COPY=skip`. **Porting note for `HEAP_MAP` forks:** when rebasing #1043 onto `SlotMap` (`Xeltax/VIcky`), `slot_flags` should be sized to `titled` (matching `tabled`) rather than `count`, `empty_slot`/`reclaim`/`mirror_with_made` should keep routing descriptor slot writes through `host = made.host(index)`, and `View::NullConstant` in `make()` becomes `Some((None, None))`.`cargo test -p victory-gpu descriptor` passed locally with that adaptation. *AI-assisted benchmark and analysis (Gemini 4 Hydrogen).*
Author
Owner

@⁠LeonardoS11 on GitHub · 2026-11-25 19:06 UTC · original

Numbers for this from an RTX 3080 Ti on Windows — it helps here too.

Windows 11, RTX 3080 Ti 12 GB, 64 GB RAM, diag build with diagnostics, Series X profile, a still scene in the prologue (the room with the window onto the yard, about 4,800 draws), 300 s a run, averages of the last 8 frame-rate lines. Same switches in every run: VICTORY_LEVELS_ON_DEMAND=1 VICTORY_INDIRECT_WINDOW=1 VICTORY_COPY_PLAIN=1 VICTORY_BACK_OWN_VIEW=1 VICTORY_JOIN_PARTS=1 VICTORY_INDIRECT_GATHER=1. Runs interleaved, after one warm-up run of each build.

ms a frame "heap buffers … ms" in the frame line
465b94f 183, 183 51, 86
465b94f + this PR (5acc7c5) 167, 173 29, 33

So about 13 ms a frame, and the heap pass roughly halved. The picture was complete in all of them (walls, the mesh in the window, the lit shirt), no device loss. cargo test --workspace with the PR: 577 passed, 12 ignored, 0 failed.

Two notes from our side, where we had been working on the same pass:

  • We had measured the single made lock as contended on this machine — found taken 12,000 to 16,000 times a frame, 76 to 115 ms waited in sum across threads — and replaced it with an atomic key per slot plus striped locks for making. On top of this PR (your page batch rewritten over that, so it takes no lock) the lock is found taken 6 to 26 times a frame, but the frame time is the same within noise: 184 and 169 ms. So your batching already removes what mattered; I mention it only in case the lock shows up on a machine with more recording threads. The branch is LeonardoS11/victory-fork port/v9 history if anyone wants it; I will not open a competing PR.
  • The pass feeding itself is also what kept our marked-slots pass (#467) at about 15,000 slots a frame whatever we cut. With record_change = false taken into that branch, the first run shows 9,800 slots looked at; I will post the rest on #467.

(Runs by me on the hardware above; written with Claude Code.)

**@⁠LeonardoS11** on GitHub · 2026-11-25 19:06 UTC · [original](https://github.com/fxceless/victory-fork/pull/1043#issuecomment-7171830112) Numbers for this from an RTX 3080 Ti on Windows — it helps here too. Windows 11, RTX 3080 Ti 12 GB, 64 GB RAM, `diag` build with `diagnostics`, Series X profile, a still scene in the prologue (the room with the window onto the yard, about 4,800 draws), 300 s a run, averages of the last 8 frame-rate lines. Same switches in every run: `VICTORY_LEVELS_ON_DEMAND=1 VICTORY_INDIRECT_WINDOW=1 VICTORY_COPY_PLAIN=1 VICTORY_BACK_OWN_VIEW=1 VICTORY_JOIN_PARTS=1 VICTORY_INDIRECT_GATHER=1`. Runs interleaved, after one warm-up run of each build. | | ms a frame | "heap buffers … ms" in the frame line | |---|---|---| | 465b94f | 183, 183 | 51, 86 | | 465b94f + this PR (5acc7c5) | 167, 173 | 29, 33 | So about 13 ms a frame, and the heap pass roughly halved. The picture was complete in all of them (walls, the mesh in the window, the lit shirt), no device loss. `cargo test --workspace` with the PR: 577 passed, 12 ignored, 0 failed. Two notes from our side, where we had been working on the same pass: - We had measured the single `made` lock as contended on this machine — found taken 12,000 to 16,000 times a frame, 76 to 115 ms waited in sum across threads — and replaced it with an atomic key per slot plus striped locks for making. On top of this PR (your page batch rewritten over that, so it takes no lock) the lock is found taken 6 to 26 times a frame, but the frame time is the same within noise: 184 and 169 ms. So your batching already removes what mattered; I mention it only in case the lock shows up on a machine with more recording threads. The branch is `LeonardoS11/victory-fork` `port/v9` history if anyone wants it; I will not open a competing PR. - The pass feeding itself is also what kept our marked-slots pass (#467) at about 15,000 slots a frame whatever we cut. With `record_change = false` taken into that branch, the first run shows 9,800 slots looked at; I will post the rest on #467. (Runs by me on the hardware above; written with Claude Code.)
Author
Owner

@⁠UwUCammie on GitHub · 2026-11-25 19:12 UTC · original

Thanks for the detailed runs @⁠LeonardoS11 and @⁠Proudnoob4!

Really nice to see the −13 ms/frame drop and 577/577 workspace tests on Windows 11 too, and glad the record_change = false fix helped #467's slot count as well. Good to know the atomic made fast path only matters once you have heavier concurrent recording — I've been testing that + CopyDescriptors null batching locally too and will keep follow-ups small and separate after this one.

**@⁠UwUCammie** on GitHub · 2026-11-25 19:12 UTC · [original](https://github.com/fxceless/victory-fork/pull/1043#issuecomment-7171975274) Thanks for the detailed runs @⁠LeonardoS11 and @⁠Proudnoob4! Really nice to see the −13 ms/frame drop and 577/577 workspace tests on Windows 11 too, and glad the `record_change = false` fix helped #467's slot count as well. Good to know the atomic `made` fast path only matters once you have heavier concurrent recording — I've been testing that + `CopyDescriptors` null batching locally too and will keep follow-ups small and separate after this one.
Author
Owner

@⁠rafaconvaitis on GitHub · 2026-11-25 19:45 UTC · original

Isolated follow-up on the self-requeue part of this PR, on Flamingo 63d976b, RTX 4070 (616.64), Ryzen 9 5900X, 32 GB, native Windows/D3D12. Series S, Relay 1, async submit off, plain copies, warm pipeline cache. I adapted just the already-described self-requeue suppression to Flamingo's existing slot-generation/stripe path. New writes, snapshot mismatches, failed makes and unresolved buffer copies retain their notifications.

Same executable and process, 20 s alternating intervals, with four whole intervals per mode in each fixed-camera scene. I excluded the first second and any sample crossing a boundary.

Metric Room/window, off → on Common room, off → on
Measured presents 343 → 389 493 → 504
Median slots inspected 15,385 → 9,875 13,208 → 9,344
Median inspection time 33.0 → 32.0 ms 32.1 → 25.6 ms
Median refreshed copies 4,284 → 4,283 4,206 → 4,208
Median draws/frame 4,306 → 4,400 3,968 → 4,088
P50 / P95 frame time 131 / 164 → 128 / 160.6 ms 121 / 159.4 → 120 / 153.0 ms
Effective FPS 7.53 → 7.65 8.10 → 8.31

The reduction in inspected slots replicates the direction of the 3080 Ti self-requeue-only report. It reduced the inspection time materially in the common room, with a small effect on overall frame throughput. Raw descriptor sync still took roughly 20.6–20.8 ms/frame, and typical frame summaries still spent about 110–123 ms in submit calls. Opposite-phase captures showed the same scene and the number of refreshed copies was steady. The focused tests also covered preserving a separate producer's dirty mark, invalidation, and retry of an unresolved buffer.

**@⁠rafaconvaitis** on GitHub · 2026-11-25 19:45 UTC · [original](https://github.com/fxceless/victory-fork/pull/1043#issuecomment-7172721860) Isolated follow-up on the self-requeue part of this PR, on **Flamingo `63d976b`**, RTX 4070 (616.64), Ryzen 9 5900X, 32 GB, native Windows/D3D12. Series S, Relay 1, async submit off, plain copies, warm pipeline cache. I adapted just the already-described self-requeue suppression to Flamingo's existing slot-generation/stripe path. New writes, snapshot mismatches, failed makes and unresolved buffer copies retain their notifications. Same executable and process, 20 s alternating intervals, with four whole intervals per mode in each fixed-camera scene. I excluded the first second and any sample crossing a boundary. | Metric | Room/window, off → on | Common room, off → on | |---|---:|---:| | Measured presents | 343 → 389 | 493 → 504 | | Median slots inspected | 15,385 → 9,875 | 13,208 → 9,344 | | Median inspection time | 33.0 → 32.0 ms | 32.1 → 25.6 ms | | Median refreshed copies | 4,284 → 4,283 | 4,206 → 4,208 | | Median draws/frame | 4,306 → 4,400 | 3,968 → 4,088 | | P50 / P95 frame time | 131 / 164 → 128 / 160.6 ms | 121 / 159.4 → 120 / 153.0 ms | | Effective FPS | 7.53 → 7.65 | 8.10 → 8.31 | The reduction in inspected slots replicates the direction of the 3080 Ti self-requeue-only report. It reduced the inspection time materially in the common room, with a small effect on overall frame throughput. Raw descriptor sync still took roughly 20.6–20.8 ms/frame, and typical frame summaries still spent about 110–123 ms in submit calls. Opposite-phase captures showed the same scene and the number of refreshed copies was steady. The focused tests also covered preserving a separate producer's dirty mark, invalidation, and retry of an unresolved buffer.
Author
Owner

@⁠rafaconvaitis on GitHub · 2026-11-25 20:26 UTC · original

Follow-up to my RTX 4070/Windows result above, with finer timers on the same Flamingo 63d976b line. Same Series S checkpoint, warm cache, Relay 1, async submit off, in-world fixed camera. Instrumentation and the REFRESH_ONCE comparison were armed after entering the controllable scene.

For the unoptimized control (69 matched per-second samples), the raw descriptor sync interval measured 22.07 ms/frame median: 2.40 ms finding dirty ranges, 1.91 ms reading pages, 3.05 ms scanning/fingerprinting records under the copied-record lock, and 14.24 ms applying the due records. Outer heap-lock acquisition rounded to 0.00 ms. Typical work was about 257k records inspected and 11.8k due records/frame. These are nested timings and the medians do not sum exactly. The application loop, rather than page reads or fingerprints, was the largest part of descriptor sync on this particular workload.

For context, the independent VICTORY_REFRESH_ONCE=alt test in the same process (four complete intervals per mode) recorded 1,432 reused refresh requests/frame when on, but actual refresh calls fell only from 5,861 to 5,539, and effective FPS was 7.71 vs 7.76, P95 174 vs 177 ms. The raw descriptor breakdown barely moved. This is a baseline for choosing which of the isolated changes here to measure next, not a test of the remaining changes in this PR.

**@⁠rafaconvaitis** on GitHub · 2026-11-25 20:26 UTC · [original](https://github.com/fxceless/victory-fork/pull/1043#issuecomment-7173667779) Follow-up to my RTX 4070/Windows result above, with finer timers on the same Flamingo `63d976b` line. Same Series S checkpoint, warm cache, Relay 1, async submit off, in-world fixed camera. Instrumentation and the `REFRESH_ONCE` comparison were armed after entering the controllable scene. For the unoptimized control (69 matched per-second samples), the raw descriptor sync interval measured **22.07 ms/frame** median: **2.40 ms** finding dirty ranges, **1.91 ms** reading pages, **3.05 ms** scanning/fingerprinting records under the copied-record lock, and **14.24 ms** applying the due records. Outer heap-lock acquisition rounded to 0.00 ms. Typical work was about 257k records inspected and 11.8k due records/frame. These are nested timings and the medians do not sum exactly. The application loop, rather than page reads or fingerprints, was the largest part of descriptor sync on this particular workload. For context, the independent `VICTORY_REFRESH_ONCE=alt` test in the same process (four complete intervals per mode) recorded 1,432 reused refresh requests/frame when on, but actual refresh calls fell only from 5,861 to 5,539, and effective FPS was 7.71 vs 7.76, P95 174 vs 177 ms. The raw descriptor breakdown barely moved. This is a baseline for choosing which of the isolated changes here to measure next, not a test of the remaining changes in this PR.
Author
Owner

@⁠UwUCammie on GitHub · 2026-11-25 20:49 UTC · original

The RX 7900 XT shows the same ordering as the RTX 4070 report above. In the prison scene, my local stack with #1043, parallel heap scanning and batched null descriptors spent a median 12.71 ms/frame applying due records, 4.89 ms scanning pages in parallel and sorting the results, 2.46 ms collecting dirty ranges, and 0.51 ms acquiring the outer heap locks. The scan timer includes worker setup and join. Total descriptor sync was 21.64 ms/frame at roughly 356k inspected slots and 32k mirrored slots. The phase medians were taken separately.

CachyOS, Wine 11.22, vkd3d-proton, RADV 26.3.1. These are 23 reporting intervals from seconds 270–390 of a scripted run with relay 2 and async submit. Separately, watch::writes workers spent 127 ms/frame in aggregate acquiring the journal lock. That measures overlapping worker waits and can’t be subtracted from frame time. This run profiles the stack; it doesn’t isolate the effect of #1043.

**@⁠UwUCammie** on GitHub · 2026-11-25 20:49 UTC · [original](https://github.com/fxceless/victory-fork/pull/1043#issuecomment-7174248808) The RX 7900 XT shows the same ordering as the RTX 4070 report above. In the prison scene, my local stack with #1043, parallel heap scanning and batched null descriptors spent a median **12.71 ms/frame applying due records**, 4.89 ms scanning pages in parallel and sorting the results, 2.46 ms collecting dirty ranges, and 0.51 ms acquiring the outer heap locks. The scan timer includes worker setup and join. Total descriptor sync was 21.64 ms/frame at roughly 356k inspected slots and 32k mirrored slots. The phase medians were taken separately. CachyOS, Wine 11.22, vkd3d-proton, RADV 26.3.1. These are 23 reporting intervals from seconds 270–390 of a scripted run with relay 2 and async submit. Separately, `watch::writes` workers spent 127 ms/frame in aggregate acquiring the journal lock. That measures overlapping worker waits and can’t be subtracted from frame time. This run profiles the stack; it doesn’t isolate the effect of #1043.
Author
Owner

@⁠rafaconvaitis on GitHub · 2026-11-25 22:20 UTC · original

I measured the typed-null descriptor reuse opportunity on the pinned Flamingo 63d976b base, native D3D12 on an RTX 4070 (616.64), Series S. This isolates replacing fresh deferred CBV/raw SRV/typed UAV nulls with copies from an immutable CPU heap. A native debug-layer readback test confirmed identical null behavior and restoration of the live descriptors.

Once the prison checkpoint loaded and the camera responded, I alternated modes every 20 seconds in one process with fixed camera and the same cache. Four complete windows per mode yielded 413 presents off and 415 on in intervals entirely contained in their windows. The median on-mode rate was 5,004.8 typed-null copies per frame. Effective FPS was 8.187 off and 8.188 on. Per-frame medians were 12.98 and 12.81 ms for applying descriptor records, and 20.66 and 20.05 ms for overall descriptor sync. P95 frame time was 162 and 165 ms. Draw count medians were 4,357 and 4,529, so the workload still had natural variation.

This implementation is local and opt-in. The fixed-scene data suggests this part of driver descriptor creation alone has little leverage on this scene's frame rate.

**@⁠rafaconvaitis** on GitHub · 2026-11-25 22:20 UTC · [original](https://github.com/fxceless/victory-fork/pull/1043#issuecomment-7176245807) I measured the typed-null descriptor reuse opportunity on the pinned Flamingo 63d976b base, native D3D12 on an RTX 4070 (616.64), Series S. This isolates replacing fresh deferred CBV/raw SRV/typed UAV nulls with copies from an immutable CPU heap. A native debug-layer readback test confirmed identical null behavior and restoration of the live descriptors. Once the prison checkpoint loaded and the camera responded, I alternated modes every 20 seconds in one process with fixed camera and the same cache. Four complete windows per mode yielded 413 presents off and 415 on in intervals entirely contained in their windows. The median on-mode rate was 5,004.8 typed-null copies per frame. Effective FPS was 8.187 off and 8.188 on. Per-frame medians were 12.98 and 12.81 ms for applying descriptor records, and 20.66 and 20.05 ms for overall descriptor sync. P95 frame time was 162 and 165 ms. Draw count medians were 4,357 and 4,529, so the workload still had natural variation. This implementation is local and opt-in. The fixed-scene data suggests this part of driver descriptor creation alone has little leverage on this scene's frame rate.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor.rs
  • crates/victory-gpu/src/descriptor/host.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1043/head:github-bot/gh-1043'
git switch 'github-bot/gh-1043'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1043'
git switch 'github-bot/gh-1043'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1043'
git switch 'github-bot/gh-1043'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1043'
git switch 'main'
git merge --squash 'github-bot/gh-1043'
git switch 'main'
git merge --ff-only 'github-bot/gh-1043'
git switch 'main'
git merge 'github-bot/gh-1043'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.