From 4ff7bb727c5316636a318beecc246b587749c6bb Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 12 Nov 2026 15:00:00 -0800 Subject: [PATCH] RUNTIME_VERSION 2154: a recovery carries Private heaps with the buffers placed in them The two commits before this one. After a device recovery a heap made before it stayed with the lost generation, so its newBufferWithLength:options:offset:, newBuffer and newTexture were refused (MadeBeforeRecovery) where Metal makes them (a guest's heap sub-allocations after an amdgpu soft recovery on an RX 550). Each live heap is now carried (Heap::carry): a Private heap's own buffer is made again in new memory placed so its textures can lie there too, zeroed, keeping its ObjectId, address, range, range token and label; each live buffer placed in it gets a link on the new generation at the same offset, keeping its identity, its old link letting go of the lost generation at rest; the heap's textures made before stay refused and are forgotten by the heap; the carried heap is in the new generation's registry, so a later recovery carries it again. Shared, no-copy and sparse heaps stay as they were. The recovery notice counts carried Private heaps (bytes, buffers) and left heaps by kind, and splits "buffers over the caller's or exportable memory" into buffers over the caller's VkBuffer and buffers in exportable memory. Docs: carry.rs, degradation.rs and API.md's device-recovered cost, MadeBeforeRecovery, the runtime README. Verified (on the branch): lavapipe, m2v_cpu_icd (m3-max-22922): device_recovery_heap::a_recovery_carries_private_heaps_with_their_buffers fails at the test commit (no heaps in the notice) and passes with the fix, with all 16 device_recovery* tests: a Private placement heap and a Private automatic heap, one buffer placed in each, identities kept, bytes zero; new_buffer_at_offset, new_buffer and new_texture after the recovery work; the texture made before is refused; use_heap commits; used_size drops by exactly one buffer on release; the lost VkDevice goes once the old texture is dropped. clippy plain, m2v_gpu, m2v_cpu_icd (22923-22925). No real GPU recovery was run (recover_for_test). --- crates/metal2vulkan/src/cache/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/metal2vulkan/src/cache/mod.rs b/crates/metal2vulkan/src/cache/mod.rs index 67e5f4a27..284597b43 100644 --- a/crates/metal2vulkan/src/cache/mod.rs +++ b/crates/metal2vulkan/src/cache/mod.rs @@ -93,7 +93,7 @@ pub const ARTIFACT_FORMAT_VERSION: u32 = 509; /// changes no behaviour, and then updates that hash alone with the commit saying why, or changes /// behaviour and also bumps this version. The commit that bumps it says what changed; this comment /// keeps no history. -pub const RUNTIME_VERSION: u32 = 2153; +pub const RUNTIME_VERSION: u32 = 2154; /// The digest of the sources this build of the crate was compiled from: SHA-256, as lowercase hex, /// of the manifest, the build script, and exactly the files the crate roots' module tree compiles