Files
metal2vulkan/docs
Anees Iqbal 3fba08c913 SEMANTICS 2108 / RUNTIME 2283: a kernel's unaliased, unwritten buffer arguments are NonWritable
Compute modules never decorated a buffer view NonWritable (serialize/non_writable.rs served graphics
only) and every buffer view was Aliased. RADV keeps a uniform read on vector memory unless the SSBO is
reorderable, so a read-only weights buffer was read with buffer_load_b32 instead of s_buffer_load.

Now a compute buffer argument that AIR marks air-buffer-no-alias (the current Metal compiler marks
every buffer argument) and that the kernel never writes (no store, wide store, atomic, ordered access
or argument-buffer source) is decorated NonWritable. Graphics unchanged. Exact under rule 1, decided
from the IR's structure and AIR's metadata, no names. A dispatch binding the same memory to an
unaliased read argument and to a written one may read the old bytes; Metal's no-alias contract
already allows that (docs/API.md section 10 says so). No Degradation kind, refusal or public type.

Verified (codegen): RADV 26.2.6 compile-only for gfx1103 (PHOENIX) under Mesa's amdgpu noop drm-shim
on msi, our own MSL: a row convolution's weights read becomes s_buffer_load (static latency 3627 ->
3270, inverse throughput 453 -> 409, VMEM 3 -> 2); a half column convolution VMEM 5 -> 4. msi job
m3-max-28950 at 9e9d464cc5: clippy -D warnings (metal2vulkan, runtime, all targets/features) 0;
154/154 touched tests incl. an_unaliased_unwritten_buffer_is_non_writable (unaliased, attribute
stripped, written, volatile) and engine_nonwritable sweeps over every public fixture. Golden tables
are re-blessed on development after landing.
2026-11-14 04:16:38 -08:00
..