Runtime: AttachmentPlace's basis is Metal's own refusal, measured on the M3 Max

What: Refusal::AttachmentPlace's Basis line said `ours`. It now says
`metal-measured` and cites the committed probe resolve_depth_planes.m
(conformance crate, Apple M3 Max, macOS 27.0.1, job m3-max-73495). With
Metal's validation layer on, a resolve into slice 3 of a 2D texture ends
the process at the encoder ("Slice is 3, but the texture has only 1
slices"), and so does a resolve at depth plane 3 of one ("depth plane is
3, but the texture has a depth of 1 at mip level 0"). With the layer off,
plain Metal writes slice and plane 0 instead. A level past the texture's
was not run, and the line says that part is ours. docs/REFUSALS.md and
error/basis.rs are regenerated by scripts/refusal-surface/refusal_surface.py.
AttachmentPlace's basis() now answers MetalMeasured, and the Refusal
table's counts move one row from ours to metal-measured.

Why: the bug row said plain Metal (layer off) takes resolveSlice 3 into a
2D texture, and the planner's 11-25 ruling was that it needed a read
first, with rule 1 applying if Metal's layer refuses it. The read is the
probe above: the layer refuses it, so the refusal stands under rule 1,
and its basis now cites that evidence. Behaviour is unchanged.

Verified: refusal_surface.py --check exits 0 on this tree. The
runtime-sources fingerprint, recomputed from the tree, is unchanged
(44066e69): the runtime crate's sources are not inputs to it. No
signature changes, so api_signatures.tsv is untouched.
This commit is contained in:
Anees Iqbal committed 2026-12-03 08:40:29 -08:00
1 parent 16ab60e417
commit e730fbddbb
3 files changed
+10 -4

No files matched your search

+7 -1
View File
@@ -1090,7 +1090,13 @@ pub enum Refusal {
/// slice, or the last of the slices a layered pass renders from it
/// (`renderTargetArrayLength`); or a 3D texture's depth plane past its level's depth.
///
/// Basis: ours (no texel of the texture is there to render into).
/// Basis: metal-measured (an Apple M3 Max, macOS 27.0.1, probe `resolve_depth_planes.m` in the
/// conformance crate, job m3-max-73495: Metal's validation layer ends the process at the
/// encoder for a resolve into slice 3 of a 2D texture, `Slice is 3, but the texture has only 1
/// slices`, and for a resolve at depth plane 3 of one, `depth plane is 3, but the texture has
/// a depth of 1 at mip level 0`; with the layer off, plain Metal writes slice and plane 0
/// instead. A level past the texture's was not run: that part is ours, as no texel of the
/// texture is there to render into).
AttachmentPlace {
/// The level asked for.
level: u32,
@@ -88,7 +88,7 @@ impl Refusal {
Refusal::AttachmentUsage { .. } => RefusalBasis::MetalDocumented,
Refusal::ResolveTexture => RefusalBasis::MetalDocumented,
Refusal::ResolveFormat { .. } => RefusalBasis::MetalDocumented,
Refusal::AttachmentPlace { .. } => RefusalBasis::Ours,
Refusal::AttachmentPlace { .. } => RefusalBasis::MetalMeasured,
Refusal::AttachmentFormat { .. } => RefusalBasis::MetalDocumented,
Refusal::NoAttachmentPass { .. } => RefusalBasis::MetalMeasured,
Refusal::SamplePositions { .. } => RefusalBasis::MetalDocumented,
+2 -2
View File
@@ -44,7 +44,7 @@ Columns:
| Rate maps the compile layer does not compile | 0 | 0 | 0 | 0 | 5 | 0 | 0 | 0 |
| The translation deadline | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
| Devices below the runtime's floor | 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 |
| The runtime's `Refusal` | 30 | 27 | 0 | 0 | 39 | 0 | 0 | 0 |
| The runtime's `Refusal` | 31 | 27 | 0 | 0 | 38 | 0 | 0 | 0 |
| The runtime's `Limit` | 0 | 0 | 0 | 15 | 6 | 0 | 0 | 0 |
| The runtime's `Gap` | 0 | 0 | 0 | 2 | 29 | 0 | 0 | 0 |
@@ -306,7 +306,7 @@ Columns:
| `AttachmentUsage` | A render pass attachment (`CommandBuffer::render_command_encoder`) whose texture was made without `RenderTarget` usage | every device (a public call's own check of its arguments) | `metal-documented`: a texture a render pass renders into needs `MTLTextureUsageRenderTarget`; Metal's validation stops the descriptor | 1: `crates/metal2vulkan-runtime/src/texture.rs (attachment)` | `-` |
| `ResolveTexture` | A store action that resolves (`MultisampleResolve` or `StoreAndMultisampleResolve`), on a render pass attachment or set by its encoder, for an... | every device (a public call's own check of its arguments) | `metal-documented`: `MTLRenderPass.h`: `resolveTexture` is "Only used (and required) if the store action is set to MTLStoreActionMultisampleResolve" | 2: `crates/metal2vulkan-runtime/src/pass.rs (resolving)`, `crates/metal2vulkan-runtime/src/render_encoder.rs (later_store)` | `-` |
| `ResolveFormat` | A resolve of a render pass color attachment of an integer pixel format | every device (a public call's own check of its arguments) | `metal-documented`: Metal's validation asserts that an integer color format "cannot be a MSAA resolve target", and plain Metal writes values no sample holds | 1: `crates/metal2vulkan-runtime/src/pass.rs (check)` | `-` |
| `AttachmentPlace` | A render pass attachment or resolve texture of a level or slice past its texture's | every device (a public call's own check of its arguments) | `ours`: no texel of the texture is there to render into | 4: `crates/metal2vulkan-runtime/src/texture.rs (attachment_view, 3 sites)`, `crates/metal2vulkan-runtime/src/texture.rs (resolve_attachment)` | `-` |
| `AttachmentPlace` | A render pass attachment or resolve texture of a level or slice past its texture's | every device (a public call's own check of its arguments) | `metal-measured`: an Apple M3 Max, macOS 27.0.1, probe `resolve_depth_planes.m` in the conformance crate, job m3-max-73495: Metal's validation layer ends the process at the encoder for a resolve into slice 3 of a 2D texture, `Slice is 3, but the texture has only 1 slices`, and for a resolve at depth plane 3 of one, `depth plane is 3, but the texture has a depth of 1 at mip level 0`; with the layer off, plain Metal writes slice and plane 0 instead. A level past the texture's was not run: that part is ours, as no texel of the texture is there to render into | 4: `crates/metal2vulkan-runtime/src/texture.rs (attachment_view, 3 sites)`, `crates/metal2vulkan-runtime/src/texture.rs (resolve_attachment)` | `-` |
| `AttachmentFormat` | A render pass color attachment of a depth or stencil pixel format, a depth attachment of a format without depth, or a stencil attachment of a... | every device (a public call's own check of its arguments) | `metal-documented`: a color attachment takes a color-renderable format, a depth attachment a format with depth and a stencil attachment a format with stencil; Metal's validation stops the descriptor | 3: `crates/metal2vulkan-runtime/src/pass.rs (check, 3 sites)` | `-` |
| `NoAttachmentPass` | A render pass with no attachment whose `renderTargetWidth` or `renderTargetHeight` is 0, or whose `defaultRasterSampleCount` is 0, Metal's default | every device (a public call's own check of its arguments) | `metal-measured`: an Apple M3 Max, macOS 27.0.1, the API validation layer off, m3-max-62174, `probes/no_attachment_passes.m`: a side of 0 makes no encoder, nil, and a count of 0 ends the process at the encoder, SIGABRT, where 64 by 64 pixels at 1 sample makes one | 1: `crates/metal2vulkan-runtime/src/pass.rs (check)` | `-` |
| `SamplePositions` | A render pass's sample positions (`setSamplePositions:count:`) other than the device's own | every device (a public call's own check of its arguments) | `metal-documented`: `MTLRenderPass.h`: the positions are "to be used in MSAA rendering (i.e. when sample count > 1)" and the count "must be a valid sample count"; `MTLTypes.h`: a position's range is "[0,1) for both x and y"; `MTLDevice.h`'s `programmableSamplePositionsSupported`; Metal's validation stops a pass of more positions than samples, a coordinate outside the pixel and positions in a pass of one sample, and one position past the samples ends plain Metal's process on an Apple M4, the conformance suite's `sample_positions` module | 1: `crates/metal2vulkan-runtime/src/positions.rs (locations)` | `-` |