From 3b986605e35356df65d3cabcd26e43f6d3a4232f Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Wed, 11 Nov 2026 22:18:56 -0800 Subject: [PATCH] The host-deallocator-delayed kind announces the wait for a buffer bound inside the import RUNTIME_VERSION 2083 made a buffer bound inside its pages' import hold the import, so a no-copy buffer's deallocator given no keep-alive waits for that buffer to go, and docs/API.md's catalogue entry said so in its cost. The kind's announced cost (Degradation::HostDeallocatorDelayed's) did not, and tests::degradation_catalogue::a_runtime_kind_s_entry_states_the_cost_it_announces failed on every device that runs it (pin 44: Iris, m3-max-19132, and the 780M). The announced cost now carries the same clause, worded 'every buffer bound inside their import goes' in both, and the kind's own docs list the case beside the others it waits for. Verified: the degradation_catalogue tests on lavapipe (see the landing report). --- crates/metal2vulkan-runtime/src/degradation.rs | 10 ++++++++-- docs/API.md | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/metal2vulkan-runtime/src/degradation.rs b/crates/metal2vulkan-runtime/src/degradation.rs index 0ef799ea0..f7dd704e3 100644 --- a/crates/metal2vulkan-runtime/src/degradation.rs +++ b/crates/metal2vulkan-runtime/src/degradation.rs @@ -2070,6 +2070,11 @@ degradations! { /// them is held: a command buffer submitted before a texture over them was released may /// still read that texture through its resource ID, and its image holds the import until /// the command buffer completes (`heap_sets.rs`); + /// - with no keep-alive, while a buffer made over part of its bytes, or over the same + /// bytes as memory of another class, while it lived is bound inside its import and holds + /// it (one live import of a page, as `VK_EXT_external_memory_host` leaves a page imported + /// twice into one device undefined: `buffer.rs`'s `Inside`; + /// `WorkCounts::host_releases_held_inside`), until that buffer goes; /// - with no keep-alive, while a live buffers' table that lists them is held: a command /// buffer whose commands may reach the buffer unnamed holds its first submission's table /// and its host steps' until it completes, and one a rebind encoded again, or a host @@ -2091,8 +2096,9 @@ degradations! { HostDeallocatorDelayed = "host-deallocator-delayed", Precision, "the deallocator runs once every command buffer that may still reach the pages \ (through a texture over them, or a table of the live buffers it holds) lets go of \ - them, or the batches submitted before the import's memory went complete, where \ - Metal's runs at the release; the pages stay mapped until then"; + them, every buffer bound inside their import goes, or the batches submitted before \ + the import's memory went complete, where Metal's runs at the release; the pages stay \ + mapped until then"; /// A no-copy buffer, a no-copy heap or a buffer's rebind was made over a copy of the /// caller's host pages in memory of the device's own, which no import maps (`copied.rs`; /// a heap's textures shadows of its bytes): the caller's gate diff --git a/docs/API.md b/docs/API.md index 4ce0c7081..c7073fb0f 100644 --- a/docs/API.md +++ b/docs/API.md @@ -3353,7 +3353,7 @@ bound. deallocator runs at the release, as Metal's, and the import keeps the keep-alive, which keeps the pages mapped, until it is freed: not announced (section 10). Cost: the deallocator runs once every command buffer that may still reach the pages (through a texture over them, or a table of the live - buffers it holds) lets go of them, every buffer bound inside their import went, or the batches + buffers it holds) lets go of them, every buffer bound inside their import goes, or the batches submitted before the import's memory went complete, where Metal's runs at the release; the pages stay mapped until then. - `metal2vulkan-degrade-copied-host-pages` (precision). `CopiedHostPages`: A no-copy buffer, a