Count a shader-cache hit from this call's flag, not the shared miss counter (#32) #175
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!175
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-175"
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?
@ri995410-art on GitHub · 2026-11-26 10:24 UTC · original
ri995410-art:cursor/shader-cache-precompile-hit-count-8436→main· +110 −24 · 1 files · 1 commits · openFixes #32.
victory translate --warmclassifies each shader as "translated now" vs. "in the cache already" fromvictory_gpu::shader_cache::precompile's returnedbool. Previously,precompilecomputed thatboolby checking whether the process-wideMISSEScounter changed around the call, so with the default four workers a miss on another thread between the two loads turned this thread's cache hit into "translated now".Changes
crates/victory-gpu/src/shader_cache.rs:cachedandcached_bynow returnResult<(HostShader, bool), String>, exposing the converter's existing per-callranflag.precompilereturns!ranwhen a cache is open, andfalsewhen no cache is open (where this call translated), removing the globalMISSESdiff and stale comment.host_shaderdiscards the flag so existing callers are unchanged.a_cache_hit_is_not_a_miss_when_another_thread_misses, which verifies a cached lookup still reports a hit while another thread concurrently triggers misses and incrementsMISSES.Verification
cargo clippy --target x86_64-pc-windows-msvc -p victory-gpu --all-targets --locked -- -D warnings(both default and--all-features) passed.victory-gputests withx86_64-pc-windows-gnuand ranshader_cache::tests::under Wine: 4 passed, 0 failed (including the new concurrency test).cargo xtask policy:262 files ok.Closes #32
@Calvix2k on GitHub · 2026-11-26 10:40 UTC · original
Independent confirmation from the other side of the same bug: a warm run here logs "shader translated" 3,332 times while the pipeline library at the same moment reports
made=0 loaded=2,287- every cache hit was counted as a translation. That made the number useless exactly where it matters, deciding whether a first run was cold (a cold run is 2-3x slower untilvictory warmhas run). The per-call flag is the right source.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.