Windows over title memory share one copy in 64 KiB tiles (VICTORY_WINDOW_ARENA=1, off by default) #4751
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!4751
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4750"
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?
@xteral67 on GitHub · 2026-12-01 04:52 UTC · original
xteral67:window-arena→main· +549 −12 · 4 files · 3 commits · closed without mergingWhat it changes
A window outside buffers (
shadow.rs) is a buffer of its own, and windows overlap: a cell's window reaches into the next cell, whose window holds the same bytes again. In a scripted walk through town, 837–888 windows held 5.1–5.5 GB for 3.75–3.9 GB of title memory (the union of their ranges), on a PC with 32 GB of RAM that was short of free memory.With
VICTORY_WINDOW_ARENA=1(off by default, nothing changes without it):UpdateTileMappingson the host queue, before any submission that reads it) to tiles of a pool shared by every window. A title tile is held once, whichever window shows it.VICTORY_WINDOW_ARENA_MB(2–64, default 8 MiB), CUSTOM, write-combined, in the PC's memory. Each heap is mapped once for the CPU through a buffer placed over all of it. New tiles come from the fullest heap, and a heap goes back to the system when all its tiles are free. With 32 MiB heaps the pool held 4.7 GB for 4.1 GB of tiles and only 8 of 148 heaps were given back. With 8 MiB it held 3,640 MB for 3,614 MB.host/send.rsgo throughShadow::cpu/cpu_runs/cpu_addr, cut where tiles end.CardCpu::Sharedover the reserved buffer).VICTORY_REFRESH_CHECKskips them, and facewatch isn't told about them.windows' shared copy (VICTORY_WINDOW_ARENA=1): …log line every 20th window census: heaps, MB held, windows made, refused and let go, heaps given back, tiles shared and new.How it was tested
VICTORY_SLOT_EVICT=0in both runs; the arena code there is the same as here). Frame-time spikes are measured after the world has loaded:cargo rustc --locked --profile diag -p victory --features diagnosticson this branch (d99f14cb, on5fabb46e), Windows: finished, no warnings.cargo clippyandcargo test(one new unit test,arena::tests::runs_cut_where_tiles_end, not run yet). Not tested on a card below tier 4 or on 8 GB cards.cargo testpassed for the crates it touches: no (not run).Checked for overlap
shadow.rsaround window creation, so one of the two will need a rebase), #4718 and #3646 (host copies of title memory), #2540.🤖 Generated with Claude Code
@xteral67 on GitHub · 2026-12-01 07:22 UTC · original
PC pool heaps are now write-back, as other windows' buffers: CPU reads of tiles (sends, compares) went from 3.5 to 16.8 GB/s in town on the same PC.
@mykimy on GitHub · 2026-12-01 09:13 UTC · original
Tested on a 32 GB PC that is short of RAM: it helps.
PC: RTX 4090 24 GB, i7-14700KF, 32 GB RAM, Windows 11 23H2, page file on its own drive (16-32 GB).
Build: the PR's three commits (
d99f14cb,dc33b7bf,26ab8f86) cherry-picked onto thev2026.11.30.03tag with no conflict, release build from CI.Settings: Series X, 1440p, DLAA, DLSS frame generation 2x, 20 fps cap,
VICTORY_CARD_CPU_FILE=1,VICTORY_WINDOW_ARENA=1(default heap size). Compared with a run ofv2026.11.30.03on the same settings without the arena, from the same save (normal play, not a fixed route). The figures leave out the first 2 minutes of each run.file_mib)VICTORY_CARD_CPU_FILE=1, part of what the windows held was in file-backed memory, which does not count as commit. The arena heaps are committed memory shared with the card. The page file grew to 24.7 GB, with about 7 GB of commit still left, so nothing was refused. On a PC with a small or fixed page file this may matter.This is one session per setting, so the over-100 ms figure is a trend only.
@trustno1-coder on GitHub · 2026-12-01 18:33 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed