Files
Anees Iqbal ab18b5cdcf Translator: LoweringInputs::word_bound_buffers holds a buffer bound at a multiple of 4 below its alignment to what its accesses need
What: a new lowering input, the buffer slots a dispatch binds where the address is a multiple of 4
and not of the argument's alignment (8 or 16). Under the identity domains such a device-address
slot states RuntimeFact::AddressAlignment as its argument's alignment up to what its accesses
need: 4 for words and wider units, 8 where a 64-bit atomic reaches it, and 8 for every such slot
of a function whose 64-bit atomic goes through a wide pointer (AccessPlan::wide_atomics64). The
slot's direct accesses claim no more Aligned than the address is held to: AccessPlan::aligned now
maps each slot to that alignment, psb::Reach::Direct carries it, and whole_place declares the
proven multiple of 8 or 16 up to it. A slot of alignment 4 or less is unchanged by the set.

Why: a guest's system texture-decode kernel binds a 16-aligned argument's buffer at an offset that
is 4 mod 16 (1871700), and the runtime refused it (Refusal::BufferOffsetAlignment). Plain Metal
reaches each element of such a bind at its own address (an Apple M3 Max, macOS 27.0.1,
probes/misaligned_buffer_binds.m). The unconditional form (steelbrain/offsetalign, 8ed59d496e) cost
the 3090's constant_* rows 99-122 us -> 234-252 us (job 74651), so the relaxed form is a variant
only a dispatch bound so compiles.

The empty set leaves everything as it is: the key appends the set only when non-empty, the base's
held alignment is the argument's, which is at least every proven offset alignment of its leaves
(MemoryPlan::proven_align takes the base's twos), so min(proven, held) is the proven one, and
note_reach's 8 for a 64-bit atomic is read only as reach.min(4) outside the set. No
SEMANTICS_VERSION bump: no existing input's translation changes.

Tests (not yet run): engine_word_phases a_word_bound_variant_claims_and_states_4 (vwp_vec16 claims
and states 4 under the set, vwp_words's words unchanged by it) and
vec16_answers_metal_bound_at_a_multiple_of_4 (the CPU interpreter, VEC16_AT_WORDS: the variant
answers Metal's words, the plain module traps on its Aligned 16); engine_access_offsets
a_word_bound_slot_is_held_to_what_its_accesses_need (plain 8/16 both ways; under the set 8/4, and
8/8 through a wide 64-bit atomic). devtools: VEC16_AT_WORDS and answer_at, from 8ed59d496e.
api_signatures.tsv blessed (one field).
2026-11-25 19:17:03 -08:00
..