Skip to content

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

Done

Description

@SimSalabimse

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

Activity

  1. Leyukaka commented on Nov 28, 2026

    @Leyukaka
    Collaborator

    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.

  2. Leyukaka commented on Nov 29, 2026

    @Leyukaka
    Collaborator

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

  3. added a commit that references this issue on Nov 29, 2026
    ec57297
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions