A block was plain data (BlockInfo) owned by the device's claims map until release_block(id) or
the device's teardown, so a block whose number the consumer lost was held until the device died:
memory unreachable but held, a leak by construction, which the "zero at device drop" gauges do
not see (the player's play ran out of memory at frame 1074). The planner ruled the handle as
proposed:
- take_block returns Block, rt's own handle with no Metal counterpart, which derefs to the
block's BlockInfo. Clones share one claim (Claim); the drop of the last handle runs what
release_block ran: the device forgets the block's number and the work's pending upload counts
it, and the block is zeroed and kept or freed once no buffer, command buffer or upload uses it.
- The device keeps claims by number as weak references, now in the core (Core::claims), so every
call that takes a block number still does (new_buffer, new_managed_buffer, heap ranges); a
number whose handles are all gone answers Error::NoSuchBlock.
- release_block(block: Block) consumes a handle: the drop made explicit; another device's block
is Refusal::OtherDevice.
- The device's teardown frees every block still claimed after halt, that is after the consumer's
BlockMappings::unmap returned for each handed block (contract 6A's order: the claims' slots are
emptied only then); a handle dropped after the teardown finds its slot empty and does nothing.
The harness keeps each pooled block's handle and gives a dedicated block's to its buffer; the
replay backend keeps a stream block's handle in its object and a dedicated place's in the place.
rt's tests hold their handles where they used to hold numbers.
Tests (device cfg, command.rs): a dedicated block whose last handle drops with no release_block
while a held command buffer uses it answers NoSuchBlock for its number at once, stays live
(Gauges::blocks one up) until the command buffer completes, and is then freed (back to where it
was); of two clones, dropping one gives nothing back and the number still names the block,
releasing the other frees it; a handle that outlives its device finds every gauge zero after the
teardown, and its drop does nothing. README, the BlockInfo, NoSuchBlock and OtherDevice docs,
docs/REFUSALS.md and api_signatures.tsv follow.