gpu: coalesce card-memory piece hashing across 64 threads per piece #997
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/fxceless--victory-fork!997
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-997"
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?
@UnkwnDev on GitHub · 2026-11-25 15:29 UTC · original
UnkwnDev:arc-card-compare-coalesced→main· +260 −34 · 2 files · 1 commits · openSummary
CARD_COMPAREincrates/victory-gpu/src/host.rsto dispatch one[numthreads(64, 1, 1)]threadgroup per 64 KiB piece (looping by 65,535 whenpieces > 65535), replacing the 4,096-step serial loop per thread with 64 coalesced 16-byte loads striding 1,024 bytes (for (uint at = lo + t * 16u; at < hi; at += 1024u)).Spancbuffer (first, skew, size, pieces, out_at, compare), gave each lane a distinct seed, and reducedgroupshared uint4 lane_h[64]via explicitGroupMemoryBarrierWithGroupSync()stages (64 -> 32 -> 16 -> 1) plus a loop-end barrier before the next iteration overwriteslane_h, avoiding any wave-size assumptions across Wave16/Wave32/Wave64/WARP.CARD_COMPAREdispatch sites incrates/victory-gpu/src/host.rsand the doc comments onCARD_COMPAREandrehash_runs()to usepieces.min(65535).warp_card_*tests incrates/victory-gpu/src/indirect.rsfor 1-group-per-piece dispatch and addedwarp_card_compare_coalesced_lanes_and_skewcovering non-alignedskew, non-zerofirst/out_at, single-byte mutations across all 64 lanes, simultaneous identical MSB flips in paired lanes,compare = 0/1/2, and D3D12 debug-layer validation on both WARP and the hardware GPU.Benchmark (Intel Arc A770,
probe_7_coalesced_card_compare)Verification
$env:VICTORY_D3D12_DEBUG='1'; cargo test -p victory-gpu --features diagnostics --lib warp_card -- --test-threads=1: 3 passed, 0 failed (including zero D3D12 debug-layer warnings or errors onCARD_COMPARE).cargo test -p victory-gpu --lib -- --test-threads=1: 170 passed, 5 ignored, 1 pre-existing unrelated failure (indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields).cargo test -p xtask --locked: 4 passed, 0 failed.cargo clippy --workspace --all-targets --locked -- -D warningsand--all-features: 0 warnings in touched files (host.rsand new code inindirect.rs); pre-existing upstream warnings remain inresource.rs:2553,draw.rs:2406,shadow.rs:2675, andindirect.rs:2356(Rig::depth_written).(Get-Item crates/victory-gpu/src/host.rs).Length: 399,234 bytes (< 524,288 bytes).AI assistance: implemented and verified with Gemini 4 Hydrogen / Claude.
@UwUCammie on GitHub · 2026-11-25 16:59 UTC · original
Tested on RX 7900 XT (CachyOS Linux, Wine 11.22 + vkd3d-proton + RADV). Merged cleanly and ran through multiple 480–540 s gameplay passes (up to frame 4600) with our card compare lists down to ~1.4–1.5 ms/frame on the GPU clock and zero device removals or debug issues.
@UnkwnDev on GitHub · 2026-11-25 17:17 UTC · original
@UwUCammie Thanks for verifying on RX 7900 XT (RADV / vkd3d-proton / Linux) across multiple 540 s runs. Glad to see the coalesced submit approach keeps GPU time at ~1.4 ms/frame with clean stability.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.