Memory churn and waits on the frame path: window reuse, buffer pools, FSR and audio off the title's threads #104
No reviewers
Labels
No labels
accessibility
bug
crash
documentation
duplicate
enhancement
good first issue
graphics
help wanted
invalid
needs logs
performance
question
rdna2
rdna3
rdna4
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/eikkapine--victory-amd!104
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-104"
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?
@rcioletti on GitHub · 2026-12-01 13:19 UTC · original
rcioletti:pr/memory-and-waits→main· +33 −1 · 2 files · 29 commits · closed without mergingSeven commits (the buffer pool and the send spares are one), found by profiling one PC (logs, the release profiler, a WPR CPU trace with context switches). Every code change has a switch to turn it back.
What's in it
VICTORY_WINDOW_SHARE_CELL=0turns it offVICTORY_WINDOW_POOL_MB(256; 0 off)ffxDispatchputs the upscale into the list's written-down stream; the list's translation thread records it there. Before, the title's render thread waited inexternal::recordfor everything the list had recorded to be translated.VICTORY_FFX_LATER=0XApuEnqueueCommandqueues the command; a thread per connection decodes in order andXApuDequeueResultreturns pending until it's done, as the console's audio hardware does.VICTORY_APU_ASYNC=0VICTORY_THIN_ELEVATED_THREADSWhy and what it did
Test PC: Intel Core i5-14600KF, RX 9060 XT 16 GB, 32 GB RAM, Windows 11. Series S, 1080p, High, FSR 4 Quality with FSR 4 frame generation.
Caveat: these are single sessions of ordinary play, not alternated A/B pairs, and areas differ between them. Frame times are compared at equal draw counts where it matters.
VICTORY_SHARED_TALLYtraced it toshadow::loose(65 buffers a second) andsend.rsupload buffers. Per minute of play: window buffer creation 1645 → 563 MiB, send buffers 878 → 198 MiB, allocation stalls over 50 ms 4.3 → 1.6. That session ran 22.5 fps at a median of 6,526 draws (the one before: 19.1 fps at 5,908).thin::for_externalfor about 16 s of 30 s together, about 24 ms per frame on the title's frame path. In a 48-minute session afterwards: 24.3 → 25.1 fps, frames over 100 ms 2.2% → 1.3%, frames of 9,000+ draws 52.6 → 50.3 ms. Part of the wait moved to the submission, which waits for translation.XApuEnqueueCommand. Moving it off didn't change the frame rate here (that thread wasn't the limit), but it frees most of a core, which may matter on slower CPUs. Sound was unchanged.recording_concurrency_capheld translation to 2 threads; on the critical path, translation threads woke each other some 35,000 times in 30 s at the top of their loop. The same PC with about 8 GB free ran far better. Not measured since; the new log line shows whether the cap acts.Testing
cargo build --release --locked -p victory: no warnings.mainitself fails three lints in files this PR doesn't touch (draw.rssame-type casts,rehydrate_prep.rsis_multiple_of,gameinput.rsassert_eq!with a bool); I ran clippy with only those three allowed.cargo test --workspace --locked --exclude victory-gpupasses, exceptswitches::documented_switches_are_read, which fails onmaintoo (the README's placeholderVICTORY_NAME). One shader test,read_by_index, was skipped: it crashes the AMD driver on this PC.decodes_on_its_own_thread_in_the_order_of_the_commands(victory-hle).Pull request closed