Indirect records gathered by runs inside their lists: one clamp pass per run of draws, 10-13 ms less card time a frame #1171
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!1171
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1171"
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-25 22:40 UTC · original
KyleS98:perf/gather-runs→main· +207 −9 · 3 files · 2 commits · openWhat
VICTORY_INDIRECT_GATHER=1gives a single indirect record a slot that the list's prelude clamps, so its draw has no pass of ours in front of it. But a prelude can only serve records read before anything in the list may write arguments. After a list's first dispatch (or first draw whose shaders store to buffers), every record went back to a clamp pass of its own. In the prologue cell that is about 1,050 passes a frame, each one a wait for every shader write, a compute dispatch and another wait, placed between two mesh draws.This PR gathers those records by runs inside the list:
0xffffffff, which the clamp shader now skips).VICTORY_INDIRECT_GATHER_RUNS=0turns it off. It only acts whenVICTORY_INDIRECT_WINDOW=1 VICTORY_INDIRECT_GATHER=1are on.Measured
RTX 3090 Ti, warm cache, prologue cell (about 4,400 draws a frame). Each row is the same binary with the switch off and on.
d510ee4+ #798 + #1081 + main's frame-rate switches on9c184b3+ this PR, onlyWINDOW=1 GATHER=1So it takes 10–13 ms a frame off the card in both. The frame follows where the card is the limit (the first row). It doesn't where the submitting thread is the limit (the second row: preparing was 60–70 ms there).
Picture: the cell looks the same with and without the switch, compared from grabs.
How the size of it was found
The card meter's pipeline table only showed 3.8 ms a frame inside the clamp passes themselves. The cost is in what they do to the draws around them. To see that, this PR adds a timing-only switch,
VICTORY_INDIRECT_TRUST=draws|dispatches|1(unsafe, documented as such): such records run as the title wrote them, with no pass.draws: the title's lists took 42.8 ms. That's the ceiling, and the runs reach it.dispatches: the host removed the device within seconds of entering the world. Compute-dispatch arguments do hold garbage, so those keep their clamp.What's left after this is about 920–1,080 compute dispatches a frame, each with its own pass.
Tests
cargo test -p victory-gpu --lib: 206 passed. One fails here with and without this PR (indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields); I haven't looked into why.AI-assisted (Claude Code, Claude Fable 5.2); runs and grabs on my machine; no game data.
@SkillIssueXO on GitHub · 2026-11-25 22:50 UTC · original
I added and ran an independent Windows x64 WARP regression for
795311baintegrated with the local Series X controls build. It records a D3D12CopyBufferRegionthat writes two mesh arguments earlier on the same list, then records a 256-slot gather with the table initially empty. The fixture fills the two slots after recording the gather and asks for one offset twice.The readback returned
[9, 1, 1]and[7, 1, 1]in the assigned slot order, and the budget read back exactly 2,048. This covers argument visibility, the late-filled table, and charging the repeated offset only once. The game comparison withVICTORY_INDIRECT_WINDOW_CHECK=1is pending.AI-assisted testing. Synthetic buffers only.
@Proudnoob4 on GitHub · 2026-11-25 23:17 UTC · original · edited 2026-11-25 23:26 UTC
AI-assisted (Claude Opus 5.5 in OpenCode), measured on my own machine. This replaces two overlapping AI-written reports I posted here earlier; on re-auditing the logs, some of their numbers were single samples or misattributed, and one said there were no visual artifacts, which was wrong.
Setup: RTX 4080 16 GB, Windows 10 22H2, Series X build, diagnostics release, prison-cell scene (~4,800 draws/frame). Three single 360 s runs, so this is a bundle comparison, not an isolated A/B:
Marvisak/VIctory#2825native f16#1168+#1147+#1164(VICTORY_CARD_PIECE_KB=16) +#1171+#1172+ a local commit (skip cleancard_dirtycopies; chunk wide compare dispatches to ≤ 65,535 groups)all other lists), 2nd-half mediancardmeter, 256-frame mean, steadycardmeterunchanged). Which of C's additions gave the 8 ms is not isolated.For this PR: gather runs were active in C (
3,271 records in 42 passesper frame). This PR is the most likely source of C's ~8 ms GPU-list drop, but that is a guess until C is run with gather runs off. That isolated run is next on my list.@UwUCammie on GitHub · 2026-11-25 23:04 UTC · original · edited 2026-11-25 23:37 UTC
I ran the gather clamp on a physical RX 7900 XT with RADV 26.3.1 and vkd3d-proton. Both the seven consecutive records and seven records spread across a 256-slot run passed. The sparse case leaves holes across four workgroups and checks the occupied output records, the exact total charged to the budget and the original source buffer after completion. The test fails if the requested physical adapter is unavailable.
The test commit applies directly on top of this PR. Set
VICTORY_TEST_PHYSICAL_ADAPTER=1and run the graphics crate’sgather_run_chargesandgathered_records_come_outtests to repeat it. The usual WARP path remains available.In the first room on the RX 7900 XT, the same integration executable averaged 675 accepted presents in 73.81 s with run gathering enabled (9.15 FPS, 4,830 draws/frame), and 448 in 74.21 s with it disabled (6.04 FPS, 4,874 draws/frame). This is one on/off pair on a shared desktop. In the reverse pair the same instrumented executable averaged 8.60 FPS with gathering disabled and 7.87 enabled. The enabled run gathered 1,974,917 records in 24,231 passes during the measured interval. Both counters stayed at zero with gathering disabled. Across both pairs the pooled averages were 8.51 FPS enabled and 7.32 disabled, with the run order changing which setting was faster. All four runs
@KyleS98 on GitHub · 2026-11-26 01:25 UTC · original
Thanks all three. This is exactly the kind of checking the change needed.
[9, 1, 1]/[7, 1, 1]and a budget of exactly 2,048.VICTORY_INDIRECT_GATHER_RUNS=0on your C build is the one-run check for whether this PR is involved. If the tiles stay with it off, it's one of the others.Main has moved under this (
006c353changes how a list stops gathering), so I'll rebase and re-test before asking for anything.AI-assisted (Claude Code, Claude Fable 5.2).
46bf535): gather runs beside gathering copy by copy 674afc50e5@KyleS98 on GitHub · 2026-11-26 08:52 UTC · original
Merged up to
main46bf535(head674afc5); it no longer conflicts.mainhas gainedVICTORY_GATHER_BY_COPYsince (006c353,36bdd51), which goes at the same single records from the other side: the prelude keeps gathering for copies the list's shaders were not declared to write. The two fit together, and the merge does this:HostList::gather_run_ends). Before, the run ended with the prelude's gathering, which under the new switch no longer ends there.VICTORY_GATHER_BY_COPYunset nothing changes from the version reviewed here.Checked on an RTX 3090 Ti, Series X profile, 280 s from boot into the prologue cell,
VICTORY_INDIRECT_GATHER=1 VICTORY_ASYNC_SUBMIT=1 VICTORY_QUEUE2=1, once without and once withVICTORY_GATHER_BY_COPY=1: both ran to the end with the cell on screen, no crash and no device loss. These two runs are a check that it works after the merge, not a timing comparison; the timing in the description is from before it. Thanks again to @SkillIssueXO, @UwUCammie and @Proudnoob4 for the tests and the AMD numbers.AI-assisted (Claude Code, Claude Fable 5.2).
@Filip722 on GitHub · 2026-11-26 13:57 UTC · original
I tested the clamped in-list gathering path from
674afc5on an RTX 5060 Laptop GPU (8 GB), NVIDIA 615.78.08, Bazzite 44, GE-Proton11-14 and vkd3d-proton 3.2.0. I backported the path to the older Series S compatibility build used for both arms. Both started with the same offline checkpoint, seed and warmed driver cache, with argument windows and prelude gathering enabled.In-list gathering handled about 3,102 records/frame in 40 additional passes/frame. Both replays rendered the same room and the patched run responded to camera input. The measured submission gain was modest in this pair. The synthetic RTX readback test also passed with two offsets filled after the clamp pass was recorded, and unused slots left out of the budget.
I separately reproduced duplicate offsets sharing one budget slot in main's prelude gather set and opened #1313 for that case. The measured port above retains the original slot behavior from this PR.
Assisted by Codex (GPT-6.2-Sol High).
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.