2 Commits

Author SHA1 Message Date
8ff0a161ff address_binding: review fixes for RT-FAULT-ADDRESS-OWNER
- A second Vulkan instance in the process no longer overwrites the messenger
  handle (the first one was left alive past its instance): it is refused, and
  enable_device only enables the extension for the instance that owns the
  messenger. install/uninstall are under a lock.
- `on` is set only when a messenger records the device, and is atomic. With
  LEONIDA_ADDRESS_BINDINGS=1 and nothing recording, the fault report says the
  bindings were not recorded instead of reading as "no object there".
- An object that only shares the reported page with the fault address is
  labelled "on the page" (unbound: "held the page"), not "containing".
- Tests: exact end and start of an object, page vs byte precision, unbind
  matching by handle and size, the kept_unbound cap, recording from several
  threads while a report reads, and the two-instance messenger cases. The test
  builds on Linux too (setenv in place of _putenv_s).

Changes made by Claude Code (AI-assisted).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JPqXc6svM4pbBagTsVEYA3
2026-11-25 22:12:33 +00:00
ae0a3d0449 d3d12: the device-fault report names what the process and the driver had at each fault address (RT-FAULT-ADDRESS-OWNER)
A fault address alone does not say whose page it is. Each one now also gets:

- VirtualQuery of the same number on Windows: base, allocation base, state, protection and type. A host
  import, a range of the title's memory or a raw CPU pointer that reached a shader shares the number.
- With LEONIDA_ADDRESS_BINDINGS=1, VK_EXT_device_address_binding_report: a debug messenger records the GPU
  range of every buffer, image and allocation the driver binds and unbinds (src/address_binding.h). The
  report lists the live objects containing the page, the nearest below and above, and recently unbound
  objects that held it.

address_binding_test checks the record and the report on synthetic bindings, and the feature and extension
on the device chain. On an RTX 5070 Ti (617.42) the messenger saw ~50,000 binds in a retail boot, and the
world-start WRITE_INVALID address was in none of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:46:00 +05:00