perf(cache): coalesce identical concurrent cache misses with self-cle… #1607
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!1607
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1607"
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?
@VlREX on GitHub · 2026-11-28 22:17 UTC · original
VlREX:perf/virex-singleflight-cache→main· +141 −0 · 1 files · 1 commits · merged 2026-11-29 08:16 UTCWhat it changes
VIREX SINGLEFLIGHT eliminates redundant concurrent conversions of identical cache entries using independent per-key synchronization and automatic gate cleanup.
How it was tested
VIREX Test Studio 3.1.0 — PASS
ca35e799All 15 unit test executions passed.
Performance impact
Eliminates duplicate conversions for simultaneous identical cache misses within one process. Actual performance and memory savings require separate benchmarking.
No gameplay FPS improvement claimed.
@babuakhil on GitHub · 2026-11-28 23:08 UTC · original
Checked on Windows 11 (Rust 1.98.1, pinned), applied on
main(d4b5d51): clippy onvictory-pipelineis clean with and without--all-features, and the 10 lib tests pass, 5 of 5 runs.It does what it says. A throwaway stress test (not part of this PR): each round, 16 threads, each with its own
Cacheon the same root, ask for one new entry at once; every round also checks the published bytes and that no staging file is left.mainstd::fs::read(200)FILE_SHARE_DELETE(200)Access is denied. (os error 5)The second row is the race #1539 fixes, and here it goes away too, since only one thread in the process publishes each entry. #1539 is still needed across processes (two
victoryruns, orwarmbeside a game).One behaviour change worth knowing: when the conversion fails, the waiters no longer fail together. Each one takes the gate in turn, finds no file, and converts again:
mainSo a key whose conversion fails costs N × conversion time instead of about one.
failed_conversion_releases_gate_for_retrycovers a sequential retry, not this. If that matters, waiters could share the leader's error, or a waiter could return the error instead of converting when it wakes behind a failure. Not a blocker for the success path.With #1539: the two apply together cleanly (both commits of #1539 on top of this), the 12 lib tests pass, and the same stress gives the same numbers as this PR alone (1.0 conversions/round, no errors; failing rounds 332.0 ms).
@ArturoWolff on GitHub · 2026-11-29 08:53 UTC · original
Follow-up on the merged integration. Thanks for #1607's per-key flight (
ca35e799) and #1489's direct decoded-cache read and in-memory result on publication failure (4fd7f4db). On combined main, the two implementations interact:victory_gpu::shader_cache::cachedreads and decodes directly, then callsCache::convert_and_store, which does not acquire the existingget_or_convertflight. The general-purpose cache's original concurrency tests still pass, but the actual shader-cache helper can duplicate work.I added two deterministic game-free tests with authored synthetic
HostShaderfixtures through the actual cache helper, synchronizing at the cold-miss boundary. Under GE-Proton11-14 / Linux, pinned Rust 1.98.1, locked MSVC library tests:4d98ca87829188e9The two cache source files are identical between those base revisions. The fix is a small extension of the existing design: expose a closure-scoped per-key gate in
victory-pipeline, preserve ungated validated hits, recheck decoded validity under that gate and only translate if still needed. Retain the in-memory result even when publication fails or the cache root cannot be canonicalized; do not change the shader serialization, fingerprint, or atomic publication rules. This is not a replacement for the separate cross-process publication work in #1539 / #632.Validation on the local candidate: native pipeline package 13 passed, locked MSVC test build succeeded; 2/2 concurrency regressions and 3/3 additional game-free cache controls passed under isolated Wine (warm/corruption/unsupported, failed publication, missing root). An independent read-only review found no correctness blocker in the exact two-file diff. Full workspace CI, native Windows execution, actual startup-time and gameplay performance have not been validated. Same-key failed conversions or unsuccessful publication can still serialize later callers, as noted in the prior review of #1607; no failure-sharing or retry loop was added. No FPS or physical RAM savings claim.
I have the reviewed patch and reproducible tests retained and can submit the focused follow-up for review. This is intended to preserve both merged changes rather than replace either one.
AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).