Use runtime shader settings when warming the disk cache #6

Open
timorjay wants to merge 1 commit from upstream-pr/6 into main
timorjay commented 2026-11-26 02:28:50 +00:00 (Migrated from github.com)

Imported from realblastex/flamingo. Originally posted by timorjay on 2026-11-26T02:28:50Z.


Offline warm-up and live cache misses use the same cache key. A live miss selects the shader-specific wave settings in translate_listed, while warm called the generic translator directly. A cache previously filled by victory translate --warm could therefore change the shader used at first use.

This routes a warm-up miss through the same helper as a live miss. The cache already fingerprints this source file, so existing entries get a new key.

On bd552a5 I compared the full HostShader (DXIL bytes and metadata) from a live miss with the result of warming a fresh cache and then calling the live path. With a 32-lane host configuration, VICTORY_SHADER_OPT=0, and the default per-shader lists, three of eight local inputs differed before the change. The inputs below are identified by the hashes already listed in the source.

Shader Live miss, bytes Live read after unpatched warm-up, bytes
369cbe906ea72764 15,068 28,072
5dc3b25986622949 103,976 201,344
6f225b641c5b0708 160,356 325,112

After the change all eight comparisons matched byte for byte, and a second warm-up read each entry from disk. The four existing shader_cache::tests passed. The PR contains one production-line change. The comparison measures cache correctness. The test inputs stayed local.

Tested with Codex assistance.

<!-- greyfinch-sync:realblastex/flamingo:issue:5502906709 --> Imported from [realblastex/flamingo](https://github.com/realblastex/flamingo/pull/6). Originally posted by [timorjay](https://github.com/timorjay) on 2026-11-26T02:28:50Z. --- Offline warm-up and live cache misses use the same cache key. A live miss selects the shader-specific wave settings in `translate_listed`, while `warm` called the generic translator directly. A cache previously filled by `victory translate --warm` could therefore change the shader used at first use. This routes a warm-up miss through the same helper as a live miss. The cache already fingerprints this source file, so existing entries get a new key. On `bd552a5` I compared the full `HostShader` (DXIL bytes and metadata) from a live miss with the result of warming a fresh cache and then calling the live path. With a 32-lane host configuration, `VICTORY_SHADER_OPT=0`, and the default per-shader lists, three of eight local inputs differed before the change. The inputs below are identified by the hashes already listed in the source. | Shader | Live miss, bytes | Live read after unpatched warm-up, bytes | | --- | ---: | ---: | | `369cbe906ea72764` | 15,068 | 28,072 | | `5dc3b25986622949` | 103,976 | 201,344 | | `6f225b641c5b0708` | 160,356 | 325,112 | After the change all eight comparisons matched byte for byte, and a second warm-up read each entry from disk. The four existing `shader_cache::tests` passed. The PR contains one production-line change. The comparison measures cache correctness. The test inputs stayed local. Tested with Codex assistance.
realblastex commented 2026-11-26 05:21:31 +00:00 (Migrated from github.com)

Imported from realblastex/flamingo. Originally posted by realblastex on 2026-11-26T05:21:31Z.


Thank you @timorjay, that's a great catch, and the byte-for-byte comparison makes it easy to trust. I'd been warming the cache with translate --warm before test runs, so those runs used the generic translation for exactly the listed shaders. The fix is in my dev branch; this PR gets merged from the GitHub side.

<!-- greyfinch-sync:realblastex/flamingo:comment:7183414062 --> Imported from [realblastex/flamingo](https://github.com/realblastex/flamingo/pull/6#issuecomment-7183414062). Originally posted by [realblastex](https://github.com/realblastex) on 2026-11-26T05:21:31Z. --- Thank you @timorjay, that's a great catch, and the byte-for-byte comparison makes it easy to trust. I'd been warming the cache with `translate --warm` before test runs, so those runs used the generic translation for exactly the listed shaders. The fix is in my dev branch; this PR gets merged from the GitHub side.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/6:upstream-pr/6'
git switch 'upstream-pr/6'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/6'
git switch 'upstream-pr/6'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/6'
git switch 'upstream-pr/6'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/6'
git switch 'main'
git merge --squash 'upstream-pr/6'
git switch 'main'
git merge --ff-only 'upstream-pr/6'
git switch 'main'
git merge 'upstream-pr/6'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
realblastex/flamingo!6
No description provided.