victory-gpu: opt-in parallel texture readback landing (VICTORY_TEXBACK_PARALLEL=1) #268
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/TaynanGT--Vice-Tay!268
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-268"
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?
@Vladimir-Human on GitHub · 2026-11-27 13:02 UTC · original
Vladimir-Human:perf/parallel-texback-and-helper-prio→main· +403 −20 · 2 files · 1 commits · openSummary
Narrowed to isolate strictly the texture readback ticket lifetime behind an opt-in switch
VICTORY_TEXBACK_PARALLEL=1(default off; liveVICTORY_ABtoggle supported indiagnosticsbuilds).descriptor.rs,descriptor/host.rs,draw.rs) have been removed for zero overlap with #234.VICTORY_BATCH_RETIRE=1) has been split into standalone PR #295 for independent matched-fixture evaluation.VICTORY_CARD_AWAKE=0andcard_stepsedits have been dropped from this PR.Adapted from
XaviFortes/VIctory-RDNAcommitse4250ebandaf65a79.Changes (
2 files: crates/victory-gpu/src/texback.rs,crates/victory-gpu/src/host.rs)texback.rs):parallel_enabled()defaults tofalseand enables parallel readback landing only whenVICTORY_TEXBACK_PARALLEL=1(orVICTORY_ABselects it indiagnostics). When off,land_manyexecutes sequentially in exact submission order.texback.rs): Narrows theTICKETSmutex intexback::landto the finalvalidre-check andcopy_mappedwrite while preserving the existingMAPPING -> TICKETSlock order (title_memory_reading()held outsideTICKETS). Worker threads reuse thread-localScratch/ tiling buffers vialand_local.texback.rs):plan_land_manyskips an earlier readback only when a later still-valid ticket matches the exact(owner, at, end)(so both share identicalreleased/replaced/remappedinvalidation predicates and texture subresources). Any overlapping remaining destination ranges fall back to strict sequential submission order.host.rs):read_backs_flightborrows each flight'sDeferred::texture_backsin place soReadbackPoolleases stay exclusive untillist.reset().Tests & Verification
Verified with
VICTORY_D3D12_DEBUG=1and--test-threads=1(0 D3D12 debug errors):cargo clippy -p victory-gpu --all-targets -- -D warnings(default &--features diagnostics): 0 warningsxtask policy --staged(2 files ok) &cargo test -p xtask: 11/11 passedtexback::tests:parallel_switch_defaults_off_and_accepts_only_oneplan_land_many_handles_disjoint_dedup_overlap_and_stale_ticketsland_many_preserves_overlap_order_and_disjoint_parallel_on_gpu(tests disjoint parallel landing, same-owner dedup, and both forward[0..256)->[128..384)and reverse[128..384)->[0..256)overlap ordering in both sequential and parallel modes)land_many_blocks_stale_cancelled_superseded_and_remapped_tickets_on_gpu(testsreleased,replaced, partialremapped, out-of-rangeremapped, and cancelled later duplicate not suppressing an earlier valid ticket)texback::tests5/5;--features diagnostics(off &VICTORY_TEXBACK_PARALLEL=1)texback::tests5/5,host::late_tests3/3,readback_pool5/5VICTORY_D3D12_WARP=1,--features diagnostics,VICTORY_TEXBACK_PARALLEL=1):texback::tests5/5,host::late_tests3/3,readback_pool5/5@TaynanGT on GitHub · 2026-11-27 13:09 UTC · original
@Vladimir-Human The readback ticket, resource retirement and descriptor slot allocator are separate lifetimes. I’d compare each change independently with the same fixture. The readback path needs the overlap-order and stale-ticket checks, and the slot changes should be coordinated with #234 so the two reclamation paths don’t overlap.
github-bot referenced this pull request2026-11-27 13:47:49 +00:00
perf(gpu): parallelize texback, batch resource retirement and dynamic slot bitsetto victory-gpu: opt-in parallel texture readback landing (VICTORY_TEXBACK_PARALLEL=1)25bfb037catobe13f4bfe8@Vladimir-Human on GitHub · 2026-11-27 14:05 UTC · original
@TaynanGT Thanks for the clear review — #268 has been narrowed to a single lifetime and split cleanly:
VICTORY_TEXBACK_PARALLEL=1, default off): #268 now touches onlycrates/victory-gpu/src/texback.rsandcrates/victory-gpu/src/host.rs, keeping sequential readback landing unchanged by default (VICTORY_ABsupported indiagnostics).descriptor.rs,descriptor/host.rs,draw.rs) were removed.crates/victory-gpu/src/texback.rscovering forward/reverse destination overlap order (land_many_preserves_overlap_order_and_disjoint_parallel_on_gpu), disjoint parallel landing, exact(owner, at, end, valid)dedup, andreleased/replaced/partialremapped/cancelled-duplicate stale-ticket blocking (land_many_blocks_stale_cancelled_superseded_and_remapped_tickets_on_gpu), alongsidehost::late_testsandreadback_poolexclusivity tests (0 D3D12 debug errors on HW and WARP).retire_resourcehandoff was split into standalone opt-in PR #295 (VICTORY_BATCH_RETIRE=1, default off, with COM refcount lifetime tests untilbury()) for independent matched-fixture comparison;VICTORY_CARD_AWAKE=0andcard_stepsedits were dropped.@TaynanGT on GitHub · 2026-11-27 14:25 UTC · original
@Vladimir-Human The split gives us a clean readback test. The overlap-order and remapped-ticket regressions cover the paths I flagged. I’ll compare
VICTORY_TEXBACK_PARALLELon its own. The stamp-ordering case on #295 can stay with retirement.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.