Bound texture metadata and read buffers; fence presentation teardown #3966
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!3966
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3966"
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?
@1mosce on GitHub · 2026-11-30 13:09 UTC · original
1mosce:codex/owned-memory→main· +3406 −715 · 32 files · 2 commits · closed without mergingCached placed-texture identities and per-worker read buffers can retain their high-water marks indefinitely. This gives texture identities explicit owners through GPU use, collects unused metadata, bounds idle CPU read storage, and fixes a swap-chain buffer being released while a preceding Present still uses it.
Stacked on #3828; merge that dependency first. The new commit is
46fe6f81330507adbd9e9008c82114c1521490a1, on top ofde352e668a3c62ce68d3706909c769ba1676ffac. Upstream main was refreshed before publication and remains41adb55167fa778fcaa5dc36fa18a1fa8dacd657. Until #3828 lands, GitHub's main comparison includes both commits.What it changes
Heldtype. Lookups retain under registry locks; placed views, upload jobs/preludes, list identity keys, and mirror/ambient lookups keep resources alive for their use. List keys release ownership after submission completion and reset.VICTORY_CARD_STEPS_GATHERandVICTORY_PORT_CBVremain off by default. The raw-CBV path overlaps #3396 and must be reconciled if both are merged.VICTORY_PLACED_OBJECTS=0,VICTORY_RESIDENT_SWEEP=0andVICTORY_READ_POOL=0disable the corresponding memory policies for comparison; ownership guarantees remain enabled. Seedocs/owned-texture-memory.mdfor lifetime and lock-order rules.The Linux RADV/Wine/vkd3d alias-mapping backend is not ported here. This does not remove every shadow copy or establish complete VRAM leak remediation.
How it was tested
Windows, RTX 4070 Laptop 8 GiB / 32 GiB system RAM, Series S, DLSS Ultra Performance, frame generation off. Optimized
diagbuilds with diagnostics. The archived game candidate SHA-256 isD67AB69545113A1A3922E3405E968CDEAF22B1FA34652D71698B2856B3578DB6; the published source was checked against its frozen source patch before committing.VICTORY_SCALAR_SPLITSkey test. The pool test consumed an earlier invalid-pipeline-library InfoQueue message; its fresh-process debug rerun passed. The full renderer/debug suite is not claimed clean.OBJECT_DELETED_WHILE_STILL_IN_USE, and exception0x87DinsideResizeBuffers, also with the new memory policies disabled. Afterward the isolated packed-format test passed with no D3D12/DXGI errors, and it passed in the final full suite.git diff --checkand the actual staged asset policy passed for all 19 new-commit text files. Full-tree policy still finds the unchanged long hex run invictory-loader/src/heap_sites/frame_users.rs.Remaining limits: dark arm/neck artifacts persist, including with metadata collection disabled; visual equivalence has not been established. City traversal, other GPUs and an extended leak/soak test remain unverified. The normal local executable was not replaced.
Checked for overlap
Implemented and tested with OpenAI Codex. No game assets, executable bytes, captures, shader dumps or private run logs are included.
@tyr0nsur on GitHub · 2026-11-30 13:29 UTC · original
I tested a small follow-up on top of
46fe6f8to let the CPU texture-read pool give memory back after a burst. The current cap is 63.75 MiB across eight classes, and idle buffers stay cached after streaming subsides. The follow-up ages each slot from its return to the pool. The existing host sweep releases slots idle for 10 seconds, or 2 seconds under host memory pressure. A hot slot can still be reused and a checked-out buffer remains owned by its reader. Frees happen outside the bin mutex.In three fresh-process A/B runs on Windows, I touched two buffers in every size class and advanced the test clock to the pressure sweep. Idle pool bytes stayed at 63.75 MiB on this PR head and fell to 0 with the follow-up. Windows private commit fell by about 62.9 MiB from the filled state in each patched run. This is an isolated CPU-memory measurement. In-game frame time and VRAM still need separate measurements.
The diagnostic build passed 17 texture tests on the RTX 4060 and 17 under WARP, plus 21 related residency, spare-cache and readback tests. The new regression exercises a cold slot alongside a warm slot in the same bin, a sweep while a lease is active, and a sweep whose timestamp predates a return.
The tested, cherry-pickable commit is
github.com/tyr0nsur/VIctory-NVIDIA@28ea2fde32.@tikD1337 on GitHub · 2026-11-30 16:52 UTC · original
Sharing a 52-phase outdoor A/B datapoint that strongly supports the
POOL_FLOORidea in this PR (and#3828):On
41adb551(diagbuild, RTX 4070 Ti SUPER 16 GB, Ryzen 5 7600, 32 GB RAM, Windows 11,VICTORY_TABLE_SAME=1), host memory pressure latches at world load on this 32 GB system (avail commit ~1.2 GB, below the clear threshold). Withpool_cap = 0,texbackchurned every frame:~25READBACKbuffers created (~28 ms) +~25destroyed (~16 ms) per frame across threads (~44 ms/framethread wall time).0when commit < 1.5 GiB):0created,0destroyed per frame, clean visuals, no device loss.f-41-pf1/f-41-pf2, draws-adjusted):+0.1 +/- 2.7 msin the 11 s phase run (-4.3 +/- 2.5 mspooled) — no significant FPS gain outdoors since those D3D12 waits sit off the critical path, so the win is purely eliminating ~50 D3D12 alloc/destroy calls per frame.Also tested a small ~60-line isolated version (
texback.rsfloor + oldest-firsttrim_to) locally, and held off opening a separate PR so we don't duplicate#3966/#3828. If you'd ever like a small standalone split-out of just thePOOL_FLOORpiece while#3966is being rebased, happy to share/open it with credit to you and#3828.AI-assisted (Claude Code / Gemini); measurements are from this PC, no game data.
@trustno1-coder on GitHub · 2026-12-01 18:47 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