gpu: remove hot-path scratch allocations in relay_merge, send::take, and refresh_front #498
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!498
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-498"
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?
@tiadiff on GitHub · 2026-11-27 23:35 UTC · original
pr/gpu-hotpath-allocs→main· +25 −10 · 3 files · 1 commits · closed without mergingProblem
Three hot CPU paths allocate unnecessarily per piece / per submission:
Shadow::relay_merge(crates/victory-gpu/src/shadow.rs): callstitle.clone()on every differing 64 KiB piece.send::take(crates/victory-gpu/src/host/send.rs): iteratesrangestwice (separately for runs and short-word count).Batch::refresh_front(crates/victory-gpu/src/host.rs): allocates a 2-elementVecvia.collect::<Vec<_>>()forsummed.Change
thread_local!Vec<u8>buffer inShadow::relay_mergeinstead oftitle.clone().send::take.VecinBatch::refresh_frontwith a stack[u64; 2].Pure refactor with no behavioral change (
3 files changed, 25 insertions(+), 10 deletions(-)).Verification
cargo test --release --locked -p victory-gpu --lib shadow::(passed)cargo xtask policy(290 files ok)cargo build --release --locked -p victory(succeeded)Part of the low-stutter patch stack tested in https://github.com/tiadiff/VIctory-NVIDIA-LowStutter.
@Machad3x on GitHub · 2026-11-28 01:27 UTC · original
Tested in a batch on an RTX 3080 Ti + Ryzen 7 5700X, 1440p, DLSS Quality, title ray tracing on (VICTORY_BVH_BUILDER=1), 240 s run into the prison cell scene. Batch: #516, #501, #498, #497, #532, #521.
Result: alive for the whole run, 61.5-63.9 ms/frame, 1 draw/frame dropped (not from this batch), no shader or pipeline refused.
No problem found in this PR.
@Rafa7046 on GitHub · 2026-11-28 01:28 UTC · original
Measured on an RTX 5080 16 GB + Ryzen 9 9950X3D (Series X, 1440p, DLSS Performance, frame generation off, diagnostics build on
64d4931with only this PR applied, pipelines made ahead withvictory warm), same stretch each run: Lucia's arrest cutscenes, then Jason on the boat and a minute standing still.preparingin the cutscenesmain, run 1main, run 2Two runs of plain
maindiffer by about 2.4 fps, so this is within the run-to-run spread on this machine: no measurable change in frame rate here, and no new warnings, faults or crashes in the log. On this card the frame is set by the submitting thread (about 21 ms of a 28 ms frame), which is probably why a saving of this size does not show.Same machine and scene with and without the title's ray tracing: #535.
@tiadiff on GitHub · 2026-11-28 01:40 UTC · original
Thanks for the feedback.
Obviously, this fix alone won't improve average FPS on high-end hardware, because the main bottleneck elsewhere (thread management) must be an order of magnitude higher
Pull request closed