perf(descriptor): defer TextureQueue WRITE ops to per-heap pending inbox with inline QueueBatch #3104
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!3104
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3104"
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 20:02 UTC · original
qlfu:pr/perf-texture-queue-pending-inbox→main· +356 −128 · 2 files · 2 commits · closed without mergingSummary
Eliminates ~98% of global
TextureQueuemutex traffic (TextureQueue::WRITE) caused by per-slotmirror(handle)calls duringdescriptor::recordandsync_heaps:HostHeappending_opsinbox +pending_count(on by default;VICTORY_QUEUE_PENDING=0disables): single-slotmirrorwrites append into a per-heap inbox rather than locking the globalTextureQueueon every descriptor slot.STATE_KEEPS | STATE_PENDINGSeqCstCAS Dekker handshake: guarantees draining readers never miss a newly queued op while keeping the uncontended fast path lock-free.[QueueOp; 64]QueueBatch: avoids heap allocation for normal batches.host.mirrorfast path in single-slotmirror_in_heaps.Verification
cargo +1.98.1-x86_64-pc-windows-msvc clippy -p victory-gpu --lib --tests --no-deps --locked: 0 new warnings.cargo +1.98.1-x86_64-pc-windows-msvc test -p victory-gpu --lib --locked -- descriptor::host::tests --test-threads=1:71/71passed.0 WARNs / 0 ERRORs):TextureQueuelocks/5s:84,418–85,323->1,538–1,682(-98.0%).TextureQueuelock wait/5s:376–492 ms->8–12 ms(-97.5%),noting342–470 ms->0 ms.sync_heapswait:1.55–1.75 ms->0.72–1.33 ms.@qlfu on GitHub · 2026-11-30 12:36 UTC · original · edited 2026-11-30 15:27 UTC
Fixed a concurrency race in
drain_pending_into/enqueue_pending:pending_countnow increments viafetch_add(ops.len(), Release)and decrements viafetch_sub(drained, Release)strictly afterapply_queue_opscompletes, so concurrenttexture_news()checks never observepending_count == 0while drained ops are still being applied. Verified withdescriptor::tests (105 passed) and cleanmerge-treeagainst41adb551.Pull request closed