A recovery carries drawing and mesh pipeline states

What: a drawing state (a mesh one, and a twin of a color group, a single-sample or a factor-scaling
state among them) keeps a chain of programs per generation as a compute state does
(pipeline/carry.rs): its StateShared Deref reaches the program of the generation whose command
buffer's work the thread does, else the last; its ID, uniqueIdentifier, label and sampler numbers
stay. Each state is kept by its generation's carry registry (GraphicsState::kept at the end of a
render or mesh creation, with its color groups' twins); the recovery carries them after the compute
states (pipeline/render/carry.rs): its base variant, and its large-buffer form's, made again from
the pipelines its creation compiled or the live variants of them the new generation holds, no
translation; then, under the new generation's reach (NoticesFor::of_generation), its neutrals, its
predicted first draw's VkPipeline handed to the pool with nothing waiting for it
(make_at_creation(false)), and its depth stand-in copies. Its descriptors, keys, label and twins are
kept; its other variants, plans, settles and routings are made as its draws need them. A failed
making is counted and refused where bound (RemadeAfterRecoveryFailed) through
RenderPipelineState::bound_device, at set_render_pipeline_state (encoder, call checks, indirect
command buffer) and an argument encoder's render word; a tile state's bind now answers its kernel's
failed making the same way. A state is made again only where both generations compile alike
(compiles_alike, the profile fingerprint the memo carry checked already); else its making is refused
as failed. Docs: device/carry.rs, pipeline/carry.rs, MadeBeforeRecovery (render states no longer
listed refused) and RemadeAfterRecoveryFailed, the DeviceRecovered cost (degradation.rs and API.md,
equal), API.md's recovery entry, the runtime README; REFUSALS.md regenerated.

Why: drawing states made before a recovery were refused where bound after it; Metal's go on.

Verified: see the lane run reported with this sha (the test commit before it fails, this one
passes), with the recovery's wall time for 0, 200 compute and 200 drawing states.
This commit is contained in:
Anees Iqbal committed 2026-11-12 17:13:53 -08:00
1 parent 5ee7cb77c9
commit 6b79a77730
14 files changed
+362 -79

No files matched your search

+2 -2
View File
@@ -267,7 +267,7 @@ Columns:
| `ColorAttachmentGroups` | What a render pass the device draws in color groups does not build | every device (runtime piece not built) | `ours` | 1: `crates/metal2vulkan-runtime/src/render/color_groups.rs (gap)` | `app`: in a render pass of more color attachments than the device draws at once (five or more on a device of four), or one at an index past them: a pipeline state of other colors, a tile state, an execution of render commands, a draw reading another group's attachment |
| `MadeBeforeRecovery` | 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... | every device (runtime piece not built) | `ours` | 3: `crates/metal2vulkan-runtime/src/device/line.rs (foreign)`, `crates/metal2vulkan-runtime/src/device/line.rs (lost_refusal)` (+1) | `app`: any object a program made before its device recovered from a lost VkDevice that the recovery does not carry (a pooled Shared or Managed buffer in memory the device allocated, a texture, a pipeline state), used after the recovery |
| `AdoptedDeviceRecovery` | `Device::recover_for_test` on a device the consumer made (`Device::from_raw`) | every device (runtime piece not built) | `ours` | 1: `crates/metal2vulkan-runtime/src/device/line.rs (recover_for_test)` | `none`: the recovery test hook on a device the consumer made itself |
| `RemadeAfterRecoveryFailed` | A bind of a pipeline state made before its device's recovery whose making on the new `VkDevice` failed there (its shader modules, layouts or... | every device (runtime piece not built) | `ours` | 1: `crates/metal2vulkan-runtime/src/pipeline/carry.rs (bound_device)` | `app`: a pipeline state made before its device recovered from a lost VkDevice whose making again on the new one failed, bound after the recovery |
| `RemadeAfterRecoveryFailed` | A bind of a pipeline state made before its device's recovery whose making on the new `VkDevice` failed there (its shader modules, layouts or... | every device (runtime piece not built) | `ours` | 3: `crates/metal2vulkan-runtime/src/pipeline/carry.rs (bound_device)`, `crates/metal2vulkan-runtime/src/pipeline/carry.rs (compiled_otherwise)` (+1) | `app`: a pipeline state made before its device recovered from a lost VkDevice whose making again on the new one failed, bound after the recovery |
## 3. Apple-only calls (`Error::AppleOnly`)
@@ -786,7 +786,7 @@ Each refusal's sites, with the function that builds it.
- `gap::ColorAttachmentGroups`: `crates/metal2vulkan-runtime/src/render/color_groups.rs (gap)`
- `gap::MadeBeforeRecovery`: `crates/metal2vulkan-runtime/src/device/line.rs (foreign)`; `crates/metal2vulkan-runtime/src/device/line.rs (lost_refusal)`; `crates/metal2vulkan-runtime/src/event.rs (carry)`
- `gap::AdoptedDeviceRecovery`: `crates/metal2vulkan-runtime/src/device/line.rs (recover_for_test)`
- `gap::RemadeAfterRecoveryFailed`: `crates/metal2vulkan-runtime/src/pipeline/carry.rs (bound_device)`
- `gap::RemadeAfterRecoveryFailed`: `crates/metal2vulkan-runtime/src/pipeline/carry.rs (bound_device)`; `crates/metal2vulkan-runtime/src/pipeline/carry.rs (compiled_otherwise)`; `crates/metal2vulkan-runtime/src/pipeline/render/carry.rs (bound_device)`
- `apple::ProtectedContent`: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (commit_now)`; `crates/metal2vulkan-runtime/src/command_buffer/protection.rs (refuse_protected_state_encoder)`; `crates/metal2vulkan-runtime/src/command_buffer/protection.rs (set)`
- `apple::ViewportTransformDisabled`: `crates/metal2vulkan-runtime/src/apple_only.rs (check)`
- `apple::VertexAmplificationMode`: `crates/metal2vulkan-runtime/src/apple_only.rs (check)`; `crates/metal2vulkan-runtime/src/apple_only.rs (set_vertex_amplification_mode)`