perf(gpu): reuse existing heap holes for card windows #209

Closed
github-bot wants to merge 2 commits from github-bot/gh-209 into main AGit
Owner

@⁠krofty on GitHub · 2026-11-27 19:48 UTC · original
perf/mixed-window-heaps → main · +1141 −37 · 6 files · 2 commits · closed without merging

Raw-address window buffers stay in system memory on an 8 GB adapter even when existing texture heap backing has usable holes. Adding separate committed window buffers increases VRAM pressure.

Add opt-in VICTORY_POOL_WINDOWS_MB (default 0) to place window card sides in compatible existing Tier2 heap holes. The factory never grows a heap or creates a committed fallback; failed admission retains the existing placement policy. Native Tier2 heaps use the valid universal flag set, with the allocator restricting texture admission to single-sample non-RT/DS resources. Other devices and optional multi-queue configurations keep the existing path.

COM-attached leases retain exclusive extents and cap/accounting reservations through bare resource clones. At final release, mixed-heap charges move into retirement and stay charged until the native fence and rest period permit actual reuse, including quarantined creation failures. Device-loss values fail closed. Fence watermarks are published before execution without acquiring the submission lock from COM release.

First use records an aliasing barrier and uploads the entire window from immutable submission memory, including zero/unrequested bytes. First-use checks discard the invalid preceding GPU representation. Existing subsequent dirty-range uploads, hashing, CPU visibility and submission retirement remain in use.

Closes #180.

Validation on the final integration:

  • Pool unit tests (13), target-room tests (3), and card-step tests (10 passed, 1 ignored) passed in separate software/native adapter processes. Card-step results do not imply that all conditional hardware cases ran.
  • Explicit WARP and RTX native fixtures passed exact texture→buffer→texture extent reuse, complete texture/buffer contents, bare-COM-clone lifetime, pending-fence refusal beyond elapsed rest, and reuse after completion.
  • Explicit production-prefix fixtures passed on both adapters: poisoned prior bytes, full initial footprint, unchanged zeros/tail, queue-blocked staging mutation after enqueue, and a later guest update. D3D12 debug-layer validation reported no error in these fixtures.
  • Diff check and formatting of the new fixture files passed. Independent source review performed.
  • Diagnostics build 295 passed through build.sh. Its preliminary baseline changed camera view before the last measurements and still had new pipelines being made, so the automatic candidate gate rejected the pair. No performance conclusion is taken from it. Corrected accounting build 296 and a shorter, identical pipeline-settled benchmark window for both variants are in progress. No FPS gain, sustained VRAM saving, or 30 FPS result is claimed yet.

Limitations: placement is at initial window creation and may miss fragmented/resting holes or hit the cap. This does not add a hotness policy or late promotion. Borrowing existing holes does not by itself prevent future texture-heap growth. The single-queue gate is deliberate. PR remains draft, open and unmerged pending game results.

**@⁠krofty** on GitHub · 2026-11-27 19:48 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/209) `perf/mixed-window-heaps` → `main` · +1141 −37 · 6 files · 2 commits · closed without merging Raw-address window buffers stay in system memory on an 8 GB adapter even when existing texture heap backing has usable holes. Adding separate committed window buffers increases VRAM pressure. Add opt-in VICTORY_POOL_WINDOWS_MB (default 0) to place window card sides in compatible existing Tier2 heap holes. The factory never grows a heap or creates a committed fallback; failed admission retains the existing placement policy. Native Tier2 heaps use the valid universal flag set, with the allocator restricting texture admission to single-sample non-RT/DS resources. Other devices and optional multi-queue configurations keep the existing path. COM-attached leases retain exclusive extents and cap/accounting reservations through bare resource clones. At final release, mixed-heap charges move into retirement and stay charged until the native fence and rest period permit actual reuse, including quarantined creation failures. Device-loss values fail closed. Fence watermarks are published before execution without acquiring the submission lock from COM release. First use records an aliasing barrier and uploads the entire window from immutable submission memory, including zero/unrequested bytes. First-use checks discard the invalid preceding GPU representation. Existing subsequent dirty-range uploads, hashing, CPU visibility and submission retirement remain in use. Closes #180. Validation on the final integration: - Pool unit tests (13), target-room tests (3), and card-step tests (10 passed, 1 ignored) passed in separate software/native adapter processes. Card-step results do not imply that all conditional hardware cases ran. - Explicit WARP and RTX native fixtures passed exact texture→buffer→texture extent reuse, complete texture/buffer contents, bare-COM-clone lifetime, pending-fence refusal beyond elapsed rest, and reuse after completion. - Explicit production-prefix fixtures passed on both adapters: poisoned prior bytes, full initial footprint, unchanged zeros/tail, queue-blocked staging mutation after enqueue, and a later guest update. D3D12 debug-layer validation reported no error in these fixtures. - Diff check and formatting of the new fixture files passed. Independent source review performed. - Diagnostics build 295 passed through build.sh. Its preliminary baseline changed camera view before the last measurements and still had new pipelines being made, so the automatic candidate gate rejected the pair. No performance conclusion is taken from it. Corrected accounting build 296 and a shorter, identical pipeline-settled benchmark window for both variants are in progress. No FPS gain, sustained VRAM saving, or 30 FPS result is claimed yet. Limitations: placement is at initial window creation and may miss fragmented/resting holes or hit the cap. This does not add a hotness policy or late promotion. Borrowing existing holes does not by itself prevent future texture-heap growth. The single-queue gate is deliberate. PR remains draft, open and unmerged pending game results.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 19:52:57 +00:00
github-bot closed this pull request 2026-11-28 01:24:23 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.