What: a shadow's merge in place into a no-copy buffer's host pages, on a device whose
check of those pages failed, or has not answered, the copies or the shader writes of
texels whose rows end inside a line (the same rule as the copy back's splice), now goes
on the host. Its keep and the copy of the texels the commands left go into two parts of
a Shared scratch (ScratchKind::ShadowHost; the fetch view is not used, so the changed
texels are always copied). The encoder records only that copy, and a host step of a
batch of its own (Deferred::ShadowSplice, now carrying HostWrite::Splice or ::Merge)
compares the parts eight bytes at a time and stores each byte that differs into the
pages with atomic byte stores. Such a texture joins no run of passes (render.rs), so
each pass merges as its encoder ends. Devices where both checks passed keep the
kernel merge.
Why: the Iris probe (m3-max-35510) showed the merge kernel's stores losing CPU writes
to padding bytes in the line that holds each row's last texels, as the copy back did.
A CPU store changes only the bytes it stores, so the bytes the commands left, and
every byte the CPU writes meanwhile, stay. Metal keeps those bytes
(conformance probe row_padding_writes.m).
Where the merge stays on the GPU (FAST-PATHS known gaps): merges recorded between a
pass's instances, before a tile dispatch, into a held command buffer, at a segment's
end, merges through a copy, and the runtime's own Shared memory.
New WorkCounts fields: shadow_merges_on_host, shadow_merge_host_nanos.
Tests: shadow_write_lines now asserts the Draw rounds (keep + merge) put back no byte
and go on the host under unanswered verdicts, and follow the measured verdicts in the
second test. A new test, costs_of_a_write_back_spliced_or_not, prints the median
command-buffer time of a copy back and a merge for 34x34 and 1920x1080 RGBA16Float,
with verdicts unanswered and passed.
Degradation kinds added: none.
Verified (fplend): msi m3-max-35675 at bdb1e2cbae clippy (runtime, all targets/features, -D warnings) 0,
touched unit tests 3/3, api_signatures + fast_paths 34/34; msi 35689 clippy --cfg m2v_gpu 0.
PHOENIX suites (35711), lavapipe, rustdoc and the Iris cost run follow.