Add opt-in stable buffer-window reuse and GPU diagnostics #2884

Open
github-bot wants to merge 6 commits from github-bot/gh-2884 into main AGit
Owner

@⁠Experimental-projects-420 on GitHub · 2026-11-29 18:31 UTC · original
Experimental-projects-420:experiment/stable-window-reuse-20261129 → main · +655 −60 · 12 files · 6 commits · draft

What it changes

Overlapping buffer copies can increase memory use. Reusing an existing covering buffer requires a stable mapping: existing descriptors must continue to reference the buffer receiving updates.

This adds experimental VICTORY_WINDOW_REUSE=1, off by default:

  • Reuses existing windows covering the entire aligned range for known-length descriptor views.
  • Preserves that choice through a bounded, non-owning alias table.
  • Retains existing resource-lifetime checks and excludes growing-window/tail modes.
  • Rejects live A/B switching because changing the mapping during a run could leave descriptors pointing at stale buffers.

Separate commits add bounded memory/skipped-render diagnostics, correct repeated pipeline-bind timing, repair diagnostics compilation, and document the findings. Shader translation and intentionally omitted rendering passes are unchanged.

[Detailed experiment report](https://github.com/Experimental-projects-420/VIctory-NVIDIA/blob/experiment/stable-window-reuse-20261129/docs/window-reuse-experiment.md)

How it was tested

  • Hardware/profile: Windows, RTX 3050 Laptop GPU with 4 GB VRAM, 32 GB RAM; Series S, 1280×720 scene / 1080p output. DLSS, frame generation and ray tracing off. SSD caches and HDD title data.
  • Before/after: exploratory gameplay runs, not matched-scene benchmarks. The tester reported more complete rendering, approximately 5–6 FPS in the prison, and a visible weapon and usable objects in a later encounter. These observations do not establish which change caused the improvement.
  • Reuse counters: 1,019 bindings created, 628 live aliases, zero capacity fallbacks, and 1,059 MiB of cumulative allocation requests avoided. This is not live memory saved.
  • Memory: peak process-private memory was 21.38 GiB versus 19.84 GiB previously, with different progression and a warmer cache. No controlled net memory or performance improvement is claimed.
  • Shader wave sizes: not applicable; no translator changes.
  • Tests: the broader GPU-library run passed 920 tests, with 57 ignored. places_written_after_sending_are_learned passed separately because of an existing process-global state interaction. This is not an unfiltered suite pass. All 25 window tests passed again after the final corrections.
  • Builds: release executable and diagnostics-feature check passed. The final live-A/B guard was added after gameplay; that gameplay run used a release build without live A/B switching.
  • Repository checks: staged asset-policy and whitespace checks passed. Existing compiler warnings remain. The full policy scan reports a long literal in unchanged crates/victory-loader/src/heap_sites/frame_users.rs; full workspace CI is not claimed green.

No title data, runtime captures or binaries are included. Please keep reuse opt-in pending controlled comparisons of rendering correctness, resident memory, copy traffic and frame times.

Checked for overlap

  • Searched open PR titles, descriptions and changed-file lists, and reviewed the relevant descriptions.
  • Direct overlap: #2852 addresses pipeline-bind timing; #2779 addresses skipped-work advisor wording; #2732, #2744 and #2788 address diagnostics build failures. These changes are separate commits so existing proposals can be preferred.
  • Related memory work: #2776 takes a different in-place/page-pool approach. This experiment reuses existing covering copies with stable aliases.

Offered for selective review and reuse, with no proposed default enablement.

**@⁠Experimental-projects-420** on GitHub · 2026-11-29 18:31 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2884) `Experimental-projects-420:experiment/stable-window-reuse-20261129` → `main` · +655 −60 · 12 files · 6 commits · draft ## What it changes Overlapping buffer copies can increase memory use. Reusing an existing covering buffer requires a stable mapping: existing descriptors must continue to reference the buffer receiving updates. This adds experimental `VICTORY_WINDOW_REUSE=1`, **off by default**: - Reuses existing windows covering the entire aligned range for known-length descriptor views. - Preserves that choice through a bounded, non-owning alias table. - Retains existing resource-lifetime checks and excludes growing-window/tail modes. - Rejects live A/B switching because changing the mapping during a run could leave descriptors pointing at stale buffers. Separate commits add bounded memory/skipped-render diagnostics, correct repeated pipeline-bind timing, repair diagnostics compilation, and document the findings. Shader translation and intentionally omitted rendering passes are unchanged. [[Detailed experiment report](https://github.com/Experimental-projects-420/VIctory-NVIDIA/blob/experiment/stable-window-reuse-20261129/docs/window-reuse-experiment.md)](https://github.com/Experimental-projects-420/VIctory-NVIDIA/blob/experiment/stable-window-reuse-20261129/docs/window-reuse-experiment.md) ## How it was tested - **Hardware/profile:** Windows, RTX 3050 Laptop GPU with 4 GB VRAM, 32 GB RAM; Series S, 1280×720 scene / 1080p output. DLSS, frame generation and ray tracing off. SSD caches and HDD title data. - **Before/after:** exploratory gameplay runs, not matched-scene benchmarks. The tester reported more complete rendering, approximately 5–6 FPS in the prison, and a visible weapon and usable objects in a later encounter. These observations do not establish which change caused the improvement. - **Reuse counters:** 1,019 bindings created, 628 live aliases, zero capacity fallbacks, and 1,059 MiB of cumulative allocation requests avoided. This is **not live memory saved**. - **Memory:** peak process-private memory was 21.38 GiB versus 19.84 GiB previously, with different progression and a warmer cache. No controlled net memory or performance improvement is claimed. - **Shader wave sizes:** not applicable; no translator changes. - **Tests:** the broader GPU-library run passed 920 tests, with 57 ignored. `places_written_after_sending_are_learned` passed separately because of an existing process-global state interaction. This is not an unfiltered suite pass. All 25 window tests passed again after the final corrections. - **Builds:** release executable and diagnostics-feature check passed. The final live-A/B guard was added after gameplay; that gameplay run used a release build without live A/B switching. - **Repository checks:** staged asset-policy and whitespace checks passed. Existing compiler warnings remain. The full policy scan reports a long literal in unchanged `crates/victory-loader/src/heap_sites/frame_users.rs`; full workspace CI is not claimed green. No title data, runtime captures or binaries are included. Please keep reuse opt-in pending controlled comparisons of rendering correctness, resident memory, copy traffic and frame times. ## Checked for overlap - [x] Searched open PR titles, descriptions and changed-file lists, and reviewed the relevant descriptions. - **Direct overlap:** #2852 addresses pipeline-bind timing; #2779 addresses skipped-work advisor wording; #2732, #2744 and #2788 address diagnostics build failures. These changes are separate commits so existing proposals can be preferred. - **Related memory work:** #2776 takes a different in-place/page-pool approach. This experiment reuses existing covering copies with stable aliases. Offered for selective review and reuse, with no proposed default enablement.
Keep pipeline objects once per list, but advance GPU timing on every binding, including A -> B -> A.
Add opt-in copy census and release-build skip reasons, bounded compute-shape tracing and query-overflow reporting. Clarify texture-seed diagnostics and avoid attributing every skipped request to failed shader translation.
Keep the heap-report MiB formatter in scope and qualify GPU timing calls hidden by a local submission timer.
Reuse a fully covering window for a new known-length descriptor range while preserving the established backing identity. Bound non-owning aliases and prune them with target removal; leave unknown-length reach and existing lifetime gates intact.

Extend the copy census with coverage and cumulative reuse counters, and add five synthetic regression tests. The experiment stays disabled by default pending matched-scene validation.
Document reproduction settings, observed visual progress, memory and timing results, cache and scene confounders, and validation limitations. Include no title assets or runtime captures.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 18:34:41 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/cardmeter.rs
  • crates/victory-gpu/src/draw.rs
  • crates/victory-gpu/src/resource.rs
  • crates/victory-gpu/src/shadow.rs
  • crates/victory-gpu/src/texture.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/2884/head:github-bot/gh-2884'
git switch 'github-bot/gh-2884'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2884'
git switch 'github-bot/gh-2884'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2884'
git switch 'github-bot/gh-2884'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2884'
git switch 'main'
git merge --squash 'github-bot/gh-2884'
git switch 'main'
git merge --ff-only 'github-bot/gh-2884'
git switch 'main'
git merge 'github-bot/gh-2884'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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/trustno1-coder--VIctory-NVIDIA!2884
No description provided.