gpu: join copy_beside before placed_copy/publish in submit split and note batch writes on shader_writes #2433
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!2433
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2433"
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?
@qlfu on GitHub · 2026-11-29 13:00 UTC · original
qlfu:pr/fix-submit-split-send-beside-and-indirect-batch→main· +12 −2 · 2 files · 1 commits · merged 2026-11-30 14:12 UTCWhat it changes
Fixes two synchronization/tracking bugs in opt-in GPU submission and indirect-batching paths on
origin/main(829188e9):VICTORY_SEND_BESIDE=1beforeplaced_copy/ submission publish underVICTORY_SUBMIT_SPLIT=1(crates/victory-gpu/src/host.rs): Whenpublishis true,Host::submitcallsself.card_take(...)which spawns asynchronouscopy_besidereads ofShadow::data, then only joinedsnapped(&mut snapping)before mutatingShadow::dataviashadow.placed_copy(...)and releasing thesubmittedlock for the next submission's refreshes. Joiningown.copied()immediately aftersnapped(&mut snapping)preserves overlap with snapping while preventing tornShadow::datareads.HostList::note_batch_writeon early returns inShadow::gpu_writesandShadow::shader_writes(crates/victory-gpu/src/shadow.rs): UnderVICTORY_INDIRECT_BATCH=3,Shadow::shader_writesreturned early forself.place.is_some()(e.g.VICTORY_PORT_CONSTANTS=1) andwc_no_backbuffers without callinglist.note_batch_write, andShadow::gpu_writesomitted it on thewc_no_backearly return. Both paths now record the write inWriteLogso subsequent indirect batches do not reuse stale clamped arguments.How it was tested
cargo testpassed for the crates it touches: yes (cargo test -p victory-gpu --lib --locked indirect::batch -- --test-threads=1passed, exit 0;cargo clippy -p victory-gpu --lib --tests --locked: 0 new warnings;--all-featureshits pre-existingmainshadowing inhost.rs:8673tracked by #2208).Checked for overlap
SEND_BESIDE,SUBMIT_SPLIT,shader_writes, andnote_batch_write; no overlapping open PR found.@Dukestar69 on GitHub · 2026-11-29 13:04 UTC · original · approved these changes
Tested locally merged onto
main(829188e9).crates/victory-gpu/src/host.rsandshadow.rs.cargo test -p victory-gpu --lib shadow::passed (71 passed; 0 failed; 5 ignored).cargo test -p victory-gpu --lib host::written_spans_tests::passed (3 passed; 0 failed).Clean ordering fix joining
copy_besidebeforeplaced_copy/publishin submit split and recording batch writes onshader_writes. LGTM.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
48099873f9tod5e6ebc0e7@qlfu on GitHub · 2026-11-29 14:53 UTC · original
Updated with deferred
copy_besidejoin (send::CopyWait+Host::pending_copy_beside):Shadow::placed_copywhen!batch.placed.is_empty()and beforeShadow::update/refresh_front/refresh_ahead/run_deferredon the next submission (plus top ofHost::settle), keeping theCopyWaitmutex held acrosscopying.join().copy_besideand submission N+1'scard_steps/sweep/ask_once.0 WARNs / 0 ERRORs):card_copiesdropped2.10 -> 1.30 msmedian (2.53 -> 1.57 msmean, -0.96 ms/frame); allindirect::batch,host::send, and fullvictory-gpu(926 passed; 0 failed) tests pass with0new clippy warnings.d5e6ebc0e7to48099873f9@qlfu on GitHub · 2026-11-29 15:33 UTC · original
Reverted the deferred
CopyWaitexperiment back to joiningown.copied()immediately beforeplaced_copy/publish(48099873):victory-relay(Shadow::card_merge_relayinshadow.rs:7188) mutatesShadow::dataconcurrently without holdingHost::submitted, so keepingcopy_besideactive pastpublishcan race with landed shader writes (and produced visual reflection artifacts in live testing).own.copied()immediately beforeplaced_copy/publishguarantees no backgroundcopy_besidereader remains alive onceHost::submitreleasessubmitted.@Yoruiopz on GitHub · 2026-11-30 11:22 UTC · original
Independent Windows verification on .05 (
41adb551) with synthetic memory. The CPU-only fixture used the production submit, send, and shadow code. A pending 32 KiB upload captured 0xC7 from a later placed update instead of its original 0x39 in four controlled schedules: the update was in the same submission or after handoff, and the copy job was queued or already claimed by a worker. All four preserve 0x39 when the exact patch from48099873is applied on .05. The synchronous and already-completed controls pass on both revisions.The locked Windows diagnostics crate build passed eight relevant CPU unit tests, with one adapter-dependent case ignored. The reproduction used CPU memory and synthetic bytes. The current #3809 and #3881 patches also apply cleanly on this tree.