Texture queue notes no longer wait for its lock (−95 % lock waits); retired D3D12 objects are released on a thread of their own #3476
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3476"
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 nyxctura on 2026-11-29T23:44:18Z.
What it changes
The texture queue's lock line showed ~2 s of waiting every 5 s, 1.6 s of it in "noting a slot's record": 60–95k short takes queuing behind the pass that takes the slots due. And "copying back" cost ~10 ms a frame for ~1 MB, mostly
bury()releasing ~20,000 retired D3D12 objects a frame on the landing thread.VICTORY_QUEUE_POST(descriptor/host.rs): a note that finds the lock busy leaves its change for the holder, who applies it before releasing; the next taker applies any left over first. While a slot has a change waiting, the lock-free reads fall back to the locked path, so every reader sees the same results as before.VICTORY_BURY_ASIDE(host.rs): retired objects are handed to a "victory-burial" thread. The title is still told the card is done only after the data has landed.Both are on by default;
=0restores the old path.How it was tested
VICTORY_QUEUE_POST=0went back to 600–2,200 ms of waiting per 5 s, with identical rendering.mainthe branch builds and thevictory-gpulib suite passes (apart fromevery_switch_of_the_translator_is_in_the_key, which fails the same way onmainwithout this PR).cargo testpassed for the crates it touches: yes.Checked for overlap
Charts
Texture queue lock, ms waited per 5 s:

Copying back, ms per frame:

All three PRs at a glance:

🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Kitrae on 2026-11-30T00:15:29Z.
I tested the background resource cleanup in
e3a0285on an RTX 4090 at 3840×1080, with DLSS Performance and native 2× frame generation. I used one build with the same local ultrawide and scene-entry changes on top of41adb551.VICTORY_QUEUE_POST=0and the memory diagnostics were held fixed. I replayed the same post-prologue save four times in off/on/on/off order, running for 36 seconds after the first frame with at least 500 draws.VICTORY_BURY_ASIDECopy-back values are medians of the periodic per-frame averages in the log. Peak VRAM is the highest sampled DXGI local-memory usage for the game process over the run.
The enabled runs both had fewer long frames after scene entry. Scene-entry hitch counts were similar across all four runs. The later workload varied, with median draw counts of about 9,610, 9,244, 6,483, and 10,480 in run order, so a controlled FPS gain would need a more repeatable scene. All four replays completed without a GPU failure, and the logs showed the cleanup worker active only in the enabled runs.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by DoubleD17 on 2026-11-30T01:01:37Z.
We ran a test of this PR on an 8-core Zen 3: no gain on this machine, and two frames with vegetation missing.
Setup:
41adb551(the merge only adds this PR's own commits), against41adb551itself;We also ran a picture check: a burst of 10 captures a second at the end of each run, looked at frame by frame.
41adb551We can run VICTORY_BURY_ASIDE=0 and VICTORY_QUEUE_POST=0 separately on this machine to tell which part does what, if that helps.
AI Assisted
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nyxctura on 2026-11-30T01:24:40Z.
Pushed a fix, testing in a moment.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nyxctura on 2026-11-30T01:42:24Z.
Tested on my side: I pushed a fix for a real race in VICTORY_QUEUE_POST (a reader could skip the texture pass for one frame while posted changes were being applied; a test reproduces it and passes with the fix). I can't confirm the dropouts are gone yet: my build carries other changes that cause their own one-frame artifacts, so it doesn't isolate this PR. Could you rerun your picture check on the updated branch? If they're still there, a run with VICTORY_QUEUE_POST=0 and one with VICTORY_BURY_ASIDE=0 would tell which half it is.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Yoruiopz on 2026-11-30T12:36:21Z.
Independent same-binary comparison on an RTX 5070 Laptop GPU (8 GB), using exact PR head
8bd0f8a8on .05. Two fresh starts from the same copied Series S porch checkpoint and seeded cache. Stage 3, four landing threads, frame generation off, andVICTORY_BURY_ASIDE=0in both runs. The only switch wasVICTORY_QUEUE_POST. Timing windows started 26.9 s after the first world frame and stayed in the foreground for 28 s each.In the five complete enabled buckets, all 602,255 accepted operations were counted by the drain, including 102,486 handed to the current holder. The drain counter includes entries it can reject as stale. Wait values sum worker time on the original texture queue mutex and exclude the posting mailbox mutex.
This confirms the mutex contention reduction on an 8 GB laptop. Frame pacing did not improve in this single pair. I also saw the known intermittent black forearms in both runs. The visual samples caught different idle poses, so they can confirm the defect still occurs and do not measure its frequency.
I also tested a small follow-up that avoids allocating a temporary vector for singleton posts. The mailbox still takes a copy of each operation and preserves the existing counter, publication and drain order. The descriptor-host suite ran on the hardware adapter with posting on and off. Each run had 83 passes, zero failures and one ignored test. I haven't measured a frame-time effect from this follow-up. Single-commit follow-up
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:51:55Z.
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