On a discrete GPU a sampled, read-only, tracked texture over logged no-copy memory is a device
copy refreshed by the logged row bands, instead of an image read across the bus in place.
One work packet, landed as 3 commit(s) (7812de9edd..919557e82f on archive/development-linear-2026-10-28-evening), in order:
* Make sampled textures over logged host pages device copies on a discrete GPU
What: on a DeviceKind::Discrete device, a texture over host pages whose
policy and usage take the image in place (HostPageTexturePolicy::InPlace,
a usage that only samples or reads), tracked, over a no-copy buffer
whose memory carries a DirtyPages log (HostPages::dirty), one slice laid
out as one copy region straight from the buffer's VkBuffer (no staging,
no rows sharing bytes), is now a shadow instead of the image in place,
announced nowhere and counted as WorkCounts::device_copy_textures. Its
copies in are the shadow path's gated ones (dirty_pages.rs): each
command buffer's first copy in takes only the row bands the log reports
changed since the hold, nothing where none changed, every row where no
hold stands, the wait says false, or a GPU write of the bytes let go of
the hold. The in-place check's verdict is not asked: the copy binds no
image to the pages. Integrated GPUs, CPU devices and memory without a log
are placed as before.
This is ws/vramcopy's device copy (9c04997aa9..6f6d709ae9) resolved onto
ws/dirtypages' design: its own refresh (a per-batch entry preamble with
its own stamps, an encoder-entry hook and a carry write list), its
DirtyLog wrapper, its buffer-key log registry and GPU-write reports, its
replace_region report and its refresh counters are all dropped for the
shadow path's DirtyHook/DirtySource, per-shadow ShadowLog hold and
stamp, gated replay-time regions, note_dirty write tracking and
dirty_copies_in_* counters, which do the same job. What stays is the
placement, its fit check (Texels::device_copy) and its counter.
Tests: runtime_lane::device_copies (m2v_gpu), on the tally of the shadow
path: a 1920x1080 surface over logged pages follows six frames of CPU
writes, its gated copies in whole at the first frame and where the wait
could not say, skipped with no write, cut otherwise; a blit fill of the
buffer lets go of the hold and the next read finds the fill; without a
log no device copy; a cost report (DEVICE-COPY-COST) of in place against
the device copy for a 3840x2160 surface read whole each frame.
Docs: runtime README (textures over buffers) and docs/API.md (textures
over host pages). api_signatures.tsv: one field row
(signatures.py --check passes).
Verified (macOS): cargo fmt; cargo clippy -p metal2vulkan-runtime
--all-targets --all-features -D warnings; the same with -p
metal2vulkan-validation under --cfg m2v_gpu. Device runs follow.
* Run the device-copy lane under the product's in-place policy
What: runtime_lane::device_copies' devices take
HostPageTexturePolicy::InPlace (in_place_textures' in_place, now shared),
the product's default: the lane's devices otherwise take the exact
answers, under which no texture is a device copy, so on the RX 7900 XTX
the first test found none ("device copy false") and the cost test
compared two shadows rather than in place against the device copy.
Verified: cargo fmt; cargo clippy -p metal2vulkan-validation
--all-targets --all-features -D warnings under --cfg m2v_gpu; on the M3
Max (MoltenVK, integrated) the three device-copy tests pass, no device
copy made there. On gem10 at 134ac6eb18 (before this fix):
tests::dirty_pages_device 2/2 passed on the RX 7900 XTX; the lane's
content checks passed and its layer checks failed on a loader message
about gem10's NVIDIA ICD (libGLX_nvidia.so.0), not the runtime's.
READY 134ac6eb18 (product code; this commit changes tests alone)
* Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.