Repository navigation
Spread dispatches: VICTORY_SPREAD_LEAN runs the records within 65,535 groups through the plain signature (off by default; #1338) - #1352
Conversation
… groups through the plain signature (off by default) An indirect dispatch of a program that takes the spread words goes through a command signature that sets two root constants and then dispatches. On an RTX 3060 that costs about 13 ms of the card's time a frame, for ~1,000 such executions, of which ~1 a frame asks for more than 65,535 groups in x. With VICTORY_SPREAD_LEAN=1 (or alt, twenty seconds each way) a batch of up to 64 records is clamped into two arrays: plain [x, y, z] records for the plain dispatch signature, with the records past 65,535 left empty, and [row, asked x, x, y, z] records for the spread signature, with only those filled. A predicate word between them is 1 when a record that runs is spread. The dispatch is recorded as the plain execution, then the spread one under SetPredication(EQUAL_ZERO). Nothing is clamped to 65,535 groups either way. Larger batches take the spread signature as before. The clamp also counts, in the budget buffer's next words, the spread-eligible records over 65,535 groups and within it, and the groups past 65,535; the frame line says them. Measured on an RTX 3060 12 GB, standing still with =alt, 9 pairs: the card's time 91 against 108 ms (lower in every pair, median -12.8 ms), frame 208 against 225 ms, preparing +4 ms. WARP tests: the routing and counts of a mixed batch, and equal group ids at 100,000 groups through the two executions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested on Linux/Proton (GE-Proton11-14 + vkd3d-proton, RTX 5080 16 GB, Series X profile,
(AI-assisted testing and summary.) |
|
Thanks for running it under Proton. Your counters match ours: ~1,000 executions a frame through the spread signature, about one record a frame past 65,535. So the cost is the signature itself, and it is clearly worse under vkd3d (copy-back alone 247–360 → 80–100 ms there) than on Windows. With two independent results, on Windows/NVIDIA (card −12.8 ms) and on Linux/vkd3d (frame more than halved), the switch could be on by default, at least on NVIDIA and under vkd3d. A run of |
|
I ran a same-process alternating comparison on the RTX 5060 Laptop 8 GB with an Intel Core 7 240H, Bazzite 44, NVIDIA 615.78.08, GE-Proton11-14 and vkd3d-proton 3.2.0. Base was 52ac4ec with the #257 loop-latch fix and the same offline Series S prison checkpoint. Both phases used the same executable, rendering scale and initial caches. Three settled 18-second windows per mode exclude the first and last second of each switch interval.
The lean arm routed a median 913 indirect dispatches per frame through the new path. The steady checkpoint showed similar throughput in the two modes. The build exited cleanly. Both new cases and all 19 indirect tests passed on the physical RTX. I explicitly selected the hardware adapter in the fixture and used the existing local DXC fallback for the test worker. Under GE-Proton, the WARP-only fixture otherwise returned early after DXGI supplied a hardware adapter. Assisted by Codex (GPT-6.2-Sol High). |
|
Thanks, that is the case we had no data for: a laptop part, Series S, preparation and copy-back above 240 ms together. The routing count matches ours and BitWuehler's (~900-1,000 indirect dispatches a frame through the plain signature). A neutral frame there is what we would expect. The switch only takes work off the card, and on your run the frame is held by the host side (preparation 149-156 ms, copy-back 117-127 ms). On our RTX 3060 the card was the limit, so 12.8 ms of card time came off and the frame dropped by about 9 ms. If the card time per frame was logged in the same windows, it would show whether the saving is there and just hidden behind the host side. With three setups now, nothing got worse in any of them: Windows desktop, card −12.8 ms; Proton on a 5080, frame more than halved; Proton on a 5060 Laptop, no change. I think that is enough to turn it on by default. AMD is still unmeasured. About the fixture: the early return under GE-Proton is |
…to exp/rtx3060-m Combines exp/rtx3060-l (L1 wave, fxceless#854 paired form, fxceless#864, fxceless#812, fxceless#768, LEVELS_ON_DEMAND, RAM_SAFE) with fxceless main e4245f3 (fxceless#927, fxceless#646, DIRTY_4K, GATHER_SEGMENTS, PAGE_WRITES, group-budget indirect clamp, WAVE_WIDE_ONLY) and PR fxceless#1352 SPREAD_LEAN (bit 32, LEAN_RECORDS=64, spread budget counters 3-5). Co-Authored-By: Antigravity <noreply@anthropic.com>
What
Since
06702fean indirect dispatch of a program that takes the spread words goes through a command signature that sets two root constants (row, asked x) and then dispatches, 20 bytes a record. That holds for every such dispatch, whatever it asks for.With
VICTORY_SPREAD_LEAN=1(oralt: twenty seconds each way, each change logged), the clamp writes a batch of up to 64 dispatch records twice:[x, y, z]records from byte 0, with the records past 65,535 groups in x left empty;(records * 12 + 7) & ~7, a predicate word: 1 when any record that runs is spread;[row, asked x, x, y, z]records, with only the spread records filled.The dispatch is then recorded as
ExecuteIndirectwith the plainDISPATCHsignature,SetPredication(EQUAL_ZERO)on the word,ExecuteIndirectwith the spread signature, and predication off again.VICTORY_DISPATCH_SPREAD=0lost the device while loading in 2 of 4 runs.The clamp also counts, in the budget buffer's words 3-5, the spread-eligible records over 65,535 groups and within it, and the groups past 65,535. The frame line says them:
Measured (RTX 3060 12 GB, Ryzen 7 5700X, Series X profile, prison prologue)
The run was on our branch, which has this change on
06702fe+ceb9e1fand the #770 stack. Standing still at one spot,=alt, 9 pairs, warm pipeline library, world frames only:The card's time was lower in every pair: −22, −19, −9, −19, −16, −7, −1, −13, −8 ms (median −12.8). Preparing pays about 4 ms for two executions and the predication instead of one.
Of the ~890-990 spread-signature executions a frame, 0.4-1.2 a frame pass 65,535 groups.
A micro-benchmark of 1,000 single-record executions of an empty dispatch on the same card, card time:
In a real frame the difference is much larger, so the driver probably serialises around executions that set root constants.
This branch is the change alone, rebased on
e4245f3(the clamp's new group charge and gather segments). It was built and tested, but not run in game on this exact base.Tests
warp_spread_lean_routes_small_and_large_records_and_counts_them: a mixed batch (100, 100,000 and 65,535 groups), and an all-small batch. It checks the plain and spread arrays, the predicate word, and the counters.warp_spread_lean_executes_same_group_ids_as_spread_for_100k_groups: 100,000 groups and 100 groups through the two executions under predication. It checks that the same group ids run, and that the predicate is set and clear respectively.VICTORY_D3D12_DEBUG=1:indirect19 passed. Wholevictory-gpu --lib(--test-threads=1): 224 passed. Clippy on the workspace is clean, and--features diagnosticsbuilds.Not tried on AMD, hence off by default. With it unset, nothing changes apart from the three counters.
🤖 Generated with Claude Code