Two independent scans put the module's `__air_sampler_state` globals in a
sequence and then pair them off by position: the interface pass, which collects
them from the SPIR-V `OpName`s and hands each the next free sampler binding, and
reflection, which collects them from the `!air.sampler_states` root and reports
the decoded state at each of those bindings. Each sorted with its own copy of a
key that read the name suffix as a single integer.
That key TIES. LLVM uniques a repeated `__air_sampler_state` by appending `.N`,
and re-uniques an already uniqued name by appending again --
`__air_sampler_state.161.1606` -- which the single-integer parse fails on, as it
does on the unsuffixed original, so both land on 0. A tie leaves the order to
input order, and the two scans have different ones. Both sides then agree on
WHICH sampler bindings exist while describing each as the other, so every sample
reaches a real sampler carrying another one's filter, address modes and compare
function, in a module that validates and binds cleanly. 14 of the 5499
sampler-state globals across 14579 local corpus sources carry the doubled form,
and 10 modules hold one beside the original.
The key now orders by the whole dot-separated suffix with the name last, which
cannot tie -- a name is unique within a module -- and it lives in one place,
`meta::static_sampler_name_order`, with the prefix predicate beside it so
neither side spells `__air_sampler_state` for itself.
The existing constexpr-sampler test checked only which bindings exist, which is
the half that was already right. It now also checks that the state reported at
each binding is the state the sample reading that binding was written with,
over both the uniquely suffixed spelling and the re-uniqued one. The re-uniqued
fixture fails on HEAD~ with the two states swapped.
A/B over the 2880-source sample: 0 status changes; 1 module changes, one
surviving constexpr sampler moving from binding 162 to 161 as its state moves to
the position the shared order gives it.