CPU-bound frames: read-back lock fix, drop causes and refresh census, opt-in APU async and upload headroom #3271
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!3271
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3271"
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?
@B0tis on GitHub · 2026-11-29 21:11 UTC · original
B0tis:pr/rtx3070-cpu-findings→main· +483 −64 · 7 files · 9 commits · closed without merging[pr-performance] [pr-diagnostics]
What it changes
In heavy open-world scenes the frame is CPU-bound: lowering the render resolution does not raise fps. This PR removes one lock that held list threads up, adds two cheap log lines that show where the CPU time goes, and adds two opt-in switches. Defaults change nowhere except the lock fix and the log lines.
Fix
Host::read_back_buffer). The lock was held acrossCreateCommittedResource, even with the pool off, so every list thread that closed a list with read backs waited for the other threads' buffer creations. This hurts most under host memory pressure, when read-back buffers are made anew every frame.Diagnostics (release builds, every 5 s)
dropped draws and dispatches by cause, per frame: every silent exit inprepare_for,bind,rectanglesanddispatchnow records a cause (no pipeline, root, table slots, memory views, index, builder stage off, …). This separates real losses from expected ones. In the scenes measured, nearly all drops were ray-tracing builder stages that are switched off.refresh census per frameandrefresh census by kind per frame(VICTORY_REFRESH_CENSUS=0turns them off):Opt-in switches (off by default)
VICTORY_TEXTURE_FIRST_UPLOAD_CARD_HEADROOM_MB=<MB>: first uploads leave this much of the card's budget free. The existing 80% ceiling counts texture copies only, so a burst of first uploads can fill a small card, and every upload after it waits. On 8 GB cards, 768 kept the upload queue moving.VICTORY_APU_ASYNC=1: each XApu connection gets a worker thread that produces the results (Opus decode, conversion), as the console's audio processor does. The title dequeues a result once it is ready. This takes most of a core's work off the title's busiest thread. Whether fps rises depends on whether that thread limits the frame.Bench
bench.ps1 -SeriesSand-Dlss ultraperformance.How it was tested
bench.ps1 -SeriesS -Dlss performance -FrameGen off -Seconds 150 -Warmup 45. The diagnostics build needs #2498 (or #2744 / #2593 / #2386) and the frame-line wording from #2475. Identical runs differ by up to ±0.6 fps.cargo test -p victory-gpu --lib: 914 pass. The one failure,every_switch_of_the_translator_is_in_the_key, also fails on main, becauseVICTORY_SCALAR_SPLITSstayed in the key list after the reverta1fe8350.cargo test -p victory-hle --lib: 423 pass.cargo clippy -p victory-gpu -p victory-hle --lib --no-deps -D warnings: clean on the lines this PR touches.Notes for further CPU work (not part of the diff)
Existing switches that helped in the bench:
VICTORY_READ_BACK_POOL=1TABLE_SAME,ROOT_SAME,ROOT_TAILS,THIN_COALESCEVICTORY_SETTLE_UNLOCKED=1: in WPR, the submitting thread's waits insidesubmitfell from 67 to 11.5 ms/s.No gain or worse in the bench:
THIN_THREADS)TITLE_AFFINITY,SUBMIT_CORE_ALONEKEEP_GUARD_LOCK+ALIAS_DIRECTLAZY_COMPAREWhere the time goes: on a timeline of heavy frames, the critical chain was spread across these:
The card's idle time is mostly the submitting thread. Only about 7% of lists repeat word for word, so translation reuse would not pay.
Guarded view memory: the streamed windows, remapped page by page, are the costliest kind of refresh. The cost is guards-mutex contention and
VirtualProtectunder the lock, not copying.Tried for guarded view memory and dropped:
publish(): publishings were skipped and refreshes got slower.In-place reads are not possible for these windows (scattered single 64 KiB views). For the constants heap they lose on Ampere (#1223).
Checked for overlap
🤖 Generated with Claude Code
@madvillain91 on GitHub · 2026-11-29 23:19 UTC · original · edited 2026-11-29 23:30 UTC
System Information:
Summary of Test Session:
Technical Highlights from Log:
Notes/Outcome:
Attachment:
victory-nvidia-play-20261129-231142-33492.log
github-bot referenced this pull request2026-11-30 01:14:29 +00:00
frame chain:line per frame, and refreshed bytes by backing (VICTORY_BACKING_STATS=1) #4378Pull request closed