perf(gpu,hle): Phase 1-3 CPU & GPU pipeline optimizations (-45% frame time, -48% GPU list time) #1053

Open
github-bot wants to merge 2 commits from github-bot/gh-1053 into main AGit
Owner

@⁠x0sman on GitHub · 2026-11-25 17:36 UTC · original
x0sman:perf/rtx5070-gta6-p123 → main · +4203 −492 · 20 files · 2 commits · open

Summary

Hardware-verified performance & stability optimizations for heavy D3D12 workloads (tested in 95s live 3D gameplay on RTX 5070 Laptop GPU 8 GB / 7,123 MiB VRAM budget, 0 crashes).

Base note: Built on \

**@⁠x0sman** on GitHub · 2026-11-25 17:36 UTC · [original](https://github.com/fxceless/victory-fork/pull/1053) `x0sman:perf/rtx5070-gta6-p123` → `main` · +4203 −492 · 20 files · 2 commits · open ## Summary Hardware-verified performance & stability optimizations for heavy D3D12 workloads (tested in 95s live 3D gameplay on **RTX 5070 Laptop GPU 8 GB / 7,123 MiB VRAM budget**, 0 crashes). > **Base note:** Built on \
Hardware-verified on RTX 5070 Laptop GPU (8 GB) in 95s 3D gameplay (0 crashes).

Includes upstream PRs (#1677, #987, #188, #610) plus Phase 1-3 changes:
- descriptor/host.rs: lock-free AtomicU64 + 64-striped slot_locks/kept in HostHeap::mirror
- host.rs & queue.rs: victory-reaper background thread for COM/late-wait drops; Held::Present 2nd MPO plane support for VICTORY_ASYNC_PRESENT=1
- xmem.rs: XMemMapPhysicalPagesScatter single-lock hoisting, no-op skipping, exact 64 KiB placeholder fast path (preserving 64 KiB page independence)
- shadow.rs: move D3D12 buffer allocations (shared_buffer, card_for, window_card_for, place_for) outside BUFFERS/LOOSE write locks
- draw.rs, host.rs, indirect.rs, list.rs: 2-slot isolated indirect_window_scratch ring synced with draw::State::windows, remove post-clamp global UAV(None) barrier, use targeted uav_barrier_for(src/count) via UAV cleanliness tracking, default VICTORY_TEXTURE_STAGE_MB=48

Measured 1000 Hz profile (baseline -> Phase 3):
- usual frame: 183.2 ms -> 102 ms (-45%)
- GPU all other lists: 70.3 ms -> 36.4 ms (-48%)
- GPU card busy: 47% -> 68%
- shadow RwLock wait: 93.46 ms (P1+2) -> 0.00 ms (-100%)
- execute_indirect: 167.05 ms (P1+2) -> 78.10 ms (-53%)
# Conflicts:
#	crates/victory-gpu/src/draw.rs
#	crates/victory-gpu/src/shadow.rs
#	crates/victory-gpu/src/watch.rs
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:56:44 +00:00
Author
Owner

@⁠MKmajster on GitHub · 2026-11-25 18:47 UTC · original

Tried on one machine: RTX 3070 8 GB, 16 GB RAM, Series S profile. The tree was main ca8829f with #1016/#1014/#1020/#1032 and the fast switches (INDIRECT_WINDOW, INDIRECT_GATHER, COPY_PLAIN, JOIN_PARTS, BACK_OWN_VIEW, ASYNC_SUBMIT, QUEUE2). Merging this PR on top needed three small resolutions:

  • indirect.rs bound_window: clamp_for(spec.2) from #1016 with this PR's window scratch ring;
  • the held present keeps the Series S overlay;
  • slice.section.0 → slice.section.handle after main's Section struct.

Result: a 142 ms median against 144 and 155 ms for two runs without it. That is within this machine's run-to-run spread, so I could not see the −45 % here. Most of what the PR removes may already be gone on this tree with those switches. No errors. The xmem tests (25) pass.

AI-assisted (Claude Code). No game data attached.

**@⁠MKmajster** on GitHub · 2026-11-25 18:47 UTC · [original](https://github.com/fxceless/victory-fork/pull/1053#issuecomment-7171398247) Tried on one machine: RTX 3070 8 GB, 16 GB RAM, Series S profile. The tree was `main` ca8829f with #1016/#1014/#1020/#1032 and the fast switches (`INDIRECT_WINDOW`, `INDIRECT_GATHER`, `COPY_PLAIN`, `JOIN_PARTS`, `BACK_OWN_VIEW`, `ASYNC_SUBMIT`, `QUEUE2`). Merging this PR on top needed three small resolutions: - `indirect.rs` `bound_window`: `clamp_for(spec.2)` from #1016 with this PR's window scratch ring; - the held present keeps the Series S overlay; - `slice.section.0` → `slice.section.handle` after main's `Section` struct. Result: a 142 ms median against 144 and 155 ms for two runs without it. That is within this machine's run-to-run spread, so I could not see the −45 % here. Most of what the PR removes may already be gone on this tree with those switches. No errors. The xmem tests (25) pass. AI-assisted (Claude Code). No game data attached.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor/host.rs
  • crates/victory-gpu/src/draw.rs
  • crates/victory-gpu/src/host.rs
  • crates/victory-gpu/src/indirect.rs
  • crates/victory-gpu/src/lib.rs
  • crates/victory-gpu/src/resource.rs
  • crates/victory-gpu/src/shadow.rs
  • crates/victory-gpu/src/watch.rs
  • crates/victory-hle/src/modules/xmem.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/1053/head:github-bot/gh-1053'
git switch 'github-bot/gh-1053'

Merge

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