Repository navigation
perf(gpu): split VIEW_SHAPES lock, O(1) FxHashMap, and forget() read-check in descriptor.rs - #666
Open
Capt-Speed wants to merge 1 commit into
Open
Capt-Speed wants to merge 1 commit into
Capt-Speed wants to merge 1 commit into
Conversation
LJGhost
pushed a commit
to LJGhost/VIctory-NVIDIA
that referenced
this pull request
Nov 28, 2026
…-probe-target-dir Loader tests: build the probe fixture under CARGO_TARGET_TMPDIR
This was referenced Nov 28, 2026
genzsekiro
pushed a commit
to genzsekiro/VIctory-NVIDIA-RT
that referenced
this pull request
Nov 28, 2026
…-probe-target-dir Loader tests: build the probe fixture under CARGO_TARGET_TMPDIR
genzsekiro
pushed a commit
to genzsekiro/VIctory-NVIDIA-RT
that referenced
this pull request
Nov 28, 2026
…-probe-target-dir Loader tests: build the probe fixture under CARGO_TARGET_TMPDIR
Dukestar69
approved these changes
Nov 28, 2026
Dukestar69
left a comment
There was a problem hiding this comment.
LGTM — verified on Windows (RTX 5090):
cargo test -p victory-gpu --lib descriptor::passed (62/62) on RTX 5090- 0 new compiler warnings in touched files
cargo xtask policypassed (294 files ok)
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
|
Tested this PR in a controlled 20-minute 3D A/B run on Windows 11 — PASS (clean stability + lower Setup
20-Minute 3D A/B Results (Strict 3D-only, Draw-Count-Matched)
Takeaways
|
This was referenced Nov 28, 2026
MystifiedSky
added a commit
to MystifiedSky/VIctory-NVIDIA-Improved
that referenced
this pull request
Nov 28, 2026
whoalin1
added a commit
to whoalin1/victory-altracing-prs
that referenced
this pull request
Nov 28, 2026
…s, PRs trustno1-coder#697/trustno1-coder#614/trustno1-coder#700/trustno1-coder#666 - upload.rs: set default VICTORY_LOW_EARLY_MB=0 (restores bright bedroom & cuts stray faults while retaining explicit override + trustno1-coder#88 arena backoff) - host/panel.rs & shadow::register: port Spaghetih/victory-sley-fork 6d813b4 (panel COPY_SOURCE->COPY_DEST barrier via uploaded flag; retire replaced shadow entry) - descriptor.rs: port PR trustno1-coder#666 (FxHasher FastMap, split VIEW_SHAPES RwLock, forget early-out) - watch.rs/host.rs/shadow.rs: port PR trustno1-coder#697 (per-range ask holds), PR trustno1-coder#614 (lock-free atomic shadow copied + ReadJournal + wide_chunks + word_runs + deferred coalescing), PR trustno1-coder#700 (keep 4 MiB chunk in scratch_any_size) - shadow::land_tests: drop JournalRead before calling watch::nothing_new to prevent Windows SRWLock recursive read deadlock
trustno1-coder
pushed a commit
that referenced
this pull request
Nov 28, 2026
krolyxon
pushed a commit
to krolyxon/VIctory-NVIDIA-proton
that referenced
this pull request
Nov 28, 2026
…check Adapted from trustno1-coder#666 by @Capt-Speed. (cherry picked from commit 74223a5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Single-file lock-contention and lookup optimization in
crates/victory-gpu/src/descriptor.rs(zero new crate dependencies, zero shader-cache impact):VIEW_SHAPESout of the globalVIEWSRwLock: Placed-view shapes (shapes+shape_index) are append-only and read heavily across concurrent recording threads. Moving them to their ownVIEW_SHAPESRwLockstops frequentPLACEDlookups from blocking behindVIEWSinsertions andforget(resource)writes.BTreeMapwith a zero-dependency 64-bitFxHasherHashMap(FastMap) forViews::index,Views::by_resource, andViewShapes::shape_index, reducing lock hold times fromO(log n)comparisons over large view structs toO(1).forget(resource): checkviews_read().by_resource.contains_key(&resource)before taking the exclusive write lock, avoiding unnecessary write-lock stalls when releasing resources that had no registered views.All existing
#58placed-view padding clearing andownerlesscap behavior are preserved unchanged.Why
Even after
#58eliminated placed-view padding leaks,VIEWSstill guarded both placed-shape lookups and resource view registration/release under one process-wideRwLockbacked byBTreeMap. In heavy outdoor scenes (7,000–10,000+draws/frame),the views' lockwait still averaged ~38–40 msper 5-second interval (with spikes up to147 ms).Measurements
Tested on Ryzen 7 9800X3D + NVIDIA RTX 5090 D (32 GB), Windows 11,
--release, Series X 4K (3840x2160), DLSS Balanced (Preset K), DLSS Frame Generation 4x, Jason's House outdoor save (#573), built froma4d05e7(which already includes#58):VICTORY_*switches identical between baseline (main) and patched (pr-view-shapes).victory.exepath before launch (shared NVIDIA DXCache;4,010gameplay pipelines pre-warmed viavictory warm --used+25,758shaders pre-translated).VICTORY_KEYS_FILEcamera/walk sequence.1. Direct lock contention (
the views' lock)maina4d05e7)VIEW_SHAPES+FastMap)36×5svs33×5s)40.5 ms / 5s(total1,458 ms, max147 ms)20.0 ms / 5s(total661 ms, max83 ms)-50.6%20×5s= 100 s)38.3 ms / 5s(total766 ms, max96 ms)18.4 ms / 5s(total369 ms, max83 ms)-52.0%(Control check: a 3rd run on the same warm
36 MBhost-pipelines.binwithout this patch still showed29.9 ms / 5swarm /35.2 ms / 5sfullviews' lockwait, confirming the ~50% lock reduction is from this change rather than cache warmth.)2. Gameplay frame time & native FPS (strictly filtered clean ticks)
gpu < 1 ms, no library save within±10 s)main)VIEW_SHAPES+FastMap)7,513vs7,517draws;n=15vsn=19)20.15 FPS/51.1 ms(med18.60)21.78 FPS/47.7 ms(med19.70)+8.1% FPS/-3.4 ms(-6.7%)draws >= 9,000(avg9,642vs9,542;n=8vsn=11)18.16 FPS/55.3 ms(max62.6 ms)19.06 FPS/52.5 ms(max57.4 ms)+5.0% FPS/-2.8 ms(-5.1%)7,000–8,999(n=2vsn=3)17.60 FPS/56.9 ms18.77 FPS/53.4 ms+6.6% FPS/-3.5 ms(-6.2%)Validation
main(8fc2254): 1 file changed (crates/victory-gpu/src/descriptor.rs,+132/-34).cargo test --lib -p victory-gpu descriptor:62 passed; 0 failed; 1 ignored(includingownerless_entries_are_capped,buffer_views_differing_in_padding_are_one_shape_and_offsets_stay_apart,views_at_new_addresses_add_no_entries,views_die_with_their_resource).--features diagnosticsbuilds.