`docs/REFLECTION.md` tells a consumer to group reflected entries by
`(set, binding, descriptor type)` and take the largest `count`. That number is
what sizes `VkDescriptorSetLayoutBinding::descriptorCount`, so if it does not
reach the largest array the module declares at that binding, the layout is smaller
than the array the shader indexes into. The rule was documented and untested.
`assert_counts_cover_declared_arrays` reads the largest `OpTypeArray` behind each
decorated binding out of the module and requires the grouped maximum to cover it.
An authored `array_ref<texture2d<float, sample>>` kernel is the case with a real
array -- it declares the descriptor-ABI capacity, 128 -- and the fixture sweep
runs the same check. Verified as a detector: reporting one fewer descriptor for a
`TextureArray` fails both.
Measured over 2880 corpus sources first, since a test that only ever passes is not
evidence: 0 bindings where the module's array outruns the grouped maximum. The
naive comparison -- each entry's own `count` against the module -- reports 193
across the function-constant-gated modules, where one binding legitimately carries
both a scalar and a 128-element variable and reflection reports an entry for each.
That is the case the grouping rule exists for.
The same sweep compared `local_size` against `OpExecutionMode LocalSize`: 0
disagreements over 2880 sources, so no check was needed there.
No product change.
Gate: fmt, clippy -D warnings, warnings-denied all-features rustdoc, cargo test
-p metal2vulkan (debug and release), cargo test -p metal2vulkan-validation.