Performance: submission sending on its own thread (VICTORY_PERF_NEXT master switch), AVX2 shadow compare/merge (VICTORY_SIMD), refresh diagnostics #3854
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!3854
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3854"
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?
@NICKNAMErutschovkonikovan on GitHub · 2026-11-30 09:26 UTC · original
NICKNAMErutschovkonikovan:perf-next→main· +20154 −362 · 72 files · 86 commits · closed without mergingBuilds on #3590 (branch
special-features). The commits of that PR are included here; the new work is the commits on top of00decd38.What's new
VICTORY_PERF_NEXT: one master switch for the optimizations below. It adds a restart-only F1 row, "PERFORMANCE OPTIMIZATIONS (RESTART)" (German: LEISTUNGS-OPTIMIERUNGEN), with ON/OFF and help text. Each optimization's own switch (0/1) wins over the master;VICTORY_PERF_NEXT=0turns all of them off. Seeswitch::perf(name, default)inswitch.rs.VICTORY_SUBMIT_SPLITis on by default under the master switch.VICTORY_ABnames the switch, A/B decides alone.VICTORY_LATE_FILLS,VICTORY_TEAM_FAST,VICTORY_RESIDENT_LATERorVICTORY_GPU_DIRTY. That case is logged.VICTORY_SUBMIT_SPLIT=1still forces it as before.AVX2 paths for the shadow's page compare and merge (
VICTORY_SIMD).auto/avx2/off.#[target_feature]. There is no global target-cpu.changed_runsandback_pieceget AVX2 versions. The scalar bodies are kept, and tests compare both.Diagnostics. A new frame line, "refreshes per frame", in every build. It shows where the refresh time goes: most of it is waiting on the guard lock behind
VirtualProtect, not copying.Measured
Setup: Ryzen 7 5800X3D, RTX 5090, 2560x1440, DLSS Q + FG, city scene that moves by itself, release build. Each run is 2 min in the world, and runs alternate in mirrored order (A B B A) because launches drift by about ±10% over a session.
VICTORY_PERF_NEXT=0,VICTORY_SIMD=off)That is about +3% fps and about 2.5 ms less per frame on the submitting thread.
Tried and dropped:
VICTORY_ASK_FIRST,VICTORY_OFF_LINEand copying guarded views first: no gain.Not done on purpose: coalescing the ~43k upload ranges a frame, because the gaps may hold bytes that shaders wrote.
Tests
cargo test -p victory-gpu --release: 1028 passed.shader_cache::tests::every_switch_of_the_translator_is_in_the_keyfails, as it already did upstream (VICTORY_SCALAR_SPLITS); cache keys are left untouched.card_steps::tests::shared_scratch_eliminates_flight_settle_end_to_endcan fail under parallel GPU load only. It passes alone with the master switch on and off.--features abcompiles.xtask policy: only the pre-existingframe_users.rsfinding from upstream.Update: big cards, relay thread, review fixes
VICTORY_VRAM_WINDOWS_BAR(on by default, off with=0).Upstream fixes taken over. Both are switches of
VICTORY_PERF_NEXT:223f22f0(VICTORY_REMAP_BACKOFF) backs off the RemapQueue compaction. "opening or noting guards" falls from 4.8 to about 1 ms.VICTORY_BURY_THREAD) moves the COM drops ofbury()to a thread of their own.Measured without frame generation. Same saved game for every run, 6 runs, alternating:
Screenshots of the same scene are equivalent.
Tried and dropped (no gain or worse frame pacing):
VICTORY_PORT_CONSTANTS=1: the card reads the title heap over the bus and runs 3x slower.VICTORY_PORT_GUARD: frames over 100 ms rose from 14 to 50.VICTORY_JOIN_PARTS=16: −4%.VICTORY_WAIT_SPIN=500: −1%.VICTORY_RANGE_LOCK=1: no gain.The remaining bottleneck is the submitting thread's preparation, 35–37 ms a frame; the GPU needs only 2–4 ms.
Tests:
cargo test -p victory-gpu --release -- --test-threads=1: 1033 passed. The only failure is the known upstreamevery_switch_of_the_translator_is_in_the_key.🤖 Generated with Claude Code
Found in the review of rr-guides. The target pictures of 2026-11-29 (frame 9446, every other texel) have 78% of the frame at zero in the albedo, normal and F0 slots alike: the sky, which no G-buffer shader writes. The pass decoded it like geometry: black albedo, gloss 0 as roughness 1, and the normal zero decodes to. NVIDIA's integration guide for Ray Reconstruction (3.4.1 to 3.4.4) asks for albedo 0.5 there ("a common integration error is to leave sky pixels un-cleared"), specular albedo 0, normal 0 and roughness 0. The pass writes those where the colours of all three slots are zero (alpha is not asked; no texel of that frame was zero in the normal slot only), checked on WARP with a fifth texel. The same pictures answer the shortcut about vegetation, noted at BUILT_IN: the 27,266 written texels with vegetation's F0 hold a 12-bit y that is an 8-bit number widened in 99.9% (9.6% for F0 0.04, 6% by chance): 8-bit normals in the same 24-bit packing, which oct24 reads rightly. Only 44 texels had a normal without albedo and F0. The alpha byte and a frame with impostors in view are not measured. Co-Authored-By: Claude Fable 5.2 <[email protected]>@tillo88 on GitHub · 2026-11-30 12:44 UTC · original
Measured this PR as it is (defaults:
VICTORY_PERF_NEXTon, so the submission split andVICTORY_SIMD=auto→ avx2; the log confirms both) on top of v2026.11.29.05, 2 runs, against 18 runs of the release as it is.Slower here: −11% fps (26.05 vs 29.40), and both runs are below the slowest of the 18 baseline runs (27.79). The submitting thread's time per frame is about the same as the release's, and refreshes are only ~0.5 ms longer, so the ~4 ms per frame that was added does not show up in the submitting thread as measured by the frame-rate log. Note this branch also carries #3590's commits, so the loss may come from those rather than the new ones. For comparison, #3809 (submission split plus the lazy-compare and table-same switches on, on the same release) measured +3.9% on this bench. No crash in either run.
Setup: Ryzen 7 9800X3D, RTX 5070 Ti 16 GB (driver 621.40), 32 GB RAM, Windows 11, release build, Series X 1440p, DLSS Quality, frame generation off, ray tracing off. Same save restored before each run (start of the game), prison cutscene, plane cutscene, first boat section, about 6 minutes; warm-up run not counted.
Measured unattended on a replay bench (same save, recorded controller input via VICTORY_INPUT_REPLAY); numbers and text prepared with Claude.
@NICKNAMErutschovkonikovan on GitHub · 2026-12-01 10:12 UTC · original
Replaced by #4772: its parts (SUBMIT_SPLIT, VRAM_WINDOWS_BAR and the rest) are there, each behind its own switch under VICTORY_PERF_NEXT, on top of current main.
Pull request closed