runtime: add opt-in LEONIDA_GATE_TIMEOUT_MS and LEONIDA_SKIP_GRAPHICS #3508

Closed
leonida/mandy
cheezy_poof wants to merge 1 commit from cheezy_poof/mandy:runtime-gate-timeout-and-skip-graphics into main

Pull request closed

Please reopen this pull request to perform a merge.

First-time contributor

Summary

Adds two strictly opt-in diagnostic environment variables (both off by default when unset, zero behavior change otherwise):

  1. LEONIDA_GATE_TIMEOUT_MS (runtime/shims/d3d12_xs_list_values.h)
    • Releases an unmet list-value wait gate after N milliseconds in choose_release().
    • Strictly restricted to the front-most (FIFO) non-action gate per queue, ensuring Vulkan timeline semaphores are never signaled out of order.
  2. LEONIDA_SKIP_GRAPHICS (runtime/shims/d3d12_vulkan_device.cpp, runtime/src/vulkan_replay.h)
    • Graphics/mesh counterpart to LEONIDA_SKIP_COMPUTE: comma-separated substrings (or all/*) matched against shader stage names at pipeline creation.
    • Matching pipelines are marked skipped = true, omitted from collect_unbuilt_pipelines(), never compiled, and dropped cleanly in prepare_draw().
  3. Documentation (runtime/README.md)
    • Documents both env vars in the runtime environment table.

Verification

  • Built gta6rt.exe cleanly on Linux (xwin-sdk / clang-cl + Ninja).
  • Tested on Arch Linux, NVIDIA RTX 4060 Ti 8 GB (driver 620.73.04), GE-Proton10-34, native Vulkan backend (LEONIDA_D3D12=vulkan):
    • LEONIDA_GATE_TIMEOUT_MS released stalled list-value gates cleanly with 0 backwards timeline semaphore warnings.
    • LEONIDA_SKIP_GRAPHICS allowed isolating multi-second mesh pipelines identified by LEONIDA_GPU_PROFILE=1 that were tripping NVIDIA Xid 109 context-switch timeouts, cutting world frame time 6-15x and sustaining a 72.7-minute continuous world run (39,059 submissions, 0 VK_ERROR_DEVICE_LOST, 0 Xid errors, clean exit).
### Summary Adds two strictly opt-in diagnostic environment variables (both off by default when unset, zero behavior change otherwise): 1. **`LEONIDA_GATE_TIMEOUT_MS`** (`runtime/shims/d3d12_xs_list_values.h`) - Releases an unmet list-value wait gate after `N` milliseconds in `choose_release()`. - Strictly restricted to the **front-most (FIFO) non-action gate per queue**, ensuring Vulkan timeline semaphores are never signaled out of order. 2. **`LEONIDA_SKIP_GRAPHICS`** (`runtime/shims/d3d12_vulkan_device.cpp`, `runtime/src/vulkan_replay.h`) - Graphics/mesh counterpart to `LEONIDA_SKIP_COMPUTE`: comma-separated substrings (or `all`/`*`) matched against shader stage names at pipeline creation. - Matching pipelines are marked `skipped = true`, omitted from `collect_unbuilt_pipelines()`, never compiled, and dropped cleanly in `prepare_draw()`. 3. **Documentation** (`runtime/README.md`) - Documents both env vars in the runtime environment table. ### Verification - Built `gta6rt.exe` cleanly on Linux (xwin-sdk / clang-cl + Ninja). - Tested on Arch Linux, NVIDIA RTX 4060 Ti 8 GB (driver `620.73.04`), GE-Proton10-34, native Vulkan backend (`LEONIDA_D3D12=vulkan`): - `LEONIDA_GATE_TIMEOUT_MS` released stalled list-value gates cleanly with **0 backwards timeline semaphore warnings**. - `LEONIDA_SKIP_GRAPHICS` allowed isolating multi-second mesh pipelines identified by `LEONIDA_GPU_PROFILE=1` that were tripping NVIDIA `Xid 109` context-switch timeouts, cutting world frame time 6-15x and sustaining a **72.7-minute continuous world run** (39,059 submissions, 0 `VK_ERROR_DEVICE_LOST`, 0 Xid errors, clean exit).
Adds two diagnostic opt-in env vars (both off by default):

- LEONIDA_GATE_TIMEOUT_MS: FIFO-only timeout release for the front-most non-action list-value gate per queue in choose_release(), preventing deadlocks without reversing Vulkan timeline semaphores.
- LEONIDA_SKIP_GRAPHICS: graphics/mesh counterpart to LEONIDA_SKIP_COMPUTE for isolating or bypassing slow/timeout mesh/graphics shaders during profiling.
cheezy_poof closed this pull request 2026-12-05 02:07:09 +00:00
Sign in to join this conversation.
No description provided.