BlitCommandEncoder::synchronize_resource is synchronizeResource:. Of a Managed
buffer with a device copy (Shared memory not device-local) it records one
vkCmdCopyBuffer of the copy into the consumer's bytes between the two barriers a
fill records, and marks the segment so its end barrier reaches the host: the
host reads the GPU's writes before the call once the command buffer completes or
it sees an event signaled after it. A buffer without a device copy is read by
the host where shaders write it, and a texture has no bytes the host reads
apart from its image (no texture has named bytes on development yet): for
those the call records nothing. Every call is counted in the new
Metrics::synchronizations and is no submission of its own.
Metal's validation stops a synchronize of a Shared or Private buffer or
texture (probe blit_synchronize_rules.m, job m3-max-43632: "synchronizeResource:
only applies when ... == MTLResourceStorageModeManaged"); rt keeps no storage
mode for those and records nothing, as the old runtime does. The probe's
Managed buffer, filled 4..12 with 0xab and synchronized, hashes
5d28bc84b408472d, the bytes the test asserts.
The barrier after a blit's write into a buffer is one helper now (fill, buffer
copy, synchronize); a buffer copy's source stage widens from COPY to
ALL_TRANSFER.
Tests (device cfgs): every_device_synchronizes_a_managed_buffer (a fill alone
leaves the host's bytes where the buffer has a device copy; fill + synchronize
gives Metal's bytes at 1 submission, 5 barriers with a device copy and 3
without, 0 bytes copied, 1 synchronization, 1 host reach; a texture's
synchronize records no barrier) and
every_device_reaches_the_host_only_after_a_blit_writes_shared_memory (the
wrote_host invariant for blit encoders: fills and copies into Private memory
or a texture reach no host, into a Shared buffer they do). README,
REFUSALS.md and the signatures table updated; the README drops the line that
said synchronizeResource comes with blit encoders, and names
synchronizeTexture:slice:level: as not built (no recorded stream calls it).