Files
metal2vulkan/docs
Anees Iqbal 158f7220ff Pages the process maps read-only are a copy whose GPU writes are dropped, on every device
On Linux, a no-copy buffer, heap or rebind over pages the process maps read-only went to the
caller's dma-buf source wherever it gave one, and so did pages an import alignment above the
host page left with no pointer import (by_pointer false), which skip the gate. A dma-buf of the
pages takes the GPU's writes, which Metal drops (an M3 Max under macOS 27.0.1: the CPU reads
read-only pages as they were). The runtime announced that as read-only-pages-written. Without a
source the pages were refused, where Metal makes the buffer. The owner's rule (10-23) is to drop
such writes on every device, never refuse them.

Such pages are now a copy whose GPU writes are dropped (copied.rs), with or without a source,
which is never called for them. The gate is still asked first where the pointer would be
imported, and its refusal is still counted as a refusal. Counted:
WorkCounts::copied_unwritable_pages (new, public), announced as copied-host-pages with its own
cause. Degradation::ReadOnlyPagesWritten is removed (public: api_signatures, docs/API.md's
catalogue, the lane's notice registry), and so are HostWindow::unwritable and
degrade_read_only_pages.

Tests: the dma_buf_imports lane test is now read_only_pages_are_a_copy_whose_gpu_writes_are_
dropped. It fails at the base, where the sourced buffer's fill reaches the file's pages and the
unsourced one is refused. The host_memory lane test a_read_only_page_is_a_copy_on_linux_and_
read_elsewhere replaces the refusal test. The runtime's copied_device tests cover a new buffer
and a rebind over read-only pages whose gate admits them: a copy, the source unasked. The
keep-alive order test uses writable memfd pages, which RADV imports as dma-bufs all the same.

(cherry picked from commit 68805d8a5742590e157b089f336c17e8e1dc4ef4)
2026-11-07 13:13:19 -08:00
..