Files
metal2vulkan/crates
Anees Iqbal b2fa7e7da8 SEMANTICS_VERSION 2052: a generic pointer stored in a closed thread allocation and loaded back keeps its stores' space
The commits before this one extend canon::generic (SV 2049) to generic pointers that pass through thread memory: the struct fields of macOS 27's MPS NDArray kernels, which hold generic pointers stored through addrspacecasts or null and loaded back field by field.
- Each constant byte offset of a thread alloca is one slot. A load takes its slot's stores' space, and may be null only where a null is stored there.
- The cell stays a GenericPointer(Memory) refusal in two cases:
  - its address escapes: it is stored, cast other than by bitcast, passed to any call but memset/memcpy/memmove, or reaches a phi, a select or an aggregate;
  - its bytes are not disciplined: overlapping slots, a data write over a slot, or an unknown-offset access meeting any write.
- docs/FAST-PATHS.md's known gap and the Memory variant's doc say so.

The owned fixture generic_pointers gains generic_slots (a struct read by reference) and generic_fields (a struct passed by value), and the Metal probe gains the same kernels. The companions were regenerated on the M3.

Verified:
- runtime_lane::generic_pointers on lavapipe gives the M3 Max's words for both new kernels: 100+t, 201+t, 1 for t<4 then 4, and t (m3-max-21485).
- engine_generic_pointers passes (m3-max-21507).
- The AIR suite passes 553/553 and metal2vulkan-air clippy is clean (m3-max-21475).
- Of macOS 27's 590 MPS functions in release on RDNA3, 11 of the 16 Memory rows move (m3-max-21539):
  - 3 translate and pass spirv-val;
  - 8 now stop at a linked visible function, which is a pipeline input;
  - 5 stay Memory, because the cell's address goes into an unlinked visible-function call.
  The slowest row takes 1.21 s and the largest peak is 207 MB.
2026-11-12 08:52:33 -08:00
..