translate: --cache DIR fills the runtime's shader cache #1730
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1730
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1730/head"
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?
@Nixitov on GitHub · 2026-11-24 21:28 UTC · original
Nixitov:feat/cache-fill→main· +275 −25 · 9 files · 5 commits · closed without mergingWhat it did
victory translatetranslated every shader in a pack and printed the report, and threw the translations away. The runtime then translated the same containers again the first time a frame asked for them, inside the frame path.What it does now
victory_gpu::shader_cache::store(container, shader)publishes a translation throughvictory-pipeline's cache under exactly the keyhost_shaderreads (this build's fingerprint and the container's bytes) and with the same encoding, so the runtime finds it as a hit.Cache::storeis public now (split out ofget_or_convert, same write-then-rename) so an entry the caller already converted can be published without translating a second time.Container::bytes()is the container cut where its header says it ends. A walk finds containers inside larger files, and hashing the file's tail would key every entry where the runtime never looks, since the runtime passes exactly the container.victory translate --cache DIRopens the runtime's cache and stores one entry per container, for the programemit::translatepicks (the first VS/PS/CS/MS program), which is the one the runtime caches. Duplicate containers, which the report counts once, are still translated and stored as the runtime would. The last line says how many entries were written and where.Measured
RTX 5070, Windows 11 26200.9974, driver 617.14:
victory runagainst that cache: 1,578 hits, 0 misses. The startup pipeline backlog falls from a peak of 652 "being made" to 200 (a run against the same cache a second time).Tested
Base
mainffe310e:cargo build --release -p victory: clean.cargo test --release -p victory-gpu: 52 passed, 1 ignored, includingshader_cache::tests::a_stored_translation_is_what_host_shader_returns(store thenhost_shaderreturns the same DXIL, so both key alike) andentries_round_trip_and_reject_damage.cargo test --release -p victory-shader dxbc: 3 passed, includingbytes_stop_where_the_header_says(a container followed by other bytes hashes only its own).cargo test --release -p victory-pipeline: passed.cargo clippy --workspace --all-targets --locked -- -D warnings, with and without--all-features: clean.victory translate <a container> --cache DIRopens the folder and reports the entries written.No game data.
AI-assisted (DeepSeek V4.1 Flash coding agent).
@Marvisak on GitHub · 2026-11-25 01:25 UTC · original
Automated triage for the maintainers. Closing because this change is already in
main, ormainhas since replaced the code it patches.translate --cache DIRfilling the runtime's shader cache: main has this astranslate --cache(the warm-up, commitc47b5297), with the cache keyed by the translator.If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
@Marvisak on GitHub · 2026-11-25 01:35 UTC · original
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:README.md,apps/victory/src/main.rs,apps/victory/src/translate.rs,crates/victory-gpu/src/shader_cache.rs,crates/victory-pipeline/src/cache.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
Pull request closed