Function constants can set an argument's slot ([[texture(c)]]; the frontend states the index as a
global the static initializer computes). Values that put two present arguments of one argument
table on overlapping slots make a specialization Metal refuses when it makes the function: "<kind>
argument X has invalid location (<index,count>)", naming the later argument. Measured on an M3 Max
(macOS 27.0.1) for:
- buffers, a constant buffer and an argument buffer;
- a visible and an intersection function table, and an acceleration structure;
- textures, and a texture array overlapping a range;
- samplers;
- threadgroup memory.
Arguments of two tables at one index (a buffer and a texture at 0) are made.
The translation took such a set as valid and went on. Where a write texture and a sampled one met
on slot 0, the slot plan gave the slot the write access and the sample was refused as
Unsupported(Lowering(Sampler)), NotImplemented: a gap that is not ours. Where the two arguments'
uses agreed, one resource stood for both, a pipeline Metal never makes.
The specialized entry now refuses it (canon::interface, beside the duplicate color output check),
as RequestError::OverlappingArgument { param, index, count } and
DescriptorError::OverlappingArgument. Only present arguments count (MPS keeps gated pairs on one
index), and a count of 0 binds no slot. past_table and the new check share one table map.
API.md, the runtime's new_function_with_name_constant_values doc (the runtime checks constants
when a pipeline compiles the function) and the specialization planner's doc say so. The
signatures table is re-blessed; REFUSALS.md is unchanged (this is a refusal Metal makes).
Verified: the canon test covers each table and the non-overlapping cases. The MPS census A/B
(590 rows, every constant 0, release CLI on msi, base 9c2635b430) moves 42 rows to
InvalidDescriptor(OverlappingArgument): the 35 Lowering(Sampler) rows, 2 Lowering(Texture) rows,
and 5 rows that translated a specialization Metal refuses. No other row changes. With constant 125
(the batch size that puts the sampled texture after the written one) set to 1, all 42 translate
and pass spirv-val.