GPU tests: a benchmark of what list calls cost on the title's threads #2818
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-25T21:28:23Z.
Issue #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.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T21:40:52Z.
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)Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T22:10:43Z.
Review: COMMENTED
Test-only benchmark infrastructure for measuring per-list-call cost on the title's threads — establishes the baseline #2821's lock changes are measured against. No production code paths touched. LGTM as scaffolding; the gfx10 list-encoding coverage keeps it honest.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T02:21:34Z.
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
Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-26T06:42:01Z.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.