An object's device stays a generation handle across a recovery

What: a fence, a depth/stencil state, a library and its functions and an address pool hold
their device as a LineDevice (device/carry.rs): a root handle, which their own checks match by
the line as before, and a chain of generation handles, kept by the generation's carry registry.
device() answers the generation handle of the generation the object was made on, else of the one
a recovery carried it to last, as a carried buffer's or texture's device does. The recovery
links the next generation's handle after the lost one and lets the lost one go at the lost
generation's rest (MadeOn, a LostParts entry), so the object still holds nothing of the lost
generation once it rests; a handle a caller took keeps meaning its generation and keeps it
alive while held. A library's functions share the library's chain. The internal checks
(encoders' fence and depth/stencil checks, sparse fences, dynamic libraries, function handles,
pipeline additions, compute creation from a function, a pool slot's placement) use the new
root_device() accessors. Docs: the four modules, carry.rs, MadeBeforeRecovery, the runtime
README. REFUSALS.md regenerated: unchanged.

Why: RV 2155-2159 made those device() accessors answer a root handle, an API break: a root's
raw() answers whichever VkDevice serves and lets go of the one it answered before, so a consumer
that takes `new_fence().device()` as the serving generation's handle destroyed objects made on
the lost VkDevice through the new one's handles (SIGSEGV in vkDestroyCommandPool on ANV).

Verified: see the lane run reported with this sha (the test commit before it fails, this one
passes).
This commit is contained in:
Anees Iqbal committed 2026-11-12 16:17:14 -08:00
1 parent e5e0747961
commit 4ae4f9b5d4
15 files changed
+238 -66

No files matched your search

@@ -195,8 +195,10 @@ impl Maker {
/// link in `functions` or `binary_functions`. A function of another device is refused
/// (`Invalid(ForeignObject)`).
fn function_handle(self, function: &Function) -> Result<Option<FunctionHandle>, Error> {
if !function.device().same(self.device()) {
return Err(function.device().foreign("function_handle", self.device()));
if !function.root_device().same(self.device()) {
return Err(function
.root_device()
.foreign("function_handle", self.device()));
}
let handle = self
.linked_functions()