All three AIR stage roots -- `!air.kernel`, `!air.vertex`, `!air.fragment` --
state their per-entry attributes in the same place: extra operands past the
`(function, outputs, inputs)` triple. They do not state them in the same form.
`air.patch` and `air.max_work_group_size` are references to a keyed node;
`early_fragment_tests` is a bare string operand on the root itself. Only the
vertex decode read that tail, and only for `air.patch`, so a stage could not
tell "no attribute" from "an attribute nobody taught me to see".
Two were being dropped in that silence.
`[[early_fragment_tests]]` -- 51 of 14579 local corpus sources -- now reaches
SPIR-V as `OpExecutionMode ... EarlyFragmentTests`. It is not a hint: under
early testing a fragment the depth test rejects executes none of the body's
stores, while under Vulkan's default late test the same shader performs every
buffer, texture and imageblock write and only its color output is discarded.
Both modules validate, bind and reflect identically, which is why nothing
caught it. A fragment that declares it and also writes `air.depth` or
`air.stencil` is refused: the test runs before the value it compares exists,
and Metal rejects the pair outright.
`[[max_total_threads_per_threadgroup(N)]]` (`air.max_work_group_size`, 439 of
the same sources) states the largest threadgroup the body was compiled to run.
A caller-requested `LocalSize` past it is refused instead of emitted as a
module that validates and runs a shape the source ruled out. The duplicated
non-zero `LocalSize` check in `transform_with_options_and_sidecar` now calls
`validate_kernel_dispatch_options` rather than restating it.
The structural half is `meta::stage_root_attributes`: one decoder for the whole
tail, recognising each attribute by its own ABI marker rather than by position,
carrying anything it cannot model out through `unmodelled_stage_attributes` so
the stage-input pass refuses by name. A node with no operands states nothing
and is skipped -- there is nothing in it to drop.
Verified: `cargo fmt --all --check`, `cargo clippy --workspace --all-targets -D
warnings`, warnings-denied all-features Rustdoc, `cargo test -p metal2vulkan`
in debug and release, `cargo test -p metal2vulkan-validation`. The six authored
cases in `tests/stage_root_attributes.rs` were checked against five mutations
(drop the execution mode, drop the decode, ignore unmodelled attributes, drop
the ceiling check, read only the first tail operand); each mutation fails at
least one. A/B over 2880 corpus sources: 0 status changes, and the only SPIR-V
byte changes are the ten fragments declaring `early_fragment_tests`, each
gaining exactly the one execution-mode line and still passing spirv-val.