Files
metal2vulkan/docs
Anees Iqbal c459695b88 rt: the consumer places a Managed buffer's device copy, in a Private block it holds, at any byte offset
new_managed_buffer(bytes, copy, length, copied) takes both placements from the consumer: the
bytes as (block, offset) in a block the host maps, and on a device that keeps a device copy
(has_unified_memory false) the copy as (block, offset) in a Private block the consumer holds, at
any byte offset; gpu_address is that block's address plus the offset. rt chooses no layout any
more: its copy blocks, COPY_ALIGN, the first fit and the device's copies place list are deleted,
and so is the Private block of the copy's own that the copy took where device-local memory had
no room. Placement, and so the slack past a buffer's length, is the consumer's: rt writes the
copy's length and no byte past it.

New typed refusals: ManagedCopyMissing (no copy where the device keeps one),
ManagedCopyOnUnified (a copy where it keeps none) and ManagedCopyNotPrivate (a copy in a block
that is not Private); a copy range past its block is BufferPastBlock, as for any buffer.
managed_spilled_bytes is now per buffer: a copy the consumer placed in a spilled Private block
counts its length while the buffer lives. new_buffer shares the range check (placed).

The harness places a Managed buffer's device copy as it places a Private buffer of its length
and frees both with the buffer. The player places the GPU copy through its places at their
current rule, as a Private buffer of the buffer's length: a buffer in a place of its own keeps
the copy's place beside its own and gives both back with the same users; a buffer in a stream's
block or heap holds the copy's place as its one place. REPLAY-STREAM.md says so.

Tests: the two-copy rule places its device copy 4 KiB into a Private block the consumer takes
and checks gpu_address there (and, under the spill test, in a consumer take that spills, counted
in managed_spilled_bytes); a new device test places the copy at byte 4099 of a Private block
filled with 0xA5 and checks the whole block after the copy's creation and after a copy-in of the
whole buffer: the copy's bytes at 4099..5099 alone, the consumer's slack write at 5100..5200 and
every other byte unchanged; and the four refusals. Every other Managed test places its copy at
the start of a Private block of its own (tests::managed::on_device::new_managed).

Regenerated docs/REFUSALS.md (scripts/refusal-surface); api_signatures.tsv by hand.
2026-11-18 06:16:37 -08:00
..