Steps on the card: their planning on the submitting thread cut by a fifth (a third with more places) #2005
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2005
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2005"
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?
@binarycleric on GitHub · 2026-11-29 07:07 UTC · original
up/card-steps-planning→main· +747 −169 · 1 files · 5 commits · closed without mergingWhat it changes
With
VICTORY_CARD_STEPSon and the relay's second stage, every submission held up by flights in the air is planned on the submitting thread before it goes: the steps the card can do in front of it are chosen, the host copy that holds each one's bytes is found, our list is recorded, and the fills' descriptor slots are pointed at the result. A play log broke the submitting thread's time down only as far as "card steps", about 4 ms a frame. This PR measures the four parts and cuts the three that cost the most.How it was measured
The first commit splits
take_stepsinto four functions, named after the timeline spans it already had:choose,ops_of,record_opsandpoint_slots. Behaviour doesn't change. It also addsplanning_bench, an ignored test that runs those functions on a frame like a street's:BENCH_FRAMES/SUBMISSIONS/FILLS/PLACES/WRITERS/RING_KB/IN_THE_AIRchange the load. Every comparison below ran the two settings in alternating rounds (6 to 10 rounds) and takes medians per frame. Noise was about ±8%: once, two identical settings came out 111 µs apart while other builds were running.At the start, per frame on a quiet machine: steps chosen ~340 µs, holders ~230, the list ~270, slots ~550. In total ~1.4 ms. With other builds running, the slots on 8 threads took 1,200 µs and slowed the other parts, for a total of ~2.1 ms.
What changes
=0restores the old path)VICTORY_CARD_SLOTS_ONE_THREADplanno longer boxes an iterator for every step (3,200 allocations a frame).VICTORY_CARD_WRITERS_SWEEPVICTORY_CARD_READS_JOINEDOverall, first commit against last, 10 rounds on a quiet machine: 1,423 → 1,141 µs a frame (~237 → ~190 µs a submission). In a heavier frame (3,000 places, 1,500 writers): 5.96 → 1.92 ms.
The bench numbers were taken on our integration branch; on main the commits conflicted only where
take_stepswas split up.VICTORY_PLACED_FILLS(#740) now goes throughchoose: its served fills come back with the chosen steps, and their slots are pointed afterpoint_slots, on the same thread. The bench runs with it off.Tried and not kept
blocked_by's answer on tolate_blocked: a wholeblocked_bythat finds nothing blocked costs 5 to 7 µs a frame.mappedlearned of pages across submissions: it costs ~25 µs a frame, and a stale entry is a correctness risk.How it was tested
planning_bench(above)VICTORY_CARD_STEPS=2, 26–28 fps, about 3,500–4,700 draws) 3.2–3.3 ms a frame. The two play numbers come from different builds of a busy branch, so they show a direction, not this PR alonecargo testpassed for the crates it touches: yes. Rebased onto maine1f2eb60:cargo test --release -p victory-gpu --lib, 592 passed, 0 failed, 45 ignoredTests
one_pass_over_the_writers_says_what_each_in_turn_does: the one pass gives the same answer, refusals included, as looking at each writer for each place. 300 random rounds of overlapping, empty and side-by-side writers and places, with writers added while it's under way.the_holder_is_the_same_after_one_pass:holdergives the same host copy or refusal both ways, with three real host copies and a writer pushed during planning.places_read_are_where_their_copies_put_them: with joining on and off, every place's bytes are where its op reads them. Places start 256-aligned, copies don't overlap, and the layout fits our buffer (400 random rounds).Checked for overlap
planand replaces the linear writer scan, with a sorted search), #1298 (card_steps among other submitting-thread changes). Slots on one thread, the one-pass writer sweep and joined reads are separate switches here, so whichever lands first, the rest can be rebased onto it.Pull request closed