A recovery carries textures, their views and those over carried buffers

What: a device's recovery now carries the program's textures made by a call it can make
again (texture/carry.rs). That covers a texture of `Device::new_texture`, a texture over a
buffer the recovery carried (`Buffer::new_texture` and its kin), and a view of either.

- The call is made again on the new generation as the runtime's own texture, which takes no
  ID. That texture holds the program texture's parts there: `TextureShared::next`, with a
  `carried` flag.
- `Texture::s` picks the parts the work at hand reaches. Inside a command buffer's work it
  answers that generation's parts (`NoticesFor::generation`); elsewhere, those of the
  generation the texture was carried to last. The buffer carry picks its parts the same way.
- Every read of a per-generation field goes through it: `storage()` (the hub), facts, faces,
  usage shadows, storage forms, render shadows, snapshots, memoryless backings and planes in
  place.
- The texture object keeps its `ObjectId`, resource ID, label, parent and handles, and its
  purgeable state is copied across. Its ID's slot in the new generation's texture table and
  heap sets names its parts there (`heap_sets::place`), and leaving the slot walks every
  generation's parts.
- Each program texture is kept by its generation's carry registry as it is made
  (`Carry::texture`). The call that made it sets how to make it again (`Remake`) and carries
  it itself where the take came first (`Device::kept_texture`, `Carry::late_texture`).
- The carry runs inside a `NoticesFor::of_generation` scope for the new generation, so the
  buffer it remakes a texture over and a view's parent answer their parts there.
- Left refused, and counted by kind in the notice: a heap's texture or one over a heap's
  buffer, a texture over the caller's `VkImage`, a sparse or shareable texture, a texture over
  a buffer left, and their views.
- The notice adds ", and N textures whose contents were lost too (they read as new ones), M
  textures over the buffers carried and V texture views".

Known gap, documented in API.md, the README and device/carry.rs: a carried texture's images
on the lost generation, and so the lost `VkDevice`, stay until the texture goes. Letting them
go at the lost generation's rest needs a hold of the parts by each call outside command
buffers' work, as `Buffer::held_parts` does for buffers.

Why: render targets and display textures made before a recovery were refused
(`MadeBeforeRecovery`) where they met the new `VkDevice`, while Metal's go on.

Tests: device_recovery_carry's main test now leaves a `Shared` heap instead of a texture as the
object that keeps the lost `VkDevice`. Its held-parts test now expects the texture made by a
call that completed on the lost generation to be carried by its maker. Docs updated:
`MadeBeforeRecovery`, the device-recovered cost (degradation.rs and docs/API.md, kept equal),
the runtime README and the heap docs. docs/REFUSALS.md regenerated (`view` became `view_as`).

Verified: the lane run of the test commit before and this one after is reported with its sha.
This commit is contained in:
Anees Iqbal committed 2026-11-12 16:27:35 -08:00
1 parent 0fdfa9414e
commit b564fb7a91
19 files changed
+635 -146

No files matched your search

+15 -8
View File
@@ -3648,20 +3648,27 @@ bound.
functions, address pools, uses of guest RAM, no-copy buffers, `Private` buffers, buffers in the
runtime's own pages (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) and `Private` heaps with the
buffers placed in them made before it go on, a `Private` buffer's or heap's contents lost (it reads zero); the
other objects made before it are refused (`MadeBeforeRecovery`), where Metal's go on; the calls
during it wait for it, and a
device call the loss met while it ran runs again after it. A no-copy buffer is made again over
textures over such pages take what they take over its own memory), `Private` heaps with the
buffers placed in them, textures of `new_texture`, textures over the buffers carried and views of
them made before it go on, the contents of a `Private` buffer or heap lost (it reads zero) and of
a texture of `new_texture` (it reads as a new one); the other objects made before it are refused
(`MadeBeforeRecovery`), where Metal's go on; the calls during it wait for it, and a device call
the loss met while it ran runs again after it. A no-copy buffer is made again over
the same pages on the new `VkDevice`, as its making or last rebind made it, so the caller's
import gate, resolver of guest RAM runs and dma-buf source are asked again, on the thread that
recovers, before the new device serves; its deallocator runs at its release once no `VkDevice`'s
import of its pages is left. A detached no-copy buffer, and a no-copy heap's buffers, are
refused. A `Private` heap is the same heap on the new `VkDevice` (its identity, address and
label), its bytes new memory that reads zero, with the buffers placed in it; buffers and
textures are made in it again, and the textures it made before are refused, as every texture
made before the recovery is. A `Shared` heap, whose bytes are pooled host-visible memory the
device allocated, is refused with its buffers, as a pooled buffer is.
textures are made in it again, and the textures it made before are refused, as a heap's
textures are. A texture of `new_texture`, one over a buffer the recovery carried and a view of
either are the same texture object on the new `VkDevice` (its identity, resource ID, label and
purgeable state): the first made again in new memory, which reads as a new texture of its
descriptor, one over a buffer made again over the buffer's bytes there, a view of its parent's
image there. Their images on the lost `VkDevice` stay with them, and keep it, until they go. A
heap's texture, one over the caller's `VkImage`, a sparse or shareable texture and one over a
buffer left are refused, with their views. A `Shared` heap, whose bytes are pooled host-visible
memory the device allocated, is refused with its buffers, as a pooled buffer is.
- `metal2vulkan-degrade-private-properties-unknown` (precision). `PrivatePropertiesUnknown`: Apple's
private device properties the device has no answer for: no document describes them and nothing the
device reports maps to them. Cost: the device gives no answer for them (`PrivateAnswer::value` is