startup: -NativeShaders stops ordinary direct graphics pipelines from translating (PSI1 key suffix, .ps57in not read by fallback) #3385

Closed
opened 2026-11-28 17:31:58 +00:00 by SimSalabimse · 2 comments
SimSalabimse commented 2026-11-28 17:31:58 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-28T17:31:58Z.


Summary. With -NativeShaders (X2W_NATIVE_SHADERS set), ordinary direct graphics pipelines stop translating at all in a real start-up run. The Python watcher and the native graphics path both refuse them, so the screen stays black.

Observed on the Windows test PC, main aec2e08, RTX 4070 Ti, Windows 11, a retail title. The run used the same flags as a run without -NativeShaders, plus -SuspendOthers 0 -InputScript, on the same warmed shader cache.

  • Without -NativeShaders, after 900 s: pipelines translated 90 / missing 574.
  • With -NativeShaders, after about 10 min: pipelines translated 3 / missing 11, translated draws 17868 (not drawn 309312), textures uploaded 2. Compute showed translated 0, refused 10255. translate.txt stayed empty.

Cause (from reading the source; please correct me).

  • With X2W_NATIVE_SHADERS set, d3d12_draw.inl (around line 1163) appends a PSI1 suffix plus 8 bytes to the key of every ordinary direct graphics request, and writes a .ps57in sidecar.
  • gfx2hlsl.py never reads .ps57in, so each request fails with shader request source key mismatch.
  • The native graphics path then refuses the same request with fixed graphics entry requires matching stage interfaces.
  • Because the keys differ, translations already in the cache never hit either.
  • The 11 missing pipelines each have a .ps57in sidecar and exactly that .fail.

Side notes.

  • run.ps1 leaves X2W_NATIVE_SHADERS set in the PowerShell session, so the next run without the flag is still affected until you clear it.
  • With the 10.0.22621.0 SDK's dxil.dll, some native compute programs fail with Validator version 1.8 is not supported; maximum 1.6. The 10.0.26100.0 SDK avoids this.

Expected. Either keep the ordinary graphics key unchanged when X2W_NATIVE_SHADERS is set (only add the suffix where the native path will accept the request), or teach the fallback to read the sidecar. In both cases the cached Python translations should still be used.

AI-Assisted

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6669000724 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3385). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-28T17:31:58Z. --- **Summary.** With `-NativeShaders` (`X2W_NATIVE_SHADERS` set), ordinary direct graphics pipelines stop translating at all in a real start-up run. The Python watcher and the native graphics path both refuse them, so the screen stays black. **Observed** on the Windows test PC, `main` `aec2e08`, RTX 4070 Ti, Windows 11, a retail title. The run used the same flags as a run without `-NativeShaders`, plus `-SuspendOthers 0 -InputScript`, on the same warmed shader cache. - Without `-NativeShaders`, after 900 s: pipelines translated 90 / missing 574. - With `-NativeShaders`, after about 10 min: `pipelines translated 3 / missing 11`, `translated draws 17868 (not drawn 309312)`, `textures uploaded 2`. Compute showed `translated 0, refused 10255`. `translate.txt` stayed empty. **Cause (from reading the source; please correct me).** - With `X2W_NATIVE_SHADERS` set, `d3d12_draw.inl` (around line 1163) appends a `PSI1` suffix plus 8 bytes to the key of every ordinary direct graphics request, and writes a `.ps57in` sidecar. - `gfx2hlsl.py` never reads `.ps57in`, so each request fails with `shader request source key mismatch`. - The native graphics path then refuses the same request with `fixed graphics entry requires matching stage interfaces`. - Because the keys differ, translations already in the cache never hit either. - The 11 missing pipelines each have a `.ps57in` sidecar and exactly that `.fail`. **Side notes.** - `run.ps1` leaves `X2W_NATIVE_SHADERS` set in the PowerShell session, so the next run without the flag is still affected until you clear it. - With the 10.0.22621.0 SDK's `dxil.dll`, some native compute programs fail with `Validator version 1.8 is not supported; maximum 1.6`. The 10.0.26100.0 SDK avoids this. **Expected.** Either keep the ordinary graphics key unchanged when `X2W_NATIVE_SHADERS` is set (only add the suffix where the native path will accept the request), or teach the fallback to read the sidecar. In both cases the cached Python translations should still be used. AI-Assisted
Leyukaka commented 2026-11-28 20:43:26 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T20:43:26Z.


I'll measure this on main 8ecd30fe: two 600 s start-up runs with the same flags and inputs, each from its own copy of the same warmed shader cache, with and without -NativeShaders, each in a new PowerShell process (run.ps1:83 leaves X2W_NATIVE_SHADERS set). I'll post counts only: draws translated and not drawn, pipelines translated and missing, .fail files by first line, and how many .ps57in base keys already have a translation in the cache. This is a measurement only; the fix is unclaimed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7245493381 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3385#issuecomment-7245493381). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-28T20:43:26Z. --- I'll measure this on `main` `8ecd30fe`: two 600 s start-up runs with the same flags and inputs, each from its own copy of the same warmed shader cache, with and without `-NativeShaders`, each in a new PowerShell process (`run.ps1:83` leaves `X2W_NATIVE_SHADERS` set). I'll post counts only: draws translated and not drawn, pipelines translated and missing, `.fail` files by first line, and how many `.ps57in` base keys already have a translation in the cache. This is a measurement only; the fix is unclaimed.
Leyukaka commented 2026-11-29 01:08:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T01:08:40Z.


Releasing my measurement claim from 2026-11-28 20:43: the comparison was not run. #3410 targets this issue.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7248589246 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3385#issuecomment-7248589246). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-29T01:08:40Z. --- Releasing my measurement claim from 2026-11-28 20:43: the comparison was not run. #3410 targets this issue.
Sign in to join this conversation.
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#3385
No description provided.