gpu: recover a missing shader on later draws after cache publication #1416

Manually merged
github merged 1 commit from gh-pr/1416/head into gh-pr/1416/base 2026-11-26 23:05:20 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-24 11:01 UTC · original
R0Y00:codex/startup-reload-published-shader → main · +42 −6 · 5 files · 1 commits · merged 2026-11-24 11:16 UTC

Refs #1150.

A missing shader manifest used to remain missing for the lifetime of the process, even after the offline translator finished writing the requested result. A later draw now retries an absent manifest at most once per second for that pipeline. It uses the existing publication order (both shader blobs first, then the manifest). A published manifest that fails parsing or loading remains rejected. The initial request is written once, including when a render-target format needs its own variant.

The source-built checks render with an existing guest PSO before and after publishing the manifest in the same process. Before publication the complete readback matches the clear. After publication the ordinary 32-pixel target matches the warm-cache draw. Unsigned and signed integer MRT variants are checked independently, including the second target, under FXC and DXC.

Windows 11 build 26200.9974, Release, RTX 4060 Laptop driver 32.0.16.1656 and WARP driver 10.0.26100.9818. The MRT fixtures enable the debug layer. The ordinary stream draw uses its default setting. No private inputs are needed.

cmake --build --preset release --target startup_stream_consumer d3d12_xs_shim
ctest --preset release --no-tests=error --output-on-failure -R '^startup_(stream_draw|mrt_(fxc|dxc))_(warp|hardware)$'

Result at 4957e609: all six CTests passed, with zero skips. The same WARP consumer linked at runtime to the unmodified base DLL failed the new check because its second readback still contained only the clear. The documentation checker passed for 315 links.

**@⁠R0Y00** on GitHub · 2026-11-24 11:01 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1416) `R0Y00:codex/startup-reload-published-shader` → `main` · +42 −6 · 5 files · 1 commits · merged 2026-11-24 11:16 UTC Refs #1150. A missing shader manifest used to remain missing for the lifetime of the process, even after the offline translator finished writing the requested result. A later draw now retries an absent manifest at most once per second for that pipeline. It uses the existing publication order (both shader blobs first, then the manifest). A published manifest that fails parsing or loading remains rejected. The initial request is written once, including when a render-target format needs its own variant. The source-built checks render with an existing guest PSO before and after publishing the manifest in the same process. Before publication the complete readback matches the clear. After publication the ordinary 32-pixel target matches the warm-cache draw. Unsigned and signed integer MRT variants are checked independently, including the second target, under FXC and DXC. Windows 11 build 26200.9974, Release, RTX 4060 Laptop driver 32.0.16.1656 and WARP driver 10.0.26100.9818. The MRT fixtures enable the debug layer. The ordinary stream draw uses its default setting. No private inputs are needed. ```powershell cmake --build --preset release --target startup_stream_consumer d3d12_xs_shim ctest --preset release --no-tests=error --output-on-failure -R '^startup_(stream_draw|mrt_(fxc|dxc))_(warp|hardware)$' ``` Result at 4957e609: all six CTests passed, with zero skips. The same WARP consumer linked at runtime to the unmodified base DLL failed the new check because its second readback still contained only the clear. The documentation checker passed for 315 links.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:05:18 +00:00
github manually merged commit 4957e609ab into gh-pr/1416/base 2026-11-26 23:05:20 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 11:14 UTC · original · reviewed

Reviewed and verified at 4957e609abedf1dc26dbdc268180e030d991cc4e:

  • Diff & locking audit: git diff --check origin/main...HEAD is clean. translation_for_targets runs under AcquireSRWLockExclusive(&draw_lock), protecting retry_manifest_at, state, and load_translation updates. Only an absent manifest schedules retry_manifest_at = GetTickCount64() + 1000; once read, retry_manifest_at is cleared to 0 so a malformed manifest or failed CSO/root-sig load remains rejected (state = 2). translation_missing is incremented once per missing pipeline and decremented on recovery, and request files are written once. Both startup_stream_draw_check.py and startup_mrt_check.py verify the pre-publication clear readback before manifest publication and recovery.
  • Linux checks: docs_links_check.py (16 Markdown files, 315 links), bidi_controls_check.py (1176 tracked files), and python3 -m py_compile on tests/startup_mrt_check.py and tests/startup_stream_draw_check.py passed.
  • Windows Server 2025 (Build 26100, MSVC 14.44.35207, D3D12 WARP):
    • Debug (--preset dev): startup_stream_consumer d3d12_xs_shim built in 24.54s; ctest --preset dev -R '^startup_(stream_draw|mrt_(fxc|dxc))_warp$' 3/3 passed (4.82s).
    • Release /O2 (--preset release): built in 36.12s; ctest --preset release -R '^startup_(stream_draw|mrt_(fxc|dxc))_warp$' 3/3 passed (4.90s).
**@⁠tedin7** on GitHub · 2026-11-24 11:14 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1416#pullrequestreview-6038204943) · **reviewed** Reviewed and verified at `4957e609abedf1dc26dbdc268180e030d991cc4e`: - **Diff & locking audit**: `git diff --check origin/main...HEAD` is clean. `translation_for_targets` runs under `AcquireSRWLockExclusive(&draw_lock)`, protecting `retry_manifest_at`, `state`, and `load_translation` updates. Only an absent manifest schedules `retry_manifest_at = GetTickCount64() + 1000`; once read, `retry_manifest_at` is cleared to `0` so a malformed manifest or failed CSO/root-sig load remains rejected (`state = 2`). `translation_missing` is incremented once per missing pipeline and decremented on recovery, and request files are written once. Both `startup_stream_draw_check.py` and `startup_mrt_check.py` verify the pre-publication clear readback before manifest publication and recovery. - **Linux checks**: `docs_links_check.py` (16 Markdown files, 315 links), `bidi_controls_check.py` (1176 tracked files), and `python3 -m py_compile` on `tests/startup_mrt_check.py` and `tests/startup_stream_draw_check.py` passed. - **Windows Server 2025 (Build 26100, MSVC 14.44.35207, D3D12 WARP)**: - Debug (`--preset dev`): `startup_stream_consumer d3d12_xs_shim` built in `24.54s`; `ctest --preset dev -R '^startup_(stream_draw|mrt_(fxc|dxc))_warp$'` **3/3 passed** (`4.82s`). - Release `/O2` (`--preset release`): built in `36.12s`; `ctest --preset release -R '^startup_(stream_draw|mrt_(fxc|dxc))_warp$'` **3/3 passed** (`4.90s`).
This discussion has been locked. Commenting is limited to contributors.
No description provided.