compile_dxil: read shader requests at revision 28 #2939

Merged
Miffedrandir merged 1 commit from upstream-pr/2939 into cpp-migration 2026-11-26 22:38:20 +00:00
Miffedrandir commented 2026-11-26 22:22:03 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Miffedrandir on 2026-11-26T22:22:03Z.


Problem

The runtime (d3d12_draw.inl) and gfx2hlsl.py key shader requests with x2w-startup-shader-28 and x2w-startup-shader-28cs. read_graphics_request and read_compute_request in src/shader_compute_request.cpp still hash with -14 and -14cs. So compile_dxil refuses every request the current runtime writes, with "graphics request key mismatch or missing root" or "compute request key mismatch".

Change

  • src/shader_compute_request.cpp: hash requests with the runtime's tags, -28 and -28cs.
  • tests/native_compute_clear_check.py and tests/native_direct_container_check.py: publish their requests with the same tags.

That's 4 lines in total, with no other behavior change.

Result

I ran compile_dxil --jobs 8 <profile> --requests <cache> <out> over a shader cache written by the current runtime, counting only requests at revision 28:

before after
graphics (gfx1013-container-pair), 576 requests 0 read (all key mismatch) read; 3 compiled, the rest refused by the frontend
compute (gfx1013-direct-cs@0), 2,834 requests 0 read (all key mismatch) read; 243 compiled, the rest refused by the frontend

Top frontend refusals after the fix:

  • graphics: "raw graphics requires a verified stage interface or wave state" (559)
  • compute: "unsupported DPP lane selection" (720), "direct resource-heap load requires the selected GPU slot and its view type" (334), "direct DXIL operand encoding" (244)

Tests

Windows 11 26200, MSVC 19.44, release preset, RTX 5070 Laptop:

cmake --build --preset release --target compile_dxil native_store_replay offscreen_check native_wave_request_gpu native_lds_gpu native_sampled_pixel_gpu native_buffered_vertex_gpu native_recording_check native_pixel_ir_dump
ctest --preset release --no-tests=error -R '^native_'

