[PR #1918] d3d12: the device-fault report names what the process and the driver had at each fault address (RT-FAULT-ADDRESS-OWNER) #1926

Open
opened 2026-11-26 21:19:26 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1918
Author: @kawaii-shakal
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: fault-address-owner


📝 Commits (5)

  • ae0a3d0 d3d12: the device-fault report names what the process and the driver had at each fault address (RT-FAULT-ADDRESS-OWNER)
  • 2239135 address binding: destroy the debug messenger before its instance
  • c626cb2 Merge upstream main into fault-address-owner
  • 8ff0a16 address_binding: review fixes for RT-FAULT-ADDRESS-OWNER
  • 51174c6 Merge upstream main into fault-address-owner

📊 Changes

6 files changed (+623 additions, -1 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+21 -0)
📝 runtime/CMakeLists.txt (+4 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+9 -1)
➕ runtime/src/address_binding.h (+303 -0)
📝 runtime/src/vulkan_device_fault.h (+21 -0)
➕ runtime/test/address_binding_test.cpp (+265 -0)

📄 Description

Claimed in the coordination issue as RT-FAULT-ADDRESS-OWNER: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7167314476

Problem

A device-fault report gives an address, its type and its precision, but not whose page it is. For the world-start WRITE_INVALID in #1608 several of us have been guessing: an untranslated title address, a raw CPU pointer, an object bound one page short, or driver-internal memory. Without an owner, nothing separates these guesses.

Change

For every fault address in the report:

  • What the process has at the same number (Windows). VirtualQuery gives the base, allocation base, state, protection and type. A GPU address isn't a CPU one, but a host import, a range of the title's memory and a raw CPU pointer that reached a shader all share the number.

  • With LEONIDA_ADDRESS_BINDINGS=1 (and LEONIDA_DEVICE_FAULT=1). The device enables VK_EXT_device_address_binding_report. A debug messenger, installed before vkCreateDevice, records the GPU virtual address range of every buffer, image and allocation the driver binds and unbinds (runtime/src/address_binding.h). The report then lists:

    • the live objects that contain the page;
    • the live objects nearest below and nearest above it;
    • up to 16 recently unbound objects that held it, with type, range, handle and the times they were bound and unbound.

    "Nothing live or recently unbound there" means that no object of this device had that GPU address.

The record and the report are pure and covered by address_binding_test: synthetic bindings, the messenger callback, and the feature and extension on the device chain. docs/d3d12_vulkan.md 4.11 describes them.

Measured (Windows 11 Pro 26300, RTX 5070 Ti, NVIDIA 617.42, 1.0.2.1 retail boot)

  • The messenger works on the real device. It recorded about 50,000 binds and 8,000 unbinds by the world start, and the boot ran as usual.
  • None of the bound objects owned the world-start write address. The highest live range ended at about 27 GiB. The write address was a committed PAGE_READWRITE private page of this process, outside every xmem-large allocation of the title. Codex reads the same numbers as the arena base plus an untranslated title address (0x299fe000 into one 2,199 MiB XMem range in three boots). After main's #1723 that loss no longer happens here (a different stop, about 820 s in).
  • CTest: address_binding and vulkan_device_fault pass.

Not done here

  • No object names. Names would need a vkSetDebugUtilsObjectNameEXT pass over the layer's objects.
  • One GPU vendor. Only checked on NVIDIA.

🤖 Generated with 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/1918 **Author:** [@kawaii-shakal](https://github.com/kawaii-shakal) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fault-address-owner` --- ### 📝 Commits (5) - [`ae0a3d0`](https://github.com/ubiquitarianism/leonida/commit/ae0a3d04498e8806f9094d45e21b089b4028d057) d3d12: the device-fault report names what the process and the driver had at each fault address (RT-FAULT-ADDRESS-OWNER) - [`2239135`](https://github.com/ubiquitarianism/leonida/commit/223913540b12649abcd9a0717b210cca249d1e94) address binding: destroy the debug messenger before its instance - [`c626cb2`](https://github.com/ubiquitarianism/leonida/commit/c626cb2dc26bd5ee594f57dc3cebbbe79f658967) Merge upstream main into fault-address-owner - [`8ff0a16`](https://github.com/ubiquitarianism/leonida/commit/8ff0a161ffa2588b75f674246521d45476762165) address_binding: review fixes for RT-FAULT-ADDRESS-OWNER - [`51174c6`](https://github.com/ubiquitarianism/leonida/commit/51174c6cd9d4c28130c0f7ac9336a8f08871b036) Merge upstream main into fault-address-owner ### 📊 Changes **6 files changed** (+623 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+21 -0) 📝 `runtime/CMakeLists.txt` (+4 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+9 -1) ➕ `runtime/src/address_binding.h` (+303 -0) 📝 `runtime/src/vulkan_device_fault.h` (+21 -0) ➕ `runtime/test/address_binding_test.cpp` (+265 -0) </details> ### 📄 Description Claimed in the coordination issue as RT-FAULT-ADDRESS-OWNER: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7167314476 ### Problem A device-fault report gives an address, its type and its precision, but not whose page it is. For the world-start WRITE_INVALID in #1608 several of us have been guessing: an untranslated title address, a raw CPU pointer, an object bound one page short, or driver-internal memory. Without an owner, nothing separates these guesses. ### Change For every fault address in the report: - **What the process has at the same number (Windows).** `VirtualQuery` gives the base, allocation base, state, protection and type. A GPU address isn't a CPU one, but a host import, a range of the title's memory and a raw CPU pointer that reached a shader all share the number. - **With `LEONIDA_ADDRESS_BINDINGS=1` (and `LEONIDA_DEVICE_FAULT=1`).** The device enables `VK_EXT_device_address_binding_report`. A debug messenger, installed before `vkCreateDevice`, records the GPU virtual address range of every buffer, image and allocation the driver binds and unbinds (`runtime/src/address_binding.h`). The report then lists: - the live objects that contain the page; - the live objects nearest below and nearest above it; - up to 16 recently unbound objects that held it, with type, range, handle and the times they were bound and unbound. "Nothing live or recently unbound there" means that no object of this device had that GPU address. The record and the report are pure and covered by `address_binding_test`: synthetic bindings, the messenger callback, and the feature and extension on the device chain. `docs/d3d12_vulkan.md` 4.11 describes them. ### Measured (Windows 11 Pro 26300, RTX 5070 Ti, NVIDIA 617.42, 1.0.2.1 retail boot) - **The messenger works on the real device.** It recorded about 50,000 binds and 8,000 unbinds by the world start, and the boot ran as usual. - **None of the bound objects owned the world-start write address.** The highest live range ended at about 27 GiB. The write address was a committed `PAGE_READWRITE` private page of this process, outside every `xmem-large` allocation of the title. Codex reads the same numbers as the arena base plus an untranslated title address (`0x299fe000` into one 2,199 MiB XMem range in three boots). After main's #1723 that loss no longer happens here (a different stop, about 820 s in). - **CTest:** `address_binding` and `vulkan_device_fault` pass. ### Not done here - **No object names.** Names would need a `vkSetDebugUtilsObjectNameEXT` pass over the layer's objects. - **One GPU vendor.** Only checked on NVIDIA. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#1926
No description provided.