[PR #2162] [MERGED] d3d12: never defer buffer V#s past console-fix budget (RT-CONSOLE-FIX-NEVER-DEFER-BUFFER-VSHARP) #2167

Closed
opened 2026-11-26 21:20:16 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2162
Author: @abnalstlll-byte
Created: 11/26/2026
Status: ✅ Merged
Merged: 11/26/2026
Merged by: @aslan2142

Base: main ← Head: feat/rt-console-fix-never-defer-buffer-vsharp


📝 Commits (1)

  • 2769c5a d3d12: never defer buffer V#s past console-fix budget (RT-CONSOLE-FIX-NEVER-DEFER-BUFFER-VSHARP)

📊 Changes

2 files changed (+82 additions, -1 deletions)

View changed files

📝 runtime/shims/d3d12_vulkan_device.cpp (+7 -1)
📝 runtime/test/console_heap_vsharp_slots_test.cpp (+75 -0)

📄 Description

Claimed in Issue #1608: RT-CONSOLE-FIX-NEVER-DEFER-BUFFER-VSHARP.

What and why

In fix_console_slots() (runtime/shims/d3d12_vulkan_device.cpp), when the LEONIDA_CONSOLE_FIX_US submission budget expires (heap.fix_over == true), the code currently zeroes every remaining descriptor slot and defers them to retry_console_slots.

Nulling buffer descriptor slots (V#s) causes compute shaders during the world transition (e.g. lib_cs_01144) to divide by 0 or read zero loop bounds from buffer descriptors, causing an infinite loop and GPU device loss.

Buffer V# descriptors (!(w3 >> 30)) only rebase virtual addresses and are fast to process without causing submission stalls (the 28s freeze is driven by thousands of image T# descriptors performing image binding and view lookups).

This change ensures that buffer V# descriptors are never nulled or deferred when the fix budget expires: they are always resolved in-place with fix_console_slot, while image T# descriptors continue to be safely deferred to retry_console_slots.

Testing

  • console_heap_vsharp_slots_test: added test_console_fix_budget_buffer_vsharp_non_deferral() verifying that under fix_over == true, buffer V# descriptors are preserved live while image T#s are deferred and nulled. Passed (100%).
  • vk_console_heap_gpu_test: passed on NVIDIA GeForce RTX 5060 Ti.
  • scripts/check_no_game_data.py: passed (0 violations).
  • tests/test_text_write_line_endings.py: passed.

AI-assisted (Claude Code).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2162 **Author:** [@abnalstlll-byte](https://github.com/abnalstlll-byte) **Created:** 11/26/2026 **Status:** ✅ Merged **Merged:** 11/26/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `feat/rt-console-fix-never-defer-buffer-vsharp` --- ### 📝 Commits (1) - [`2769c5a`](https://github.com/ubiquitarianism/leonida/commit/2769c5a739ab5e9f362b606677d827d02905c95f) d3d12: never defer buffer V#s past console-fix budget (RT-CONSOLE-FIX-NEVER-DEFER-BUFFER-VSHARP) ### 📊 Changes **2 files changed** (+82 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+7 -1) 📝 `runtime/test/console_heap_vsharp_slots_test.cpp` (+75 -0) </details> ### 📄 Description Claimed in Issue #1608: [RT-CONSOLE-FIX-NEVER-DEFER-BUFFER-VSHARP](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7178867037). ### What and why In `fix_console_slots()` (`runtime/shims/d3d12_vulkan_device.cpp`), when the `LEONIDA_CONSOLE_FIX_US` submission budget expires (`heap.fix_over == true`), the code currently zeroes every remaining descriptor slot and defers them to `retry_console_slots`. Nulling buffer descriptor slots (V#s) causes compute shaders during the world transition (e.g. `lib_cs_01144`) to divide by 0 or read zero loop bounds from buffer descriptors, causing an infinite loop and GPU device loss. Buffer V# descriptors (`!(w3 >> 30)`) only rebase virtual addresses and are fast to process without causing submission stalls (the 28s freeze is driven by thousands of image T# descriptors performing image binding and view lookups). This change ensures that buffer V# descriptors are never nulled or deferred when the fix budget expires: they are always resolved in-place with `fix_console_slot`, while image T# descriptors continue to be safely deferred to `retry_console_slots`. ### Testing - `console_heap_vsharp_slots_test`: added `test_console_fix_budget_buffer_vsharp_non_deferral()` verifying that under `fix_over == true`, buffer V# descriptors are preserved live while image T#s are deferred and nulled. Passed (100%). - `vk_console_heap_gpu_test`: passed on NVIDIA GeForce RTX 5060 Ti. - `scripts/check_no_game_data.py`: passed (0 violations). - `tests/test_text_write_line_endings.py`: passed. AI-assisted (Claude Code). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 21:20:16 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#2167
No description provided.