Memory: windows of title memory in place over the page pool, soft writes (12-13 GB at copies' speed under Proton) #2776
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!2776
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2776"
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?
@kc01-8 on GitHub · 2026-11-29 17:10 UTC · original
kc01-8:kc/memory-in-place→main· +1177 −46 · 11 files · 31 commits · openWhat this does
Windows of title memory in place over the page pool, through views of our own, instead of copies; and the rest of what makes that fast. Everything is off unless asked for: nothing changes for anyone who does not set these.
VICTORY_INPLACE=1+VICTORY_INPLACE_VIEWS=1inplace::OwnViews), not copies the card pinsVICTORY_INPLACE_VIEWS_CHURN=4VICTORY_SOFT_VIEWS=1(F1: SOFT VIEWS → ALL)SoftViews::write), instead of making the view realAlso in these commits, active only with the switches above:
VICTORY_INPLACE_VIEWS, trustno1's re-make for growing windows runs for them too);Measured
RTX 3080 Ti 12 GB, Ryzen 7 5800X3D, 32 GB, Linux 7.3 with Proton Experimental and vkd3d-proton, Series X profile, 1440p. Each run is in docs/kc-linux-status.md of kc01-8/VIctoryNVIDIALINUX (branch
kc/foxhound).VICTORY_SOFT_VIEWS=1+ soft writesSo copies' frame rate at about 3 GB less memory. The wineserver part (every map/unmap walks the process's ~90,000 views under Wine) is Proton's; the memory part should hold on Windows too, but I have not measured it on Windows.
Merge notes
Picked onto today's
main(829188e9). Where it met newer code: windows that grow (VICTORY_WINDOW_GROW) keep the page index when they take a window's place, and the in-place staleness check is on the normal path only. The two have not been run together.made_windowis called with the table's lock let go;cardedtakes only its own lock.Tests
Under Proton's Wine (no D3D12 debug layer), without the diagnostics feature: victory-gpu 905 passed / 14 failed, victory-hle 417 / 6.
mainalone gives 901 / 14 and 417 / 6, the same failures (Wine: placeholders, ws2_32, NTFS links and others). The diagnostics build ofmaindoes not compile at the moment, before these commits:copystat.rs:1350calls anmb()that is not there, and inhost.rsaround line 9168 a localtimingshadowstiming().Where this comes from
kc01-8/VIctoryNVIDIALINUX, branch
kc/foxhound: the title on Linux under Proton on an RTX 3080 Ti, with every run's numbers indocs/kc-linux-status.mdand the plan in its README. Also from there: the frame recorder and replay working under vkd3d-proton, a hang watcher that dumps every thread's place without the loader lock, and a fix for a double unlock in vkd3d-proton's memory budget lock.🤖 Generated with Claude Code
@agentiverse on GitHub · 2026-11-29 21:24 UTC · original
was_refusedalso rejects sub-ranges of a refused range (46090991)was_refused(first, last)returns true for any range inside a cached refusal. When a merged range inask_rest(or a half inask_run) is refused because it crosses into memory that isn't write-watched,kernel_writtencaches the whole merged range, so the per-piece retry that follows is refused without asking, including pieces that are write-watched. For non-view memory the guard fallback refuses too,writes()returnsNone, andShadow::update_freemarks the shadowNOT_WATCHEDfor good. From then on every refresh of it copies the whole range, andmerge_under_writesmakes every overlap with pending shader writes wait for the flights.It depends on which ranges get merged, so it's intermittent: when it hits, the "title memory changed under shader writes" settle wait is 30–50 ms per frame.
Suggested fix, treat only the exact range as refused:
@neongatzu on GitHub · 2026-11-29 23:54 UTC · original
A Windows run of this, since the description asks for one. Short version: on Windows with an NVIDIA driver the page-pool path is refused by the runtime, so it opens nothing and costs some frame time; the probe says why, and points at what would work.
PC: RTX 3060 Ti 8 GB, 16 GB RAM, Windows 11 26200.9974, NVIDIA 621.24. Series S profile, 1080 upscaled to 1440, DLSS Performance. Caveat: applied onto another fork's tree (it also carries #2910 and #2234), with two small conflicts in
shadow.rs(theShadowstruct andstale_pageskeep both sides).The probe (
VICTORY_INPLACE_PROBE=1) on this driver:So the runtime here refuses
OpenExistingHeapFromAddress1on a view of theSEC_RESERVEpool section, the same as it refuses the section itself, while aSEC_COMMITsection opens fine, also through a placed buffer at a view's offset, and survives views being remapped, made read-only or unmapped.What that did in play (
VICTORY_INPLACE=1 VICTORY_INPLACE_VIEWS=1 VICTORY_SOFT_VIEWS=1, 8 minutes, no errors):Views of our own mapped and unmapped for those attempts: 82,925 over the run, up to 11,106 in one 10 s line. Against the same build without
VICTORY_INPLACE_VIEWS/VICTORY_SOFT_VIEWSin the same area: shared memory peak 5,370 vs 5,599 MB (noise), median preparing time 58.8 vs 51.6 ms per frame, fps median 11.0 vs 11.8.The target is right, though. The census 150 s in:
About 1.5 GB of the 2.4 GB of windows is page-pool memory, which on an 8 GB card with 16 GB of RAM is exactly what runs the shared memory into its cap. Two suggestions, from the probe rather than measured: on Windows, make the pool section
SEC_COMMIT(the probe opens that one as one heap, without locking pages); and when the probe finds the views path refused, turnVICTORY_INPLACE_VIEWSoff for the run instead of trying each window.The
was_refusedcomment above: with this PR applied,watch::tests::ask_rest_falls_back_per_piece_when_touching_unwatched_neighbourfailed every time here. With the suggested change (refused().1.get(&first) == Some(&last)) it passes, and so does the rest ofvictory-gpu's library tests (1615 passed, 0 failed).@kc01-8 on GitHub · 2026-11-30 01:42 UTC · original · edited 2026-11-30 01:47 UTC
Thanks to you both. Pushed two commits; the branch merges cleanly with main again.
The
was_refusedsub-range bug (agentiverse): confirmed. A merged range refused because it crossed into memory that isn't write-watched cached the whole span, so the per-piece retries were refused without being asked. Main has since gained its own refusal cache (#2834: per thread, exact ranges, kept 64 frames or until the title is given memory over them), so the merge (d3b5554d1) drops this branch's cache for main's. That's the exact-range fix you suggested, and there's one cache instead of two. Kept from this branch: views of the title's pages still aren't asked of the system's write watch, checked after main's lookup.ask_rest_falls_back_per_piece_when_touching_unwatched_neighbourpasses now.The Windows run (neongatzu): thanks for the probe output.
efac61779adds your second suggestion: if the host refuses the first 16 windows through views of our own and has opened none, the path turns off for the run, with one warning, and those windows stay copies. SoVICTORY_INPLACE_VIEWS=1on Windows with NVIDIA no longer maps and unmaps views for thousands of refusals. Under Proton, where vkd3d-proton opens them, nothing changes. I haven't done the committed pool section on Windows: it changes the pool's commit charge, and I can't measure that here. If you can try it, it looks like the way to get those 1.5 GB in place on Windows.Tests (Proton Experimental, victory-gpu lib): 911 passed, 15 failed, and main alone gives 907 passed with the same 15 failures. All 15 depend on the environment under Wine (shader compiler, GPU adapter, placeholder memory), and none involves this change.
CI: the red check is main's own. Clippy stops on
function unwind_copy is never used(crates/victory-loader/src/crash.rs:804), and main's push CI fails the same way at41adb5516. This PR doesn't touchvictory-loader.Full work, run logs and status: https://github.com/kc01-8/VIctoryNVIDIALINUX (branch
kc/foxhound).🤖 Generated with Claude Code
@kc01-8 on GitHub · 2026-11-30 16:45 UTC · original
Merged main again (
25dcfe40c); the branch merges cleanly.Main's #2538 (cwWwWwW) opens a page-pool window over our own view of one run of one section (
VICTORY_INPLACE_VIEW). This PR'sVICTORY_INPLACE_VIEWScovers the windows that #2538 turns down asScatteredorHoles: pages of several sections, or none, mapped again in order into a range of ours, with zeros where the title shows nothing. Both are kept, and both are off by default.Placedcarries both sides' fields.place_fortries our views, then main'splace_private.PLACEDlist. Windows through our views still go only when the title maps other pages under them.Tests under Proton (
watch::,inplace::,shadow::,port::): 175 of 175 pass with an ntdll that answersMemoryRegionInformationEx. On stock Proton, the same 4 placeholder tests fail as on main. Across the wholevictory-gpusuite, the 19 failures under Wine are main's own: I checked the 5 that are new on main against main's own build. The only clippy warnings left are main's (Shadow::ranged, which has no callers left on main;copystat::mb;xmem::parse_port_mode).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.Merge
Merge the changes and update on Forgejo.