Sends: snapshot only near the title's own buffer copies (VICTORY_SEND_OWN_COPIED, opt-in; RTX 3080 21.1 → 21.8 fps), with refresh and send diagnostics #3726
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!3726
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3726"
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?
@remijn on GitHub · 2026-11-30 05:02 UTC · original
remijn:send-own-copied→main· +415 −11 · 3 files · 2 commits · closed without mergingSummary
Two changes to how the bytes a submission changed reach host copies in the card's memory, plus the diagnostics used to find where that time goes. No defaults change: the new behaviour is opt-in (
VICTORY_SEND_OWN_COPIED=1) and the diagnostics are off unless set.On an RTX 3080 (Series S, the same save, 60 s measured per run), turning it on took the median from 21.1 to 21.8 fps, preparing a frame from 35.1 to 32.9 ms, and p99 from 84 to 82 ms.
VICTORY_SEND_OWN_COPIED=1: a snapshot only where it's neededEach submission's sends to copies in the card's memory are first copied into memory of the submission's own (
VICTORY_SEND_OWN, on by default), so that a later submission's preparation can't change those bytes before the card copies them up. The module's own notes say what that protects: the title's buffer copies, which we perform when a submission is prepared. "A value to a buffer, a draw that reads it", repeated in the next submission with another value, would otherwise have the first draw read the second value. What the title's CPU writes, it doesn't write while the card still reads it, as on the console.With the switch on:
defer_copy) are recorded, and kept for 8 frames.VICTORY_SEND_OWN=0does.Measured on the 3080, per frame: taking the sends into the snapshot fell from 2.8 to 1.9 ms. For comparison,
VICTORY_SEND_OWN=0(no snapshot at all, including for the title's copies, which isn't safe) took preparing down 4 ms in a 30 s A/B.card_recordalso sizes its range lists once instead of growing them push by push.Why opt-in: it relies on the assumption that the CPU doesn't rewrite memory the GPU is still reading. If some title does, those bytes could reach the card one submission late. It has run on one PC.
Diagnostics (off by default, diagnostics builds)
VICTORY_REFRESH_KINDS=1VICTORY_SEND_RUNS=1card_record)What they showed on the 3080:
card_recordare where that step's time goes.Tested
cargo checkwith and withoutdiagnostics.victory-gputests for sends, host copies and the compare (124 pass).Measured
RTX 3080 10 GB, 32 GB RAM, Series S profile, DLSS Quality, FSR 3 frame generation (rendered frames counted), ray tracing off,
play-foxhound.ps1's switches; the same save, 15 s warm-up then 60 s:VICTORY_SEND_OWN_COPIED🤖 Generated with Claude Code
Each submission's sends to copies in the card's memory are taken into memory of its own (VICTORY_SEND_OWN), so that a later submission's preparation cannot change them before the card copies them. That matters for the title's buffer copies, which we do when a submission is prepared ("a value to a buffer, a draw that reads it", twice in a row). What the title's CPU writes it does not write while the card still reads it, as on the console. With VICTORY_SEND_OWN_COPIED=1 the 64 KiB blocks the title's buffer copies write are noted (kept 8 frames). Copies with a dirty range in one go up out of own memory as before; the others send their short runs as pairs (as before) and their long runs straight out of their CPU side's staging buffer, as with VICTORY_SEND_OWN=0. Runs are not joined across gaps: a gap may hold what a shader wrote on the card and has not landed. card_record also sizes its range lists once instead of growing them per push. RTX 3080, Series S, the same save, 30 s runs: taking the sends 2.9 -> 1.7 ms a frame; with every send straight up (VICTORY_SEND_OWN=0, which also skips the title's copies) preparing fell 4 ms and p99 93 -> 72 ms. Co-Authored-By: Claude Opus 5.5 <[email protected]>@ColorC on GitHub · 2026-11-30 08:58 UTC · original
Independent cross-validation on RTX 5070 Ti + Ryzen 7 9800X3D (Series X 1440p, DLSS Quality + 3x MFG), via same-binary toggle A/B (
VICTORY_SEND_OWN_COPIED=1vs0) at ~10,250 draws/frame:copies in card's memoryVICTORY_SEND_OWN_COPIED=0VICTORY_SEND_OWN_COPIED=1Takeaway
VICTORY_SUBMIT_SPLIT=1+VICTORY_LAZY_COMPARE_MB=64+VICTORY_REFLEX_ASIDE=1,VICTORY_SEND_OWN_COPIED=1still delivered a clean-2.6 msdrop in submitting-thread card-copy work,+0.78 FPS(-1.0 msframe time), and-698 MBlower peak VRAM with zero visual issues or errors across 8+ minutes of walking tests.Test Setup
--res 1440 --dlss quality --framegen 3 --fps 1000)-C target-cpu=znver5) rebased onmain(41adb551) with a curated local PR stack; all A/B numbers below are same-binary toggle ablations from the exact same restored save (~10.0k–10.4k draws/frame standing scene) after official 1-time warmup.@shurhundo on GitHub · 2026-12-01 02:48 UTC · original
copied_lately()is only ever populated bynote_copied(), whichdefer_copy()calls for the title's explicit CopyBufferRegion path (host.rs:10840/10847). The ordinary write-watch refresh path (update_free_inner→copy_stale,shadow.rs:6425-6442) also writes fresh title bytes intoself.datafor the same submissions, but never callsnote_copied. So a range dirtied by a plain CPU store rather than an explicit buffer copy won't be flagged "copied lately" and takes the new unprotected direct-CPU-read path underVICTORY_SEND_OWN_COPIED=1, even though it's exposed to the same CPU-write-while-GPU-reads raceown()exists to guard against. Is that an intentional scope limit (buffer-copy writes specifically are the hazard, not all title writes), or a gap? TheCOPIED_FRAMEScomment about submissions still in the air when this fires reads like the latter is possible.@trustno1-coder on GitHub · 2026-12-01 18:49 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed