📝 Record that a wrapper must forward a HostVm default [ci skip]

Group dma-bufs were implemented on LinuxVm and FakeVm, and every test passed,
while remap::VulkanVm, the VM the devices are given, answered the trait's
default: a Geekbench walk on the 780M grouped no view. view_mappings had the
same gap. Record the trap, the lint that now keeps it shut and its sign, a
feature's counter at 0 on the hardware it is for.
This commit is contained in:
Anees Iqbal committed 2026-11-14 08:07:42 -08:00
1 parent 86b349fe70
commit cee5813f21
1 file changed
+1
+1
View File
@@ -55,6 +55,7 @@ one. A new trap found the same way goes here.
- A copy kept in its source's layout keeps every constraint the layout fails. On a GPU of its own memory the host kept each IOSurface in a device cache laid out as its pages, and the guest's rows stayed at IOSurface's 64-byte alignment, as the device info answered the GPU's linear alignment only where the GPU shares the CPU's memory: the caches were thought to have no pitch to meet. Every texture over a cache whose rows missed the GPU's linear pitch was then the runtime's shadow of the cache, in VRAM, copied in at each command buffer, which no count of the caches' own copies showed: 2092 of them in one desktop walk on an RX 7900 XTX (job m3-max-20009, macOS 26.7.2), and 165 once IOSurface laid its rows and planes out at the GPU's alignment (m3-max-20241): 140 of those the planes of CoreVideo's video buffers and 6 an app's 6016-pixel texture, both of which place their rows themselves. How to spot the next one: where a copy keeps the guest's layout, count the runtime's shadows over the copy (`METAL2VULKAN_LOG_SHADOWS=1`), not only the copy's traffic.
- An object the host makes once and keeps does not outlive a recovery of the device. The display's draws kept their converter, colour functions and pipelines, buffers, table and ramps from their first make, and the Vulkan platform kept its no-draw and predication-step pipelines; when the runtime recovered a lost `VkDevice` (the 780M's rate-map hang, perf-scout's 22883 and 22936), every one of them was refused on the new device (`MadeBeforeRecovery`) or read zero, and the window kept its last frame. The platform now counts the recoveries the runtime announces (`GpuDevice::recoveries`), and each keeper makes its objects again once the count changes. The runtime also refuses a new buffer in an address pool reserved before the recovery, so the draws' small buffers stay nil on the pinned runtime; metal2vulkan 8bead88369 (`RUNTIME_VERSION` 2159) places them, and the sink's recovery test runs again with the pin that carries it. How to spot the next one: a `OnceLock`, a static list or any field that holds a platform object past the call that made it; ask what it holds after `recover_for_test`.
- A check's verdict answers only for what the check tries, and the making refuses more. The host answered a guest surface's cache ask (`RGFX_SURFACE_PAGES_ASK_CACHE`) from the runtime's in-place check alone: whether the device's images take reads, renders and writes over pages whose rows lie in its lines as the plane's do. The runtime's making of a texture also refuses a pitch that no linear image of the GPU's lays rows at, a place in the import and a reach past it, and those refusals are shadows, copied in at each use. On a Radeon 780M, a macOS 26.7.2 guest's walk (pin 64) had 2125 of its 2126 asks answered in place, and 428 textures over those surfaces were shadows refused for their pitch (rows of 3904, 3552, 1920 and 1984 bytes). The ask now takes the runtime's placement of each plane's textures, as their making decides (`gpu/pages_in_place.rs`), and the walk's pitch shadows over surfaces went to 0, with 78 surfaces in device caches. How to spot the next one: a decision taken from a check of part of what decides, while the work count of the whole moves (`host_texture_shadows_refused_*` over the textures it was meant to keep in place).
- A trait method with a default answer is off wherever a wrapper forgets to forward it, and no test of the wrapped type sees that. Group dma-bufs (`HostVm::view_groups` and `HostVm::group_views`, defaulting to none) were implemented on `LinuxVm` and on the testkit's `FakeVm`, and every decoder test and the dma-buf tests passed; but the devices are given the platform's VM, `remap::VulkanVm`, which wraps `LinuxVm` and forwarded neither, so a Geekbench walk on the Radeon 780M (2026-11-14) grouped no view (its views log line: 0 imported as pieces, in 0 groups). A look at every default then found `HostVm::view_mappings` unforwarded since it was added: making room for a view read each cached view as holding no mapping, and let go of none. `VulkanVm`'s impl now denies `clippy::missing_trait_methods`, so a method `HostVm` answers by default that it does not name fails clippy, and `the_vm_answers_the_oss_questions_of_a_view` asks it and the OS's VM the same questions. How to spot the next one: a wrapper of a trait with default methods that has no such lint, or a counter a feature's log line prints that stays at 0 on the hardware the feature is for.
## QEMU, the window and VM boots