Shader cache: precompile tells from its own call whether it translated (#32) #192

Open
github-bot wants to merge 3 commits from github-bot/gh-192 into main AGit
Owner

@⁠HamudL on GitHub · 2026-11-26 11:05 UTC · original
HamudL:fix/warm-counts → main · +47 −9 · 2 files · 3 commits · open

Closes #32.

precompile compared the global miss counter before and after its call. With translate --warm on several threads (four by default), another thread's miss in between made a cache hit count as "translated now", so the warm-up's split between translated and cached was wrong.

cached_ran now returns whether its own call ran the converter: a miss, an entry of an earlier build that was translated again with refresh, or an entry that did not read back. cached and cached_by keep their signatures.

New test each_call_tells_whether_it_translated: another call's miss between two calls for the same container leaves the second a hit, and entries of an earlier build are served or refreshed as expected.

Checked: cargo clippy -p victory-gpu --all-targets [--all-features] --target x86_64-pc-windows-msvc -- -D warnings is clean. The shader-cache tests (all 4, the new one included) pass on Linux in a copy of the module with the D3D12 calls stubbed out, since victory-gpu itself only builds on Windows.

**@⁠HamudL** on GitHub · 2026-11-26 11:05 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/192) `HamudL:fix/warm-counts` → `main` · +47 −9 · 2 files · 3 commits · open Closes #32. `precompile` compared the global miss counter before and after its call. With `translate --warm` on several threads (four by default), another thread's miss in between made a cache hit count as "translated now", so the warm-up's split between translated and cached was wrong. `cached_ran` now returns whether its own call ran the converter: a miss, an entry of an earlier build that was translated again with `refresh`, or an entry that did not read back. `cached` and `cached_by` keep their signatures. New test `each_call_tells_whether_it_translated`: another call's miss between two calls for the same container leaves the second a hit, and entries of an earlier build are served or refreshed as expected. Checked: `cargo clippy -p victory-gpu --all-targets [--all-features] --target x86_64-pc-windows-msvc -- -D warnings` is clean. The shader-cache tests (all 4, the new one included) pass on Linux in a copy of the module with the D3D12 calls stubbed out, since victory-gpu itself only builds on Windows.
On several threads (`translate --warm`, four by default) another thread's
miss between the two loads of MISSES made a hit count as "translated now",
so the warm-up's split of translated and cached was wrong. cached_ran
returns whether its call ran the converter; cached and cached_by keep their
form. Test: each call tells whether it translated, with another one's miss
between two calls of the first, and for entries of an earlier build served
or refreshed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:22:10 +00:00
The same one-line change as in #173, so that this pull request's Clippy job
passes on its own; the two merge in either order.
#169 keeps the (F, F) annotation and breaks the line; the same text here
leaves nothing to resolve whichever of the two lands first, and once #169 is
in main this pull request no longer touches the file.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/192/head:github-bot/gh-192'
git switch 'github-bot/gh-192'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-192'
git switch 'github-bot/gh-192'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-192'
git switch 'github-bot/gh-192'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-192'
git switch 'main'
git merge --squash 'github-bot/gh-192'
git switch 'main'
git merge --ff-only 'github-bot/gh-192'
git switch 'main'
git merge 'github-bot/gh-192'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.