List translation: a bench of a frame's list calls, a draw's retirements under one lock, per-thread draw counts, dropped draws by reason #2006
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!2006
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2006"
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/list-translation-cpu→main· +1285 −34 · 12 files · 6 commits · closed without mergingWhat it changes
Why
Turning the title's list calls into D3D12 calls costs about 6.2 µs a call in
play logs of 2026-11-28: about 280 ms of CPU a frame across the eight
threads that do it. Those are the title's own recording threads, or with
VICTORY_THIN=1ourvictory-list-*threads, whose work the submissionsthen wait for. There was no way to measure that cost outside a play run, and
no profile of where it goes.
The 5-second line also put every dropped draw under "without a host
pipeline". That was 300 to 1,400 draws a frame, and nobody could tell
missing pipelines from draws that failed to bind.
What
Commits 1, 2, 4: a bench of the list calls (
list/bench.rs,#[ignore])(about 23,500 calls) through the same
list::statecalls as a translatingthread.
early-pipelines.txt,made from an earlier run's
known-pipelines.binandknown-shaders.bin(
pipeline/known.rsbench_pipelines).a mesh pool; each thread has its own render targets and depth target.
textures upload once, as in a run. The bench prints ns and cycles per call
(
QueryThreadCycleTime), CPU ms and wall ms a frame.VICTORY_BENCH_PROFILE=1: samples the threads every quartermillisecond (suspend,
RtlVirtualUnwind, dbghelp with inline frames; noadmin rights needed) and prints where they were.
VICTORY_BENCH_AB=<switch>,..: turnstoggled!switches off and onframe by frame in one run and prints the median on/off ratio of 30 frame
pairs.
machine's other load.
diagnostics,toggled!checks this variableonce. Other builds are unchanged.
shadersfolder.Profile (bench, 8 threads, before the changes below)
make_listed/make_null→HostHeap::keep→retire_resource, plus the driver'sdescriptor calls.
retire_resourcealone was 14.6 %, nearly all of itwaiting for the
RETIREDlock.readable,upload_fromwithtexture::staging'sSTAGINGlock,hosted,transition).placed_texture.views_read; 3–5 %:shadow::lookup/find_any.Commit 3: a draw's retirements go to the shared line in one go (
VICTORY_RETIRE_BATCH, on)before, about 20,000 resources a frame. Each was pushed onto
RETIREDunder its lock and counted in a shared atomic, by all eight threads.
State::tablesholds ahost::Retiring, during whichretire_resourcekeeps each object, with the submission count it wasretired at, in a thread-local list. At the end the list goes onto
RETIREDunder one lock, with one atomic add.is the same; at worst it waits one more bury.
Retiringleaves its objects to theouter one. If the thread's local storage is gone, the object goes straight
to the line.
VICTORY_RETIRE_BATCH=0retires one object at a time, as before.Commit 5: draw counts per thread (
VICTORY_SPREAD_COUNTS, on)process (
DRAWS,DRAWS_EVER, thenDRAWN,DROPPEDorDISPATCHED).Their cache lines moved between cores with every draw.
counts.rs): each thread has its own counters, on lines of theirown, written only by that thread with a plain load and store.
total()sums every thread's counters, including threads that haveended.
take()replaces the old swap with 0.most once per present.
VICTORY_SPREAD_COUNTS=0goes back to the shared atomics. Non-Windowsbuilds keep the old statics.
Commit 6: dropped draws counted by reason
left_out, the structurebuilder while it is off, or a pipeline skipped in diagnostics builds;
prepare()orbind()refused (no free table slots, a root SRV without a view, an index buffer
not found, the wrong kind of pipeline).
pipeline::host_missing()tells these apart without waiting for thepipeline, and it runs only for a dropped draw.
that could not be bound; C left out on purpose)".
Measurements
All from the bench, with frames alternating off and on in one run. Each
figure is the median of 30 pair ratios (on/off), and below 1 is better.
Other sessions loaded the machine throughout.
7.2 µs to 6.2 µs a call.
play.
Not tried in play. None of this has run in the game yet: every number
above is from the bench. Both behaviour changes can be turned off
(
VICTORY_RETIRE_BATCH=0,VICTORY_SPREAD_COUNTS=0).Tried and left out, because the bench measured no gain:
after a rework;
Leads not taken here
These are all in the fresh-table path:
STAGINGlock, taken per texture on a list's first use (about6 %);
State::fresh_tablesstarting empty in every list (2–7 %).How it was tested
cargo testpassed for the crates it touches: yes. Rebased onto maine1f2eb60:cargo test --release -p victory-gpu --lib, 592 passed, 0 failed, 45 ignoredTests
host::retiring_tests:Retiring, objects are kept alive by the thread, with countsno later than when retired;
Retiringleaves them to the outer one;Retiring, they go to the line at once.counts::tests: eight threads' adds all count;takegives what camesince the last take.
draw::dropped_tests: each drop counts in the total and under its reason.list::benchis#[ignore]d: it needs an earlier run's cache folder.Checked for overlap
Pull request closed