A cached IOSurface's device cache was filled at the read-write lock that
moves the surface's generation, not at its unlock. A command buffer committed
while a CPU held the lock filled the cache with the pages mid-write, and the
CPU's writes after it reached the GPU only at the surface's next lock.
What the guest observes changes: the first command buffer committed after the
unlock that uses the surface now reads the CPU's writes made under the lock.
The bundle tracks a cached surface's unlock seed from a commit that found it
locked for writing, as copy mode does, and that buffer's SURFACE_USE carries
the new RGFX_SURFACE_USE_REFILL flag. The host fills the cache again at the
generation it holds, unless a command buffer that may write it was committed
since its last copy into the pages, whose write a fill would lose.
The flag is under the new feature bit RGFX_FEATURE_SURFACE_REFILL (bit 58),
which every host offers and both kexts take; the bundle sets it only where
its kext took the bit and answers the surface seeds. The bundle counts the
surfaces named mid-write and the refills, and the host its refills and the
refills it kept from, in their summaries.