Files
metal2vulkan/docs
Anees Iqbal 22fa0997b1 RUNTIME 2312: A write-only argument-buffer use of a texture whose writes Metal drops names none of its image
What. A command that makes a texture resident whose writes Metal drops
(metal::format::writes_dropped: the 4:2:2 formats, the subsampled and packed
two-plane YCbCr ones) names no use of it where its binding plan's heap holds
it at no element (no WriteSource::HeapEntry of its token): every heap storage
array holds such a texture as its neutral (bind::heap's Fit::Dropped), and a
kernel that only writes it declares no sampled array, so its function reaches
none of the texture's image (binding.rs, resident_uses_into; the storage-only
test holds_write_shadow becomes heap_holds, by class access or any).

Why. A kernel that only wrote a YCBCR8_420_2P texture through an argument
buffer (useResource WRITE) named the texture's image as a written use. That
use matched the texture's converted shadow, so the command's shadow planning
made and recorded the planes' conversion (ShadowCopies::prepare ->
YCbCrConversion::make), and on a device that converts 4:2:0 itself (Iris Xe:
the consumer's pin 92 Iris leg, writes_through_argument_buffers_of_two_plane_
ycbcr_textures_are_the_slots) that first conversion announced
ycbcr-filter-not-exact though nothing read the texture: relayed in default
mode, fatal in strict mode. The write itself was dropped, as Metal drops it.
4:4:4 textures already named only their write shadow. Now such a command
converts nothing and announces nothing; a command whose function reads the
texture through the argument buffer (a sampled array holds it) converts it
and announces the device's conversion as before.

Test: runtime_lane::ycbcr_argument_writes::a_kernel_that_only_writes_a_held_
420_texture_converts_none_of_its_planes (lavapipe and GPU lanes): resident
WRITE and READ|WRITE, the write-only kernel records no conversion
(ycbcr_refreshes + ycbcr_whole_conversions), announces no
ycbcr-filter-not-exact and leaves the planes' bytes; a kernel reading it
through the argument buffer records one conversion and announces the notice
where the device converted the texture itself. lavapipe converts 4:2:0
through Metal's arithmetic, so there the conversion count is the check that
fails without the fix. docs/API.md's catalogue entry and ycbcr.rs's writes
bullet say so.

Verified (lane ycbcrnote, at 12dbbcc67e on fe38b678dc):
- msi lavapipe m3-max-30151: touched lane tests 173/173 and runtime cpu_icd
  tests 238/238; clippy -D warnings plain and cpu_icd exit 0. Negative control
  in the same job (binding.rs back to fe38b678dc): the new test fails at "the
  writing command converted the planes".
- RTX 5080 (b5080 entry ycbcrnote-held420-130832, prebuilt m2v_gpu archive):
  passes; device conversion true, write-only commands announce nothing, the
  reading command announces YCbCrFilterNotExact once.
- msi m3-max-30159: clippy -D warnings under m2v_gpu and rustdoc -D warnings
  exit 0.
Expected, not run: the consumer's Iris strict test passes.
RUNTIME_VERSION moves: the same artifact's write-only commands now record and
announce nothing where they converted and announced before.
2026-11-14 13:11:54 -08:00
..