From f168b9b645db5c0811eb8f2473dca61b95a8dbbf Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Mon, 9 Nov 2026 08:24:21 -0800 Subject: [PATCH] RuntimeGap::MadeBeforeRecovery: what a recovery carries, as it carries it now The variant's docs listed the events, the Private buffers and the buffers in fresh pages as all a recovery carries, and every no-copy buffer and pooled Shared or Managed buffer among what it does not. A recovery also carries the uses of guest RAM and the no-copy buffers (made again over the same pages; a detached one stays refused), and, where the device takes them, the pooled buffers in blocks of the runtime's own pages. The docs now say so, as the runtime README's recovery section does. docs/REFUSALS.md regenerated: its row reads the variant's first sentence, unchanged. (cherry picked from commit 5db8726121b2ff46f89b793adb3a5f354d505758) --- crates/metal2vulkan-runtime/src/error.rs | 30 ++++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/crates/metal2vulkan-runtime/src/error.rs b/crates/metal2vulkan-runtime/src/error.rs index 235fed1e5..eb74f71b3 100644 --- a/crates/metal2vulkan-runtime/src/error.rs +++ b/crates/metal2vulkan-runtime/src/error.rs @@ -2016,19 +2016,23 @@ pub enum RuntimeGap { /// An object made before its device's recovery from the loss of its `VkDevice` that the /// recovery did not carry to the new one (the runtime made a new `VkDevice` behind the device, /// announced as `Degradation::DeviceRecovered`; `Device::recover_for_test` runs the same - /// recovery). The recovery carries the events, the `Private` buffers (their contents lost: - /// they read zero) and the buffers in the runtime's fresh pages (their contents and - /// `contents` pointer kept); every other object's Vulkan objects are the lost `VkDevice`'s, - /// which serves nothing more: a pooled `Shared` or `Managed` buffer, whose `contents` pointer - /// is its lost memory's mapping, a no-copy buffer, a heap and its resources, a texture, a - /// pipeline state, a library, a sampler state, an indirect command buffer, a buffer over the - /// caller's `VkBuffer` or exportable memory, and an event made exportable. A call that meets - /// such an object with the new generation (an encoder's bind, a pipeline's making from its - /// functions, a buffer or texture placed in its heap) or that needs its own lost `VkDevice` - /// (its placements, its imports again, its event signals) is refused, where Metal's object - /// goes on; the recovery's notice counts the buffers and events it left. The same object made - /// again on the device serves; a command buffer made before the recovery fails as its victim - /// (`GpuRecoveryVictim`). + /// recovery). The recovery carries the events, the uses of guest RAM, the no-copy buffers + /// (made again over the same pages), the `Private` buffers (their contents lost: they read + /// zero) and the buffers in the runtime's own pages (their contents and `contents` pointer + /// kept): a long host-visible buffer's fresh pages, and the blocks of pages the `Shared` and + /// `Managed` buffers lie in where the device's checks found a held host-page import costs its + /// submissions nothing and textures over such pages take what they take over its own memory. + /// Every other object's Vulkan objects are the lost `VkDevice`'s, which serves nothing more: + /// a pooled `Shared` or `Managed` buffer in memory the device allocated, whose `contents` + /// pointer is its lost memory's mapping, a detached no-copy buffer, a heap and its resources, + /// a texture, a pipeline state, a library, a sampler state, an indirect command buffer, a + /// buffer over the caller's `VkBuffer` or exportable memory, and an event made exportable. A + /// call that meets such an object with the new generation (an encoder's bind, a pipeline's + /// making from its functions, a buffer or texture placed in its heap) or that needs its own + /// lost `VkDevice` (its placements, its imports again, its event signals) is refused, where + /// Metal's object goes on; the recovery's notice counts the buffers and events it left. The + /// same object made again on the device serves; a command buffer made before the recovery + /// fails as its victim (`GpuRecoveryVictim`). MadeBeforeRecovery, /// `Device::recover_for_test` on a device the consumer made (`Device::from_raw`): the runtime /// cannot make a new `VkDevice` of the consumer's, so it recovers none, and the device is