GPU tests: a benchmark of what list calls cost on the title's threads #2820
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2820
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2820"
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?
@0xkn0wh3r3 on GitHub · 2026-11-25 21:28 UTC · original
0xkn0wh3r3:gpu/list-call-bench-only→main· +1588 −0 · 3 files · 1 commits · openIssue #2586 quotes about 20 µs per list call, measured on a fork. The triage asked for a per-call cost measured on main. This adds a synthetic benchmark that gives one, with no game data.
What it does
crates/victory-gpu/src/list_bench.rsis an#[ignore]d test. Several threads record command lists at once, the way a title's render threads do. Each call goes through the device and list method slots the title calls, and each call is timed.Close. The main thread submits every list and waits for it.Draws and dispatches run real host pipelines. Their shaders are hand-assembled GFX10 programs in the console container layout, taken from the conformance title's GPU frame (branch
tests/gpu-frame-workload,list_bench/gfx10.rs). They read descriptor tables, soState::binddoes what it does for a title's draws. The test fails if any draw does not run on the host.The defaults are close to the issue's shape: 5 threads, about 8,300 calls each per frame.
LIST_BENCH_THREADS,LIST_BENCH_DRAWSandLIST_BENCH_FRAMESchange the shape. Run it alone, because other tests switch the device to the newer layouts, which moves list slots:Numbers on main (RTX 5070 Ti, Windows 11, release)
diagnosticsDraws take about 78% of recording time and descriptor writes about 17%. Everything else costs under 100 ns per call, except
Reset(about 80 µs, once per list),Close,OMSetRenderTargets, barriers and dispatches. With five threads each call costs 3× what it costs on one thread, so the difference is contention.A sampling profile of the five recording threads (an in-process sampler, not included here) puts about 58% of recording time in
Mutex::lock_contended:HostHeap::madedescriptor::SHADER_HEAPSshadow::BUFFERSshadow::findfromdraw::readableThe
VIEWSregistry is next. Allocations, string formatting and SipHash lookups are each about 1% or less in this workload.A follow-up PR (the lock changes, measured with this benchmark) builds on it.
What it does not cover
VICTORY_D3D12_DRED, #913) are not turned on.@fuzeofficlal on GitHub · 2026-11-25 21:40 UTC · original
Verified
f7579ca0on Windows 11 (RTX 5090):cargo xtask policy: 186 files ok;cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default &--features diagnostics): 0 warnings; cleangit merge-treeagainstorigin/main13f91ca.--releaselist_callsbenchmark (5threads ×8,310calls/frame ×10frames =80,000draws +2,500dispatches,0dropped, 2 runs):1871 ns/call,15.54 ms/thr/frame(15.78 msrecording,12.81 msCPU,15.97 ms/framewall;DrawIndexedInstanced7521 ns,CreateCBV1795 ns,CopyDescriptorsSimple3165 ns,Dispatch1867 ns)1495 ns/call,12.42 ms/thr/frame(12.65 msrecording,8.44 msCPU,12.79 ms/framewall;DrawIndexedInstanced6065 ns,CreateCBV1344 ns,CopyDescriptorsSimple2407 ns,Dispatch1580 ns)@Marvisak on GitHub · 2026-11-26 02:21 UTC · original · edited 2026-11-26 07:22 UTC
Automated triage for the maintainers.
Thanks. I confirmed that #2821 no longer carries
list_bench.rsorlist_bench/gfx10.rs, so this is now the only PR that would add them. Otherwise nothing has changed (same head). Whether about 1,600 lines of benchmark code, including hand-assembled GFX10 shaders, belong in the tree needs the maintainer's decision. The numbers stay in the description either way.CI: passing.
Generated by Claude Code
@0xkn0wh3r3 on GitHub · 2026-11-26 06:42 UTC · original
Understood: whether the benchmark belongs in the tree is your call. #2821 no longer carries these files, so this PR is the only place they'd land. If you'd rather not keep ~1,600 lines of benchmark code, I'll close it; the numbers stay in the description for reference.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.