Files
metal2vulkan/docs
Anees Iqbal f1c3a2557e translator: spilled fields read 16 bytes at a time, through a NonWritable block
Under the identity domains a function's fields past its push window live
in a parameter block at the pushed ArgumentTableAddress, and each was read
by a load of its own size (a slot's bounds: 8 bytes, aligned 8) through a
writable device place. The block is now read in 16-byte lines: each line a
spilled field touches is one uvec4 load, aligned 16, made once where it
dominates (EmitCx::block_line, so load_push_fields' reads at entry share
them), and each field is taken from its line (a word, a two-word shuffle,
a bitcast for an address, whole lines for a region). The place's member is
NonWritable: nothing writes the block while a command reads it, so a device
may read it as read-only memory; device_place_read_only notes that RADV
reads a uniform address of such memory with a scalar load.

The block's address is a multiple of 16 (rt's ring aligns every write to
16) and its size is (argument_table_size), so every line lies in it.
docs/API.md states that contract for a consumer.

Why: wide_bindings spills 23 of its 24 slots' bounds; it read them as 23
loads of 8 bytes, now 12 of 16. In one stream's kept lowerings
(gb-3090-r2) 2 of 424 modules spill: 14 spilled bounds become 7 lines,
2 become 1. SEMANTICS_VERSION 2197 -> 2198: module words change.

Test: engine_identity_spill's vertex function loads each 16-byte line of
its spilled fields once, in its first block, as a uvec4 aligned 16 through
a NonWritable block; its interpreter tests read the spilled bounds as
before.
2026-11-19 23:35:15 -08:00
..