Count a shader-cache hit from this call's flag, not the shared miss counter (#32) #175
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from avatarmanz/VIctory-7900XTX. Originally posted by ri995410-art on 2026-11-26T10:24:33Z.
Fixes #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
Imported from avatarmanz/VIctory-7900XTX. Originally posted by Calvix2k on 2026-11-26T10:40:09Z.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.