Warm-up: each shader's "translated now" comes from its own call (#32) #171
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!171
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-171"
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?
@amine23012004 on GitHub · 2026-11-26 09:53 UTC · original
amine23012004:fix/warm-cache-hit-count→main· +53 −15 · 1 files · 1 commits · openFixes #32.
What and why
victory translate --warmreports "N translated now, M in the cache already". Each shader is classified byshader_cache::precompile, which read the process-wideMISSEScounter before and after its own call. With the default four workers, a miss on another thread between the two loads turned this shader's cache hit into "translated now", so the split in the warm-up line depended on scheduling (details in #32).cached_byalready tracks, per call, whether its converter ran (Translate::ran), and uses it to bumpHITS/MISSES. It now also returns it:Result<(HostShader, bool), String>.precompiletakes the bool from there instead of fromMISSES, and the comment that said the caller only adds the counts up is gone.cached(used byhost_shaderin runs) still returns the shader alone, so runs are unchanged. Without a cache,precompilenow reports "translated" rather than "was there"; both callers open the cache first, so this path is not taken today.Tested
cargo clippy -p victory-gpu -p victory-hle -p victory --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings, with and without--all-features: clean.cargo xtask policy --staged: ok.each_call_tells_its_own_hit_from_its_miss: one container already cached is asked 64 times while 64 other threads translate new containers; every hit must come back as not translated, every miss as translated.entries_of_an_earlier_translator_are_served_or_refreshednow also checks the flag at each step.shader_cache::tests::each_call_tells_its_own_hit_from_its_miss ... ok,entries_of_an_earlier_translator_are_served_or_refreshed ... ok. On this branch alone the CI stays red for the two reasons fixed in the CI pull request.victory translate --warmitself (no game files, no GPU used).AI-assisted: yes (Claude Code)
🤖 Generated with Claude Code
@amine23012004 on GitHub · 2026-11-26 11:23 UTC · original
Heads-up: #175 (opened ~30 min after this one) fixes the same #32 counter. It threads the "did this call run the translator" flag back out of
cached()instead of comparing the global miss counter — a cleaner shape than mine. Only one of the two is needed; happy for this one to be closed in favour of #175 if you prefer it.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.