Files
metal2vulkan/docs
Anees Iqbal c120b74608 replay player: a noted buffer's address in written bytes moves with the buffer
What: once the stream notes a buffer escaped (m2v.bufferEscaped), the player no longer stops at a
written word whose value lies in that buffer's recorded range (PlayError::NotedWord, now deleted).
It moves the word with AddressMap::move_noted to AddressMap::relocated(value), the address the play
gave the innermost live range the value lies in plus the same offset, the same move an address
argument gets. This happens after the census counts and before the bytes reach the backend, on
all five write paths:
- set*Bytes data;
- a copied buffer's contents;
- m2v.write;
- the m2v.copyFromGuestRam pieces;
- the m2v.privateBytes bytes before a dispatch.
A new stream count, noted_words, counts the words moved. The census counts are still taken from
the bytes as the stream holds them.

Why: the runtime backend makes objects where it has room, so a pointer the program wrote into
memory held the recorded address and pointed at nothing in the play. The stop ended every replay
of a stream whose buffers escape (one of reims's plays stopped at frame 216). Every live range has
the address the backend made its object at; a make without one already stops at the make. So
every noted word can be placed, and the stop has no case left. A pointer into memory no live
range holds cannot be told from data and plays as recorded, as before. This runs on every
backend and device; nothing is keyed by identity.

Docs: REPLAY-STREAM.md section 5 (written words and the escape note) and section 10 (the stream
counts and the addresses line), VALIDATION.md, and command-replay's addresses line, which gains
noted_words.

Tests:
- Unit (mock backend), a_word_into_a_buffer_noted_escaped_moves_with_it. After the note, a word
  in an m2v.write and a word in setBytes data each move to the mock's base plus their offset,
  and are counted as noted. The same word written before the note, and a word into a buffer with
  no note, play as written.
- lavapipe, a_noted_buffer_s_address_in_written_bytes_moves_and_a_kernel_follows_it. A block at a
  recorded address holds a data buffer noted escaped (kind 0) and a buffer whose written word is
  the data buffer's recorded address plus 16. The fixture kernel ab_address (out[i] = held.p[i])
  follows the moved word, and out holds the data words from the fifth on, exactly.
- Negative: the two tests on development's tip without the move. The play stops with NotedWord.

How verified: the lane's compile gate with the validation suite on lavapipe, and the negative job.
2026-11-20 10:50:42 -08:00
..