31 of 32 passed, and 1 was skipped (native_comparison_pso_warp). native_scalar_lds_hardware fails with "native compute PSO creation failed". It fails the same way on e97c5c7c without this change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Sir6Mr49SZWax95VApRPvz

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5517945947 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2939). Originally posted by [Miffedrandir](https://github.com/Miffedrandir) on 2026-11-26T22:22:03Z. --- ## Problem The runtime (`d3d12_draw.inl`) and `gfx2hlsl.py` key shader requests with `x2w-startup-shader-28` and `x2w-startup-shader-28cs`. `read_graphics_request` and `read_compute_request` in `src/shader_compute_request.cpp` still hash with `-14` and `-14cs`. So `compile_dxil` refuses every request the current runtime writes, with "graphics request key mismatch or missing root" or "compute request key mismatch". ## Change - `src/shader_compute_request.cpp`: hash requests with the runtime's tags, `-28` and `-28cs`. - `tests/native_compute_clear_check.py` and `tests/native_direct_container_check.py`: publish their requests with the same tags. That's 4 lines in total, with no other behavior change. ## Result I ran `compile_dxil --jobs 8 <profile> --requests <cache> <out>` over a shader cache written by the current runtime, counting only requests at revision 28: | | before | after | |---|---|---| | graphics (`gfx1013-container-pair`), 576 requests | 0 read (all key mismatch) | read; 3 compiled, the rest refused by the frontend | | compute (`gfx1013-direct-cs@0`), 2,834 requests | 0 read (all key mismatch) | read; 243 compiled, the rest refused by the frontend | Top frontend refusals after the fix: - graphics: "raw graphics requires a verified stage interface or wave state" (559) - compute: "unsupported DPP lane selection" (720), "direct resource-heap load requires the selected GPU slot and its view type" (334), "direct DXIL operand encoding" (244) ## Tests Windows 11 26200, MSVC 19.44, release preset, RTX 5070 Laptop: ```powershell cmake --build --preset release --target compile_dxil native_store_replay offscreen_check native_wave_request_gpu native_lds_gpu native_sampled_pixel_gpu native_buffered_vertex_gpu native_recording_check native_pixel_ir_dump ctest --preset release --no-tests=error -R '^native_' ``` 31 of 32 passed, and 1 was skipped (`native_comparison_pso_warp`). `native_scalar_lds_hardware` fails with "native compute PSO creation failed". It fails the same way on `e97c5c7c` without this change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Sir6Mr49SZWax95VApRPvz
MasterDomino commented 2026-11-26 22:38:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T22:38:18Z.

Review: APPROVED


Review of head 6bd7803f on cpp-migration e97c5c7c. Approving and merging.

Diff: it changes exactly the four places that still used revision 14: both reader tags in src/shader_compute_request.cpp, and the two test publishers. git grep 'x2w-startup-shader-14' finds nothing else.

Real runtime cache, counts only: a copy of a cache written by the current runtime (2,747 .c67 compute requests and 628 graphics .a requests, no .psin), run with compile_dxil --jobs 8 <profile> --requests, release build, Windows 11 26300.9974:

base e97c5c7c this PR
compute, gfx1013-direct-cs@0 0 of 2,747 read: all compute request key mismatch all read; 243 compiled, 2,504 refused by the frontend
graphics, gfx1013-container-pair 0 of 628 read: all graphics request key mismatch or missing root all read; 3 compiled, 625 refused by the frontend

The top refusals after the change are unsupported DPP lane selection (711), direct resource-heap load requires the selected GPU slot and its view type (334) and, for graphics, raw graphics requires a verified stage interface or wave state (608). That is the same picture you report.

Fixtures: ctest --preset release --no-tests=error -R '^native_' on an AMD Radeon RX 9070 XT (driver 32.0.32029.2010) gives 32 tests, 31 passed and 1 skipped (77, native_comparison_pso_warp). native_scalar_lds_hardware passes here, so its native compute PSO creation failed on your RTX 5070 Laptop looks specific to that adapter or driver, and is worth its own issue.

Still open in #2933 (this PR does not claim it):

  • .psin: read_graphics_request still reads at most 12 bytes and hashes them raw, while the runtime path uses the ASCII psin1 <key> ena=… addr=… line and gfx2hlsl.pipeline_key hashes b'psin1' + <II masks>. A request with a .psin file is therefore refused as oversized rather than read. That is safe, but not yet aligned.
  • Output names and the <key>.txt manifest the runtime loads.

No CI runs for this base.

AI-assisted; the commands above were run locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6081183211 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2939#pullrequestreview-6081183211). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-26T22:38:18Z. **Review:** APPROVED --- Review of head `6bd7803f` on `cpp-migration` `e97c5c7c`. Approving and merging. **Diff:** it changes exactly the four places that still used revision 14: both reader tags in `src/shader_compute_request.cpp`, and the two test publishers. `git grep 'x2w-startup-shader-14'` finds nothing else. **Real runtime cache, counts only:** a copy of a cache written by the current runtime (2,747 `.c67` compute requests and 628 graphics `.a` requests, no `.psin`), run with `compile_dxil --jobs 8 <profile> --requests`, release build, Windows 11 26300.9974: | | base `e97c5c7c` | this PR | |---|---|---| | compute, `gfx1013-direct-cs@0` | 0 of 2,747 read: all `compute request key mismatch` | all read; 243 compiled, 2,504 refused by the frontend | | graphics, `gfx1013-container-pair` | 0 of 628 read: all `graphics request key mismatch or missing root` | all read; 3 compiled, 625 refused by the frontend | The top refusals after the change are `unsupported DPP lane selection` (711), `direct resource-heap load requires the selected GPU slot and its view type` (334) and, for graphics, `raw graphics requires a verified stage interface or wave state` (608). That is the same picture you report. **Fixtures:** `ctest --preset release --no-tests=error -R '^native_'` on an AMD Radeon RX 9070 XT (driver 32.0.32029.2010) gives 32 tests, 31 passed and 1 skipped (77, `native_comparison_pso_warp`). `native_scalar_lds_hardware` **passes** here, so its `native compute PSO creation failed` on your RTX 5070 Laptop looks specific to that adapter or driver, and is worth its own issue. **Still open in #2933** (this PR does not claim it): - `.psin`: `read_graphics_request` still reads at most 12 bytes and hashes them raw, while the runtime path uses the ASCII `psin1 <key> ena=… addr=…` line and `gfx2hlsl.pipeline_key` hashes `b'psin1' + <II masks>`. A request with a `.psin` file is therefore refused as oversized rather than read. That is safe, but not yet aligned. - Output names and the `<key>.txt` manifest the runtime loads. No CI runs for this base. AI-assisted; the commands above were run locally.
SimSalabimse commented 2026-11-26 22:46:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-26T22:46:42Z.


Hardware and WARP result for head 6bd7803f8cac32bb681b3017251e23992ef30672 (base e97c5c7c). The revision-28 request tests pass. A synthetic revision-14 compute request is still refused with "compute request key mismatch".

Environment: Windows 11 25H2 (26200), Windows SDK 10.0.26100 DXC, NVIDIA GeForce RTX 4070 Ti, driver 32.0.16.2135, Microsoft WARP (4-lane waves). Clean worktree at the PR head, fresh out/pe-env, dev preset. Tests run serially. No game cache or title files were used; the requests came from the repo fixtures and one synthetic control with the same layout.

Commands

cmake --preset dev
cmake --build --preset dev
ctest --preset dev --no-tests=error -R "^(native_compute_clear|native_direct_container|native_comparison_pso_warp|native_graphics_comparison_pso_warp|native_rectangle_pso_warp)$" -V --output-on-failure -j 1 --timeout 300
ctest --preset dev --no-tests=error -R "^native_" --output-on-failure -j 1 --timeout 300

Result (measured, 2 runs, same outcomes): 5 tests: 4 passed, 1 skipped, 0 failed. ctest exit 0 both times (15.33 s and 14.71 s).

Test Result Times
native_compute_clear Passed. "two-table request, register renaming, store order, cache, tamper and partial descriptor passed" 0.45 s, 0.30 s
native_direct_container Passed 14.17 s, 13.82 s
native_comparison_pso_warp Skipped: compute requires wave32: WaveOps=1 range=4..4 0.23 s, 0.14 s
native_graphics_comparison_pso_warp Passed. "WARP created cold and cached graphics pipelines with regular/comparison samples and vertex/pixel UAVs" 0.21 s, 0.19 s
native_rectangle_pso_warp Passed. requests=1 compiled=1 refused=0 0.20 s, 0.20 s

Wider check, once: ctest --preset dev --no-tests=error -R "^native_" --output-on-failure -j 1 --timeout 300 on this head: 32 tests, 31 passed, 1 skipped (native_comparison_pso_warp), 0 failed. ctest exit 0. Total 65.05 s. native_wave_request_hardware passed (8.33 s). That is the test that failed at 40365770 in #2915; the current cpp-migration base already includes #2928. native_scalar_lds_hardware also passed here (2.63 s). Nothing else in the ^native_ set failed or skipped.

Control: Against this head's compile_dxil, a synthetic compute request hashed as x2w-startup-shader-14cs (same source-built payload as native_compute_clear, no title cache) was refused, exit 1:

compute request key mismatch

The same payload hashed as x2w-startup-shader-28cs was accepted and compiled, exit 0. native_compute_clear also has its own tamper control, which passed in both runs: after the revision-28 files are published, a damaged .data section is refused with "key mismatch".

AI-Assisted

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7204976527 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2939#issuecomment-7204976527). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-26T22:46:42Z. --- Hardware and WARP result for head `6bd7803f8cac32bb681b3017251e23992ef30672` (base `e97c5c7c`). The revision-28 request tests pass. A synthetic revision-14 compute request is still refused with "compute request key mismatch". **Environment:** Windows 11 25H2 (26200), Windows SDK 10.0.26100 DXC, NVIDIA GeForce RTX 4070 Ti, driver 32.0.16.2135, Microsoft WARP (4-lane waves). Clean worktree at the PR head, fresh `out/pe-env`, `dev` preset. Tests run serially. No game cache or title files were used; the requests came from the repo fixtures and one synthetic control with the same layout. **Commands** ``` cmake --preset dev cmake --build --preset dev ctest --preset dev --no-tests=error -R "^(native_compute_clear|native_direct_container|native_comparison_pso_warp|native_graphics_comparison_pso_warp|native_rectangle_pso_warp)$" -V --output-on-failure -j 1 --timeout 300 ctest --preset dev --no-tests=error -R "^native_" --output-on-failure -j 1 --timeout 300 ``` **Result (measured, 2 runs, same outcomes):** 5 tests: 4 passed, 1 skipped, 0 failed. ctest exit 0 both times (15.33 s and 14.71 s). | Test | Result | Times | |---|---|---| | `native_compute_clear` | Passed. "two-table request, register renaming, store order, cache, tamper and partial descriptor passed" | 0.45 s, 0.30 s | | `native_direct_container` | Passed | 14.17 s, 13.82 s | | `native_comparison_pso_warp` | Skipped: `compute requires wave32: WaveOps=1 range=4..4` | 0.23 s, 0.14 s | | `native_graphics_comparison_pso_warp` | Passed. "WARP created cold and cached graphics pipelines with regular/comparison samples and vertex/pixel UAVs" | 0.21 s, 0.19 s | | `native_rectangle_pso_warp` | Passed. `requests=1 compiled=1 refused=0` | 0.20 s, 0.20 s | **Wider check, once:** `ctest --preset dev --no-tests=error -R "^native_" --output-on-failure -j 1 --timeout 300` on this head: 32 tests, 31 passed, 1 skipped (`native_comparison_pso_warp`), 0 failed. ctest exit 0. Total 65.05 s. `native_wave_request_hardware` passed (8.33 s). That is the test that failed at `40365770` in #2915; the current `cpp-migration` base already includes #2928. `native_scalar_lds_hardware` also passed here (2.63 s). Nothing else in the `^native_` set failed or skipped. **Control:** Against this head's `compile_dxil`, a synthetic compute request hashed as `x2w-startup-shader-14cs` (same source-built payload as `native_compute_clear`, no title cache) was refused, exit 1: ``` compute request key mismatch ``` The same payload hashed as `x2w-startup-shader-28cs` was accepted and compiled, exit 0. `native_compute_clear` also has its own tamper control, which passed in both runs: after the revision-28 files are published, a damaged `.data` section is refused with "key mismatch". AI-Assisted
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
R0Y00/Xbox2Windows!2939
No description provided.