Bound the DXR cache of decoded meshlet indices #4578
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4578"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-11-30T23:07:29Z.
Related to #4314.
What it changes
The DXR meshlet path caches a committed upload buffer for each decoded index stream. Until the title frees the source address, cache entries can accumulate as the scene changes. The existing BLAS budget covers acceleration structures. These upload buffers are separate.
Bound the decoded index cache to 256 MiB of buffer allocation sizes, using the standard 64 KiB alignment for these committed buffers. At the limit, release the oldest entries from earlier frames and leave room for subsequent misses. A miss can still use its upload buffer for the recording when the cache is full of buffers used this frame. Hits update recency under the read lock. Skip caching a decode when the title freed memory since its lookup. Concurrent misses can share the winner's entry. A recording keeps its existing reference to the buffer and evicted entries are retired outside the cache lock.
Log the current cache count and bytes. The existing decoded-MB field is cumulative decode work and includes quant24 vertices as well as indices. #4314 shows budget pressure on a 5070 Ti, but its release log cannot identify this cache's live size or attribute the local VRAM growth to it.
How it was tested
cargo test -p victory-gpu --features diagnostics --locked --lib hwrt::tests:: -- --test-threads=1passed (21 tests). The staged asset-policy check passed.Checked for overlap
Developed with Codex and reviewed with Claude Opus 5.5.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by TechnoStone on 2026-11-30T23:53:52Z.
Hi, this PR solves vram leakage with enabled DXR, but still game can crash after a short car/boat trip (without this commit it crashed as soon as leaving house/loading other save/starting new game)
9800X3D, 48 GB, 4070TiS
crashes.log
victory-nvidia-20261201-025054.log
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by paales on 2026-12-01T01:41:09Z.
Written by 🤖:
Tested together with #4337, #4170 and #4144 on an RTX 5070 Ti 16 GB (https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4337#issuecomment-7297773692). No crash and no lost card in 6 runs with
VICTORY_HW_RT=1, 2 of them a save that ends on the boat (82 s). The meshlet index cache stays under its bound: at most 230 MB kept of 256 MB in the cutscene, 231 MB in the save. The cherry-pick onto #4337 conflicts in theHwRtManagerfields (shownbesideMeshletCache) and intitle_memory_freed; both sides stay.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-12-01T01:50:18Z.
I checked TechnoStone's attached play log. The 15 meshlet-cache samples peak at 231 MiB of the 256 MiB cap. The last sample reports 190 MiB, about 2.3 s before the relay reports device removal (
0x887A0005). The closest DXGI sample, 82 ms before that error, reads 12,819 MiB local use against a 14,621 MiB budget. The log shows the cap holding through the sampled interval, with the run still ending in device loss.#4337 is relevant to that remaining failure. The six successful runs above tested it in a stack with other changes. The useful follow-up for this 4070 Ti SUPER report would be the same save and settings with this cache PR in both runs and only #4337 added in the second.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:37:21Z.
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