Placement refused a resource once device-local memory was full: memory.rs
gives the Private class only DEVICE_LOCAL types, every texture's image is
Private, and a Managed buffer's own bytes on a device without unified memory
are Private, so place() returned OutOfMemory(Device). On the RTX 5080, 96 of
5090 1-MiB Managed GPU copies were refused at about 5 GB held, where Metal
on a 4 GiB Radeon Pro 5300M made, used and read back 12 GiB of Managed
buffers, six 1 GiB Private buffers and a 17 GB Private heap.
- memory.rs: overflow_candidates, the types a Private or Memoryless
resource overflows into where none of its own has room (allowed,
allocatable, neither device-local nor lazily allocated; those the host
does not map first). place() tries them after the class's own types;
such a placement is marked (Placement::overflowed) and counted
(Memory::overflows, WorkCounts::device_memory_overflows). Metal's own
refusals (max_buffer_length, texture limits) stay where they are.
- Driver paging first: VK_EXT_pageable_device_local_memory with
VK_EXT_memory_priority, enabled where the device lists both and has
pageableDeviceLocalMemory (enables.rs, create.rs); the spec lets such a
driver page memory out rather than fail an allocation. Every allocation
keeps the default priority.
- Degradation::DeviceMemoryOverflow (performance), announced once for a
program's buffer or heap (degrade_system_memory, which now names the
storage mode) and texture (Texture::overflowed) that overflowed.
- Tests: tests::memory::device_local_classes_overflow_into_system_memory,
tests::device::pageable_device_local_memory_is_enabled_where_the_device_has_it,
and the device test tests::device_memory_overflow (a GPU hazard, under
m2v_gpu_hazards on a GPU, in the shape of 7b57d9a87a; check-cfg added),
which fills device-local memory where it can overflow and makes, uses
and reads back Private buffers, a Private heap with a buffer and a
texture, Private textures and Managed buffers past it. The lane names
the kind's site as the runtime's test (degrade_notices OVERFLOWED).
- Docs: API.md (runtime-own extensions, catalogue entry), runtime README
memory model.
Verified: nothing yet (cargo fmt only); builds and runs follow as potluck
jobs.
(cherry picked from commit 586f2d0b5c6708016d9a255c0934f9727569125c)