A reset compute pipeline descriptor is a fresh one: an accepted difference
MTLComputePipeline.h documents -[MTLComputePipelineDescriptor reset] as "Restore all compute pipeline descriptor properties to their default values", and maxTotalThreadsPerThreadgroup as "If it is not set, returns zero". The runtime's reset is ComputePipelineDescriptor::new, every field at its default. Metal's reset on the M3 Max (macOS 27.0.1) keeps threadGroupSizeIsMultipleOfThreadExecutionWidth, maxTotalThreadsPerThreadgroup and requiredThreadsPerThreadgroup as the program set them (true, 96 and 8 by 6 by 2 in compute-descriptor-reset), while the tile and mesh descriptors' resets restore every field on the same machine. The owner's decision: the header's contract is Metal's, and the compute descriptor's kept fields read as one release's defect. docs/API.md section 10 (Kernels) states it. compute-descriptor-reset loosens its five thread-shape sites to the runtime's default alone (AnyOf the default, so Metal's kept value is still a divergence), justified by that entry, and its five known-gaps rows go. A module test holds the entry, the five paths and the defaults; the other two shapes loosen nothing. CONFORMANCE-COVERAGE.md regenerated. Verified: the conformance suite and clippy run on this branch next. (cherry picked from commit 3dbd14b8fa45f6fcb836603b32aace527d009c0e)
This commit is contained in:
1 parent
82b534db49
commit
14e55e0c6c
4 files changed
+110
-18
No files matched your search
@@ -85,11 +85,6 @@ discard-quad-sum-placement llvmpipe (LLVM 21.1.8, 128 bits) divergent case/count
|
||||
discard-quad-sum-placement llvmpipe (LLVM 21.1.8, 128 bits) divergent case/counted_dependent/texels 4 elements differ (I32), the largest difference 1 Metal counts the quads the discard drops whole in a simdgroup sum that sits ahead of the discard for a measured reason -- the discard's condition reads the sum (`counted_dependent`), or a device store (`counted_store`) or an atomic (`counted_atomic`) lies between them -- so each kept texel's first channel, `before > after`, is 1. On the gate container's arm64 lavapipe (`llvmpipe (LLVM 21.1.8, 128 bits)`, the venue this row names) all four texels of the kept quad read 0, uniformly and each by exactly one code: our run's sum saw the same lane count before and after the discard. MoltenVK on this M3 Max answers Metal's 1 exactly, with no notice, so this is one venue's difference and not the module's rule being wrong (verified: a whole-set replay on each venue, 2026-10-23). The suite's other lavapipe, `llvmpipe (LLVM 23.1.1, 256 bits)` on x86-64, does not hold it and carries no row for this case, which is why the venue field names the 128-bit build rather than the bare substring `llvmpipe` that covers both: a row scoped to both read as stale on a venue the gap was never measured on. Two llvmpipe builds that differ in vector width and in LLVM release answering differently makes this the build's and not the module's, and it still does not say which of the two candidates below it is. The cause is NOT established, and the case as written cannot establish it: the four numbers it records per texel are identical under both candidates -- the device's fragment simdgroup holding only the kept quad, so the dropped quads were never in it (the target is 8 by 4, exactly one 32-lane simdgroup if the device packs it that way), and the device's compiler moving the reduction past the discard although `canon/discard_sink.rs` placed it ahead on purpose. Both give before == after and so (0, 0, 0, 0), on every texel alike, which is why the uniformity across the quad separates nothing either. The next step is the case's: record the simdgroup's own size and the raw `before` and `after` beside the four derived numbers, which separates the two at no cost, then fix whichever it is -- a device whose reduction does not see the dropped lanes needs the active set computed in the module rather than taken from the device's implicit one (crates/metal2vulkan/src/lower/simd/group.rs with crates/metal2vulkan-air/src/canon/discard_sink.rs), and a device whose fragment simdgroup is smaller than Metal's is a different answer again. Open: on the orchestrator's todo list, handed to whoever takes the discard-hoist family.
|
||||
discard-quad-sum-placement llvmpipe (LLVM 21.1.8, 128 bits) divergent case/counted_store/texels 4 elements differ (I32), the largest difference 1 Metal counts the quads the discard drops whole in a simdgroup sum that sits ahead of the discard for a measured reason -- the discard's condition reads the sum (`counted_dependent`), or a device store (`counted_store`) or an atomic (`counted_atomic`) lies between them -- so each kept texel's first channel, `before > after`, is 1. On the gate container's arm64 lavapipe (`llvmpipe (LLVM 21.1.8, 128 bits)`, the venue this row names) all four texels of the kept quad read 0, uniformly and each by exactly one code: our run's sum saw the same lane count before and after the discard. MoltenVK on this M3 Max answers Metal's 1 exactly, with no notice, so this is one venue's difference and not the module's rule being wrong (verified: a whole-set replay on each venue, 2026-10-23). The suite's other lavapipe, `llvmpipe (LLVM 23.1.1, 256 bits)` on x86-64, does not hold it and carries no row for this case, which is why the venue field names the 128-bit build rather than the bare substring `llvmpipe` that covers both: a row scoped to both read as stale on a venue the gap was never measured on. Two llvmpipe builds that differ in vector width and in LLVM release answering differently makes this the build's and not the module's, and it still does not say which of the two candidates below it is. The cause is NOT established, and the case as written cannot establish it: the four numbers it records per texel are identical under both candidates -- the device's fragment simdgroup holding only the kept quad, so the dropped quads were never in it (the target is 8 by 4, exactly one 32-lane simdgroup if the device packs it that way), and the device's compiler moving the reduction past the discard although `canon/discard_sink.rs` placed it ahead on purpose. Both give before == after and so (0, 0, 0, 0), on every texel alike, which is why the uniformity across the quad separates nothing either. The next step is the case's: record the simdgroup's own size and the raw `before` and `after` beside the four derived numbers, which separates the two at no cost, then fix whichever it is -- a device whose reduction does not see the dropped lanes needs the active set computed in the module rather than taken from the device's implicit one (crates/metal2vulkan/src/lower/simd/group.rs with crates/metal2vulkan-air/src/canon/discard_sink.rs), and a device whose fragment simdgroup is smaller than Metal's is a different answer again. Open: on the orchestrator's todo list, handed to whoever takes the discard-hoist family.
|
||||
argb8-targets-destination-alpha * refused case/pipeline/argb8 Err(Error::Unsupported("unsupported: Unsupported { feature: Format, needs: NotImplemented, location: Some(RenderPipeline at Color(0)), symbol: None }")) Plain Metal on this M3 Max makes and runs a render pipeline whose ARGB8Unorm colour attachment blends with DestinationAlpha and OneMinusDestinationAlpha in the COLOUR factors, and stores every texel as the RGBA8Unorm leg's bytes rotated (recorded here over 3 runs, 8,192 texels, zero mismatches; Metal's own API validation let it run). The runtime refuses the pipeline Unsupported(Format, NotImplemented) at colour attachment 0, so the refusal is of something plain Metal does. The cause is structural rather than a policy: the runtime holds ARGB8Unorm in an R8G8B8A8_UNORM image of the rotated bytes, so the image's alpha channel carries Metal's BLUE and a colour factor that must read Metal's destination alpha would have to read the image's red. Vulkan has no such blend factor. The alpha-factor direction is already solved -- a second pipeline output of copies of Metal's source alpha (pipeline::rotated_blend) -- but that trick does not reach a DESTINATION channel, which only the framebuffer holds. The exact forms are a pass that keeps the rotated image's channels in Metal's order behind a swizzled view, or reading the destination in the fragment where the device offers programmable blending. Neither is built. Fix belongs in metal2vulkan's pipeline (rotated_blend) and the runtime's ARGB8Unorm image layout. On the orchestrator's todo list as runtime work.
|
||||
compute-descriptor-reset * divergent case/facts/max_total_threads_per_threadgroup Metal 96 (0x60), ours 0 (0x0) Metal's `MTLComputePipelineDescriptor.reset` is PARTIAL. Measured on this M3 Max (macOS 27.0.1, build 26A434), from `compute-descriptor-reset`'s own committed recording over three runs: the reset restores the label to nil, every `buffers[i].mutability` to `MTLMutabilityDefault`, `supportIndirectCommandBuffers` and `supportAddingBinaryFunctions` to false and `maxCallStackDepth` to 1, and leaves its three thread-shape properties exactly as the program set them -- `threadGroupSizeIsMultipleOfThreadExecutionWidth` true, `maxTotalThreadsPerThreadgroup` 96, `requiredThreadsPerThreadgroup` 8 by 6 by 2. The runtime has no descriptor object, so the coverage map's counterpart for `reset` is `ComputePipelineDescriptor::new` (crates/metal2vulkan/src/pipeline/descriptor.rs), a fresh value that resets all nine, and our side answers 0, 0 and false where Metal answers what was set. Nothing is announced for it, so by the standing rule it is a gap of ours. It is also very likely an Apple defect rather than a contract: in the same round `MTLTileRenderPipelineDescriptor.reset` restores the analogous `maxTotalThreadsPerThreadgroup`, `requiredThreadsPerThreadgroup` and `threadgroupSizeMatchesTileSize` correctly (`tile-descriptor-reset` is exact) and `MTLMeshRenderPipelineDescriptor.reset` restores every field it has (`mesh-descriptor-reset` is exact), so only the compute descriptor keeps anything. The fix is a choice between two forms and neither may be guessed at: a `ComputePipelineDescriptor::reset` that mirrors Metal's three kept fields, or an accepted difference in docs/API.md section 10 saying a reset compute descriptor keeps its thread shape on Metal and not here. Mirroring an Apple bug in a published crate's API is the owner's call, so this is on the orchestrator's todo list rather than fixed here. Not a device gap: no venue is involved -- the difference is Metal's recorded answer against a plain Rust struct, so the row is every venue's.
|
||||
compute-descriptor-reset * divergent case/facts/required_threads_per_threadgroup/depth Metal 2 (0x2), ours 0 (0x0) Metal's `MTLComputePipelineDescriptor.reset` is PARTIAL. Measured on this M3 Max (macOS 27.0.1, build 26A434), from `compute-descriptor-reset`'s own committed recording over three runs: the reset restores the label to nil, every `buffers[i].mutability` to `MTLMutabilityDefault`, `supportIndirectCommandBuffers` and `supportAddingBinaryFunctions` to false and `maxCallStackDepth` to 1, and leaves its three thread-shape properties exactly as the program set them -- `threadGroupSizeIsMultipleOfThreadExecutionWidth` true, `maxTotalThreadsPerThreadgroup` 96, `requiredThreadsPerThreadgroup` 8 by 6 by 2. The runtime has no descriptor object, so the coverage map's counterpart for `reset` is `ComputePipelineDescriptor::new` (crates/metal2vulkan/src/pipeline/descriptor.rs), a fresh value that resets all nine, and our side answers 0, 0 and false where Metal answers what was set. Nothing is announced for it, so by the standing rule it is a gap of ours. It is also very likely an Apple defect rather than a contract: in the same round `MTLTileRenderPipelineDescriptor.reset` restores the analogous `maxTotalThreadsPerThreadgroup`, `requiredThreadsPerThreadgroup` and `threadgroupSizeMatchesTileSize` correctly (`tile-descriptor-reset` is exact) and `MTLMeshRenderPipelineDescriptor.reset` restores every field it has (`mesh-descriptor-reset` is exact), so only the compute descriptor keeps anything. The fix is a choice between two forms and neither may be guessed at: a `ComputePipelineDescriptor::reset` that mirrors Metal's three kept fields, or an accepted difference in docs/API.md section 10 saying a reset compute descriptor keeps its thread shape on Metal and not here. Mirroring an Apple bug in a published crate's API is the owner's call, so this is on the orchestrator's todo list rather than fixed here. Not a device gap: no venue is involved -- the difference is Metal's recorded answer against a plain Rust struct, so the row is every venue's.
|
||||
compute-descriptor-reset * divergent case/facts/required_threads_per_threadgroup/height Metal 6 (0x6), ours 0 (0x0) Metal's `MTLComputePipelineDescriptor.reset` is PARTIAL. Measured on this M3 Max (macOS 27.0.1, build 26A434), from `compute-descriptor-reset`'s own committed recording over three runs: the reset restores the label to nil, every `buffers[i].mutability` to `MTLMutabilityDefault`, `supportIndirectCommandBuffers` and `supportAddingBinaryFunctions` to false and `maxCallStackDepth` to 1, and leaves its three thread-shape properties exactly as the program set them -- `threadGroupSizeIsMultipleOfThreadExecutionWidth` true, `maxTotalThreadsPerThreadgroup` 96, `requiredThreadsPerThreadgroup` 8 by 6 by 2. The runtime has no descriptor object, so the coverage map's counterpart for `reset` is `ComputePipelineDescriptor::new` (crates/metal2vulkan/src/pipeline/descriptor.rs), a fresh value that resets all nine, and our side answers 0, 0 and false where Metal answers what was set. Nothing is announced for it, so by the standing rule it is a gap of ours. It is also very likely an Apple defect rather than a contract: in the same round `MTLTileRenderPipelineDescriptor.reset` restores the analogous `maxTotalThreadsPerThreadgroup`, `requiredThreadsPerThreadgroup` and `threadgroupSizeMatchesTileSize` correctly (`tile-descriptor-reset` is exact) and `MTLMeshRenderPipelineDescriptor.reset` restores every field it has (`mesh-descriptor-reset` is exact), so only the compute descriptor keeps anything. The fix is a choice between two forms and neither may be guessed at: a `ComputePipelineDescriptor::reset` that mirrors Metal's three kept fields, or an accepted difference in docs/API.md section 10 saying a reset compute descriptor keeps its thread shape on Metal and not here. Mirroring an Apple bug in a published crate's API is the owner's call, so this is on the orchestrator's todo list rather than fixed here. Not a device gap: no venue is involved -- the difference is Metal's recorded answer against a plain Rust struct, so the row is every venue's.
|
||||
compute-descriptor-reset * divergent case/facts/required_threads_per_threadgroup/width Metal 8 (0x8), ours 0 (0x0) Metal's `MTLComputePipelineDescriptor.reset` is PARTIAL. Measured on this M3 Max (macOS 27.0.1, build 26A434), from `compute-descriptor-reset`'s own committed recording over three runs: the reset restores the label to nil, every `buffers[i].mutability` to `MTLMutabilityDefault`, `supportIndirectCommandBuffers` and `supportAddingBinaryFunctions` to false and `maxCallStackDepth` to 1, and leaves its three thread-shape properties exactly as the program set them -- `threadGroupSizeIsMultipleOfThreadExecutionWidth` true, `maxTotalThreadsPerThreadgroup` 96, `requiredThreadsPerThreadgroup` 8 by 6 by 2. The runtime has no descriptor object, so the coverage map's counterpart for `reset` is `ComputePipelineDescriptor::new` (crates/metal2vulkan/src/pipeline/descriptor.rs), a fresh value that resets all nine, and our side answers 0, 0 and false where Metal answers what was set. Nothing is announced for it, so by the standing rule it is a gap of ours. It is also very likely an Apple defect rather than a contract: in the same round `MTLTileRenderPipelineDescriptor.reset` restores the analogous `maxTotalThreadsPerThreadgroup`, `requiredThreadsPerThreadgroup` and `threadgroupSizeMatchesTileSize` correctly (`tile-descriptor-reset` is exact) and `MTLMeshRenderPipelineDescriptor.reset` restores every field it has (`mesh-descriptor-reset` is exact), so only the compute descriptor keeps anything. The fix is a choice between two forms and neither may be guessed at: a `ComputePipelineDescriptor::reset` that mirrors Metal's three kept fields, or an accepted difference in docs/API.md section 10 saying a reset compute descriptor keeps its thread shape on Metal and not here. Mirroring an Apple bug in a published crate's API is the owner's call, so this is on the orchestrator's todo list rather than fixed here. Not a device gap: no venue is involved -- the difference is Metal's recorded answer against a plain Rust struct, so the row is every venue's.
|
||||
compute-descriptor-reset * divergent case/facts/threadgroup_size_is_multiple_of_execution_width Metal true, ours false Metal's `MTLComputePipelineDescriptor.reset` is PARTIAL. Measured on this M3 Max (macOS 27.0.1, build 26A434), from `compute-descriptor-reset`'s own committed recording over three runs: the reset restores the label to nil, every `buffers[i].mutability` to `MTLMutabilityDefault`, `supportIndirectCommandBuffers` and `supportAddingBinaryFunctions` to false and `maxCallStackDepth` to 1, and leaves its three thread-shape properties exactly as the program set them -- `threadGroupSizeIsMultipleOfThreadExecutionWidth` true, `maxTotalThreadsPerThreadgroup` 96, `requiredThreadsPerThreadgroup` 8 by 6 by 2. The runtime has no descriptor object, so the coverage map's counterpart for `reset` is `ComputePipelineDescriptor::new` (crates/metal2vulkan/src/pipeline/descriptor.rs), a fresh value that resets all nine, and our side answers 0, 0 and false where Metal answers what was set. Nothing is announced for it, so by the standing rule it is a gap of ours. It is also very likely an Apple defect rather than a contract: in the same round `MTLTileRenderPipelineDescriptor.reset` restores the analogous `maxTotalThreadsPerThreadgroup`, `requiredThreadsPerThreadgroup` and `threadgroupSizeMatchesTileSize` correctly (`tile-descriptor-reset` is exact) and `MTLMeshRenderPipelineDescriptor.reset` restores every field it has (`mesh-descriptor-reset` is exact), so only the compute descriptor keeps anything. The fix is a choice between two forms and neither may be guessed at: a `ComputePipelineDescriptor::reset` that mirrors Metal's three kept fields, or an accepted difference in docs/API.md section 10 saying a reset compute descriptor keeps its thread shape on Metal and not here. Mirroring an Apple bug in a published crate's API is the owner's call, so this is on the orchestrator's todo list rather than fixed here. Not a device gap: no venue is involved -- the difference is Metal's recorded answer against a plain Rust struct, so the row is every venue's.
|
||||
binary-archive-mesh-adder * refused case/program Err({refused: Unavailable({call: "addMeshRenderPipelineFunctionsWithDescriptor"}), step: 1 (0x1)}) `BinaryArchive` has three of Metal's four pipeline adders: `addMeshRenderPipelineFunctionsWithDescriptor:error:` has no counterpart at all. Metal takes the call, takes it a second time with the same descriptor, and then serialises the archive to a file that exists and holds bytes (measured on this M3 Max, macOS 27.0.1, from this case's own committed recording over three runs, plain Metal and under its API validation, which let the case run). Ours cannot be asked: crates/metal2vulkan-runtime/src/binary_archive/mod.rs declares `add_compute_pipeline_functions` (:138), `add_render_pipeline_functions` (:161) and `add_tile_render_pipeline_functions` (:194) and no mesh form, and the module's own documentation lists the three as if they were all of them. The pieces for the fourth are already there: `metal2vulkan::pipeline::MeshPipelineDescriptor` exists and the runtime creates mesh states from it (crates/metal2vulkan-runtime/src/pipeline/render.rs:629), and the add's own shape is the render one -- create the state with `Some(&used)`, then keep what it used under the descriptor's archive keys -- so what is missing is the key function beside `metal_key::render` (crates/metal2vulkan-runtime/src/binary_archive/metal_key.rs:185) for an object-plus-mesh-plus-fragment triple, and the `check` arm that refuses a mesh creation on a miss (`binary_archive::check` is already called for the mesh path at crates/metal2vulkan-runtime/src/pipeline/render.rs:1579, where the comment says outright that no archive holds a mesh render pipeline). It is deliberately NOT done here: adding `BinaryArchive::add_mesh_render_pipeline_functions` adds an item to a published crate's public surface and a new archive key form to its container, which needs docs/REFUSALS.md regenerated and the `api_surface` table updated, and this stream took no evidence for either. Every venue's: the gap is in the runtime's own API, before any Vulkan call. Open: for whoever takes the runtime's archive surface.
|
||||
binary-archive-sources * divergent case/program/from-a-metallib/refused Metal false, ours true Metal accepts a **metallib** as a binary archive and we refuse it. Measured on this M3 Max (macOS 27.0.1) from this case's own committed recording over three runs: `newBinaryArchiveWithDescriptor:error:` with the descriptor's `url` set to a metallib of the case's own shader answers an archive, where the same call over a text file, an empty file, a missing path and a directory each answers `MTLBinaryArchiveDomain` code 1 (the four rows this case compares beside it, all four of which we match exactly). What Metal does with such an archive is not measured here -- whether it holds anything, or is simply an empty archive that happens to have read a container it recognises -- and that is the first thing the fix needs. Ours refuses at `container::read` (crates/metal2vulkan-runtime/src/binary_archive/container.rs:183), which reads the file whole and hands it to `decode`, whose first act is to check the suite-private magic `M2VBARCH` and a version word (container.rs:116, the magic at :37); a metallib starts `MTLB`, so `decode` answers `None` and the creation becomes `BinaryArchive(InvalidFile)` (container.rs:240). By the owner's standing rule that what Metal allows we must allow, the refusal is the bug. The fix is to decide what a non-archive container means and say so: either accept a file that parses as a metallib as an archive that holds no entry (which is what Metal's answer is consistent with, and which `Library::from_metallib` can already tell), or keep refusing and record an accepted difference in docs/API.md section 10. The first changes a published crate's documented refusal surface -- `Device::new_binary_archive`'s own doc comment states that a file that is missing or not an archive is `BinaryArchive(InvalidFile)` 'as Metal answers for a missing, empty, garbage or text file and for a directory', a list measured on an M3 Max and an M4 that is correct as far as it goes and simply never asked about a metallib -- so it is not this stream's call. Every venue's: the refusal is in the container reader, before any Vulkan call. Open: for whoever takes the runtime's archive surface.
|
||||
attribute-stride-buffer * divergent case/nine-strides 7 elements differ (U32), the largest difference 16 Metal's `MTLAttributeStrideStatic` on a `[[stage_in]]` layout of `MTLBufferLayoutStrideDynamic` is not "read at stride 0"; it fetches the element at the bind offset for the FIRST element and hands every element past it ZERO. Measured on this M3 Max (macOS 27.0.1) from these cases' own committed recordings: a dynamic layout over a buffer holding `0x10 + e` at element `e`, eight threads stepping by thread position in x at rate 1, bound with the constant, answered `0x110` and then `0x100` seven times (the fixture writes the attribute plus `0x100`), while a bind at stride 0 answered `0x110` eight times -- so the two are different answers and Metal's validation stops neither. The same shape at a bind offset of 8 answered `0x112` and then `0x100` seven times, which says the bind offset still reaches the first element. Ours answers the stride-0 reading: `attribute_stride` (crates/metal2vulkan-runtime/src/argument_table.rs:377) maps the constant to `None`, `None` removes the index's entry from `ArgumentTable::attribute_strides`, and every reader of that map takes a missing entry as 0 -- the binder's push constant `PushField::StageInStride` (crates/metal2vulkan/src/lower/stage_io/stage_in.rs:179, whose own module note at line 28 says "as 0 for a buffer bound without one") and the reach check (crates/metal2vulkan-runtime/src/fetch_reach.rs:112). So the fetch walks elements at stride 0 and every thread reads element 0, which is a silently wrong answer rather than a refusal. The runtime already knows the real behaviour for ONE of the four setters: `ComputeCommandEncoder::set_bytes_with_stride` (crates/metal2vulkan-runtime/src/compute.rs:607) documents "an M4 read element 0 of the bytes and zeros past it" and refuses that combination `NotImplemented(KernelStageIn)` rather than emulating it -- this oracle shows the buffer forms behave the same way, so the note on the buffer forms (argument_table.rs:377 and compute.rs:509, "one bound without a stride reads at stride 0") is what is wrong, not the inline-bytes one. The fix belongs in the fetch, not in the table: `PushField::StageInStride` needs to be able to say "the constant was bound" apart from "stride 0" -- a sentinel value or a flag beside it -- and the pulled read in crates/metal2vulkan/src/lower/stage_io/stage_in.rs must then select the element at the bind offset where the element index is 0 and a zero of the attribute's form otherwise, which is the same predicate the inline-bytes form would need and would let that refusal be dropped too. It is deliberately NOT done here: this stream's target is the conformance suite, the change is to a published crate's shader lowering and its push-constant ABI (so it moves `SEMANTICS_VERSION` and every stage-in recording), and it needs release-mode evidence this stream has not taken. Scoped to every venue because the gap is in the push constant and the fetch's own arithmetic, before any device behaviour -- measured on this M3 Max alone, so every other venue is expected and unaudited. Open: for whoever takes the runtime's stage-in fetch.
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -39,7 +39,11 @@
|
||||
//! # Exactness
|
||||
//!
|
||||
//! Every field is a number, a bool, a name or an ordinal. The family declares no tolerance and
|
||||
//! announces nothing: no case touches a texture, a sampler, a float or the GPU.
|
||||
//! announces nothing: no case touches a texture, a sampler, a float or the GPU. The one loosening
|
||||
//! is `compute-descriptor-reset`'s three thread-shape facts, which Metal's `reset` keeps on the M3
|
||||
//! Max where the runtime's fresh descriptor answers the defaults its header documents: each may be
|
||||
//! that default alone, under the accepted difference `docs/API.md` section 10 carries for it
|
||||
//! ([`RESET_IS_ACCEPTED`]).
|
||||
//!
|
||||
//! Four items are compared **at their default alone** — `binaryArchives`, the two spellings of the
|
||||
//! preloaded libraries and `linkedFunctions` — because the runtime takes each of them somewhere
|
||||
@@ -53,12 +57,13 @@
|
||||
//! each makes one library, one function of it, and a descriptor it reads and drops. The one setter
|
||||
//! of Metal's that can end a process here is `setLabel:` with nil, which no shape sends.
|
||||
|
||||
use crate::allowance::{Allowance, Justification, Loosening};
|
||||
use crate::case::{Abort, Case, Failure, Input, MetalSource, Side};
|
||||
use crate::compute_descriptors::DescriptorSpec;
|
||||
use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT};
|
||||
use crate::recording::ShaderRef;
|
||||
use crate::render_descriptors::Shape;
|
||||
use crate::transcript::{Digest, Node, Observed, Sites};
|
||||
use crate::transcript::{Digest, Node, Observed, Sites, Value};
|
||||
|
||||
/// The site the library's make sits at.
|
||||
const LIBRARY: &str = "library";
|
||||
@@ -71,6 +76,28 @@ const FACTS: &str = "facts";
|
||||
const FIXTURE: &str = "a27_ob1_threadgroup";
|
||||
const KERNEL: &str = "ob1_threadgroup";
|
||||
|
||||
/// The bold lead-in of the accepted difference in `docs/API.md` section 10 that a reset
|
||||
/// descriptor's thread shape rests on: the runtime's `reset` is a fresh descriptor, as
|
||||
/// `MTLComputePipeline.h` documents it, where Metal's on the M3 Max (macOS 27.0.1) keeps the three
|
||||
/// thread-shape properties the program set. The slug of these words must be an entry of the
|
||||
/// document or the case fails.
|
||||
pub const RESET_IS_ACCEPTED: &str = "A reset compute pipeline descriptor is a fresh one";
|
||||
|
||||
/// The thread-shape facts Metal's `reset` keeps, under [`FACTS`], with the default the runtime's
|
||||
/// fresh descriptor answers at each.
|
||||
fn kept_by_metals_reset() -> [(&'static str, Value); 5] {
|
||||
[
|
||||
(
|
||||
"threadgroup_size_is_multiple_of_execution_width",
|
||||
Value::Bool(false),
|
||||
),
|
||||
("max_total_threads_per_threadgroup", Value::Uint(0)),
|
||||
("required_threads_per_threadgroup/width", Value::Uint(0)),
|
||||
("required_threads_per_threadgroup/height", Value::Uint(0)),
|
||||
("required_threads_per_threadgroup/depth", Value::Uint(0)),
|
||||
]
|
||||
}
|
||||
|
||||
/// A case over one compute pipeline descriptor's own facts.
|
||||
pub struct ComputeDescriptorCase {
|
||||
name: &'static str,
|
||||
@@ -119,6 +146,23 @@ impl Case for ComputeDescriptorCase {
|
||||
MetalSource::Run
|
||||
}
|
||||
|
||||
fn allowances(&self) -> Vec<Allowance> {
|
||||
if !matches!(self.spec.shape, Shape::Reset) {
|
||||
return Vec::new();
|
||||
}
|
||||
let justified = Justification::accepted(crate::allowance::accepted_slug(RESET_IS_ACCEPTED));
|
||||
kept_by_metals_reset()
|
||||
.into_iter()
|
||||
.map(|(site, default)| {
|
||||
Allowance::new(
|
||||
format!("case/{FACTS}/{site}"),
|
||||
Loosening::AnyOf(vec![default]),
|
||||
justified.clone(),
|
||||
)
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn shaders(&self) -> Result<Vec<ShaderRef>, String> {
|
||||
let fixture = self.loaded();
|
||||
[RUNTIME_TEXT, METAL_TEXT]
|
||||
@@ -206,6 +250,55 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
/// The reset case alone loosens anything: each of the three thread-shape facts Metal's `reset`
|
||||
/// keeps, to the default the runtime's fresh descriptor answers there, under an entry
|
||||
/// `docs/API.md` section 10 holds; the defaults and the stated shapes compare exactly.
|
||||
#[test]
|
||||
fn only_the_reset_loosens_and_only_the_kept_thread_shape() {
|
||||
let entry = crate::allowance::accepted_slug(RESET_IS_ACCEPTED);
|
||||
assert!(
|
||||
crate::allowance::accepted_differences().contains(&entry),
|
||||
"docs/API.md section 10 holds no entry {entry}"
|
||||
);
|
||||
for case in all() {
|
||||
let allowances = case.allowances();
|
||||
if !matches!(case.spec.shape, Shape::Reset) {
|
||||
assert!(allowances.is_empty(), "{}", case.name());
|
||||
continue;
|
||||
}
|
||||
let paths: Vec<&str> = allowances.iter().map(|a| a.path.as_str()).collect();
|
||||
assert_eq!(
|
||||
paths,
|
||||
[
|
||||
"case/facts/threadgroup_size_is_multiple_of_execution_width",
|
||||
"case/facts/max_total_threads_per_threadgroup",
|
||||
"case/facts/required_threads_per_threadgroup/width",
|
||||
"case/facts/required_threads_per_threadgroup/height",
|
||||
"case/facts/required_threads_per_threadgroup/depth",
|
||||
]
|
||||
);
|
||||
for allowance in &allowances {
|
||||
assert_eq!(
|
||||
allowance.justified_by,
|
||||
Justification::AcceptedDifference(entry.clone()),
|
||||
"{}",
|
||||
allowance.path
|
||||
);
|
||||
// Metal's kept value is outside it, so the allowance takes the default alone.
|
||||
let Loosening::AnyOf(values) = &allowance.loosening else {
|
||||
panic!("{}: {:?}", allowance.path, allowance.loosening);
|
||||
};
|
||||
assert_eq!(values.len(), 1, "{}", allowance.path);
|
||||
assert!(
|
||||
!allowance.within(&values[0], &Value::Uint(96))
|
||||
&& !allowance.within(&values[0], &Value::Bool(true)),
|
||||
"{}",
|
||||
allowance.path
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Every buffer slot the stated table names is inside the bound the facts are read over, so a
|
||||
/// stated mutability always appears in the record.
|
||||
#[test]
|
||||
|
||||
@@ -4312,6 +4312,15 @@ each item named states the rule in full.
|
||||
tile state then answered 16 after a 4x4 one, and its 8x8 dispatch ran no thread. A compute
|
||||
state of the same `MTLFunction` answered 16 after a 4x4x1 state, with an 8x8x1 size and with
|
||||
none, where the runtime's answers 64 and the compiled limit.
|
||||
- **A reset compute pipeline descriptor is a fresh one**, every field at its default:
|
||||
`ComputePipelineDescriptor::new` stands for `reset`, as `MTLComputePipeline.h` documents it
|
||||
("Restore all compute pipeline descriptor properties to their default values", and of
|
||||
`maxTotalThreadsPerThreadgroup`, "If it is not set, returns zero"). Metal's `reset` on the M3
|
||||
Max (macOS 27.0.1) restores every other field and keeps three as the program set them:
|
||||
`threadGroupSizeIsMultipleOfThreadExecutionWidth`, `maxTotalThreadsPerThreadgroup` and
|
||||
`requiredThreadsPerThreadgroup` (true, 96 and 8 by 6 by 2 in `compute-descriptor-reset`, where
|
||||
the runtime answers false, 0 and 0 by 0 by 0). The tile and mesh render pipeline descriptors'
|
||||
resets restore every field on the same machine.
|
||||
|
||||
**Mesh render pipelines**
|
||||
|
||||
|
||||
@@ -38,13 +38,13 @@ Its limits, measured rather than asserted:
|
||||
| of the reachable, exercised by the suite's Metal leg | 811 |
|
||||
| of the reachable, not exercised | 163 |
|
||||
| share of the reachable exercised | 83% |
|
||||
| of those exercised, no case reaching it loosens anything | 591 |
|
||||
| of those exercised, a case reaching it loosens some site | 220 |
|
||||
| of those exercised, no case reaching it loosens anything | 570 |
|
||||
| of those exercised, a case reaching it loosens some site | 241 |
|
||||
| case modules | 158 |
|
||||
| committed recordings | 1228 |
|
||||
| distinct SDK items the Metal leg reaches, of any status | 819 |
|
||||
| of those, reached only where this cannot name the family | 3 |
|
||||
| ledger rows (a case whose gap is recorded) | 2626 |
|
||||
| ledger rows (a case whose gap is recorded) | 2621 |
|
||||
| declared crossings of the option space (pairs put to Metal at once) | 26 |
|
||||
| declared crossings that are no pair of it (a boolean or numeric field, or one type in two slots) | 30 |
|
||||
|
||||
@@ -535,8 +535,8 @@ An implemented container no case's Metal leg touches. These are the families of
|
||||
| cases whose Metal answer is `metal_run` | 1144 |
|
||||
| cases whose Metal answer is `carried` | 80 |
|
||||
| cases whose Metal answer is `never_returned` | 4 |
|
||||
| modules that loosen a measured value | 10 |
|
||||
| tolerances in all | 10 |
|
||||
| modules that loosen a measured value | 11 |
|
||||
| tolerances in all | 11 |
|
||||
| modules declaring a notice (loosening no value) | 124 |
|
||||
| loosenings used | `Unchecked`, `Absolute`, `AnyOf`, `Nonzero` |
|
||||
| justifications named | `Degradation`, `AcceptedDifference`, `WithoutCompression` |
|
||||
@@ -583,7 +583,7 @@ Each case module: the cases it holds, the `Side` methods it calls, and how many
|
||||
| `compressed_views` | 14 | 14 | every field | 48 |
|
||||
| `compute_encoder_commands` | 8 | 8 | every field | 65 |
|
||||
| `compute_heap_residency` | 1 | 1 | every field | 58 |
|
||||
| `compute_pipeline_descriptors` | 3 | 3 | every field | 24 |
|
||||
| `compute_pipeline_descriptors` | 3 | 3 | 1 tolerance(s): `AcceptedDifference` | 24 |
|
||||
| `compute_render_chains` | 3 | 3 | every field | 150 |
|
||||
| `compute_threadgroups` | 2 | 1 | every field | 28 |
|
||||
| `denormal_word_fetches` | 1 | 1 | every field | 43 |
|
||||
@@ -2237,11 +2237,6 @@ A case whose difference from Metal is recorded rather than compared away. The le
|
||||
| `discard-quad-sum-placement` | Metal counts the quads the discard drops whole in a simdgroup sum that sits ahead of the discard for a measured reason -- the discard's condition reads the sum … |
|
||||
| `discard-quad-sum-placement` | Metal counts the quads the discard drops whole in a simdgroup sum that sits ahead of the discard for a measured reason -- the discard's condition reads the sum … |
|
||||
| `argb8-targets-destination-alpha` | Plain Metal on this M3 Max makes and runs a render pipeline whose ARGB8Unorm colour attachment blends with DestinationAlpha and OneMinusDestinationAlpha in the … |
|
||||
| `compute-descriptor-reset` | Metal's `MTLComputePipelineDescriptor.reset` is PARTIAL. Measured on this M3 Max (macOS 27.0.1, build 26A434), from `compute-descriptor-reset`'s own committed r… |
|
||||
| `compute-descriptor-reset` | Metal's `MTLComputePipelineDescriptor.reset` is PARTIAL. Measured on this M3 Max (macOS 27.0.1, build 26A434), from `compute-descriptor-reset`'s own committed r… |
|
||||
| `compute-descriptor-reset` | Metal's `MTLComputePipelineDescriptor.reset` is PARTIAL. Measured on this M3 Max (macOS 27.0.1, build 26A434), from `compute-descriptor-reset`'s own committed r… |
|
||||
| `compute-descriptor-reset` | Metal's `MTLComputePipelineDescriptor.reset` is PARTIAL. Measured on this M3 Max (macOS 27.0.1, build 26A434), from `compute-descriptor-reset`'s own committed r… |
|
||||
| `compute-descriptor-reset` | Metal's `MTLComputePipelineDescriptor.reset` is PARTIAL. Measured on this M3 Max (macOS 27.0.1, build 26A434), from `compute-descriptor-reset`'s own committed r… |
|
||||
| `binary-archive-mesh-adder` | `BinaryArchive` has three of Metal's four pipeline adders: `addMeshRenderPipelineFunctionsWithDescriptor:error:` has no counterpart at all. Metal takes the call… |
|
||||
| `binary-archive-sources` | Metal accepts a **metallib** as a binary archive and we refuse it. Measured on this M3 Max (macOS 27.0.1) from this case's own committed recording over three ru… |
|
||||
| `attribute-stride-buffer` | Metal's `MTLAttributeStrideStatic` on a `[[stage_in]]` layout of `MTLBufferLayoutStrideDynamic` is not "read at stride 0"; it fetches the element at the bind of… |
|
||||
|
||||
Reference in new issue
Block a user