Perf: retire in batches per thread, and skip decoding declared constant buffers #3565
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!3565
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3565"
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?
@Monard2033 on GitHub · 2026-11-30 01:08 UTC · original
Monard2033:main→main· +822 −829 · 33 files · 11 commits · closed without mergingFixes: no issue (found while profiling the list translation on my machine)
What it changes
Retirements in batches. The resources of descriptor slots let go by
make_listed'skeep-- hundreds of thousands a second -- went to the retiredqueue with one lock per object, and that was 15% of the list translation's
processor time. A thread now keeps up to
RETIRE_BATCH(256) of them and movesthem into its shard in one go:
bury(), which publishes the calling thread's batch first, so nothing itholds can outlive a drain that should have freed it;
list/thin.rs), where a listing job'swork ends.
bury()still drops a retirement only after the last submission that may useit: objects are freed a little later than they could be, and never earlier.
Declared constant buffers are no longer decoded twice.
tables()decodedevery slot of every table three times when the slot was a constant buffer its
plan declares as one:
record_at, thenmake_listed(which answers none forView::Constantand keeps nothing), thendescriptor::view. The declared CBVsnow go straight to the constants path. No state is touched: it is the same path
the code took once
make_listedanswered none.How it was tested
GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing):
NVIDIA GeForce RTX 5080 Laptop GPU; Intel Core Ultra 9 275HX (24 threads, 8 P +
16 E); Windows 11. Series X profile (
console=series-x),1080to1440(scene1920x1080, upscaled by DLSS), DLSS quality, frame generation 2x, ray tracing off
(this build leaves the title's RT passes out).
Before / After: thread-local rdtsc counters on an instrumented local build (the
counters are not part of this PR), same scene, 90 s in the world, 8 translating
threads:
l_retire)l_retire, share of the translation's CPUmake_listed'skeepmake_listedcallsl_lookupcold)Gameplay A/B at matched draw counts (the idle camera drifts, so runs are
compared at the same draws): at ~7.3k draws the difference is inside the noise
(+/-2 ms of a ~53 ms frame), which is what a change to the translating threads
should show there. It shows in heavy scenes: at 10-11k draws the translating
threads run 89-94% occupied and the title's record calls are 13 + 4 ms of the
frame's critical chain, and that is where the earlier cuts of the same kind
moved the frame rate.
For shader changes, the wave sizes tested (32 and/or 64 lanes): not a shader
change.
cargo testpassed for the crates it touches: yes forvictory-gpu(920tests; the 2 failures in this environment reproduce on
41adb551without thepatch -- one is the translator-switch test, the other is a flake that passes
3/3 run alone).
cargo clippy -p victory-gpu --all-targets: no warnings in thetouched files.
Checked for overlap
touches. Related: none open on these paths -- the ones merged for 29.05
(#2607, #2116, #2509, #2530, #2854, #2814, #2971, #2795, #2834) are already in
this base.
@Dukestar69 on GitHub · 2026-11-30 05:19 UTC · original · approved these changes
Tested locally merged onto
main(41adb551).draw.rs,host.rs, andlist/thin.rs.cargo test -p victory-gpu --lib draw::passed (25 passed; 0 failed; 2 ignored).cargo test -p victory-gpu --lib list::thin::andhost::recycle::passed.Clean per-thread batched retirement and declared-CBV decode skip optimization. LGTM.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@dyshay on GitHub · 2026-11-30 05:49 UTC · original
Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch
janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with--profile diag --features diagnostics, and the CPU tests of the touched crates pass. A run on an RTX 4090 is queued (Series S with ray tracing, DLSS Quality). Frame times will follow here.0f96b182eato07f43a56ac@trustno1-coder on GitHub · 2026-12-01 18:51 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed