GPU: the passes over copies in the card's memory hash with a group per piece #253
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!253
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-253"
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?
@TG0000 on GitHub · 2026-11-24 23:01 UTC · original
TG0000:gpu/card-hash-wide→main· +150 −11 · 3 files · 1 commits · openWith copies kept in the card's memory (
VICTORY_CARD_BUFFERS_*), the passes that hash their 64 KiB pieces used one shader thread per piece, with a pass per range sent up and copies and passes in turn. They now use one 64-thread group per piece, and the copies come first, behind one barrier.VICTORY_CARD_HASH_WIDE=0keeps the old passes.Measured on an RX 6800 (Ryzen 5900X, Windows 11), in the world, on
7b0f736plus our measuring tools and PastiiJay's AMD wave fixes; the same change is rebased here ona253706and has not been run in a game on that head:Tests on this head (
3b0521a, one thread, RX 6800 and WARP): victory-gpu 169 passed, 1 failed; victory-shader 215 passed. The failure iswarp_budget_saturates_without_wraparound_and_preserves_draw_fields, which also failed 2 of 6 times on unchangedf85101bhere (#847 and #849 are about it). Clippy with-D warningsfor the Windows target (both feature sets), with #841's patch on top: one error,shadow.rs(is_multiple_of), the same on unchangeda253706.With main's copy queue (
VICTORY_QUEUE2) the copies-first order keeps the landing buffer's offsets: copies are recorded in the same order as they were sent up.Not measured: NVIDIA, Intel, other AMD cards, and pictures frame by frame (the photos show the same kind of scenes). A report of the GPU ms per frame with
VICTORY_CARD_HASH_WIDE=0and without it, on any card, would help.AI-assisted.
🤖 Generated with Claude Code
@ericomeehan on GitHub · 2026-11-24 23:37 UTC · original
A heads-up on overlap, in case it saves a rebase later: #265 (
VICTORY_LEAN_WINDOWS) rewrites the same copy loop incard_before(host.rs). It adds an upload-ring path for lean windows that can close, run and wait on the list partway through the loop when the ring fills, then reset it and carry on. This PR reorders that loop into "all copies, then one barrier, then all hash passes" behindhash_wide(). The two don't merge textually. And once both are in, a mid-loop flush would split "all copies" into several submissions, so the single barrier and the passes after it would need to come after the last flush, or be repeated per part. Whichever of the two lands second will need to fit around the other, so it may be worth comparing notes with CoDrift.Written with an AI assistant (Claude).
@ryotdev on GitHub · 2026-11-25 00:43 UTC · original
Tested on a desktop RTX 5070, driver 610.88, Windows. I applied the GPU changes from
3c9b4ceto a local #63 build and ran the same executable (SHA-256 prefix9d1f15b53bb7) withVICTORY_CARD_HASH_WIDE=0, then=1. Each run started from the same save and pipeline-cache seed with relay off. I measured the first 90 seconds after the scene reached 3,500 draws/frame.The final windows had 4,959 vs 4,970 median draws/frame and about 16,800 pieces compared per frame in both arms. That gives a 4.8% gain in settled FPS for this pair. The higher p90 is worth keeping in view. Both runs completed. The wide screenshot had a darker character silhouette and brighter background, but the captures were 3.6 seconds apart at different draw counts, so visual parity is still open.
Both comparison shaders passed the D3D12 WARP tests with #71’s paired-sign edit and a skewed boundary/partial tail. The old #71 build missed the paired edit on the same machine. AI-assisted testing.
@tightfall on GitHub · 2026-11-25 01:10 UTC · original
A data point from an RX 9070 (RDNA 4, Windows 11, Adrenalin 26.11.2), in case it helps this one along.
I hit the same cost independently and made the compare pass part of this change (one 64-lane group per 64 KiB piece, lanes interleaved over 16-byte blocks) in #451, before I saw this PR. This PR covers more (the hash passes too, copies ahead of one barrier), so I'm closing mine in favour of it.
What I measured with the compare-only version, so it is a lower bound for this PR:
CARD_COMPAREwas the most expensive pipeline in the capture, 0.4-0.64 ms per pass regardless of size (4096 serial steps in one thread), about 600 passes a frame. The card was idle about 66% of the time, so the frame is CPU-bound around it.VICTORY_INPLACE=2: median 3.0-3.1 fps -> 3.8 fps (about 330 -> 266 ms a frame). Tree: myokex/victory-amd 8e6d29e (2119b0e+ 6 commits) plus the compare change, withVICTORY_TEXTURE_SWEEP=0.I haven't run this PR itself in the game on this card yet; I'll add the numbers here when I have them (with
VICTORY_CARD_HASH_WIDE=0and without, as you asked).AI-assisted (Claude Code).
@alpz1000 on GitHub · 2026-11-25 22:15 UTC · original · edited 2026-11-25 22:30 UTC
I tested the standalone
CARD_COMPARE_WIDEshader from3b0521aon an RTX 3060 12 GB (driver 610.88, Windows 11). The baseline is the one-thread-per-piece shader from9c184b3. Both used the same generated bytes in D3D12 DEFAULT-heap buffers.Numbers are medians of nine measured batches per shader, with 16 mode-0 hash dispatches per batch, a UAV barrier between dispatches, and D3D12 queue timestamps. This measures the shader and the dispatch barrier in isolation.
I also ran
3b0521aapplied to a local integration of9c184b3, with the Series S profile and a 64 KiB card-buffer threshold. After shader compilation settled, 398 frames at a stationary checkpoint averaged 4.88 FPS, with a 234 ms p90. The median timing windows showed 3.6 ms in send-and-hash lists and 1.4 ms in compare lists per frame. CPU-side submission preparation was 167 ms per frame. An earlier local build recorded 13.8 ms and 6.1 ms respectively for those GPU lists at the same checkpoint, with a different base and card-buffer threshold. The isolated shader benchmark above is the controlled comparison.AI-assisted with OpenAI Codex.
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.