Translator: containment is the in-shader check on every profile; Robustness goes

The translator chose a containment form from the device's buffer robustness: with
robustBufferAccess or robustBufferAccess2 enabled, a descriptor view's access carried no check
and the device bounded it. The runtime enables neither feature (its floor's feature table names
only nullDescriptor, robustImageAccess and robustImageAccess2), so that form never ran there; it
ran only on validation's committed descriptions, as stated. It goes, with the choice:

- Robustness (None, Rba, Rba2), DeviceProfile::robustness() and
  DeviceProfile::checks_buffers_in_shader(), and contain::encoding. A descriptor view's access is
  the in-shader check on every profile; Check::None remains only for a device-address access that
  nothing bounds (AccessPlan::psb_contained false).
- A texel buffer is checked in the shader on every profile (it was the device's under
  robustBufferAccess2). Images keep their device form: device_reads_texels and
  device_drops_texel_writes still read robustImageAccess2 and robustImageAccess, which the
  runtime's floor requires.
- Vertex input: outside the identity domains every attribute is pulled through a checked view;
  before, a device with robustBufferAccess fetched in fixed function. Under the identity domains
  nothing changes: fixed function, or the refusal of what it needs.
- The loop hoist loses its robustness parameter and the speculative path only Rba and Rba2
  reached: a load in the loop's entry run still moves, other loads stay.
- Validation: of_compile states buffers as Unused or Checked, the out-of-bounds contract states
  Check::Shader for a descriptor view and a texel buffer and Unchecked for a fixed-function
  attribute. BufferEncoding::Robust and Check::Robust stay as stored vocabulary: committed
  observations hold them, and no compile states them now.

Removed public items, each with 0 hits in the consumer's checkout at bd9d6ae85a and at
ad28ebd881 (git grep -w -F over *.rs, *.toml, *.md): Robustness, Rba, Rba2, robustness,
checks_buffers_in_shader (DeviceProfile, their owner, has 0 hits too). api_signatures.tsv and api_surface.rs are
blessed here; docs/API.md (the bounds bullet, the profile facts list, vertex_input) and the
runtime README's not-enabled row for robustBufferAccess change in this commit;
docs/REFUSALS.md is regenerated and unchanged. No version moves: the batch's SEMANTICS and
ARTIFACT_FORMAT_VERSION bumps are applied last, once for the batch.

Tests: the hoist's a_guarded_uniform_load_at_a_fixed_word_leaves_its_loop goes with the
speculative path; without_robust_access_only_a_load_every_entry_runs_leaves becomes
only_a_load_every_entry_runs_leaves; robustness2_selects_the_rba2_encoding keeps its MoltenVK
asserts as moltenvk_m3_derives_its_stride_and_format_usages; engine_texture_interp's
contains_texel_buffers helper goes, its tests always running N+3 threads. Rewritten to the one
form: engine_texture_oob's texel-buffer classes ([Class::Shader]), engine_texture_ulong,
engine_graphics_binder's per-device assert, the coverage tier-table and containment tests, and
the out-of-bounds contract's fixed-function test. None was the sole proof of a kept behaviour.

Golden: the table's columns are validation's committed descriptions as stated, all with
robustBufferAccess and 13 with robustBufferAccess2; no column is the runtime's. Every column's
fingerprint moves (ProfileFields loses its robustness field). Bless items: 24 rows, 312 cells,
24 in each of the 13 columns that state robustBufferAccess2 and 0 in moltenvk-m3 and
runtime-floor, every one hash to hash, in the 14 texel-buffer fixtures now checked in the shader.
The .air.ll half (567 typed-pointer fixtures, which need metal-as) is unchecked per commit; the
batch's golden bless on the M3 covers it.

Verified:
- On unshipped's tip before this rebase (96d953bb0b), the same change: compile job
  m3-max-66123 green (fmt, signatures, refusals, clippy plain, m2v_gpu and m2v_cpu_icd,
  workspace Rustdoc, api-docs).
- At the batch's top on that base (all four commits, probe job m3-max-66130): the hash probe's
  252 rows equal unshipped's arm at 4861c9863d (m3-max-65976); the golden probe's set without
  buffer robustness (the runtime's state) equals the base arm 96d953bb0b (m3-max-66128), 1855 of
  1855 rows; the stated set moves exactly the 312 cells above.
- Here: cargo fmt; signatures check; refusal surface regenerated. The compile job follows on the
  branch tip.
This commit is contained in:
Anees Iqbal committed 2026-11-22 00:17:42 -08:00
1 parent 5e3477e60a
commit 556707ed79
33 files changed
+341 -620

No files matched your search

+8 -12
View File
@@ -100,9 +100,8 @@ compile does. `DevicePolicy::default()` is the one constructor: the runtime comp
and so do the command line, the compile worker and every validation tool. It holds:
- **Bounds on a buffer-slot access at a run-time offset.** Such an access stays inside the range
the binder supplied: where the device enables `robustBufferAccess`, buffer accesses and vertex
input are left to it, and elsewhere the shader checks them. (MoltenVK advertises the feature
without implementing it; there such accesses are not bounded, as on native Metal.)
the binder supplied: the shader checks it on every device, whatever buffer robustness the device
enables.
- **The device's arithmetic.** The device's own maths library, divisions, fused multiply-adds,
`float` denormals, rounding order of `dot`/`mix`/`fast::sqrt`, the grouping and fusion of
fast-math sums and products (each operation in the AIR's order, its own fast-math flags its
@@ -307,8 +306,7 @@ println!(" Metal properties: {:?}", device.metal_properties());
- `profile().spirv_validation()`: the `spirv-val` environments and relaxations every module for
the device is valid under. The command line runs exactly these.
- The profile's facts: `enabled()`, `limits()`, `images()`, `fragment()`, `descriptors()`,
its `subgroups()` model and `simd_tier(...)`, the buffer robustness that bounds a buffer-slot
access (`robustness()`, `checks_buffers_in_shader()`), and the Function
its `subgroups()` model and `simd_tier(...)`, and the Function
storage a thread holds (`function_storage()`: `FunctionStorage::Measured` bytes for a measured
device, or `FunctionStorage::Assumed` with the 16 KiB floor, past which a vertex or fragment
function runs with `FunctionStorageAssumed` up to 192 KiB and any other stage is refused).
@@ -797,13 +795,11 @@ A `RenderPipeline` holds:
- `stages`: vertex, then fragment when rasterization is enabled;
- `layout`: one pipeline layout for every stage;
- `vertex_input`: Vulkan bindings and attributes. An attribute Vulkan cannot fetch as described is
pulled in the shader instead, and so is every attribute on a device without
`robustBufferAccess`. A `FloatRGB9E5` attribute is pulled on every
device: no device must fetch the shared-exponent format as vertex input, and its decode is
exact, so the shader's is the answer a conformant fetch gives. Under the identity domains
nothing is pulled, as the pulled fetch reads through a
descriptor: every attribute is fetched in fixed function, with or without buffer robustness
- `vertex_input`: Vulkan bindings and attributes. Outside the identity domains every attribute is
pulled in the shader through a checked descriptor view: nothing bounds fixed-function input
without buffer robustness (VUID-vkCmdDraw-None-02721), which the translator never leaves an
access to. Under the identity domains nothing is pulled, as the pulled fetch reads through a
descriptor: every attribute is fetched in fixed function
(a fetch outside its buffer reads what the device gives), an unnormalized signed-integer format
into a variable declared `int`, the constant step at vertex rate on a binding of stride 0 (no
divisor); an attribute fixed-function input cannot take is refused,