Replay dumps: a texture the cover rule holds covered is dumped with a whole-texture cover

A heap texture that another placement's texture wrote over after its last write was reported by
compare-dumps as a difference: the dump loop passed no cover for a texture (dumps.rs: "always `-`
for a texture"), so the bytes Metal leaves undefined there were compared. Each texture a listed
command buffer stores or binds is now dumped, when the dump reads it (after the wait that saw
the command buffer complete, the moment a buffer's ranges are taken), with the cover 0..N, N its
dump's length, where the cover rule holds any byte of it covered (Covers::covered), and `-`
otherwise. A texture's ranges in the rule are its bytes in its heap, which the dump's parts are
not laid out as, so a covered texture is covered whole. The compare then leaves its words out
as it leaves out a covered buffer word. dumps.rs and docs/REPLAY-STREAM.md section 10 say so.

Test: the_dump_compare_leaves_out_a_covered_texture_and_reports_one_outside_every_cover (no
device; Kept reads a texture part's first word from a per-texture word where it holds one). Of
three textures placed in a heap, #5 and #6 over each other and #7 apart, two dispatches of a
state that writes slot 0 write #5 then #6, which covers #5; the second play reads #5 and #7
otherwise. #5's cover is 0..32 and its differing word is counted covered; #7, covered by
nothing, is the one difference reported.

Verified at this commit: nothing yet; the lane's jobs follow.
This commit is contained in:
Anees Iqbal committed 2026-11-25 16:41:51 -08:00
1 parent f6b1adf204
commit e9484b7d03
4 files changed
+113 -17

No files matched your search

+6 -4
View File
@@ -1156,15 +1156,17 @@ encoder's `setColorStoreAction:atIndex:`. `cbC-objT.bin` holds the texture's par
stored, each a level, a slice and a depth plane (`level`, `slice` and `depthPlane`, or the
resolve's; a pass of `renderTargetArrayLength` 2 or more stores that many slices from the slice),
one after another by level, then slice, then plane, each laid out as a check reads a texture's
first level and slice; its `cbC-objT.cover` is `-`, and `cbC-objT.unread` replaces the bytes
where the backend could not read a part (a multisample texture stored without its resolve, for
one). It writes too each texture the command buffer's compute encoders bound
first level and slice; and `cbC-objT.unread` replaces the bytes where the backend could not read
a part (a multisample texture stored without its resolve, for one). It writes too each texture the command buffer's compute encoders bound
(`setTexture:atIndex:` and `setTextures:withRange:`, a nil one left out): its first level and
slice as a part, read once the command buffer completed as an attachment's parts are, so what the
command buffer's last write left there; a texture both stored and bound holds each of its parts
once, in that order. A depth or stencil attachment is not written: a texture of a combined depth and
stencil format reads back one aspect at a time, through a copy with that aspect's blit option,
which this read does not make. `command-replay compare-dumps --a DIR --b DIR` compares two plays' dumps word by word (4 bytes), leaving out a word
which this read does not make. A texture's `cbC-objT.cover` is `0..N`, the whole of its `N`
bytes, where the cover rule (above) held any byte of the texture covered then, and `-` otherwise:
the rule's ranges are the texture's bytes in its heap, which its parts are not laid out as.
`command-replay compare-dumps --a DIR --b DIR` compares two plays' dumps word by word (4 bytes), leaving out a word
wholly inside a range either play held covered, and prints `differs cb #C obj #O: N words outside every cover, the first word
W; M covered; lengths A and B` for each buffer that differs outside every cover, `only in a|b:
cbC-objO` for a dump one play lacks, `unread in a|b: cbC-objO: WHY`, `copies differ: cbC-objO: a