GPU: batch host mirroring for contiguous descriptor copies #3265
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3265
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3265"
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?
@yumaste on GitHub · 2026-11-26 15:03 UTC · original
yumaste:perf/batch-descriptor-copy-mirrors→main· +107 −14 · 2 files · 2 commits · openCopyDescriptorsSimple currently looks up the shader-visible destination heap and locks its pending queue separately for every descriptor. A contiguous, aligned copy into one heap now looks it up once. Pending indices are appended together. Initialized heaps use the existing sync_slots path in bounded batches to skip host slots whose record is already current. Ranges crossing heap boundaries or using a different stride retain the existing per-slot lookup.
An exact self-copy skips the guest byte write and still mirrors the destination, so records written directly into the heap can still become visible. Overlapping ranges with different starts still use memmove semantics. The change is shared across D3D12 adapters and adds no driver-specific defaults.
A synthetic 304-descriptor copy goes from 304 registry lookups to one on this path. The regression covers lazy heap initialization and verifies that a self-copy mirrors a new slot, clears a stale slot, and retains an occupied slot beyond the first batch. The full WARP GPU suite passed twice (247 passed, one ignored); strict Clippy passed. Scoped the existing test-only preparation hook to its own test thread after observing an unrelated test consume the hook during a parallel run. The new regression also passed on a physical NVIDIA RTX 5080 Laptop GPU with both PRs applied. AMD hardware validation remains open. No title files were used.
Inspired by reducing descriptor-store work and batching heap-record work in cool_fox.
@Dukestar69 on GitHub · 2026-11-26 15:08 UTC · original · approved these changes
Reviewed the diff and verified locally on Windows 11 x64 (RTX 5090 + WARP):
mirror_copyunder oneSHADER_HEAPSlookup (with 256-slotsync_slotschunks and a clean fallback for cross-heap/mismatched-stride ranges) and making the test hookWHILE_PREPARINGthread-local are clean and sound.cargo test -p victory-gpu --lib descriptor:: -- --test-threads=1 --skip dynamic_slots_are_held_until_released(RTX 5090): 22 passed, 0 failed (includingdescriptor_copies_mirror_batched_slots_before_and_after_host_creation).VICTORY_FORCE_WARP=1 cargo test -p victory-gpu --lib descriptor::tests::descriptor_copies_mirror_batched_slots_before_and_after_host_creation -- --test-threads=1(WARP): 1 passed, 0 failed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo clippy -p victory-gpu --features diagnostics --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@oni-swr on GitHub · 2026-11-26 16:10 UTC · original
WARP verification report (test report only, no code changes)
6c8fc75463bcca43(control); WARP software adapter forced withVICTORY_WARP=1 VICTORY_D3D12_WARP=1,--features diagnostics, d3d10warp.dll 10.0.26100.9818; dxil.dll 1.8.2502.11 (Windows Kit 10.0.26100.0, viaVICTORY_DXIL).--exact),-j 4, synthetic tests only, no game data. Command:cargo test -p victory-gpu --lib --features diagnostics -j 4 -- --exact <test>.descriptor::tests::descriptor_copies_mirror_batched_slots_before_and_after_host_creation: passes on the PR (1 passed). The changed testsdescriptor::host::tests::a_slot_rewritten_while_its_view_is_prepared_views_the_new_recordanddescriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_waitalso pass (1 passed each).victory-gpulib suite: PR 247 passed, 0 failed, 1 ignored (1 run); main 246 passed, 0 failed, 1 ignored. No failures.AI-assisted: verification by Claude Code (Claude Sonnet 5.5)
@Kajanos on GitHub · 2026-11-26 17:36 UTC · original
This PR and #3055 merge cleanly but don't compile together. On
main63bcca4+ #3147 + #3047 + #3048 + #3258 #3274 #3061 #3248 #3246 + #3265 + #3055 + #3068:#3055 replaces the runtime use of
HostHeap::sync_slotswithsync_rangesand leavessync_slotsunder#[cfg(test)], while this PR adds a runtime call to it indescriptor.rs. Whichever lands second needs a rebase onto the other. Both batch heap syncs, so they may also overlap in intent. In that stack I kept #3055 and left this one out.AI-assisted (Claude Code)
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.