[RTX 3070 / Ryzen 5 7600X] Frame time bound by the submitting thread (~56 ms at 5–10k draws); port of cool_fox's pipeline-library "store later" reduced stalls #1427
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#1427
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@yoshidacaio on GitHub · 2026-11-28 19:44 UTC · original
<html>System
9ce3cf9), release, plus the local changes listed at the end Profile | Series S, 720p → 1080p with DLSS Quality, FSR 3 frame generation 2x (FG off where noted) Non-default switches | VICTORY_TEXTURE_ROOM_PERCENT=85, VICTORY_CARD_ROOM_FOR_TARGETS_MB=1600, VICTORY_CARD_ROOM_FOR_TARGETS_SETTLE_MS=8000, VICTORY_POOL_SMALL=1, VICTORY_WATER_LIGHT=0, VICTORY_LIBRARY_STORE_LATER=1, VICTORY_LIBRARY_SAVE_S=60The GPU is never the limit. The frame time follows the draw count through the submitting thread. Here is one representative line from the city at ~10k draws:
The refreshes take ~23 ms even though 86% of the flushes are already known to copy nothing. My guess, unverified: the cost on this 6-core CPU is in waking and joining the helper threads per flush, not in copying.
VICTORY_WIDE_THREADS=8instead of the default 4 changed little in a short run; I can do a longer A/B if useful.The following made no relevant difference here:
VICTORY_WC_BAR=1with Resizable BAR on: no relevant gain, and the picture broke (as its doc comment warns).2. Pipeline-library saves stalled frames — port of cool_fox's
LIBRARY_STORE_LATERBefore, on v2026.11.28.02 with the defaults, I ran a 36-minute session:
While a save holds
savingfor writing, a worker that has just made a pipeline waits to store it, and the frame that asked for it waits up toVICTORY_PIPELINE_WAIT_MS(500).I ported DoubleGhosty/cool_fox's
VICTORY_LIBRARY_STORE_LATERandVICTORY_LIBRARY_SAVE_Stopipeline/library.rs. The patch is attached: one file, off by default, unit tests included (store_or_defer/drain/save_seconds), builds clean on Windows. With it on andSAVE_S=60, the next session had 14 such windows in 21 minutes and 7 saves.Caveat: I also ran a full
victory warmin between, so the two effects are not separated. If this direction is welcome, I can do a clean A/B (same build, same spot,STORE_LATER0/1) before a PR.3. Other findings on a 32-lane card (for reference)
6b82bc7d22016cb5(every session) anda10179ab7eda0dc3(first seen in one session), bothno wave32 lowering for this wave64 program.VICTORY_CARD_ROOM_FOR_TARGETS_MB(3072 by default) is never released at 720p, where the targets use ~1.3–1.5 GB (same as #609). 1600 MB with an 8 s settle released it and kept textures in budget at 85%.VICTORY_POOL_SMALL=1on NVIDIA: 36 minutes, no device loss. 18,746 small textures held in 218 MB, against ~1.2 GB at 64 KiB granularity.VICTORY_LEVELS_ON_DEMAND=1made things worse here: 8.1 GB in use, about half the objects missing.VICTORY_AMBIENT=1.8,VICTORY_AMBIENT_SHADE=0.15,0.6andVICTORY_AMBIENT_ONCE=1, plus a small local change,VICTORY_AMBIENT_FLOOR=<share>. It floors the diffuse estimate at a share of the scene's mean (ambient.rs,max(now, mean * floor_share * open)). I can open a separate PR for it if it is of interest.Local changes in this build
The full patch is available on request. It contains:
Logs available on request.
</html>0001-pipeline-library-store-later.patch
@joeypercia on GitHub · 2026-11-29 07:34 UTC · original
On "serial per-item work or contention", thread stacks point at contention: the write watch's one guards lock (
watch::GUARDS).Setup. RTX 4070 Ti 12 GB, Ryzen 7 7800X3D, 32 GB, Windows 11 26200.
mainat568c5e5(release build, matching pdb), Series X, DLSS off, frame generation off, in the world. I took 30 samples of every thread withcdb -pv(non-invasive), one every ~3 s over about 2 minutes. Each sample suspends the process for a moment, so this run's per-frame times are inflated; read the shares, not the milliseconds.What the threads were doing:
victory-submitshadow::wide←wide_each←wide_each_from, i.e. the end of a refresh flush, waiting for helpers.victory-wide-*(6)watch::guards→GUARDS.lock()(viaShadow::update_free→watch::writes→watch::guard). The other 13 were copying (copy_mapped→soft_read,Shadow::copy) or inwatch::kernel_written.victory-list-*(8)So the refresh fan-out has spare helpers, and the time a flush takes is set by its jobs queueing on
GUARDS.guard()takes that lock on its fast path too (g.clean.range(first..last).count() == ...), once per refresh item that isn't sifted out, and holds it acrossprotect()'sVirtualProtectcalls andsoft_runs. The title's write faults wait on the same lock. That fits your C run (two thirds fewer helpers cost only ~12 %) and D (spinning doesn't help: the helpers are awake but blocked).Open PRs that work on that lock, for whoever compares them: #1925 (
GUARDSsplit by block), #1967 / #1561 / #1609 / #653 (the fast path inguard()without thecount(); #1967 and #1561 also skip the secondguards_timed()), #730 and #1044 (spinning ortry_lockon it). I haven't measured any of them.Not measured: with more samples, or on Series S.
(Claude Code, Claude Opus 5.5: took the samples, read the stacks, wrote this.)
@trustno1-coder on GitHub · 2026-11-30 15:43 UTC · original
Closing this because it was opened before v2026.11.29.01, and a great deal has changed since then. The latest release is v2026.11.30.01.
If this still happens, or still applies, on the latest release, please open a new issue. For a bug, attach both logs from that run:
victory-nvidia-play-<date>-<time>-<number>.login%LOCALAPPDATA%\victory\logs\.%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, plus the newest.crash.login%LOCALAPPDATA%\VIctory\data\7952987A\temp\if there is one from that run.