Heap::textures_from upgraded every texture of the heap's list under its lock, then let go,
with the lock free, of each one that no program handle held (Texture::for_heap_use, RV 2128).
If the command buffer that held such a texture completed in between, that let-go was the
texture's last handle, and the texture's release ran inside the heap use: on the encoding
thread, or on the scheduler's steps thread in a host step's sync_heaps, outside any passing
hold (resource_ids.rs).
The heap's list now holds each texture's Retain weakly. Retain(Weak<TextureShared>) is made
with the texture (Arc::new_cyclic). textures_from upgrades the retains, which only the
program's handles hold, and reaches each texture through its retain (Texture::heap_use). A
texture no program handle holds is never taken. A retain that outlives its texture's last
program handle drops holding the texture weakly, so it never releases the texture.
Behaviour is otherwise unchanged: the same textures are made resident. Checked by the existing
heap-use tests (tests::heap_use_released, the residency and heap suites) on lavapipe. No
deterministic test exists for the race itself: it is a let-go between two threads that the
structure now rules out.