Files
metal2vulkan/tests
Anees Iqbal 8506f33a6d Pin the byte-view vector store, the one remaining rejection class that is a gap
Eight of the twelve non-function-pointer corpus rejections are one shape, and until now nobody could
author it. Three previous attempts produced modules that translate cleanly, because they reduced
from the diagnostic's text — which named the address arithmetic, not the shape. `llvm-reduce` got it
in three passes: 708 lines to 44, then renamed so it carries no third-party identifiers.

The shape is a `<3 x float>` store through a `device uchar*` view of a `{ RuntimeArray<uint> }`
block, reached across a call. Every surviving part is load-bearing, each checked by deleting it:

- the `i32` load and the byte `getelementptr` in the kernel, which between them fix the block's
  element width at 32 bits and open the byte view — dropping either translates;
- the pointer crossing a call boundary through an `alloca`d struct — inlining the callee translates,
  which is why every single-function reduction before this one missed;
- the callee's pass-through blocks and the full argument list, both of which change which
  construction attempt the module reaches.

It is pinned as a must-FALLBACK because it is the class most likely to be closed wrongly, and the
test says so. Both tempting lowerings are unsound: a non-atomic read-modify-write of the surrounding
words races another thread writing the neighbouring bytes — which is exactly what
`emit_scalar_narrowing_store` restricts to thread-local slots and what
`emit_raw_byte_store_from_u32` uses atomics for on shared storage — and a plain word store is
byte-exact only under four-byte alignment, which the AIR asserts with `align` but which does not
reach the SPIR-V pass that would need it. So the suite's header now separates this gap from the
function-pointer limits around it: closing it has to be a deliberate edit to this test.

`cargo fmt --all --check`, clippy `-D warnings`, `RUSTDOCFLAGS='-D warnings' cargo doc`,
`cargo test -p metal2vulkan` debug and release, `cargo test -p metal2vulkan-validation`.
2026-08-31 21:01:13 +03:00
..
2026-07-22 13:15:24 +03:00