Skip to content

GPU: experimental memory-window and scratch-pool tuning - #2

Draft
ChaerilM wants to merge 1 commit into
mainfrom
perf/experimental-memory-pools
Draft

ChaerilM wants to merge 1 commit into
mainfrom
perf/experimental-memory-pools

Conversation

@ChaerilM

Copy link
Copy Markdown
Owner

Changes

  • Adapt VItoriaBr #106: VICTORY_WINDOW_KB=1024 optionally uses smaller aligned shadow windows for known-length accesses. Unspecified lengths (one-byte sentinel) still use 4 MiB hulls. Registered buffers are unchanged. Invalid settings fall back to 4 MiB; checked arithmetic rejects overflow.
  • Adapt fxceless #1367: VICTORY_SCRATCH_SPARE_MB=128 optionally shares upload chunks between successfully reset host command lists. Best-fit bounded reuse, idle pool capped at 512 MiB, excess released outside the shared mutex. No sharing by default. Current synchronous submission and Arc ownership are retained; no async GPU work is introduced.
  • Document both switches and add pure regression tests for pool accounting, best-fit reuse, range coverage and overflow.

Why not XCL Marvisak#2844 directly?

XCL #2844 remakes imported UMA windows as CUSTOM WRITE_BACK L0 driver heaps. VIctory already creates its shadow buffers using committed CUSTOM WRITE_BACK L0 resources; it has a different title-memory/page-table model. Its reported 4.9x result cannot be extrapolated here. A direct-address UMA redesign or mixed VRAM memory path requires a separate correctness and hardware-validation effort.

Validation and limitations

GitHub compare confirms only README.md, host.rs and shadow.rs changed, based on main eac2195; independent of PR #1. No compile, Rust tests or NVIDIA gameplay benchmark run here. Both options are off by default, pending Windows CI and hardware tests. The finer grid can create overlapping copies and increase page-table pressure or affect rendering; validate with identical scenes and D3D12 debug checks. Scratch sharing can increase allocations if the pool is undersized and may use more idle RAM; only reset lists return chunks (not arbitrary dropped recordings). The existing per-list reuse test is scoped to the default path; the shared pool accounting test is hardware-independent.

Suggested A/B: test baseline, window grid alone, scratch pool alone, then both. Record FPS, median/p95/p99 frame time, process private bytes, VRAM, device removal, shader page misses, image correctness and scratch allocation counts. Use the same driver, game build and cache state. Run cargo test -p victory-gpu fine_window_grid and cargo test -p victory-gpu scratch on Windows. Do not merge until compile and GPU validation are complete.

Adapt known-length window sizing from uiliannn/VItoriaBr#106 while keeping 4 MiB hulls for unknown root ranges. Adapt scratch chunk sharing from fxceless/victory-fork#1367 to the synchronous host-list reset path, with a bounded spare budget and original behavior by default.

Sources:
uiliannn/VItoriaBr#106
fxceless/victory-fork#1367
ChaerilM added a commit that referenced this pull request Nov 27, 2026
Keep existing victory.toml path configuration unchanged. Validate three performance settings, allow git-ignored local overrides, restore the parent process environment, and allowlist only the three authored preset paths in asset policy. Intended for use with PR #1 and #2.
ChaerilM added a commit that referenced this pull request Nov 27, 2026
Use feature-gated GPU upload heaps for reusable CPU-written command-list scratch, with an atomic lifetime budget and DXGI pressure check. Preserve normal upload fallback and writable shadow semantics. Add reservation and GPU readback fixtures. Stacked on PR #2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant