shader: reject base requests with a mismatched source cache key #2595

Manually merged
github merged 2 commits from gh-pr/2595/head into gh-pr/2595/base 2026-11-27 01:05:42 +00:00
Owner

@⁠chasegrindy on GitHub · 2026-11-25 22:16 UTC · original
chasegrindy:fix/startup-shader-request-key → main · +127 −5 · 5 files · 2 commits · merged 2026-11-25 22:33 UTC

A base shader request with the wrong filename key could still generate both shaders and a manifest. I reproduced that on fb2f86ac53fb91b40fde6a78bd753961610752f1 with a synthetic VS/PS pair: translate_request returned ok and wrote the outputs under the wrong key.

Check the key against the stored .a, .b, .root and optional .ia bytes before decoding. A mismatched request now writes only the .fail diagnostic. Correct requests produce the same bytes as before. The RTV diagnostic and refusal-only reporting stay unchanged. This does not invalidate entries already on disk.

Tested locally on Windows 26300.9974 with MSVC 19.44.35229.0 and SDK 10.0.26100.0. The new regression failed before the fix and passed after. Seven Python CTests and six stream checks passed (including real FXC with RX 7900 XTX driver 32.0.32015.7029 and WARP 10.0.26100.9818). All 12 valid-output comparisons matched byte for byte. The patch also applied and its direct regression passed on adc2fd95164cfe4361d93b79015babb9e464e3cf. The 13 CTest results above are from fb2f86ac53fb91b40fde6a78bd753961610752f1.

ctest --test-dir <build> -C Release --no-tests=error -j 1 -R '^startup_(shader_cache_key|translator|gfx2hlsl_capture|image_sample_l|image_3d_controls|gfx2hlsl_smem_offset|tools_lint)$'
ctest --test-dir <build> -C Release --no-tests=error -j 1 -R '^startup_(stream_request_warp|stream_draw_(warp|hardware)|stream_fetch_(warp|hardware)|stream_fetch_translate)$'

AI-assisted: GPT-6.1-sol, GPT-6.2-sol and Nemotron 3 Ultra. Tests ran locally on synthetic fixtures.

**@⁠chasegrindy** on GitHub · 2026-11-25 22:16 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2595) `chasegrindy:fix/startup-shader-request-key` → `main` · +127 −5 · 5 files · 2 commits · merged 2026-11-25 22:33 UTC A base shader request with the wrong filename key could still generate both shaders and a manifest. I reproduced that on `fb2f86ac53fb91b40fde6a78bd753961610752f1` with a synthetic VS/PS pair: `translate_request` returned `ok` and wrote the outputs under the wrong key. Check the key against the stored `.a`, `.b`, `.root` and optional `.ia` bytes before decoding. A mismatched request now writes only the `.fail` diagnostic. Correct requests produce the same bytes as before. The RTV diagnostic and refusal-only reporting stay unchanged. This does not invalidate entries already on disk. Tested locally on Windows 26300.9974 with MSVC 19.44.35229.0 and SDK 10.0.26100.0. The new regression failed before the fix and passed after. Seven Python CTests and six stream checks passed (including real FXC with RX 7900 XTX driver 32.0.32015.7029 and WARP 10.0.26100.9818). All 12 valid-output comparisons matched byte for byte. The patch also applied and its direct regression passed on `adc2fd95164cfe4361d93b79015babb9e464e3cf`. The 13 CTest results above are from `fb2f86ac53fb91b40fde6a78bd753961610752f1`. ```powershell ctest --test-dir <build> -C Release --no-tests=error -j 1 -R '^startup_(shader_cache_key|translator|gfx2hlsl_capture|image_sample_l|image_3d_controls|gfx2hlsl_smem_offset|tools_lint)$' ctest --test-dir <build> -C Release --no-tests=error -j 1 -R '^startup_(stream_request_warp|stream_draw_(warp|hardware)|stream_fetch_(warp|hardware)|stream_fetch_translate)$' ``` AI-assisted: GPT-6.1-sol, GPT-6.2-sol and Nemotron 3 Ultra. Tests ran locally on synthetic fixtures.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:05:40 +00:00
github manually merged commit 96471e482a into gh-pr/2595/base 2026-11-27 01:05:42 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.