Send-and-hash list in three steps (copies, one state change, hash passes): 29 -> 6 ms of card time a frame #1227
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!1227
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1227"
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?
@KyleS98 on GitHub · 2026-11-26 00:53 UTC · original
KyleS98:perf/sync-list-batched→main· +163 −34 · 1 files · 2 commits · openWhat
Before each submission, one list of the layer's brings the copies in the card's memory up to date ("send-and-hash"). It went copy by copy. For each title buffer's copy it recorded:
CopyBufferRegions (the changed ranges, from PC memory),So the card went from copying to compute and back once per copy. That's about 300 times a frame once every title buffer's copy is in the card's memory (
VICTORY_CARD_BUFFERS_MIN_KB=64), which is where the README notes the send-and-hash lists rising from 11.6 to 23.0 ms.This PR records the same work in three steps over all the copies: every changed range copied up, then every state change in one
ResourceBarriercall, then every hash pass, with the hash pipeline bound once.It's safe to reorder. Each hash pass reads only its own copy's buffer, and a list's copies and hash passes for different copies touch different buffers, so no hash pass reads anything a later copy of the list writes.
VICTORY_CARD_SYNC_BATCH=0gives the old order.Measured
RTX 3090 Ti, warm cache, prologue cell. Each row is the same binary with the switch off and on, using the README's run-253 switch set plus
VICTORY_CARD_BUFFERS_MIN_KB=64 VICTORY_CARD_BUFFERS_MB=1280.9c184b3+ #798 + #1081 + #1171 + this006c353+ this PR onlyOn the Series X row the two runs were not at the same draw count (4,950 against 3,830–3,990 draws), so take the frame times there as indicative only. The send-and-hash times are the direct comparison.
In the Series S row the card went from 19 to 30 ms idle a frame and the submitting thread never waited for it, so on this machine the thread that prepares submissions is now the only limit.
Picture: the cell is the same in both orders, compared from grabs.
One thing found on the way (not caused by this PR)
In the Series S runs, the print on the back of the prologue's shirt disappears whenever the submitting thread never settles the flights within a frame:
VICTORY_LATE_WAIT_LISTS=1024, with either order of this PR.VICTORY_CARD_HASH_LEN=1.So something reads what a flight wrote without the layer knowing, and the settle at 256 lists in the air has been hiding it. I haven't found the read yet.
AI-assisted (Claude Code, Claude Fable 5.2); runs and grabs on my machine; no game data.
@UwUCammie on GitHub · 2026-11-26 01:09 UTC · original
Batching helped on an RX 7900 XT under Wine 11.22 / RADV 26.3.1 with
VICTORY_CARD_BUFFERS_MIN_KB=64. The same first-room session gave 335 accepted presents in 77.46 s with batching off (4.33 FPS) and 423 in 78.77 s with it on (5.37 FPS). All four adjacent pairs favored batching, by 0.99–1.10 FPS. The counter recorded 190,194 buffers in multi-buffer batches. Both private visual checks showed the room.A separate two-buffer test on this card verified the copied dwords and the piece hashes in 0.10 s off and 0.08 s on. GPU fixture · Build and gameplay measurements
@KyleS98 on GitHub · 2026-11-26 01:27 UTC · original
@UwUCammie thank you, both for the RX 7900 XT pairs (4.33 → 5.37 fps, all four pairs the same way) and for the fixture. I've merged your test into this branch (
1bb0e35). On the RTX 3090 Ti heretwo_dirty_card_buffers_reach_readback_in_the_same_submissionpasses withVICTORY_CARD_SYNC_BATCH=0and with=1(withVICTORY_CARD_BUFFERS_MIN_KB=64 VICTORY_CARD_BUFFERS_MB=1280), so both orders put the same dwords and piece hashes on the card on NVIDIA as well as on RADV.AI-assisted (Claude Code, Claude Fable 5.2).
@KyleS98 on GitHub · 2026-11-26 06:42 UTC · original
For anyone following: this is in
mainas6aed078, carried by hand, off by default there (VICTORY_CARD_SYNC_BATCH=1|alt), with @UwUCammie's test alongside. The maintainer's note says no run of theirs has carried it yet, so reports with=alton other cards are the useful thing now. Numbers so far: 29.4 -> 5.6 ms of card time in the send-and-hash lists on an RTX 3090 Ti (Series S, prologue cell), and about +1 fps in four paired runs on an RX 7900 XT.This PR is superseded by that commit and can be closed.
AI-assisted (Claude Code, Claude Fable 5.2).
@slauko on GitHub · 2026-11-26 08:21 UTC · original
Took it under Wine (RTX 3080 Ti, vkd3d-proton
ec20719, uiliannn's line,VICTORY_CARD_SYNC_BATCH=1, the cell at about 5,000 draws a frame, 190 to 200 MB of changed bytes a frame):preparing: copiesis 66 to 76 ms for those 190 MB — the copies are a memcpy into staging on this stack, so the recording side the batching saves is not what they cost here;Xid, the picture the same.So the 29 → 6 ms is real where it was measured, but a run whose copies are memcpy-bound does not see it. Worth knowing before anyone reads the switch as a frame-time win on Wine; the win there would have to come from the copy itself (a mapped upload heap would be the obvious one, and
VICTORY_WINDOW_UPLOADstays unsupported under this stack:GPU upload heaps ... supported=false).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.