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

Merged
R0Y00 merged 1 commit from upstream-pr/1416 into main 2026-11-24 11:16:30 +00:00
R0Y00 commented 2026-11-24 11:01:49 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T11:01:49Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6580304542 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1416). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T11:01:49Z. --- 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.
tedin7 commented 2026-11-24 11:14:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:14:25Z.

Review: COMMENTED


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).
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6038204943 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1416#pullrequestreview-6038204943). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T11:14:25Z. **Review:** COMMENTED --- 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`).
upstream-sync closed this pull request 2026-11-24 12:02:50 +00:00
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!1409
No description provided.