perf(gpu): batch dynamic descriptor release, 64-way padded RETIRED with oldest watermark, and scratch_held_with_base #26
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-logs
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ToLIManl--VIctory-Hydra!26
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/26/head"
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?
@justadudeinbulgaria on GitHub · 2026-12-01 18:16 UTC · original
justadudeinbulgaria:pr/descriptor-batch-retired-64→main· +193 −26 · 4 files · 1 commits · closed without mergingSummary
Cherry-picks the three genuine lock/COM-overhead wins from
Androtim/MiniVI#288adapted cleanly to VIctory-Hydra's existingbits::two_ended_run,DYNAMIC_SLAB,CopyRun, andbury_lag()architecture:descriptor.rs,descriptor/host.rs,draw.rs):descriptor::release_dynamic_batch()andHostHeap::release_batch(), collapsing per-tableSHADER_HEAPS.read()+HostHeap::next.lock()loops inState::tables_done()andDrop for Stateinto a single read lock + single heap lock per contiguous heap run.self.slabdirectly intoself.dynamicontables_done()/Drop(eliminating an extra lock for the unused tail), preserves theguard.0 = guard.0.min(min_at)lowest-free hint forbits::two_ended_run, and notifieslist::thin::moved()once after releasing the lock.RETIREDshards + lock-freeoldestwatermark (host.rs):RETIREDfrom 16 unpadded[Mutex<VecDeque>; 16]entries to 64#[repr(align(64))] struct RetiredShardentries with an atomicoldest: AtomicU64watermark, eliminating cache-line false sharing across recording/list threads and lettingbury()skip empty/not-ready shards with one lock-freeAcquireload.let finished = finished.saturating_sub(bury_lag());strictly beforeuav_pool::drain_retired_uavs(finished).HostList::scratch_held_with_base+HostHeap::constant_at_with_base(host.rs,descriptor/host.rs,draw.rs):gpusoconstant_at_with_base()skips a redundantID3D12Resource::GetGPUVirtualAddress()COM call per CBV slot whenVICTORY_PORT_CBV=0.Verification
crates/victory-shader/*andshader_cache.rsuntouched).origin/main(48413c9):descriptor::+host::retired_tests::sharded_retired_queues_drain_across_threads_in_order: all passedVICTORY_DYNAMIC_SLAB=0draw::: 7/7 passedSUBdropped from51.5 msto32.4–44.8 ms, liveFRAMEdropped from104.5 msto85.0–93.4 ms,0descriptor waits,0drops/visual artifacts.@ToLIManl on GitHub · 2026-12-02 12:54 UTC · original
Thank you @justadudeinbulgaria! Integrated onto v2.0
mainin commit5d7f3efwith fullCo-authored-bycredit:#[repr(align(64))]cache-paddedRETIREDshards with atomicoldestwatermark and fast-skip inbury()(host.rs, plus updatedhost/membench.rs), preserving v2.0's monotonic fence invariant.scratch_held_with_base(host.rs) andconstant_at_with_base(descriptor/host.rs) to avoid redundantGetGPUVirtualAddress()COM calls.release_dynamic_batchwas already present in v2.0descriptor.rs.)Built, unit-tested, and shipped in the refreshed
VIctory-Hydra-v2.0-Stage17.ziprelease. Closing since the PR targeted pre-v2.0 history and is now landed onmain.Pull request closed