perf(descriptor): defer TextureQueue WRITE ops to per-heap pending inbox with inline QueueBatch #3104
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by qlfu on 2026-11-29T20:02:12Z.
Summary
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.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by qlfu on 2026-11-30T12:36:48Z.
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.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.