GPU: opt-in file-backed CPU mirrors #3824
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!3824
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3824"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@john-9474 on GitHub · 2026-11-30 08:25 UTC · original
john-9474:codex/file-backed-cpu-mirrors→main· +220 −12 · 8 files · 1 commits · merged 2026-11-30 14:12 UTCWhat it changes
CPU-only mirrors of two-sided GPU buffers still consume private system commit when allocated from the process heap.
VICTORY_CARD_CPU_FILE=1opts into temporary file-backed storage for those mirrors instead. The default remains off.The application configures an absolute
cache/cpu-mirrorsdirectory through the existing asset-policy check. Each mirror owns its mapping and delete-on-close file. Submission-owned snapshots continue to supply GPU reads; the file mapping is never imported into D3D12. Single-sided buffers and the upload-checker path retain their existing allocation behavior. Failed file allocations fall back to the existing private/shared storage path.This reduces commit charged to CPU mirrors; it does not reduce all renderer memory usage. Cached file pages still consume RAM and can incur disk I/O. The documentation covers that tradeoff and the required submission-owned-send configuration.
How it was tested
Base: current upstream
41adb551/v2026.11.29.05. Windows 11 build 26100, RTX 3080 Ti 12 GB, driver 610.47, Ryzen 9800X3D, 64 GB RAM.Three fresh processes each allocated and touched eight 32 MiB mirrors:
Real D3D12 round trips passed separately with shared, private and file-backed mirrors: submission-time refresh, GPU copy/writeback, then later CPU writes through a second mapping. Three rounds compare the full output bytes. Temporary-file counts return to zero after each test process exits.
Both new storage tests pass, including zero-initialization, a non-page-aligned length, full byte preservation, cleanup and rejection of empty storage.
cargo build --locked --release -p victory: passed from the clean contribution branch.Full GPU library suite: 994 passed, 3 failed, 63 ignored. The clean upstream control gives 992 passed, the same 3 failures, 62 ignored. The failures are
compose::tests::bgrx_plane_selects_a_typed_view,host::card_steps::tests::places_written_after_sending_are_learned, andshader_cache::tests::every_switch_of_the_translator_is_in_the_key. The ignored new hardware test was also run explicitly and passed in each storage mode.git diff --checkand the staged asset-policy check: passed; eight source/documentation files, no title data or dependency changes.Live comparison on this branch used identical local process-mute and native physical-page file-backing test support on both sides (those harness changes are excluded from this PR): Series X, 2560×1440 output, DLSS Performance, FSR 2×, 30 rendered-FPS cap, builder off, the same restored save/cache and
CARD_BUFFERS_MIN_KB=1024.The figures below were recomputed after correcting the log parser to pair FPS and preparation/workload counts from the same statistics call. The earlier parser attached the next preparation interval to the preceding FPS line; these corrected live figures supersede the earlier ones.
Across the two off and two on runs, the approximate matched steady-commit reduction is 0.69–1.30 GiB. There is no convincing FPS improvement. Scene/workload matching is approximate, this is a small sample, and generated FPS is not independently measured.
Transition-validation limitation. The off controls reached our unchanged 6 GiB headroom guard around 150 seconds. One enabled run failed at command-list Close around 140 seconds, while its repeat completed 240 seconds. A current-head diagnostic run with the faster buffer-placement setting reproduced the exact rejection: BC3_TYPELESS to BC7_TYPELESS CopyTextureRegion (D3D12 message 874). Existing #3043 addresses this format-mismatch class. Its bit-preserving bridge also passes asset-free GPU checks for this exact pair in both directions, through the 1x1 mip and partial regions, with the separate geometry-skipping guard disabled. Gameplay candidates have completed 240 seconds without a logged error, but have not logged a repaired cross-format copy, so full transition stability is still unproven. These unequal endpoints are not a peak-memory comparison. No FPS or crash-fix claim is made for CPU mirror storage.
Checked for overlap
@dyshay on GitHub · 2026-11-30 08:55 UTC · original
Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch
janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with--profile diag --features diagnostics, and the CPU tests of the touched code pass. A run on an RTX 4090 is queued. Frame times will follow here.