What: where device-local memory has no room for a copy block, a Managed buffer's device copy is
now a Private block of its own, taken through the pool, so it spills to whatever memory type has
room like any Private block; where no type has room, new_managed_buffer returns the allocation's
out-of-device-memory error (Metal: nil). Before, such a buffer was its Shared range, one copy,
on a device whose has_unified_memory is false. Gauges::managed_spilled_bytes counts the bytes of
Managed buffers whose device copy is not device-local, while they live; the replay player
reports it beside spilled_bytes. The rt README states the cost: on a full discrete card a
Managed kernel reads its copy across the host link.
Why: the planner's ruling. Metal keeps a Managed buffer's two copies on a discrete Mac: a
kernel's write stays in the GPU's copy until a synchronize, and didModifyRange sends the CPU's
bytes over it. With one copy, a kernel's write reached the consumer's bytes, and a range named
with no CPU write left the kernel's value in place: a program could observe the difference.
Tests: tests::managed::every_device_keeps_metal_s_two_copy_rule_for_a_managed_buffer (every
device): a kernel takes each word x to 2x+1, the range is named with no host write, a second
kernel reads it. Where has_unified_memory is false the consumer's bytes keep the host's words
and the reader reads them, and the buffer's address is not its Shared range's; on a unified
device the reader reads the kernel's write. tests::spill: the same rule with the Private type's
allocations made to fail (the test seam core.fail_private) and the pool's Private blocks
spilled; on a device that is not unified the gauge counts the buffer's 256 bytes while it lives
and reads 0 after. The api signature table gains the gauge field.