Guard cached compute precompilation against driver faults #758

Closed
klimovich008 wants to merge 3 commits from codex/guard-compute-precompile into main
klimovich008 commented 2026-11-08 20:10:34 +00:00 (Migrated from github.com)

What this fixes

On Windows, a driver access violation (0xC0000005) during cached compute precompilation terminates startup. This call bypasses the exception guard already used during shader preparation and runtime compilation.

Why merge

  • One-line change. Reuse the existing guard; non-Windows behavior stays the same.
  • Preserve the cache, creation arguments, successful publication and failure cleanup.
  • Keep startup limits, defaults and environment overrides unchanged.

Change

  • gpu/vk/vk_draw.cpp: use guarded_compute(pcache, &ci, &made).
  • tests/test_precompile_compute_guard.py: test the actual wrapper and worker branch with injected Windows faults.
  • tests/run_all.py: run the check on Windows and record a Linux skip.

Tested

  • On Windows: python -I -B tests/run_all.py --strict precompile_compute_guard; checks success, access violations, ordinary errors and abandoned-pipeline cleanup.
  • Fails on the old code, passes now. All five cases pass after the change.
  • Local Windows/Ryzen 7 5700X3D: the injected access violation kills the old child; the fixed child exits normally. No GPU driver is invoked.

All seven CI checks pass after syncing with current main, including the Windows regression and both platform builds.

Not covered

  • Real GPU startup validation is pending. This does not identify the cause of the reported RX 9070 XT startup abort.
  • Driver hangs, fast-fail termination and production worker scheduling are outside this test.

No game data is included.

## What this fixes On Windows, a driver access violation (`0xC0000005`) during cached compute precompilation terminates startup. This call bypasses the exception guard already used during shader preparation and runtime compilation. ## Why merge - One-line change. Reuse the existing guard; non-Windows behavior stays the same. - Preserve the cache, creation arguments, successful publication and failure cleanup. - Keep startup limits, defaults and environment overrides unchanged. ## Change - `gpu/vk/vk_draw.cpp`: use `guarded_compute(pcache, &ci, &made)`. - `tests/test_precompile_compute_guard.py`: test the actual wrapper and worker branch with injected Windows faults. - `tests/run_all.py`: run the check on Windows and record a Linux skip. ## Tested - On Windows: `python -I -B tests/run_all.py --strict precompile_compute_guard`; checks success, access violations, ordinary errors and abandoned-pipeline cleanup. - Fails on the old code, passes now. All five cases pass after the change. - Local Windows/Ryzen 7 5700X3D: the injected access violation kills the old child; the fixed child exits normally. No GPU driver is invoked. All seven CI checks pass after syncing with current main, including the Windows regression and both platform builds. ## Not covered - **Real GPU startup validation is pending.** This does not identify the cause of the reported RX 9070 XT startup abort. - Driver hangs, fast-fail termination and production worker scheduling are outside this test. No game data is included.
NotRexed commented 2026-11-09 05:17:01 +00:00 (Migrated from github.com)

Merged into main in fa43939 (v2.0.6), thanks!

Merged into main in fa43939 (v2.0.6), thanks!
Commenting is not possible because the repository is archived.
No description provided.