perf(descriptor): skip unused list-view raw twins and coalesce heap-sync rounds #9

Manually merged
github merged 1 commit from github-bot/gh-9 into mega-upgrade-v3 2026-12-04 20:20:13 +00:00 AGit
Owner

@⁠MahanYTT on GitHub · 2026-12-04 17:55 UTC · original
MahanYTT:perf/descriptor-raw-twins → mega-upgrade-v3 · +303 −61 · 2 files · 1 commits · merged 2026-12-04 20:18 UTC

Summary

Fixes two descriptor hot-path bottlenecks identified in the 1440p RTX 5070 Ti gameplay log (12,249 raw buffer view twins created/frame and 1.23 ms/frame write-watch asking for 44 changed heap pages):

  1. Skip unused raw buffer view twins (crates/victory-gpu/src/descriptor/host.rs): HostHeap::make_listed previously passed Some(views.slot(at + 1)) unconditionally even when raw_twins=false (self.twins empty on capped 1M-slot heaps), creating 12,249 unused D3D12 SRVs/UAVs per frame and halving ListViews capacity. Now reserves 2 slots and creates a twin only when self.twins is populated and twinned(&view) is true (doubling ListViews capacity from 4,096 to 8,192 views). Also guards self.twin(index) in make_at/mirror behind twinned(view).
  2. Coalesce queued sync_heaps rounds & skip empty batches (crates/victory-gpu/src/descriptor.rs): Replaced (u64, u64) in SYNC_ROUNDS with SyncRounds { asked, started, done } so victory-heap-sync claims and coalesces all queued rounds arrived before a scan starts instead of running redundant back-to-back 19.4 MB GetWriteWatch scans. Added empty-batch early exits in sync_heaps().
  3. Unit tests: Added 5 unit tests covering list_view_slot_plan, cache compatibility, and SyncRounds coalescing/invariants.
**@⁠MahanYTT** on GitHub · 2026-12-04 17:55 UTC · [original](https://github.com/MahanYTT/VIctory-MA/pull/9) `MahanYTT:perf/descriptor-raw-twins` → `mega-upgrade-v3` · +303 −61 · 2 files · 1 commits · merged 2026-12-04 20:18 UTC ## Summary Fixes two descriptor hot-path bottlenecks identified in the 1440p RTX 5070 Ti gameplay log (12,249 raw buffer view twins created/frame and 1.23 ms/frame write-watch asking for 44 changed heap pages): 1. **Skip unused raw buffer view twins (`crates/victory-gpu/src/descriptor/host.rs`)**: `HostHeap::make_listed` previously passed `Some(views.slot(at + 1))` unconditionally even when `raw_twins=false` (`self.twins` empty on capped 1M-slot heaps), creating 12,249 unused D3D12 SRVs/UAVs per frame and halving `ListViews` capacity. Now reserves 2 slots and creates a twin only when `self.twins` is populated and `twinned(&view)` is true (doubling `ListViews` capacity from 4,096 to 8,192 views). Also guards `self.twin(index)` in `make_at`/`mirror` behind `twinned(view)`. 2. **Coalesce queued `sync_heaps` rounds & skip empty batches (`crates/victory-gpu/src/descriptor.rs`)**: Replaced `(u64, u64)` in `SYNC_ROUNDS` with `SyncRounds { asked, started, done }` so `victory-heap-sync` claims and coalesces all queued rounds arrived before a scan starts instead of running redundant back-to-back 19.4 MB `GetWriteWatch` scans. Added empty-batch early exits in `sync_heaps()`. 3. **Unit tests**: Added 5 unit tests covering `list_view_slot_plan`, cache compatibility, and `SyncRounds` coalescing/invariants.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 17:55:27 +00:00
github manually merged commit 4ba58378c8 into mega-upgrade-v3 2026-12-04 20:20:13 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.