Mixed refresh batches can finish waiting for one long texture task #1820
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#1820
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?
@NotADonky43 on GitHub · 2026-11-29 00:24 UTC · original
In a local Series X opening trace on an RTX 5070 Ti, texture refreshes accounted for ~61% of the exclusive last-task-class tail across 175 sampled mixed CPU batches; buffer copies accounted for most of the rest. Changes to write-watch locking alone did not improve frame tails here. Testing an opt-in choice of which independent texture job starts first, without moving work between batches or changing GPU uploads. Scope: host.rs / Batch::refresh_front. Related to #1298 but not the journal or copy-planning changes; source-only implementation and repeated A/B results to follow.
@NotADonky43 on GitHub · 2026-11-29 00:24 UTC · original
/claim
@github-actions[bot] on GitHub · 2026-11-29 00:24 UTC · original
Please attach both logs from the run that went wrong. Without them we can only guess. Paste
%LOCALAPPDATA%into the address bar of File Explorer to get there.%LOCALAPPDATA%\victory\logs\: the newestvictory-nvidia-play-<date>-<time>-<number>.log(fromvictory.exe) orvictory-nvidia-<date>-<time>.log(from the script launcher). The window shows its path at the start, on the lineLog: ....%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newestvictory-<date>-<time>-<number>.crash.login%LOCALAPPDATA%\VIctory\data\7952987A\temp\.Also say which GPU, Windows version (10 or 11)
@kalberts0089-hash on GitHub · 2026-11-29 08:00 UTC · original · edited 2026-11-29 08:19 UTC
The textures in a mixed
refresh_frontbatch are still started in step order on main ate1f2eb6. I checked the code path and ran the scheduler with synthetic jobs on my machine. I can't run the game here, so these are not game numbers.Code at
e1f2eb6crates/victory-gpu/src/host.rs:9086:refresh_front()isahead_of_writes() && (VICTORY_JOIN_PARTS > 1 || VICTORY_REFRESH_FRONT).ahead_of_writes()(host.rs:9065-9068) is on unlessVICTORY_REFRESH_AHEAD=0orVICTORY_LIGHT_REFRESH=0is set or wide refresh is off. Wide refresh is on by default with 4 or more logical CPUs.apps/victory/src/play.rs:58setsVICTORY_JOIN_PARTS=8, sovictory.exetakes this path by default.host.rs:9436-9439: withwide_textures()on (the default), textures go intoduein the order theirStep::Textureappears. Nothing orders them by size.host.rs:9476-9479: onewide_each_from(spans.len() + due.len(), due.len(), wide_chunk(), ...)call. Texture indices come before copy indices, so textures are claimed before copies. Among themselves, they run in step order.shadow.rs:1990-1996: whenVICTORY_WIDE_CHUNKis unset (chunk 1), this falls through towide_each, which hands out indices in order from one shared counter. With a larger chunk,claimstill hands textures out one at a time (shadow.rs:2025).shadow.rs:1812: the pool isavailable_parallelism * 3/8, clamped to 2..8 helpers. On my 24-thread CPU that is 8 helpers plus the submitting thread, 9 in total.Batch::refresh_textures(host.rs:9571-9581), only runs whenrefresh_frontis off. It is a separatewide_eachover the textures, and #1821 doesn't touch it.#1821 on current main
The PR diff was written against the older
wide_each(...)line. It still merges cleanly ontoe1f2eb6. The reorder happens before thewide_each_fromcall, so it works alongside theVICTORY_WIDE_CHUNKchange (7ab985d).Scheduler probe (synthetic, busy-wait jobs)
I wrote a throwaway ignored test (local only, not part of the PR) that calls
shadow::wide_each_from(tex + 200, tex, chunk, ..)with batches shaped likerefresh_front:It compares the long texture placed last against placed first. Each line is the median of 40 runs on a machine with 24 logical CPUs:
A second run gave the same numbers within a few µs.
So moving the largest texture first only shortens the batch when there are more textures than pool threads (9 here). The gain is about the time the earlier textures take to drain before the long one gets a thread: 0.5 ms with 16 textures and 1.5 ms with 32. With no more textures than threads, every texture starts at once and the order makes no measurable difference.
VICTORY_WIDE_CHUNKdoesn't change this, because textures are claimed one at a time either way.Two things that follow from the code (untested in game):
largest_firstmoves only one job to the front. If a batch has two long textures and more textures than threads, the second keeps its place in step order.Staging::memory().1, the number of bytes of title memory read (crates/victory-gpu/src/texture.rs:1532). A texture whose memory hasn't changed may be cheap whatever its size, as the PR description already says.To tell whether this matters in game, a useful number from the trace would be how many textures a mixed batch usually has compared with the machine's pool size.