Files
metal2vulkan/docs
Anees Iqbal fb183b48f7 player: the old backend gives a no-copy Managed buffer of a two-copy stream with no identity its writes before first use
The new runtime's backend plays a stream with no identity record under
--managed two-copy by its first-use rule. A no-copy Managed buffer made with
no bytes is fresh until the command buffer that first names it commits, and
a write into it while fresh reaches its GPU copy too (did_modify_range). That
write is the nearest record the stream has of the buffer's bytes at its
making (docs/REPLAY-STREAM.md, Managed buffers). The old backend had no
such rule. Those writes reached only its CPU copy, so on a device that keeps
two copies its GPU copy read zeros where the new runtime's read the bytes.

The old backend now follows the same rule. It notes each encoder's command
buffer, marks a buffer's first use when an encoder names it, drops the mark
at that command buffer's commit, and announces a fresh buffer's writes. Its
managed line counts the buffers whose contents came from first use, as the
new runtime's does. docs/REPLAY-STREAM.md states the two-copy rule for both
runtimes: which writes before first use reach the GPU copy, and what an
identity record changes.

Found by a synthetic stream of our own on the RX 550 (m3-max-53813): with no
identity record under --managed two-copy, rt read the write and old read
zeros. Recordings it touches: gb-3090-r2 (641 Managed objects read without
them, the first in frame 0) and windrag-780m-b2 (15), where played as two
copies.

Test: a_two_copy_stream_with_no_identity_gives_a_no_copy_buffer_its_writes_
before_first_use (replay_streams), which fails without the fix on a device
that keeps two copies. The made-with test's managed line now carries the
count.
2026-11-19 12:46:43 -08:00
..