Reach the resource state encoder and a command buffer's own facts

The steps this packet landed as, in order:
- Record the sparse mapping sweep and the command buffer's facts on this M3
- Reflow what the rebase resolution left unformatted

Content: the tree of `development` at 9ae4ffce16, unchanged.
This commit is contained in:
Anees Iqbal committed 2026-10-26 13:19:12 +02:00
1 parent acea7ad20b
commit f0d21dd4e7
23 files changed
+6772 -124

No files matched your search

@@ -106,3 +106,4 @@ resource-labels Apple M3 Max divergent case/view-of-a-device-texture/parent/2-0/
resource-own-getters Apple M3 Max divergent case/device-texture-private/fresh/resource_options Metal 544 (0x220), ours 32 (0x20) `Texture::resource_options` does not carry the hazard tracking mode it resolved. Metal never reports `MTLHazardTrackingModeDefault` from a resource: it resolves the descriptor's `Default` and reports the result, which for a texture made outside a heap is `Tracked` -- so its `resourceOptions` holds 0x200 beside the storage field (0x200 shared, 0x220 private, measured on this M3 Max under Metal 27.0.1). The runtime resolves it too, and correctly: `Texture::hazard_tracking_mode` answers `Tracked` here and agrees with Metal at every site of these cases, because it reads `Identity::new(mode, in_heap)`'s already-resolved flag (crates/metal2vulkan-runtime/src/resource.rs:57). What it does NOT do is put that resolved field back into the option word: `Texture::resource_options` (crates/metal2vulkan-runtime/src/texture.rs:4759) hands back the descriptor's options as asked for, so the hazard field stays 0. `Buffer::resource_options` (crates/metal2vulkan-runtime/src/buffer.rs:3355), `Heap::resource_options` (crates/metal2vulkan-runtime/src/heap.rs:842) and `IndirectCommandBuffer::resource_options` (crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:3111) each document and do the resolution, and each agrees with Metal in these same cases -- a heap's answers are exact at every site of `heap-own-getters`, including an `Untracked` resolved from `Default` -- so the texture is the one resource of the four that does not. The fix is to report the resolved field: give `ResourceOptions` a `with_hazard_tracking_mode` beside its own shifts (crates/metal2vulkan-runtime/src/values.rs:120, which is where the bit positions live and the only place they should be written) and have `Texture::resource_options` apply `self.hazard_tracking_mode()` through it, keeping `PRIVATE_BIT`. It is deliberately NOT done in this change: `Texture::resource_options` is read inside the runtime as well as by a consumer (crates/metal2vulkan-runtime/src/buffer_texture.rs:1075 reads a tracked flag off an option word), so moving it is a behaviour change in a published crate and needs its own evidence, which this stream has not taken. The three mode getters are each read through their own getter on both sides for exactly this reason, so this row is the option word alone and not the mode. Scoped to this venue because that is where it was measured; the answer is the runtime's own record and so is expected to be every venue's, which is unaudited. Open: on the orchestrator's todo list, for whoever takes the runtime's resource surface.
resource-own-getters Apple M3 Max divergent case/device-texture-shared/fresh/resource_options Metal 512 (0x200), ours 0 (0x0) `Texture::resource_options` does not carry the hazard tracking mode it resolved. Metal never reports `MTLHazardTrackingModeDefault` from a resource: it resolves the descriptor's `Default` and reports the result, which for a texture made outside a heap is `Tracked` -- so its `resourceOptions` holds 0x200 beside the storage field (0x200 shared, 0x220 private, measured on this M3 Max under Metal 27.0.1). The runtime resolves it too, and correctly: `Texture::hazard_tracking_mode` answers `Tracked` here and agrees with Metal at every site of these cases, because it reads `Identity::new(mode, in_heap)`'s already-resolved flag (crates/metal2vulkan-runtime/src/resource.rs:57). What it does NOT do is put that resolved field back into the option word: `Texture::resource_options` (crates/metal2vulkan-runtime/src/texture.rs:4759) hands back the descriptor's options as asked for, so the hazard field stays 0. `Buffer::resource_options` (crates/metal2vulkan-runtime/src/buffer.rs:3355), `Heap::resource_options` (crates/metal2vulkan-runtime/src/heap.rs:842) and `IndirectCommandBuffer::resource_options` (crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:3111) each document and do the resolution, and each agrees with Metal in these same cases -- a heap's answers are exact at every site of `heap-own-getters`, including an `Untracked` resolved from `Default` -- so the texture is the one resource of the four that does not. The fix is to report the resolved field: give `ResourceOptions` a `with_hazard_tracking_mode` beside its own shifts (crates/metal2vulkan-runtime/src/values.rs:120, which is where the bit positions live and the only place they should be written) and have `Texture::resource_options` apply `self.hazard_tracking_mode()` through it, keeping `PRIVATE_BIT`. It is deliberately NOT done in this change: `Texture::resource_options` is read inside the runtime as well as by a consumer (crates/metal2vulkan-runtime/src/buffer_texture.rs:1075 reads a tracked flag off an option word), so moving it is a behaviour change in a published crate and needs its own evidence, which this stream has not taken. The three mode getters are each read through their own getter on both sides for exactly this reason, so this row is the option word alone and not the mode. Scoped to this venue because that is where it was measured; the answer is the runtime's own record and so is expected to be every venue's, which is unaudited. Open: on the orchestrator's todo list, for whoever takes the runtime's resource surface.
resource-own-getters Apple M3 Max divergent case/view-of-a-device-texture/fresh/resource_options Metal 512 (0x200), ours 0 (0x0) `Texture::resource_options` does not carry the hazard tracking mode it resolved. Metal never reports `MTLHazardTrackingModeDefault` from a resource: it resolves the descriptor's `Default` and reports the result, which for a texture made outside a heap is `Tracked` -- so its `resourceOptions` holds 0x200 beside the storage field (0x200 shared, 0x220 private, measured on this M3 Max under Metal 27.0.1). The runtime resolves it too, and correctly: `Texture::hazard_tracking_mode` answers `Tracked` here and agrees with Metal at every site of these cases, because it reads `Identity::new(mode, in_heap)`'s already-resolved flag (crates/metal2vulkan-runtime/src/resource.rs:57). What it does NOT do is put that resolved field back into the option word: `Texture::resource_options` (crates/metal2vulkan-runtime/src/texture.rs:4759) hands back the descriptor's options as asked for, so the hazard field stays 0. `Buffer::resource_options` (crates/metal2vulkan-runtime/src/buffer.rs:3355), `Heap::resource_options` (crates/metal2vulkan-runtime/src/heap.rs:842) and `IndirectCommandBuffer::resource_options` (crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:3111) each document and do the resolution, and each agrees with Metal in these same cases -- a heap's answers are exact at every site of `heap-own-getters`, including an `Untracked` resolved from `Default` -- so the texture is the one resource of the four that does not. The fix is to report the resolved field: give `ResourceOptions` a `with_hazard_tracking_mode` beside its own shifts (crates/metal2vulkan-runtime/src/values.rs:120, which is where the bit positions live and the only place they should be written) and have `Texture::resource_options` apply `self.hazard_tracking_mode()` through it, keeping `PRIVATE_BIT`. It is deliberately NOT done in this change: `Texture::resource_options` is read inside the runtime as well as by a consumer (crates/metal2vulkan-runtime/src/buffer_texture.rs:1075 reads a tracked flag off an option word), so moving it is a behaviour change in a published crate and needs its own evidence, which this stream has not taken. The three mode getters are each read through their own getter on both sides for exactly this reason, so this row is the option word alone and not the mode. Scoped to this venue because that is where it was measured; the answer is the runtime's own record and so is expected to be every venue's, which is unaudited. Open: on the orchestrator's todo list, for whoever takes the runtime's resource surface.
sparse-mapping-a-level-past-the-textures * refused case/program/step/0/updateTextureMapping Err(Error::Invalid("invalid use of update_texture_mappings: Sparse(Level { level: 9, levels: 9 })")) The runtime refuses a direct mapping update of a mip level past the texture's own levels, where plain Metal takes the call and maps nothing. Measured on this M3 Max (macOS 27.0.1) from this case's own committed recording over three runs: `updateTextureMapping:mode:region:mipLevel:slice:` of level 9 of a nine-level 256x256 R32Float sparse texture answers, the command buffer completes, and the sparse heap's `usedSize` is 0 before and 0 after -- Metal mapped nothing and refused nothing. Ours answers Invalid(Sparse(Level)) at crates/metal2vulkan-runtime/src/sparse/mapping.rs:500, in `UnitGrid::checked_region`, whose own doc says the refusal is there because Metal's VALIDATION stops it; the suite's second oracle confirms that half -- Metal's API validation layer prints `mipLevel(9) must be <= [texture firstMipmapInTail](3)` -- so the two oracles disagree and the runtime follows the stricter one. It also disagrees with ITSELF: `UnitGrid::clipped_region` (mapping.rs:467), which the indirect selector uses, returns no units for exactly this input and so matches plain Metal, and `update_texture_mapping_indirect`'s doc says so outright. By the owner's standing rule that what Metal allows we must allow, the direct path is the one that is wrong. The fix is one of two forms and neither may be guessed at: make `checked_region` clip a level or slice past the texture's as `clipped_region` does and map nothing, which makes the direct and indirect paths one behaviour and follows plain Metal; or keep the refusal and record an accepted difference in docs/API.md section 10 saying the runtime follows Metal's validation here. The first changes a published crate's documented refusal surface and the runtime's own tests assert the refusal, so it is the owner's call rather than this packet's. The same question stands for `SparseProblem::Slice` (mapping.rs:505) and `SparseProblem::Region` (mapping.rs:520), which no case covers yet. Not a device gap: no venue is involved -- the refusal is in the encoder, before any Vulkan call -- so the row is every venue's.
Can't render this file because it contains an unexpected character in line 67 and column 130.
@@ -0,0 +1,261 @@
{
"format": 1,
"case": "command-buffer-facts",
"suite_version": 1,
"answers": [
{
"key": {
"chip": "apple-m3-max",
"os_version": "27.0.1",
"os_build": "26A434",
"metal_level": "27.0.1"
},
"provenance": "metal_run",
"device": "Apple M3 Max",
"runs": 5,
"outcomes": [
{
"runs": 5,
"transcript": {
"root": {
"name": "case",
"observed": {
"value": "absent"
},
"children": [
{
"name": "inputs",
"observed": {
"value": "absent"
},
"children": [
{
"name": "timed-bytes-and-queue-labels",
"observed": {
"value": "absent",
"digest": {
"kind": "sha256",
"hex": "6fa881c9d51a93c1ef139e32e518d4c0c82fee8140d0c9d4372f0f678d4d3c6e"
}
}
}
]
},
{
"name": "command-buffer",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "facts",
"observed": {
"value": "absent"
},
"children": [
{
"name": "device-is-the-queues",
"observed": {
"value": {
"bool": true
}
}
},
{
"name": "queue-label-is-its-own/0",
"observed": {
"value": {
"bool": true
}
}
},
{
"name": "queue-label-is-its-own/1",
"observed": {
"value": {
"bool": true
}
}
},
{
"name": "zero-before-commit/kernelStartTime",
"observed": {
"value": {
"bool": true
}
}
},
{
"name": "positive-after-completion/kernelStartTime",
"observed": {
"value": {
"bool": true
}
}
},
{
"name": "zero-before-commit/kernelEndTime",
"observed": {
"value": {
"bool": true
}
}
},
{
"name": "positive-after-completion/kernelEndTime",
"observed": {
"value": {
"bool": true
}
}
},
{
"name": "kernel-interval-is-ordered",
"observed": {
"value": {
"bool": true
}
}
},
{
"name": "gpu-times",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "zero-before-commit/GPUStartTime",
"observed": {
"value": {
"bool": true
}
}
},
{
"name": "positive-after-completion/GPUStartTime",
"observed": {
"value": {
"bool": true
}
}
},
{
"name": "zero-before-commit/GPUEndTime",
"observed": {
"value": {
"bool": true
}
}
},
{
"name": "positive-after-completion/GPUEndTime",
"observed": {
"value": {
"bool": true
}
}
},
{
"name": "gpu-interval-is-ordered",
"observed": {
"value": {
"bool": true
}
}
},
{
"name": "gpu-starts-no-earlier-than-the-kernel",
"observed": {
"value": {
"bool": true
}
}
},
{
"name": "gpu-ends-no-earlier-than-the-kernel",
"observed": {
"value": {
"bool": true
}
}
},
{
"name": "resource-state-encoder-opened",
"observed": {
"value": {
"bool": true
}
}
},
{
"name": "status",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "state-encoder-status",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
}
]
},
{
"name": "notices",
"observed": {
"value": "absent"
},
"children": [
{
"name": "set",
"observed": {
"value": {
"nothing": "announced_nothing"
}
}
},
{
"name": "counts",
"observed": {
"value": {
"fields": {}
}
}
}
]
}
]
}
}
}
],
"validated": {
"stopped": {
"call": "command_buffer_facts",
"message": "Ending encoding with no commands encoded."
}
}
}
]
}
@@ -0,0 +1,165 @@
{
"format": 1,
"case": "sparse-mapping-a-level-past-the-textures",
"suite_version": 1,
"answers": [
{
"key": {
"chip": "apple-m3-max",
"os_version": "27.0.1",
"os_build": "26A434",
"metal_level": "27.0.1"
},
"provenance": "metal_run",
"device": "Apple M3 Max",
"runs": 3,
"outcomes": [
{
"runs": 3,
"transcript": {
"root": {
"name": "case",
"observed": {
"value": "absent"
},
"children": [
{
"name": "inputs",
"observed": {
"value": "absent"
},
"children": [
{
"name": "program",
"observed": {
"value": "absent",
"digest": {
"kind": "sha256",
"hex": "8c799409c633113f9c6f9d677c0334b3f082d1bc3a570f47cf9a22b499e71074"
}
}
}
]
},
{
"name": "sparse-mapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "program",
"observed": {
"value": "absent"
},
"children": [
{
"name": "used-size/0",
"observed": {
"value": {
"uint": 0
}
}
},
{
"name": "used-size/1",
"observed": {
"value": {
"uint": 0
}
}
},
{
"name": "tail/0/first-mipmap",
"observed": {
"value": {
"uint": 3
}
}
},
{
"name": "tail/0/bytes",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "status/0",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "step/0/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/1/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
}
]
},
{
"name": "notices",
"observed": {
"value": "absent"
},
"children": [
{
"name": "set",
"observed": {
"value": {
"nothing": "announced_nothing"
}
}
},
{
"name": "counts",
"observed": {
"value": {
"fields": {}
}
}
}
]
}
]
}
}
}
],
"validated": {
"stopped": {
"call": "sparse_mapping",
"message": "mipLevel(9) must be <= [texture firstMipmapInTail](3)\nmipLevel(9) must be lower or equal to min(mipmapLevelCount-1,firstMipmapInTail)(3)"
}
}
}
]
}
@@ -0,0 +1,204 @@
{
"format": 1,
"case": "sparse-mapping-fences",
"suite_version": 1,
"answers": [
{
"key": {
"chip": "apple-m3-max",
"os_version": "27.0.1",
"os_build": "26A434",
"metal_level": "27.0.1"
},
"provenance": "metal_run",
"device": "Apple M3 Max",
"runs": 3,
"outcomes": [
{
"runs": 3,
"transcript": {
"root": {
"name": "case",
"observed": {
"value": "absent"
},
"children": [
{
"name": "inputs",
"observed": {
"value": "absent"
},
"children": [
{
"name": "program",
"observed": {
"value": "absent",
"digest": {
"kind": "sha256",
"hex": "74b1e3af5ed8fac6ae583a2096e27c7d66f9e56911efa80b36256db225cae8c6"
}
}
}
]
},
{
"name": "sparse-mapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "program",
"observed": {
"value": "absent"
},
"children": [
{
"name": "used-size/0",
"observed": {
"value": {
"uint": 0
}
}
},
{
"name": "used-size/1",
"observed": {
"value": {
"uint": 327680
}
}
},
{
"name": "tail/0/first-mipmap",
"observed": {
"value": {
"uint": 3
}
}
},
{
"name": "tail/0/bytes",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "status/0",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "step/0/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/1/updateFence",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/2/endEncoding",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/3/waitForFence",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/4/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/5/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
}
]
},
{
"name": "notices",
"observed": {
"value": "absent"
},
"children": [
{
"name": "set",
"observed": {
"value": {
"nothing": "announced_nothing"
}
}
},
{
"name": "counts",
"observed": {
"value": {
"fields": {}
}
}
}
]
}
]
}
}
}
],
"validated": "ran"
}
]
}
@@ -0,0 +1,283 @@
{
"format": 1,
"case": "sparse-mapping-indirect-updates",
"suite_version": 1,
"answers": [
{
"key": {
"chip": "apple-m3-max",
"os_version": "27.0.1",
"os_build": "26A434",
"metal_level": "27.0.1"
},
"provenance": "metal_run",
"device": "Apple M3 Max",
"runs": 3,
"outcomes": [
{
"runs": 3,
"transcript": {
"root": {
"name": "case",
"observed": {
"value": "absent"
},
"children": [
{
"name": "inputs",
"observed": {
"value": "absent"
},
"children": [
{
"name": "program",
"observed": {
"value": "absent",
"digest": {
"kind": "sha256",
"hex": "ea83c2a0a9a27030bfc2e96bb75505f86e1d15944008b2e8f78449621209e2c0"
}
}
}
]
},
{
"name": "sparse-mapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "program",
"observed": {
"value": "absent"
},
"children": [
{
"name": "used-size/0",
"observed": {
"value": {
"uint": 0
}
}
},
{
"name": "used-size/1",
"observed": {
"value": {
"uint": 0
}
}
},
{
"name": "used-size/2",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "used-size/3",
"observed": {
"value": {
"uint": 98304
}
}
},
{
"name": "used-size/4",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "tail/0/first-mipmap",
"observed": {
"value": {
"uint": 3
}
}
},
{
"name": "tail/0/bytes",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "status/0",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/1",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/2",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/3",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "step/0/updateTextureMappingIndirect",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/1/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/2/updateTextureMappingIndirect",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/3/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/4/updateTextureMappingIndirect",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/5/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/6/updateTextureMappingIndirect",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/7/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
}
]
},
{
"name": "notices",
"observed": {
"value": "absent"
},
"children": [
{
"name": "set",
"observed": {
"value": {
"nothing": "announced_nothing"
}
}
},
{
"name": "counts",
"observed": {
"value": {
"fields": {}
}
}
}
]
}
]
}
}
}
],
"validated": "ran"
}
]
}
@@ -0,0 +1,447 @@
{
"format": 1,
"case": "sparse-mapping-levels-and-the-tail",
"suite_version": 1,
"answers": [
{
"key": {
"chip": "apple-m3-max",
"os_version": "27.0.1",
"os_build": "26A434",
"metal_level": "27.0.1"
},
"provenance": "metal_run",
"device": "Apple M3 Max",
"runs": 3,
"outcomes": [
{
"runs": 3,
"transcript": {
"root": {
"name": "case",
"observed": {
"value": "absent"
},
"children": [
{
"name": "inputs",
"observed": {
"value": "absent"
},
"children": [
{
"name": "program",
"observed": {
"value": "absent",
"digest": {
"kind": "sha256",
"hex": "35e3ba2a54be845b93086ebf12c3c7cbe01ccce906ec1e5dac1f5659c26f1f82"
}
}
}
]
},
{
"name": "sparse-mapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "program",
"observed": {
"value": "absent"
},
"children": [
{
"name": "used-size/0",
"observed": {
"value": {
"uint": 0
}
}
},
{
"name": "used-size/1",
"observed": {
"value": {
"uint": 262144
}
}
},
{
"name": "used-size/2",
"observed": {
"value": {
"uint": 327680
}
}
},
{
"name": "used-size/3",
"observed": {
"value": {
"uint": 344064
}
}
},
{
"name": "used-size/4",
"observed": {
"value": {
"uint": 360448
}
}
},
{
"name": "used-size/5",
"observed": {
"value": {
"uint": 98304
}
}
},
{
"name": "used-size/6",
"observed": {
"value": {
"uint": 32768
}
}
},
{
"name": "used-size/7",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "used-size/8",
"observed": {
"value": {
"uint": 0
}
}
},
{
"name": "tail/0/first-mipmap",
"observed": {
"value": {
"uint": 3
}
}
},
{
"name": "tail/0/bytes",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "status/0",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/1",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/2",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/3",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/4",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/5",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/6",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/7",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "step/0/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/1/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/2/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/3/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/4/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/5/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/6/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/7/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/8/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/9/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/10/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/11/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/12/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/13/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/14/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/15/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
}
]
},
{
"name": "notices",
"observed": {
"value": "absent"
},
"children": [
{
"name": "set",
"observed": {
"value": {
"nothing": "announced_nothing"
}
}
},
{
"name": "counts",
"observed": {
"value": {
"fields": {}
}
}
}
]
}
]
}
}
}
],
"validated": "ran"
}
]
}
@@ -0,0 +1,208 @@
{
"format": 1,
"case": "sparse-mapping-mapped-tiles-hold-their-texels",
"suite_version": 1,
"answers": [
{
"key": {
"chip": "apple-m3-max",
"os_version": "27.0.1",
"os_build": "26A434",
"metal_level": "27.0.1"
},
"provenance": "metal_run",
"device": "Apple M3 Max",
"runs": 3,
"outcomes": [
{
"runs": 3,
"transcript": {
"root": {
"name": "case",
"observed": {
"value": "absent"
},
"children": [
{
"name": "inputs",
"observed": {
"value": "absent"
},
"children": [
{
"name": "program",
"observed": {
"value": "absent",
"digest": {
"kind": "sha256",
"hex": "323ba9076b05d680459cd093ba7b954a5323be3b0b7164d8b86fd00b9e97976d"
}
}
}
]
},
{
"name": "sparse-mapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "program",
"observed": {
"value": "absent"
},
"children": [
{
"name": "used-size/0",
"observed": {
"value": {
"uint": 0
}
}
},
{
"name": "used-size/1",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "tail/0/first-mipmap",
"observed": {
"value": {
"uint": 3
}
}
},
{
"name": "tail/0/bytes",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "status/0",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "step/0/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/1/copyFromBufferToTexture",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/2/copyFromTextureToBuffer",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/3/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
}
]
},
{
"name": "read/0",
"observed": {
"value": {
"bytes": "w8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PLine truncated
},
"shape": {
"bytes": {
"region": {
"buffer": {
"offset": 0,
"length": 16384
}
},
"element": "u32",
"row_offset": 0,
"row_elements": 4096,
"row_pitch": 16384,
"rows": 1,
"image_pitch": 16384,
"images": 1,
"gaps": "ignored"
}
}
}
},
{
"name": "notices",
"observed": {
"value": "absent"
},
"children": [
{
"name": "set",
"observed": {
"value": {
"nothing": "announced_nothing"
}
}
},
{
"name": "counts",
"observed": {
"value": {
"fields": {}
}
}
}
]
}
]
}
}
}
],
"validated": "ran"
}
]
}
@@ -0,0 +1,529 @@
{
"format": 1,
"case": "sparse-mapping-modes-and-region-sizes",
"suite_version": 1,
"answers": [
{
"key": {
"chip": "apple-m3-max",
"os_version": "27.0.1",
"os_build": "26A434",
"metal_level": "27.0.1"
},
"provenance": "metal_run",
"device": "Apple M3 Max",
"runs": 3,
"outcomes": [
{
"runs": 3,
"transcript": {
"root": {
"name": "case",
"observed": {
"value": "absent"
},
"children": [
{
"name": "inputs",
"observed": {
"value": "absent"
},
"children": [
{
"name": "program",
"observed": {
"value": "absent",
"digest": {
"kind": "sha256",
"hex": "86305391ae3c1737a3eb7824f8d9d85d68b601fa8536fb6e4fbde119110cfb98"
}
}
}
]
},
{
"name": "sparse-mapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "program",
"observed": {
"value": "absent"
},
"children": [
{
"name": "used-size/0",
"observed": {
"value": {
"uint": 0
}
}
},
{
"name": "used-size/1",
"observed": {
"value": {
"uint": 0
}
}
},
{
"name": "used-size/2",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "used-size/3",
"observed": {
"value": {
"uint": 65536
}
}
},
{
"name": "used-size/4",
"observed": {
"value": {
"uint": 262144
}
}
},
{
"name": "used-size/5",
"observed": {
"value": {
"uint": 262144
}
}
},
{
"name": "used-size/6",
"observed": {
"value": {
"uint": 262144
}
}
},
{
"name": "used-size/7",
"observed": {
"value": {
"uint": 245760
}
}
},
{
"name": "used-size/8",
"observed": {
"value": {
"uint": 196608
}
}
},
{
"name": "used-size/9",
"observed": {
"value": {
"uint": 0
}
}
},
{
"name": "used-size/10",
"observed": {
"value": {
"uint": 0
}
}
},
{
"name": "tail/0/first-mipmap",
"observed": {
"value": {
"uint": 3
}
}
},
{
"name": "tail/0/bytes",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "status/0",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/1",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/2",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/3",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/4",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/5",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/6",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/7",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/8",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/9",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "step/0/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/1/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/2/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/3/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/4/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/5/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/6/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/7/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/8/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/9/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/10/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/11/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/12/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/13/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/14/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/15/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/16/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/17/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/18/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/19/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
}
]
},
{
"name": "notices",
"observed": {
"value": "absent"
},
"children": [
{
"name": "set",
"observed": {
"value": {
"nothing": "announced_nothing"
}
}
},
{
"name": "counts",
"observed": {
"value": {
"fields": {}
}
}
}
]
}
]
}
}
}
],
"validated": "ran"
}
]
}
@@ -0,0 +1,381 @@
{
"format": 1,
"case": "sparse-mapping-moves",
"suite_version": 1,
"answers": [
{
"key": {
"chip": "apple-m3-max",
"os_version": "27.0.1",
"os_build": "26A434",
"metal_level": "27.0.1"
},
"provenance": "metal_run",
"device": "Apple M3 Max",
"runs": 3,
"outcomes": [
{
"runs": 3,
"transcript": {
"root": {
"name": "case",
"observed": {
"value": "absent"
},
"children": [
{
"name": "inputs",
"observed": {
"value": "absent"
},
"children": [
{
"name": "program",
"observed": {
"value": "absent",
"digest": {
"kind": "sha256",
"hex": "bb6b59f39cfe0e4b1bef0e8787a8928a6179a01f0ab9c64b02db05ead067f049"
}
}
}
]
},
{
"name": "sparse-mapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "program",
"observed": {
"value": "absent"
},
"children": [
{
"name": "used-size/0",
"observed": {
"value": {
"uint": 0
}
}
},
{
"name": "used-size/1",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "used-size/2",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "used-size/3",
"observed": {
"value": {
"uint": 32768
}
}
},
{
"name": "used-size/4",
"observed": {
"value": {
"uint": 32768
}
}
},
{
"name": "used-size/5",
"observed": {
"value": {
"uint": 32768
}
}
},
{
"name": "used-size/6",
"observed": {
"value": {
"uint": 32768
}
}
},
{
"name": "tail/0/first-mipmap",
"observed": {
"value": {
"uint": 3
}
}
},
{
"name": "tail/0/bytes",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "tail/1/first-mipmap",
"observed": {
"value": {
"uint": 3
}
}
},
{
"name": "tail/1/bytes",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "status/0",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/1",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/2",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/3",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/4",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/5",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "step/0/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/1/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/2/moveTextureMappingsFromTexture",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/3/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/4/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/5/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/6/moveTextureMappingsFromTexture",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/7/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/8/moveTextureMappingsFromTexture",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/9/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/10/moveTextureMappingsFromTexture",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/11/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
}
]
},
{
"name": "notices",
"observed": {
"value": "absent"
},
"children": [
{
"name": "set",
"observed": {
"value": {
"nothing": "announced_nothing"
}
}
},
{
"name": "counts",
"observed": {
"value": {
"fields": {}
}
}
}
]
}
]
}
}
}
],
"validated": "ran"
}
]
}
@@ -0,0 +1,242 @@
{
"format": 1,
"case": "sparse-mapping-plural-updates",
"suite_version": 1,
"answers": [
{
"key": {
"chip": "apple-m3-max",
"os_version": "27.0.1",
"os_build": "26A434",
"metal_level": "27.0.1"
},
"provenance": "metal_run",
"device": "Apple M3 Max",
"runs": 3,
"outcomes": [
{
"runs": 3,
"transcript": {
"root": {
"name": "case",
"observed": {
"value": "absent"
},
"children": [
{
"name": "inputs",
"observed": {
"value": "absent"
},
"children": [
{
"name": "program",
"observed": {
"value": "absent",
"digest": {
"kind": "sha256",
"hex": "5a7f628a0f7c6d62f12927637a9c5d4954c5568e3260dc09b35030d3f690807e"
}
}
}
]
},
{
"name": "sparse-mapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "program",
"observed": {
"value": "absent"
},
"children": [
{
"name": "used-size/0",
"observed": {
"value": {
"uint": 0
}
}
},
{
"name": "used-size/1",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "used-size/2",
"observed": {
"value": {
"uint": 360448
}
}
},
{
"name": "used-size/3",
"observed": {
"value": {
"uint": 0
}
}
},
{
"name": "tail/0/first-mipmap",
"observed": {
"value": {
"uint": 3
}
}
},
{
"name": "tail/0/bytes",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "status/0",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/1",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/2",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "step/0/updateTextureMappings",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/1/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/2/updateTextureMappings",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/3/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/4/updateTextureMappings",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/5/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
}
]
},
{
"name": "notices",
"observed": {
"value": "absent"
},
"children": [
{
"name": "set",
"observed": {
"value": {
"nothing": "announced_nothing"
}
}
},
{
"name": "counts",
"observed": {
"value": {
"fields": {}
}
}
}
]
}
]
}
}
}
],
"validated": "ran"
}
]
}
@@ -0,0 +1,283 @@
{
"format": 1,
"case": "sparse-mapping-slices-of-an-array",
"suite_version": 1,
"answers": [
{
"key": {
"chip": "apple-m3-max",
"os_version": "27.0.1",
"os_build": "26A434",
"metal_level": "27.0.1"
},
"provenance": "metal_run",
"device": "Apple M3 Max",
"runs": 3,
"outcomes": [
{
"runs": 3,
"transcript": {
"root": {
"name": "case",
"observed": {
"value": "absent"
},
"children": [
{
"name": "inputs",
"observed": {
"value": "absent"
},
"children": [
{
"name": "program",
"observed": {
"value": "absent",
"digest": {
"kind": "sha256",
"hex": "e03a11aec1b27ae38a29a24e5f3e9469a2f1d610acef5d125e0aa97249b72ab6"
}
}
}
]
},
{
"name": "sparse-mapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "program",
"observed": {
"value": "absent"
},
"children": [
{
"name": "used-size/0",
"observed": {
"value": {
"uint": 0
}
}
},
{
"name": "used-size/1",
"observed": {
"value": {
"uint": 262144
}
}
},
{
"name": "used-size/2",
"observed": {
"value": {
"uint": 524288
}
}
},
{
"name": "used-size/3",
"observed": {
"value": {
"uint": 262144
}
}
},
{
"name": "used-size/4",
"observed": {
"value": {
"uint": 0
}
}
},
{
"name": "tail/0/first-mipmap",
"observed": {
"value": {
"uint": 3
}
}
},
{
"name": "tail/0/bytes",
"observed": {
"value": {
"uint": 16384
}
}
},
{
"name": "status/0",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/1",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/2",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "status/3",
"observed": {
"value": {
"variant": {
"name": "Completed",
"payload": "absent"
}
}
}
},
{
"name": "step/0/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/1/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/2/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/3/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/4/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/5/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/6/updateTextureMapping",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
},
{
"name": "step/7/commit",
"observed": {
"value": {
"variant": {
"name": "Ok",
"payload": "absent"
}
}
}
}
]
},
{
"name": "notices",
"observed": {
"value": "absent"
},
"children": [
{
"name": "set",
"observed": {
"value": {
"nothing": "announced_nothing"
}
}
},
{
"name": "counts",
"observed": {
"value": {
"fields": {}
}
}
}
]
}
]
}
}
}
],
"validated": "ran"
}
]
}
@@ -1479,6 +1479,39 @@ pub trait Side {
Err(Failure::unavailable("sparse_texture_facts"))
}
/// One sparse mapping program: the heap, the textures over it, and every command of
/// `program` encoded in order through `MTLResourceStateCommandEncoder` and
/// `MTLBlitCommandEncoder` ([`crate::sparse_mapping`]).
///
/// The whole program is one call because what it measures is a **sequence**: the heap's
/// `usedSize` after a map, after an unmap and after a move is three numbers of one experiment,
/// and a case that made them three independent calls would be measuring three heaps.
///
/// Every command is encoded whatever an earlier one answered, as
/// [`compute_pass`](Side::compute_pass) does, and the answer names which one refused. **Every
/// region is in tiles**, bounded by the texture's own grid, and the side checks the venue's
/// tile size against the program's stated one before it encodes anything: a venue whose tiles
/// are another size answers a typed refusal rather than being handed a region past its grid.
fn sparse_mapping(
&mut self,
program: &crate::sparse_mapping::SparseMappingProgram,
) -> Answer<crate::sparse_mapping::SparseMapped> {
let _ = program;
Err(Failure::unavailable("sparse_mapping"))
}
/// What one command buffer answers about itself
/// ([`crate::command_buffer_facts::CommandBufferFacts`]): its `device` and its `commandQueue`,
/// the four timing getters before and after it ran, and whether a
/// `resourceStateCommandEncoder` could be opened on one.
///
/// The timings are recorded as **orderings and signs**, never as times: a recording holding a
/// machine's clock would decay on its next run. What is durable is whether each getter answers
/// zero before the work ran, whether it is positive after, and the order of the four.
fn command_buffer_facts(&mut self) -> Answer<crate::command_buffer_facts::CommandBufferFacts> {
Err(Failure::unavailable("command_buffer_facts"))
}
/// A command queue's limit on uncompleted command buffers, by the probe both sides run
/// ([`crate::queue_slots`]): the queue is made with `max` as its
/// `maxCommandBufferCount` (`newCommandQueue` where `max` is `None`), and at most `cap` command
@@ -53,6 +53,7 @@ pub mod buffer_texture_blits;
pub mod buffer_textures;
pub mod chroma_pairs;
pub mod color_write_masks;
pub mod command_buffer_facts;
pub mod command_queues;
pub mod compressed_blits;
pub mod compressed_decode;
@@ -129,6 +130,7 @@ pub mod shared_exponent_storage;
pub mod simdgroup_lockstep;
pub mod snorm_tile_store;
pub mod sparse_heaps;
pub mod sparse_mappings;
pub mod sparse_tiles;
pub mod srgb_fetch;
pub mod stage_in_regions;
@@ -375,6 +377,8 @@ pub fn all() -> Vec<Box<dyn Case>> {
for case in sparse_heaps::all() {
cases.push(Box::new(case));
}
cases.extend(sparse_mappings::all());
cases.extend(command_buffer_facts::all());
cases.extend(fresh_contents::all());
cases.extend(sample_positions::all());
cases.extend(
@@ -0,0 +1,148 @@
//! What a command buffer says about itself: `device`, `commandQueue`, the four timing getters and
//! `resourceStateCommandEncoder`.
//!
//! Seven of `MTLCommandBuffer`'s eight unexercised items, in one case, because they are one
//! experiment: a command buffer's owners and its timings are facts about **that** command buffer,
//! and a case that read them from several would be reading several command buffers.
//! [`crate::command_buffer_facts`] says what is recorded and why a time never is.
//!
//! # The timings are the subject, and they are read as orderings
//!
//! Nothing in this tree held an implementation to the shape of `GPUStartTime`, `GPUEndTime`,
//! `kernelStartTime` and `kernelEndTime`. The runtime builds all four from its own clocks and
//! announces three different degradations over them, and the only thing watching was a lane
//! assertion that one of them eventually stops being zero. This case states the contract instead:
//! zero before the work, positive after, and each interval ordered, with the GPU's interval not
//! beginning or ending before the kernel's.
//!
//! **Two of those are a measurement, not a known answer.** Whether Metal's `GPUStartTime` is at or
//! after its `kernelStartTime`, and whether its `GPUEndTime` is at or after its `kernelEndTime`,
//! is what the recording will say. They are recorded because they are the two an implementation
//! can get wrong without any other row moving, and the case is run several times so a pair that
//! flaps says so in its own recording rather than passing as whichever run came last.
//!
//! # Why the GPU pair may be refused, and why that is recorded rather than smoothed
//!
//! `GPUStartTime` and `GPUEndTime` need timestamps from the device. The runtime refuses them typed
//! where the queue family writes none, and the case records that refusal against Metal's answer —
//! a real gap, stated as one, rather than four booleans computed from two zeros that would have
//! read as agreement.
//!
//! # Why it is safe
//!
//! Three command buffers: two that only make a command buffer and read its queue's label, one that
//! fills a few bytes of the case's own buffer, and one that opens a resource state encoder and ends
//! it with nothing encoded. No shader, no draw, no dispatch, no loop, no mapping, and every wait is
//! bounded.
use crate::allowance::Allowance;
use crate::case::{made, Abort, Case, Input, MetalSource, Side};
use crate::replay::notice_allowance;
use crate::transcript::Sites;
use metal2vulkan_runtime::Degradation;
/// The case's name.
pub const COMMAND_BUFFER_FACTS: &str = "command-buffer-facts";
/// The notices the runtime can announce over the GPU times, and the whole of what this case takes.
///
/// `UncalibratedGpuTimes` is **not** here, though the runtime can announce it: on this oracle it
/// never fires, and a declaration that outlives its own reason keeps asserting that somebody
/// examined a notice nobody has looked at since. A venue that does announce it reads as
/// `UndeclaredNotice`, naming the code and the case, which is the loud form and the moment to look
/// at it.
const GPU_TIME_NOTICES: [Degradation; 1] = [Degradation::GpuTimesFromHost];
/// A case over one command buffer's own answers.
pub struct CommandBufferFactsCase {
name: &'static str,
}
/// The case.
pub fn command_buffer_facts() -> CommandBufferFactsCase {
CommandBufferFactsCase {
name: COMMAND_BUFFER_FACTS,
}
}
/// Every case of the family.
pub fn all() -> Vec<Box<dyn Case>> {
vec![Box::new(command_buffer_facts())]
}
impl Case for CommandBufferFactsCase {
fn name(&self) -> &'static str {
self.name
}
fn metal_source(&self) -> MetalSource {
MetalSource::Run
}
fn inputs(&self) -> Result<Vec<Input>, String> {
// What the case feeds is the shape of the experiment, which is the side's own: the bytes
// the timed command buffer fills, and the two queue labels. They are stated here so a
// change to either is a change to the case's inputs.
Ok(vec![Input::bytes(
"timed-bytes-and-queue-labels",
crate::command_buffer_facts::TIMERS.join(",").as_bytes(),
)])
}
fn record_runs(&self) -> u32 {
// Two of the recorded booleans are an ordering of two clocks, and a clock read is a race
// however wide the window. More runs do not remove that; they record it, because a
// recording holds the set of outcomes with their frequencies, so a row that flaps says so
// instead of passing as whichever run came last.
5
}
fn allowances(&self) -> Vec<Allowance> {
// The runtime builds `GPUStartTime` and `GPUEndTime` from its own clocks and announces how
// on the venues that need it. The case takes the notice and compares every value exactly;
// what it may not do is take a different *number* because of one, and it does not.
// `GpuTimesFromHost`: the runtime answers the GPU times from the host clock where the
// driver's own timestamps wait for every queue's (MoltenVK on Apple's GPUs).
// `UncalibratedGpuTimes`: it places them without calibrated timestamps where the device
// offers none. The orderings this case compares do not depend on either, which is why the
// case can take the notice and still compare every value exactly.
GPU_TIME_NOTICES
.iter()
.map(|code| notice_allowance(code.code()))
.collect()
}
fn run(&self, side: &mut dyn Side, sites: &mut Sites) -> Result<(), Abort> {
// The call's own site and the facts take **different** names: two siblings under one name
// are paired by whichever namesake the comparison reaches first, which is how a round
// reported six cases divergent having compared no byte of either side. The suite holds it
// for every recording (`tests::no_recorded_site_shares_its_name_with_a_sibling`), and it
// caught this case's first recording.
let facts = made(sites, "command-buffer", side.command_buffer_facts())?;
sites.push(facts.node("facts"));
Ok(())
}
}
#[cfg(test)]
mod tests {
use super::*;
/// The case states its inputs, names itself once, and declares the two notices the runtime can
/// announce over the GPU times and nothing else.
///
/// A third notice slipping in would be a value the case took for a reason nobody wrote down,
/// which is what this count is for.
#[test]
fn the_case_states_its_inputs_and_only_the_gpu_time_notices() {
let cases = all();
assert_eq!(cases.len(), 1);
let case = &cases[0];
assert_eq!(case.name(), COMMAND_BUFFER_FACTS);
assert!(!case.inputs().expect("the inputs").is_empty());
let allowed = case.allowances();
assert_eq!(allowed.len(), GPU_TIME_NOTICES.len());
// And the case records more than one run, because two of its booleans read a clock.
assert!(case.record_runs() > 1);
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,352 @@
//! What one command buffer answers about itself: its two owners, its four timing getters, and the
//! encoder kind nothing else in the suite opens.
//!
//! `MTLCommandBuffer` has twenty-one implemented items and the suite reached thirteen of them.
//! Seven of the eight it did not are here: `device`, `commandQueue`, `kernelStartTime`,
//! `kernelEndTime`, `GPUStartTime`, `GPUEndTime` and `resourceStateCommandEncoder`. The eighth is
//! the protocol declaration itself, which no call site can reach.
//!
//! # Why a time is never recorded, and what is recorded instead
//!
//! The four timing getters answer a `CFTimeInterval` — this machine's clock, in seconds. A
//! recording that held one would be a recording of when somebody ran the suite, and it would
//! differ on its own next run. So nothing here records a time.
//!
//! What is durable is the **shape** of the four answers, and it is a contract a consumer leans on:
//!
//! - each getter answers **zero** on a command buffer that has not completed, so a consumer that
//! reads one early reads a zero rather than a stale number;
//! - each answers a **positive** number once the command buffer completed;
//! - each interval's end is at or after its start, and the GPU's interval does not begin or end
//! before the kernel's did.
//!
//! Those are booleans, and a boolean compares exactly on every venue and in every year. A venue
//! whose `GPUEndTime` precedes its `GPUStartTime` records a different boolean and the case moves,
//! which is the point: nothing in this tree watched for that before.
//!
//! # The GPU pair is a `Result`, because one side may have no answer
//!
//! `GPUStartTime` and `GPUEndTime` need the device to write timestamps. The runtime refuses them
//! typed where its queue family writes none, and answers them from the host — announcing
//! `Degradation::GpuTimesFromHost` — where the driver's own timestamps wait for every queue's.
//! So [`CommandBufferFacts::gpu`] holds either the flags or the refusal, and a venue with no
//! timestamps records the refusal rather than four booleans derived from zeros. The kernel pair
//! needs no device at all and is always flags.
//!
//! # Why the two owners are booleans too
//!
//! `device` and `commandQueue` answer objects, and an object's address is not a fact a recording
//! may hold either. What a case can state is the **identity** a consumer depends on: the command
//! buffer's `device` is the device its queue was made on — compared by `registryID`, the number
//! Metal gives a device for exactly this — and its `commandQueue` is the queue object it was made
//! by. Each is one boolean, and an implementation that handed back another device or another queue
//! fails it.
//!
//! # Why it is safe
//!
//! One command buffer of one small blit — a fill of a few bytes of the side's own buffer — is
//! committed and waited for. No shader runs, no draw, no dispatch, no loop, and the wait is
//! bounded. The resource state encoder is opened on a command buffer of its own and ended with no
//! update encoded at all, which maps nothing and takes no heap memory.
use crate::case::Failure;
use crate::transcript::{Node, Observed, Value};
/// The flags the GPU pair comes to, where the side answered both getters.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct GpuFlags {
/// Whether `GPUStartTime` and `GPUEndTime` answered zero before the commit.
pub zero_before: [bool; 2],
/// Whether each answered a number greater than zero once the command buffer completed.
pub positive_after: [bool; 2],
/// Whether `GPUEndTime` is at or after `GPUStartTime`.
pub interval_is_ordered: bool,
/// Whether `GPUStartTime` is at or after `kernelStartTime`.
pub starts_no_earlier_than_the_kernel: bool,
/// Whether `GPUEndTime` is at or after `kernelEndTime`.
pub ends_no_earlier_than_the_kernel: bool,
}
/// What one command buffer answered about itself.
#[derive(Clone, Debug, PartialEq)]
pub struct CommandBufferFacts {
/// `device`: whether its `registryID` is that of the device the queue was made on.
pub device_is_the_queues: bool,
/// `commandQueue`: for each of two distinctly labelled queues, whether the command buffer
/// made on it answers **its own** queue's label.
pub queue_label_is_its_own: [bool; 2],
/// Whether `kernelStartTime` and `kernelEndTime` answered zero before the commit.
pub kernel_zero_before: [bool; 2],
/// Whether each answered a number greater than zero once the command buffer completed.
pub kernel_positive_after: [bool; 2],
/// Whether `kernelEndTime` is at or after `kernelStartTime`.
pub kernel_interval_is_ordered: bool,
/// The GPU pair's flags, or the side's typed refusal of the two getters.
pub gpu: Result<GpuFlags, Failure>,
/// `resourceStateCommandEncoder`: whether one was opened on a fresh command buffer. The
/// encoder is ended at once with nothing encoded into it.
pub resource_state_encoder_opened: bool,
/// The status of the command buffer the timings were read from, once it completed.
pub status: Value,
/// The status of the command buffer the resource state encoder was opened on.
pub state_encoder_status: Value,
}
/// The four timing getters, in the order both sides read them and the order a site names them.
pub const TIMERS: [&str; 4] = [
"kernelStartTime",
"kernelEndTime",
"GPUStartTime",
"GPUEndTime",
];
impl CommandBufferFacts {
/// The facts a command buffer's answers come to.
///
/// `kernel_before` and `kernel_after` are `kernelStartTime` and `kernelEndTime` before the
/// commit and after the completion; `gpu_before` and `gpu_after` the same pair of
/// `GPUStartTime` and `GPUEndTime`, or the side's refusal of them.
///
/// Both sides build their answer through this one function, so neither can read the order of
/// the four differently from the other.
#[allow(clippy::too_many_arguments)]
pub fn new(
device_is_the_queues: bool,
queue_label_is_its_own: [bool; 2],
kernel_before: [f64; 2],
kernel_after: [f64; 2],
gpu: Result<([f64; 2], [f64; 2]), Failure>,
resource_state_encoder_opened: bool,
status: Value,
state_encoder_status: Value,
) -> Self {
Self {
device_is_the_queues,
queue_label_is_its_own,
kernel_zero_before: [kernel_before[0] == 0.0, kernel_before[1] == 0.0],
kernel_positive_after: [kernel_after[0] > 0.0, kernel_after[1] > 0.0],
kernel_interval_is_ordered: kernel_after[1] >= kernel_after[0],
gpu: gpu.map(|(before, after)| GpuFlags {
zero_before: [before[0] == 0.0, before[1] == 0.0],
positive_after: [after[0] > 0.0, after[1] > 0.0],
interval_is_ordered: after[1] >= after[0],
starts_no_earlier_than_the_kernel: after[0] >= kernel_after[0],
ends_no_earlier_than_the_kernel: after[1] >= kernel_after[1],
}),
resource_state_encoder_opened,
status,
state_encoder_status,
}
}
/// The facts as the sites a case emits under one node, so both sides emit one shape.
pub fn node(&self, name: impl Into<crate::transcript::NodeName>) -> Node {
let flag = |at: String, held: bool| Node::leaf(at, Observed::value(Value::Bool(held)));
let mut node = Node::branch(name, Vec::new())
.with(flag(
"device-is-the-queues".to_owned(),
self.device_is_the_queues,
))
.with(flag(
"queue-label-is-its-own/0".to_owned(),
self.queue_label_is_its_own[0],
))
.with(flag(
"queue-label-is-its-own/1".to_owned(),
self.queue_label_is_its_own[1],
));
for (at, getter) in TIMERS[..2].iter().enumerate() {
node = node.with(flag(
format!("zero-before-commit/{getter}"),
self.kernel_zero_before[at],
));
node = node.with(flag(
format!("positive-after-completion/{getter}"),
self.kernel_positive_after[at],
));
}
node = node.with(flag(
"kernel-interval-is-ordered".to_owned(),
self.kernel_interval_is_ordered,
));
match &self.gpu {
Err(failure) => {
node = node.with(Node::leaf("gpu-times", Observed::value(failure.recorded())));
}
Ok(flags) => {
node = node.with(Node::leaf(
"gpu-times",
Observed::value(Value::ok(Value::Absent)),
));
for (at, getter) in TIMERS[2..].iter().enumerate() {
node = node.with(flag(
format!("zero-before-commit/{getter}"),
flags.zero_before[at],
));
node = node.with(flag(
format!("positive-after-completion/{getter}"),
flags.positive_after[at],
));
}
node = node
.with(flag(
"gpu-interval-is-ordered".to_owned(),
flags.interval_is_ordered,
))
.with(flag(
"gpu-starts-no-earlier-than-the-kernel".to_owned(),
flags.starts_no_earlier_than_the_kernel,
))
.with(flag(
"gpu-ends-no-earlier-than-the-kernel".to_owned(),
flags.ends_no_earlier_than_the_kernel,
));
}
}
node.with(flag(
"resource-state-encoder-opened".to_owned(),
self.resource_state_encoder_opened,
))
.with(Node::leaf("status", Observed::value(self.status.clone())))
.with(Node::leaf(
"state-encoder-status",
Observed::value(self.state_encoder_status.clone()),
))
}
}
#[cfg(test)]
mod tests {
use super::*;
use std::collections::BTreeSet;
/// A set of answers whose order is the one Metal is expected to give, for the guards below.
fn ordered() -> CommandBufferFacts {
facts([100.0, 100.5], Ok(([0.0, 0.0], [100.25, 101.0])))
}
/// The facts of a kernel pair and a GPU answer, with everything else held still.
fn facts(
kernel_after: [f64; 2],
gpu: Result<([f64; 2], [f64; 2]), Failure>,
) -> CommandBufferFacts {
CommandBufferFacts::new(
true,
[true, true],
[0.0, 0.0],
kernel_after,
gpu,
true,
Value::unit_variant("Completed"),
Value::unit_variant("Completed"),
)
}
/// Each ordering reads the times, and **fails on the times that break it**.
///
/// Each half matters. Without the first the orderings would be constants; without the second a
/// getter whose answers came out backwards would record the same booleans as one that did not,
/// and the case would compare nothing four times over.
#[test]
fn each_ordering_fails_on_the_times_that_break_it() {
let held = ordered();
assert!(held.kernel_interval_is_ordered);
let flags = held.gpu.clone().expect("the GPU pair answered");
assert!(flags.interval_is_ordered);
assert!(flags.starts_no_earlier_than_the_kernel);
assert!(flags.ends_no_earlier_than_the_kernel);
// A kernel interval that ends before it starts.
assert!(
!facts([100.0, 99.0], Ok(([0.0, 0.0], [100.25, 101.0]))).kernel_interval_is_ordered
);
// A GPU interval that ends before it starts.
let backwards = facts([100.0, 100.5], Ok(([0.0, 0.0], [101.0, 100.25])))
.gpu
.expect("answered");
assert!(!backwards.interval_is_ordered);
// A GPU that starts before the kernel did.
let early = facts([100.0, 100.5], Ok(([0.0, 0.0], [99.0, 101.0])))
.gpu
.expect("answered");
assert!(!early.starts_no_earlier_than_the_kernel);
// A GPU that ends before the kernel's submission did.
let short = facts([100.0, 100.5], Ok(([0.0, 0.0], [100.25, 100.4])))
.gpu
.expect("answered");
assert!(!short.ends_no_earlier_than_the_kernel);
}
/// A zero before the commit and a positive number after read as such, and each flag fails on
/// the answer that breaks it.
#[test]
fn the_zero_and_positive_flags_fail_on_the_answers_that_break_them() {
let held = ordered();
assert_eq!(held.kernel_zero_before, [true; 2]);
assert_eq!(held.kernel_positive_after, [true; 2]);
let early = CommandBufferFacts::new(
true,
[true, true],
[0.0, 7.0],
[100.0, 100.5],
Ok(([3.0, 0.0], [0.0, 101.0])),
true,
Value::unit_variant("Completed"),
Value::unit_variant("Completed"),
);
assert_eq!(early.kernel_zero_before, [true, false]);
let flags = early.gpu.expect("answered");
assert_eq!(flags.zero_before, [false, true]);
assert_eq!(flags.positive_after, [false, true]);
}
/// A refused GPU pair records the refusal and **no** GPU flags: a venue whose device writes no
/// timestamps compares a refusal against Metal's answer rather than four booleans derived from
/// zeros, which would have read as agreement.
#[test]
fn a_refused_gpu_pair_records_the_refusal_and_no_flags() {
let refused = facts(
[100.0, 100.5],
Err(Failure::named("Unsupported", "GpuTimes".to_owned())),
);
assert!(refused.gpu.is_err());
let names: BTreeSet<String> = refused
.node("facts")
.children
.iter()
.map(|child| child.name.to_string())
.collect();
assert!(names.contains("gpu-times"));
assert!(!names.contains("gpu-interval-is-ordered"));
assert!(!names.contains("zero-before-commit/GPUStartTime"));
// And the kernel half is still there, so a refusal of one pair does not hide the other.
assert!(names.contains("kernel-interval-is-ordered"));
assert!(names.contains("zero-before-commit/kernelStartTime"));
}
/// Every flag the facts hold reaches a site of its own, so none of them can be set and then
/// never compared.
///
/// The count is written out: a flag added to the struct and not to the node would otherwise be
/// a fact nobody compares, which is exactly the shape this round found six times.
#[test]
fn every_flag_reaches_a_site_of_its_own() {
let node = ordered().node("facts");
let names: BTreeSet<String> = node
.children
.iter()
.map(|child| child.name.to_string())
.collect();
assert_eq!(names.len(), node.children.len(), "{names:?}");
// The device, a flag a labelled queue, two flags a timer, one kernel ordering, the GPU
// answer, three GPU orderings, the encoder, two statuses.
assert_eq!(
node.children.len(),
1 + 2 + 2 * TIMERS.len() + 1 + 1 + 3 + 1 + 2
);
for getter in TIMERS {
assert!(names.contains(&format!("zero-before-commit/{getter}")));
assert!(names.contains(&format!("positive-after-completion/{getter}")));
}
}
}
@@ -368,81 +368,116 @@ mod tests {
Handle(0)
}
/// One step of every kind, for the guards that read all of them.
/// Every kind of one vocabulary, from `first` through the successor each kind names.
///
/// This is where the exhaustiveness comes from: `after` is a `match` over every variant of its
/// enum with **no wildcard arm**, so a variant added to that enum does not compile until it is
/// given its own arm, and the arm of the kind it is placed after is what hands it to this
/// walk. The guards then read the walk rather than an array written out beside the enum, which
/// is the thing a new variant can be added without touching.
///
/// It is [`crate::render`]'s mechanism, ported: the hand-written list that used to stand here
/// fed three guards, and a variant added to [`ComputeStep`] escaped all three in silence.
///
/// The walk is checked to be a list and not a cycle, so an arm naming a kind already walked
/// fails here, by name, instead of running forever.
fn every_kind<T: std::fmt::Debug>(first: T, after: impl Fn(&T) -> Option<T>) -> Vec<T> {
let mut kinds = vec![first];
let mut walked = vec![std::mem::discriminant(&kinds[0])];
while let Some(next) = after(kinds.last().expect("the walk starts at its first kind")) {
assert!(
!walked.contains(&std::mem::discriminant(&next)),
"the walk of {} returns to {next:?}, so it is a cycle rather than each kind once",
std::any::type_name::<T>()
);
walked.push(std::mem::discriminant(&next));
kinds.push(next);
}
kinds
}
/// One step of every kind, in declaration order, through the compiler-kept walk.
fn one_of_each() -> Vec<ComputeStep> {
vec![
ComputeStep::Pipeline(handle()),
ComputeStep::Buffer {
every_kind(ComputeStep::Pipeline(handle()), step_after)
}
/// The step that follows `step` in declaration order, or `None` after the last.
///
/// One arm per variant and no wildcard: see [`every_kind`] for why that is the whole point.
fn step_after(step: &ComputeStep) -> Option<ComputeStep> {
Some(match step {
ComputeStep::Pipeline(_) => ComputeStep::Buffer {
buffer: handle(),
offset: 0,
index: 0,
},
ComputeStep::BufferOffset {
ComputeStep::Buffer { .. } => ComputeStep::BufferOffset {
offset: 4,
index: 0,
},
ComputeStep::Buffers {
ComputeStep::BufferOffset { .. } => ComputeStep::Buffers {
buffers: vec![(handle(), 0)],
first: 0,
},
ComputeStep::Bytes {
ComputeStep::Buffers { .. } => ComputeStep::Bytes {
bytes: vec![1, 2, 3],
index: 1,
},
ComputeStep::Texture {
ComputeStep::Bytes { .. } => ComputeStep::Texture {
texture: handle(),
index: 0,
},
ComputeStep::Textures {
ComputeStep::Texture { .. } => ComputeStep::Textures {
textures: vec![handle()],
first: 0,
},
ComputeStep::Sampler {
ComputeStep::Textures { .. } => ComputeStep::Sampler {
sampler: handle(),
index: 0,
},
ComputeStep::Samplers {
ComputeStep::Sampler { .. } => ComputeStep::Samplers {
samplers: vec![handle()],
first: 0,
},
ComputeStep::ClampedSampler {
ComputeStep::Samplers { .. } => ComputeStep::ClampedSampler {
sampler: handle(),
lod_min: 0.0,
lod_max: 1.0,
index: 0,
},
ComputeStep::ClampedSamplers {
ComputeStep::ClampedSampler { .. } => ComputeStep::ClampedSamplers {
samplers: vec![(handle(), 0.0, 1.0)],
first: 0,
},
ComputeStep::ThreadgroupMemory {
ComputeStep::ClampedSamplers { .. } => ComputeStep::ThreadgroupMemory {
length: 16,
index: 0,
},
ComputeStep::UseResource {
ComputeStep::ThreadgroupMemory { .. } => ComputeStep::UseResource {
resource: PassResource::Buffer(handle()),
usage: USAGE_READ,
},
ComputeStep::UseResources {
ComputeStep::UseResource { .. } => ComputeStep::UseResources {
resources: vec![PassResource::Texture(handle())],
usage: USAGE_READ,
},
ComputeStep::BarrierScope {
ComputeStep::UseResources { .. } => ComputeStep::BarrierScope {
scope: SCOPE_BUFFERS,
},
ComputeStep::BarrierResources {
ComputeStep::BarrierScope { .. } => ComputeStep::BarrierResources {
resources: vec![PassResource::Buffer(handle())],
},
ComputeStep::DispatchThreadgroups {
ComputeStep::BarrierResources { .. } => ComputeStep::DispatchThreadgroups {
groups: [1, 1, 1],
threads: [8, 1, 1],
},
ComputeStep::DispatchThreadgroupsIndirect {
ComputeStep::DispatchThreadgroups { .. } => ComputeStep::DispatchThreadgroupsIndirect {
buffer: handle(),
offset: 0,
threads: [8, 1, 1],
},
]
ComputeStep::DispatchThreadgroupsIndirect { .. } => return None,
})
}
/// One pass of `steps`, the way a case states one.
@@ -452,6 +487,9 @@ mod tests {
/// Every step names a Metal call no other step names, so a refusal reads as the call we
/// refused and the fingerprint keys each step by its own name.
///
/// It reads the compiler-kept walk, so a variant added to [`ComputeStep`] is in this check —
/// and in the two below it — the moment it compiles.
#[test]
fn every_step_names_a_call_of_its_own() {
let steps = one_of_each();
@@ -48,6 +48,7 @@ pub mod buffer_texture;
pub mod case;
pub mod cases;
pub mod clocks;
pub mod command_buffer_facts;
pub mod compare;
pub mod compute_descriptors;
pub mod compute_pass;
@@ -84,6 +85,7 @@ pub mod runtime_work;
pub mod scheduled_handlers;
pub mod shared_events;
pub mod slow_calls;
pub mod sparse_mapping;
pub mod sparse_query;
pub mod surface;
pub mod texture;
+577 -14
View File
@@ -19,6 +19,7 @@ use crate::case::{
ShaderSource, Side, StageInRegion, StageInput, TextureRole, TextureSpec, TileFacts,
TilePipelineSpec, TileStep, Venue,
};
use crate::command_buffer_facts::CommandBufferFacts;
use crate::compute_descriptors::{
ComputeDescriptorFacts, DescriptorSpec as ComputeDescriptorSpec,
SuppliedLists as ComputeSuppliedLists, AWAY as COMPUTE_AWAY,
@@ -58,6 +59,9 @@ use crate::render_descriptors::{
LinkedCounts, RenderDescriptorFacts, SuppliedLists, VertexDescriptorFacts, AWAY, READ_BUFFERS,
READ_COLORS, READ_VERTEX_SLOTS,
};
use crate::sparse_mapping::{
MappingMode, MappingStep, SparseMapped, SparseMappingProgram, TileRect,
};
use crate::sparse_query::{
HeapFacts, QueryPage, SparseHeapSpec, SparseTextureFacts, SparseTextureSpec, SparseTileQuery,
TileSize,
@@ -88,14 +92,15 @@ use objc2_metal::{
MTLComputeCommandEncoder, MTLComputePipelineDescriptor, MTLComputePipelineReflection,
MTLComputePipelineState, MTLCreateSystemDefaultDevice, MTLCullMode, MTLDataType,
MTLDepthClipMode, MTLDepthStencilDescriptor, MTLDepthStencilState, MTLDevice, MTLDispatchType,
MTLDynamicLibrary, MTLEvent, MTLFunction, MTLFunctionConstant, MTLFunctionConstantValues,
MTLFunctionDescriptor, MTLFunctionOptions, MTLHazardTrackingMode, MTLHeap, MTLHeapDescriptor,
MTLHeapType, MTLIndexType, MTLIndirectCommandBuffer, MTLIndirectCommandBufferDescriptor,
MTLIndirectCommandType, MTLIndirectComputeCommand, MTLIndirectRenderCommand, MTLLibrary,
MTLLinkedFunctions, MTLLoadAction, MTLMeshRenderPipelineDescriptor,
MTLMultisampleDepthResolveFilter, MTLMultisampleStencilResolveFilter, MTLMutability, MTLOrigin,
MTLPipelineBufferDescriptor, MTLPipelineBufferDescriptorArray, MTLPipelineOption,
MTLPixelFormat, MTLPointerType, MTLPrimitiveTopologyClass, MTLPrimitiveType, MTLPurgeableState,
MTLDynamicLibrary, MTLEvent, MTLFence, MTLFunction, MTLFunctionConstant,
MTLFunctionConstantValues, MTLFunctionDescriptor, MTLFunctionOptions, MTLHazardTrackingMode,
MTLHeap, MTLHeapDescriptor, MTLHeapType, MTLIndexType, MTLIndirectCommandBuffer,
MTLIndirectCommandBufferDescriptor, MTLIndirectCommandType, MTLIndirectComputeCommand,
MTLIndirectRenderCommand, MTLLibrary, MTLLinkedFunctions, MTLLoadAction,
MTLMeshRenderPipelineDescriptor, MTLMultisampleDepthResolveFilter,
MTLMultisampleStencilResolveFilter, MTLMutability, MTLOrigin, MTLPipelineBufferDescriptor,
MTLPipelineBufferDescriptorArray, MTLPipelineOption, MTLPixelFormat, MTLPointerType,
MTLPrimitiveTopologyClass, MTLPrimitiveType, MTLPurgeableState,
MTLRasterizationRateLayerDescriptor, MTLRasterizationRateMap,
MTLRasterizationRateMapDescriptor, MTLRegion, MTLRenderCommandEncoder,
MTLRenderPassAttachmentDescriptor, MTLRenderPassColorAttachmentDescriptor,
@@ -103,12 +108,13 @@ use objc2_metal::{
MTLRenderPassDescriptor, MTLRenderPassStencilAttachmentDescriptor,
MTLRenderPipelineColorAttachmentDescriptor, MTLRenderPipelineColorAttachmentDescriptorArray,
MTLRenderPipelineDescriptor, MTLRenderPipelineReflection, MTLRenderPipelineState,
MTLRenderStages, MTLResource, MTLResourceOptions, MTLResourceUsage, MTLSamplePosition,
MTLSamplerAddressMode, MTLSamplerBorderColor, MTLSamplerDescriptor, MTLSamplerMinMagFilter,
MTLSamplerState, MTLScissorRect, MTLSharedEvent, MTLSharedEventHandle, MTLSize,
MTLSparsePageSize, MTLSparseTextureRegionAlignmentMode, MTLStageInputOutputDescriptor,
MTLStencilDescriptor, MTLStencilOperation, MTLStepFunction, MTLStorageMode, MTLStoreAction,
MTLStoreActionOptions, MTLStructMember, MTLStructType, MTLTessellationControlPointIndexType,
MTLRenderStages, MTLResource, MTLResourceOptions, MTLResourceStateCommandEncoder,
MTLResourceUsage, MTLSamplePosition, MTLSamplerAddressMode, MTLSamplerBorderColor,
MTLSamplerDescriptor, MTLSamplerMinMagFilter, MTLSamplerState, MTLScissorRect, MTLSharedEvent,
MTLSharedEventHandle, MTLSize, MTLSparsePageSize, MTLSparseTextureMappingMode,
MTLSparseTextureRegionAlignmentMode, MTLStageInputOutputDescriptor, MTLStencilDescriptor,
MTLStencilOperation, MTLStepFunction, MTLStorageMode, MTLStoreAction, MTLStoreActionOptions,
MTLStructMember, MTLStructType, MTLTessellationControlPointIndexType,
MTLTessellationFactorFormat, MTLTessellationFactorStepFunction, MTLTessellationPartitionMode,
MTLTexture, MTLTextureBinding, MTLTextureDescriptor, MTLTextureReferenceType,
MTLTextureSwizzle, MTLTextureSwizzleChannels, MTLTextureType, MTLTextureUsage,
@@ -760,6 +766,291 @@ impl MetalSide {
.ok_or_else(|| Failure::named("NoSuchHandle", format!("heap {}", handle.0)))
}
/// Encode step `at` of `program`, answering whether it closed its command buffer.
///
/// Each arm is one Metal call, with the program's indices resolved through the handles it
/// made. The open encoder is passed in rather than held on the side, because a program's
/// encoders live exactly as long as its own run.
#[allow(clippy::too_many_arguments)]
fn sparse_step(
&mut self,
program: &SparseMappingProgram,
at: usize,
textures: &[Handle],
buffers: &[Handle],
fences: &[Retained<ProtocolObject<dyn MTLFence>>],
scratch: &[Handle],
scratch_at: &mut usize,
pending: &mut Vec<(usize, usize)>,
command_buffer: &mut Option<Retained<ProtocolObject<dyn MTLCommandBuffer>>>,
open: &mut OpenEncoder,
) -> Answer<Commits> {
let texture_at = |at: usize| -> Answer<Handle> {
textures
.get(at)
.copied()
.ok_or_else(|| Failure::named("NoSuchHandle", format!("texture {at}")))
};
let step = &program.steps[at];
match step {
MappingStep::Commit => {
open.end();
if command_buffer.is_none() {
return Err(Failure::named("NoCommandBuffer", "a commit of nothing"));
}
Ok(Commits::Yes)
}
MappingStep::NextEncoder => {
open.end();
Ok(Commits::No)
}
MappingStep::FillRegion {
texture,
level,
slice,
region,
..
} => {
let held = Retained::from(self.held_texture(texture_at(*texture)?)?);
let source = Retained::from(self.held(scratch[*scratch_at])?);
let (per_row, bytes) = program.tile.bytes_of(region);
let (origin, extent) = program.tile.texels_of(region);
let encoder = self.open_blit(command_buffer, open)?;
// SAFETY: the buffer holds the region's rows at `per_row`, the side just made it
// that long, and the region lies inside the level's own tiles, which the case's
// guard holds against the grid this side checked against the device.
unsafe {
encoder.copyFromBuffer_sourceOffset_sourceBytesPerRow_sourceBytesPerImage_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin(
&source,
0,
per_row as usize,
bytes as usize,
long_size(extent),
&held,
*slice as usize,
*level as usize,
long_origin(origin),
);
}
*scratch_at += 1;
Ok(Commits::No)
}
MappingStep::ReadRegion {
texture,
level,
slice,
region,
} => {
let held = Retained::from(self.held_texture(texture_at(*texture)?)?);
let into = Retained::from(self.held(scratch[*scratch_at])?);
let (per_row, bytes) = program.tile.bytes_of(region);
let (origin, extent) = program.tile.texels_of(region);
let encoder = self.open_blit(command_buffer, open)?;
// SAFETY: as the fill's, the other way round.
unsafe {
encoder.copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toBuffer_destinationOffset_destinationBytesPerRow_destinationBytesPerImage(
&held,
*slice as usize,
*level as usize,
long_origin(origin),
long_size(extent),
&into,
0,
per_row as usize,
bytes as usize,
);
}
pending.push((*scratch_at, bytes as usize));
*scratch_at += 1;
Ok(Commits::No)
}
MappingStep::One {
texture,
mode,
region,
level,
slice,
} => {
let held = Retained::from(self.held_texture(texture_at(*texture)?)?);
let encoder = self.open_state(command_buffer, open)?;
// SAFETY: the region lies inside the level's own tiles, which the case's guard
// holds against the grid this side checked against the device, and the encoder
// outlives the call.
unsafe {
encoder.updateTextureMapping_mode_region_mipLevel_slice(
&held,
mapping_mode(*mode),
tile_region(region),
*level as usize,
*slice as usize,
);
}
Ok(Commits::No)
}
MappingStep::Many {
texture,
mode,
regions,
} => {
let held = Retained::from(self.held_texture(texture_at(*texture)?)?);
let rects: Vec<MTLRegion> = regions
.iter()
.map(|(region, _, _)| tile_region(region))
.collect();
let levels: Vec<usize> = regions
.iter()
.map(|(_, level, _)| *level as usize)
.collect();
let slices: Vec<usize> = regions
.iter()
.map(|(_, _, slice)| *slice as usize)
.collect();
let encoder = self.open_state(command_buffer, open)?;
// SAFETY: the three arrays each hold `numRegions` elements, every region lies
// inside its level's tiles, and the encoder outlives the call.
unsafe {
encoder.updateTextureMappings_mode_regions_mipLevels_slices_numRegions(
&held,
mapping_mode(*mode),
array_head(&rects)?,
array_head(&levels)?,
array_head(&slices)?,
rects.len(),
);
}
Ok(Commits::No)
}
MappingStep::Indirect {
texture,
mode,
buffer,
offset,
} => {
let held = Retained::from(self.held_texture(texture_at(*texture)?)?);
let named = buffers
.get(*buffer)
.copied()
.ok_or_else(|| Failure::named("NoSuchHandle", format!("buffer {buffer}")))?;
let arguments = Retained::from(self.held(named)?);
let encoder = self.open_state(command_buffer, open)?;
// SAFETY: the buffer holds a 32-bit count and that many
// `MTLMapIndirectArguments` at `offset`, which the case states as its own input
// and its guard checks, and the encoder outlives the call.
unsafe {
encoder.updateTextureMapping_mode_indirectBuffer_indirectBufferOffset(
&held,
mapping_mode(*mode),
&arguments,
*offset as usize,
);
}
Ok(Commits::No)
}
MappingStep::Move {
from,
from_slice,
from_level,
from_origin,
size,
to,
to_slice,
to_level,
to_origin,
} => {
let source = Retained::from(self.held_texture(texture_at(*from)?)?);
let destination = Retained::from(self.held_texture(texture_at(*to)?)?);
let encoder = self.open_state(command_buffer, open)?;
// SAFETY: both regions lie inside their level's own tiles, which the case's guard
// holds, and the encoder outlives the call.
unsafe {
encoder.moveTextureMappingsFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin(
&source,
*from_slice as usize,
*from_level as usize,
long_origin(*from_origin),
long_size(*size),
&destination,
*to_slice as usize,
*to_level as usize,
long_origin(*to_origin),
);
}
Ok(Commits::No)
}
MappingStep::UpdateFence { fence } => {
let held = fences
.get(*fence)
.cloned()
.ok_or_else(|| Failure::named("NoSuchHandle", format!("fence {fence}")))?;
let encoder = self.open_state(command_buffer, open)?;
encoder.updateFence(&held);
Ok(Commits::No)
}
MappingStep::WaitForFence { fence } => {
let held = fences
.get(*fence)
.cloned()
.ok_or_else(|| Failure::named("NoSuchHandle", format!("fence {fence}")))?;
let encoder = self.open_state(command_buffer, open)?;
encoder.waitForFence(&held);
Ok(Commits::No)
}
}
}
/// The command buffer a sparse mapping program's next command goes into, opened on first use.
fn open_command_buffer(
&self,
command_buffer: &mut Option<Retained<ProtocolObject<dyn MTLCommandBuffer>>>,
) -> Answer<Retained<ProtocolObject<dyn MTLCommandBuffer>>> {
if command_buffer.is_none() {
*command_buffer = Some(
self.queue
.commandBuffer()
.ok_or_else(|| Failure::named("CommandBuffer", "returned nil".to_owned()))?,
);
}
Ok(command_buffer
.clone()
.expect("the command buffer was just opened"))
}
/// The program's blit encoder, ending a resource state encoder first where one is open.
fn open_blit(
&self,
command_buffer: &mut Option<Retained<ProtocolObject<dyn MTLCommandBuffer>>>,
open: &mut OpenEncoder,
) -> Answer<Retained<ProtocolObject<dyn MTLBlitCommandEncoder>>> {
if let OpenEncoder::Blit(encoder) = open {
return Ok(encoder.clone());
}
open.end();
let buffer = self.open_command_buffer(command_buffer)?;
let encoder = buffer
.blitCommandEncoder()
.ok_or_else(|| Failure::named("BlitCommandEncoder", "returned nil".to_owned()))?;
*open = OpenEncoder::Blit(encoder.clone());
Ok(encoder)
}
/// The program's resource state encoder, ending a blit encoder first where one is open.
fn open_state(
&self,
command_buffer: &mut Option<Retained<ProtocolObject<dyn MTLCommandBuffer>>>,
open: &mut OpenEncoder,
) -> Answer<Retained<ProtocolObject<dyn MTLResourceStateCommandEncoder>>> {
if let OpenEncoder::State(encoder) = open {
return Ok(encoder.clone());
}
open.end();
let buffer = self.open_command_buffer(command_buffer)?;
let encoder = buffer.resourceStateCommandEncoder().ok_or_else(|| {
Failure::named("ResourceStateCommandEncoder", "returned nil".to_owned())
})?;
*open = OpenEncoder::State(encoder.clone());
Ok(encoder)
}
/// The rasterization-rate map `handle` names.
fn held_rate_map(
&self,
@@ -941,6 +1232,80 @@ impl MetalSide {
}
}
/// Bytes the command buffer whose timings [`Side::command_buffer_facts`] reads fills: a few, so
/// the GPU ran and nothing else did.
const TIMED_BYTES: usize = 256;
/// The labels the two queues of [`Side::command_buffer_facts`] take: distinct, so a command
/// buffer that answered the other queue reads as the other label.
const QUEUE_LABELS: [&str; 2] = ["conformance-queue-a", "conformance-queue-b"];
/// The byte a read-back buffer of a sparse mapping program is made holding, so a byte no copy
/// wrote is a value the side put there rather than whatever the allocator left.
const READ_GUARD: u8 = 0x7e;
/// Which encoder of a sparse mapping program's command buffer is open.
///
/// Metal takes one encoder at a time of a command buffer, so a program whose next command needs
/// the other kind ends this one first. The variants hold the encoder itself rather than a flag,
/// because ending it is a call on the object.
enum OpenEncoder {
None,
Blit(Retained<ProtocolObject<dyn MTLBlitCommandEncoder>>),
State(Retained<ProtocolObject<dyn MTLResourceStateCommandEncoder>>),
}
impl OpenEncoder {
/// End whichever encoder is open, leaving none.
fn end(&mut self) {
match self {
OpenEncoder::None => {}
OpenEncoder::Blit(encoder) => encoder.endEncoding(),
OpenEncoder::State(encoder) => encoder.endEncoding(),
}
*self = OpenEncoder::None;
}
}
/// Whether a step of a sparse mapping program closed its command buffer.
enum Commits {
No,
Yes,
}
/// Metal's `MTLSparseTextureMappingMode` for a case's mode, by its raw value, so the two spellings
/// cannot drift apart.
fn mapping_mode(mode: MappingMode) -> MTLSparseTextureMappingMode {
MTLSparseTextureMappingMode(mode.as_raw() as usize)
}
/// Three axes as Metal's size.
fn long_size(axes: [u64; 3]) -> MTLSize {
MTLSize {
width: axes[0] as usize,
height: axes[1] as usize,
depth: axes[2] as usize,
}
}
/// Three axes as Metal's origin.
fn long_origin(axes: [u64; 3]) -> MTLOrigin {
MTLOrigin {
x: axes[0] as usize,
y: axes[1] as usize,
z: axes[2] as usize,
}
}
/// A region of tiles as the `MTLRegion` the mapping calls take: Metal states a mapping region in
/// **tiles**, not texels, so the numbers pass through unchanged.
fn tile_region(region: &TileRect) -> MTLRegion {
MTLRegion {
origin: long_origin(region.origin),
size: long_size(region.size),
}
}
/// Three axes as Metal's size.
fn size(axes: [u32; 3]) -> MTLSize {
MTLSize {
@@ -5479,6 +5844,204 @@ impl Side for MetalSide {
}
Ok(facts)
}
fn sparse_mapping(&mut self, program: &SparseMappingProgram) -> Answer<SparseMapped> {
// The venue's own tile size, against the grid the program's regions are stated in. A
// disagreement stops the program **before anything is encoded**: a region in tiles means
// nothing without the grid it was written for, and a region past a level's tiles is the
// one shape in this family that could fault a device.
for spec in &program.textures {
let query = SparseTileQuery {
texture_type: spec.texture_type,
format: spec.format,
samples: spec.samples,
page: Some(program.heap.page),
};
let held = self.sparse_tile_size(&query)?;
let stated = program.tile.tile;
if [held.width, held.height, held.depth] != stated {
return Err(Failure::named(
"TileSize",
format!(
"{} tiles {}x{}x{} where the program states {}x{}x{}",
spec.site(),
held.width,
held.height,
held.depth,
stated[0],
stated[1],
stated[2]
),
));
}
}
let heap_handle = self.sparse_heap(&program.heap)?;
let mut textures = Vec::new();
for spec in &program.textures {
textures.push(self.heap_texture(heap_handle, spec)?);
}
let mut buffers = Vec::new();
for bytes in &program.buffers {
buffers.push(self.buffer(bytes)?);
}
let mut fences = Vec::new();
for at in 0..program.fences {
fences.push(
self.device.newFence().ok_or_else(|| {
Failure::named("NewFence", format!("fence {at} returned nil"))
})?,
);
}
let mut tails = Vec::new();
for texture in &textures {
let facts = self.sparse_texture_facts(*texture)?;
tails.push((facts.first_mipmap_in_tail, facts.tail_size_in_bytes));
}
// A scratch buffer for each fill and each read, in the order the steps name them, so a
// read's bytes are the side's own and never one of the program's.
let mut scratch: Vec<Handle> = Vec::new();
for step in &program.steps {
match step {
MappingStep::FillRegion { region, value, .. } => {
let (_, bytes) = program.tile.bytes_of(region);
scratch.push(self.buffer(&vec![*value; bytes as usize])?);
}
MappingStep::ReadRegion { region, .. } => {
let (_, bytes) = program.tile.bytes_of(region);
scratch.push(self.buffer(&vec![READ_GUARD; bytes as usize])?);
}
_ => {}
}
}
// The baseline: the heap with its textures made and nothing mapped.
let mut used_size = vec![self.heap_facts(heap_handle)?.used_size];
let mut refused: Vec<Option<Failure>> = Vec::with_capacity(program.steps.len());
let mut statuses = Vec::new();
let mut reads = Vec::new();
let mut pending: Vec<(usize, usize)> = Vec::new();
let mut scratch_at = 0usize;
let mut command_buffer: Option<Retained<ProtocolObject<dyn MTLCommandBuffer>>> = None;
let mut open = OpenEncoder::None;
for at in 0..program.steps.len() {
let answered = self.sparse_step(
program,
at,
&textures,
&buffers,
&fences,
&scratch,
&mut scratch_at,
&mut pending,
&mut command_buffer,
&mut open,
);
refused.push(match answered {
Ok(Commits::No) => None,
Ok(Commits::Yes) => {
let status = match command_buffer.take() {
Some(buffer) => {
buffer.commit();
buffer.waitUntilCompleted();
Value::unit_variant(status_word(buffer.status()))
}
None => Value::Absent,
};
statuses.push(status);
used_size.push(self.heap_facts(heap_handle)?.used_size);
for &(slot, length) in &pending {
reads.push(self.read_buffer(scratch[slot], 0, length)?);
}
pending.clear();
None
}
Err(failure) => Some(failure),
});
}
// A program that left an encoder open closes it and does not commit: its steps' answers
// stand, and the case's own guard holds every program to ending on a commit.
open.end();
Ok(SparseMapped {
refused,
used_size,
tails,
statuses,
reads,
})
}
fn command_buffer_facts(&mut self) -> Answer<CommandBufferFacts> {
let scratch = self.buffer(&[0u8; TIMED_BYTES])?;
let target = Retained::from(self.held(scratch)?);
let made = self
.queue
.commandBuffer()
.ok_or_else(|| Failure::named("CommandBuffer", "returned nil".to_owned()))?;
// Each getter is read through a binding of its own declared type, never as the scrutinee
// of an expression: the coverage derivation types a call's receiver from the expression
// before the dot, and a receiver it cannot type is attributed to no item at all.
let held: Retained<ProtocolObject<dyn MTLCommandBuffer>> = made;
let answered_device = held.device();
let queues_device = self.queue.device();
let device_is_the_queues = answered_device.registryID() == queues_device.registryID();
// Two queues with distinct labels, a command buffer on each: whether each command
// buffer's `commandQueue` answers **its own** queue's label. Neither API compares two
// queues for identity publicly, so this is the strongest fact both legs compute alike.
let mut queue_label_is_its_own = [false; 2];
for (at, label) in QUEUE_LABELS.iter().enumerate() {
let made = self.device.newCommandQueue().ok_or_else(|| {
Failure::named("NewCommandQueue", format!("{label} returned nil"))
})?;
let labelled: Retained<ProtocolObject<dyn MTLCommandQueue>> = made;
labelled.setLabel(Some(&NSString::from_str(label)));
let buffer: Retained<ProtocolObject<dyn MTLCommandBuffer>> =
labelled.commandBuffer().ok_or_else(|| {
Failure::named("CommandBuffer", format!("on {label} returned nil"))
})?;
let answered = buffer.commandQueue();
queue_label_is_its_own[at] =
answered.label().map(|held| held.to_string()).as_deref() == Some(*label);
}
let kernel_before = [held.kernelStartTime(), held.kernelEndTime()];
let gpu_before = [held.GPUStartTime(), held.GPUEndTime()];
// One blit of a few bytes of the side's own buffer: enough work that the GPU ran, and no
// shader, draw or dispatch at all.
let encoder = held
.blitCommandEncoder()
.ok_or_else(|| Failure::named("BlitCommandEncoder", "returned nil".to_owned()))?;
encoder.fillBuffer_range_value(&target, NSRange::new(0, TIMED_BYTES), 0xa5);
encoder.endEncoding();
held.commit();
held.waitUntilCompleted();
let status = Value::unit_variant(status_word(held.status()));
let kernel_after = [held.kernelStartTime(), held.kernelEndTime()];
let gpu_after = [held.GPUStartTime(), held.GPUEndTime()];
// A command buffer of its own for the encoder, so the timings above are of a command
// buffer that only blitted and this one only opens an encoder.
let state_buffer: Retained<ProtocolObject<dyn MTLCommandBuffer>> = self
.queue
.commandBuffer()
.ok_or_else(|| Failure::named("CommandBuffer", "returned nil".to_owned()))?;
let opened = state_buffer.resourceStateCommandEncoder();
let resource_state_encoder_opened = opened.is_some();
if let Some(encoder) = opened {
// Ended with nothing encoded into it: it maps nothing and takes no heap memory.
encoder.endEncoding();
}
state_buffer.commit();
state_buffer.waitUntilCompleted();
let state_encoder_status = Value::unit_variant(status_word(state_buffer.status()));
Ok(CommandBufferFacts::new(
device_is_the_queues,
queue_label_is_its_own,
kernel_before,
kernel_after,
Ok((gpu_before, gpu_after)),
resource_state_encoder_opened,
status,
state_encoder_status,
))
}
}
/// Metal's `MTLHeapType` for a case's heap type, by its raw value, so the two spellings cannot
@@ -14,6 +14,7 @@ use crate::case::{
RateMapFacts, RateMapRequest, SamplerSpec, ShaderSource, Side, StageInRegion, StageInput,
TextureRole, TextureSpec, TileFacts, TilePipelineSpec, TileStep, Venue,
};
use crate::command_buffer_facts::CommandBufferFacts;
use crate::compute_descriptors::{
ComputeDescriptorFacts, DescriptorSpec as ComputeDescriptorSpec,
SuppliedLists as ComputeSuppliedLists, AWAY as COMPUTE_AWAY,
@@ -53,6 +54,9 @@ use crate::render_descriptors::{
LinkedCounts, RenderDescriptorFacts, SuppliedLists, VertexDescriptorFacts, AWAY, READ_BUFFERS,
READ_COLORS, READ_VERTEX_SLOTS,
};
use crate::sparse_mapping::{
MappingMode, MappingStep, SparseMapped, SparseMappingProgram, TileRect,
};
use crate::sparse_query::{
HeapFacts, QueryPage, SparseHeapSpec, SparseTextureFacts, SparseTextureSpec, SparseTileQuery,
TileSize,
@@ -65,7 +69,7 @@ use crate::tile_descriptors::{
};
use crate::transcript::{Negative, Value};
use metal2vulkan::bind::{
ArgumentDescriptor, RateMapDescriptor, RateMapLayerDescriptor, SamplerDescriptor,
ArgumentDescriptor, RateMapDescriptor, RateMapLayerDescriptor, SamplerDescriptor, TileMapping,
};
use metal2vulkan::metal::state::DepthStencilDescriptor;
use metal2vulkan::metal::{
@@ -80,16 +84,16 @@ use metal2vulkan::pipeline::{
};
use metal2vulkan_runtime::{
ArgumentEncoder, BlitOption, Buffer, ClearColor, CommandBuffer, CommandBufferStatus,
CommandQueue, ComputePipelineState, DepthStencilState, Device, DrawPrimitiveType, Heap,
CommandQueue, ComputePipelineState, DepthStencilState, Device, DrawPrimitiveType, Fence, Heap,
HeapDescriptor, HeapType, HostMemory, IndirectCommand, IndirectCommandBuffer,
IndirectCommandBufferDescriptor, IndirectDraw, IoSurfacePlane, IoSurfaceYCbCr, Library,
LoadAction, MultisampleDepthResolveFilter, MultisampleStencilResolveFilter, Origin,
PipelineOption, PipelineOptions, PurgeableState, RasterizationRateMap, Region,
RenderPassColorAttachmentDescriptor, RenderPassDepthAttachmentDescriptor, RenderPassDescriptor,
RenderPassStencilAttachmentDescriptor, RenderPipelineState, ResourceOptions, ResourceRef,
SamplePosition, SamplerState, SamplerStateOptions, ScissorRect, Size,
SparseTextureRegionAlignmentMode, StoreAction, StoreActionOptions, Texture, TextureDescriptor,
Viewport,
ResourceStateCommandEncoder, SamplePosition, SamplerState, SamplerStateOptions, ScissorRect,
Size, SparseTextureRegionAlignmentMode, StoreAction, StoreActionOptions, Texture,
TextureDescriptor, Viewport,
};
use std::time::Duration;
@@ -1470,6 +1474,134 @@ fn our_pointer(held: &metal2vulkan::reflection::PointerType, depth: u32) -> Poin
}
/// The variant a command buffer's status records as.
/// Bytes the command buffer whose timings [`Side::command_buffer_facts`] reads fills: a few, so
/// the GPU ran and nothing else did.
const TIMED_BYTES: usize = 256;
/// The labels the two queues of [`Side::command_buffer_facts`] take: distinct, so a command
/// buffer that answered the other queue reads as the other label.
const QUEUE_LABELS: [&str; 2] = ["conformance-queue-a", "conformance-queue-b"];
/// The byte a read-back buffer of a sparse mapping program is made holding, so a byte no copy
/// wrote is a value the side put there rather than whatever the allocator left.
const READ_GUARD: u8 = 0x7e;
/// Whether a step of a sparse mapping program closed its command buffer.
enum Committed {
No,
Yes,
}
/// A sparse mapping program's command buffer and the one encoder of it that is open.
///
/// Two `Option`s rather than one enum, because the runtime's `end_encoding` consumes its encoder,
/// which is what [`Option::take`] hands over. Only one is ever `Some`:
/// [`Mapping::blit`] and [`Mapping::state`] close the other first, as the runtime refuses a second
/// encoder of one command buffer.
struct Mapping {
queue: CommandQueue,
command_buffer: Option<CommandBuffer>,
blit: Option<metal2vulkan_runtime::BlitCommandEncoder>,
state: Option<ResourceStateCommandEncoder>,
}
impl Mapping {
/// The command buffer the next command goes into, made on first use.
fn command_buffer(&mut self) -> Answer<CommandBuffer> {
if self.command_buffer.is_none() {
self.command_buffer = Some(self.queue.command_buffer().map_err(Failure::from_error)?);
}
Ok(self
.command_buffer
.clone()
.expect("the command buffer was just made"))
}
/// End whichever encoder is open, leaving none.
fn close_encoders(&mut self) -> Answer<()> {
if let Some(encoder) = self.blit.take() {
encoder.end_encoding().map_err(Failure::from_error)?;
}
if let Some(encoder) = self.state.take() {
encoder.end_encoding().map_err(Failure::from_error)?;
}
Ok(())
}
/// The program's blit encoder, ending a resource state encoder first where one is open.
fn blit(&mut self) -> Answer<&mut metal2vulkan_runtime::BlitCommandEncoder> {
if self.blit.is_none() {
self.close_encoders()?;
let buffer = self.command_buffer()?;
self.blit = Some(buffer.blit_command_encoder().map_err(Failure::from_error)?);
}
Ok(self.blit.as_mut().expect("the encoder was just opened"))
}
/// The program's resource state encoder, ending a blit encoder first where one is open.
fn state(&mut self) -> Answer<&mut ResourceStateCommandEncoder> {
if self.state.is_none() {
self.close_encoders()?;
let buffer = self.command_buffer()?;
self.state = Some(
buffer
.resource_state_command_encoder()
.map_err(Failure::from_error)?,
);
}
Ok(self.state.as_mut().expect("the encoder was just opened"))
}
}
/// The runtime's `TileMapping` for a case's mapping mode, by its raw value, so the two spellings
/// cannot drift apart.
fn tile_mapping(mode: MappingMode) -> TileMapping {
match mode {
MappingMode::Map => TileMapping::Map,
MappingMode::Unmap => TileMapping::Unmap,
}
}
/// Three axes as the runtime's size.
fn long_size(axes: [u64; 3]) -> Size {
Size {
width: axes[0],
height: axes[1],
depth: axes[2],
}
}
/// Three axes as the runtime's origin.
fn long_origin(axes: [u64; 3]) -> Origin {
Origin {
x: axes[0],
y: axes[1],
z: axes[2],
}
}
/// A region of tiles as the `Region` the mapping calls take: a mapping region is stated in
/// **tiles**, not texels, so the numbers pass through unchanged.
fn tile_region(region: &TileRect) -> Region {
Region {
origin: long_origin(region.origin),
size: long_size(region.size),
}
}
/// `GPUStartTime` and `GPUEndTime`, or the runtime's typed refusal of them: a device whose queue
/// family writes no timestamps has no answer, and that is a fact the facts record as a refusal
/// rather than as two zeros.
fn gpu_times(command_buffer: &CommandBuffer) -> Result<[f64; 2], Failure> {
let start = command_buffer
.gpu_start_time()
.map_err(|error| Failure::of(&error))?;
let end = command_buffer
.gpu_end_time()
.map_err(|error| Failure::of(&error))?;
Ok([start, end])
}
fn status_value(status: CommandBufferStatus) -> Value {
Value::unit_variant(format!("{status:?}"))
}
@@ -4993,6 +5125,378 @@ impl Side for RuntimeSide<'_> {
keep(&mut self.textures, opened);
Ok(facts)
}
fn sparse_mapping(&mut self, program: &SparseMappingProgram) -> Answer<SparseMapped> {
// The venue's own tile size, against the grid the program's regions are stated in. A
// disagreement stops the program **before anything is encoded**: a region in tiles means
// nothing without the grid it was written for.
for spec in &program.textures {
let query = SparseTileQuery {
texture_type: spec.texture_type,
format: spec.format,
samples: spec.samples,
page: Some(program.heap.page),
};
let held = self.sparse_tile_size(&query)?;
let stated = program.tile.tile;
if [held.width, held.height, held.depth] != stated {
return Err(Failure::named(
"TileSize",
format!(
"{} tiles {}x{}x{} where the program states {}x{}x{}",
spec.site(),
held.width,
held.height,
held.depth,
stated[0],
stated[1],
stated[2]
),
));
}
}
let heap_handle = self.sparse_heap(&program.heap)?;
let heap = self.held_heap(heap_handle)?.clone();
let mut textures = Vec::new();
for spec in &program.textures {
let made = self.heap_texture(heap_handle, spec)?;
textures.push(self.held_texture(made)?.clone());
}
let mut buffers = Vec::new();
for bytes in &program.buffers {
let made = self.buffer(bytes)?;
buffers.push(self.held(made)?.clone());
}
let fences: Vec<Fence> = (0..program.fences)
.map(|_| self.device.new_fence())
.collect();
let tails: Vec<(u64, u64)> = textures
.iter()
.map(|texture| {
(
texture.first_mipmap_in_tail().unwrap_or(0),
texture.tail_size_in_bytes().unwrap_or(0),
)
})
.collect();
// A scratch buffer for each fill and each read, in the order the steps name them, so a
// read's bytes are the side's own and never one of the program's.
let mut scratch: Vec<Handle> = Vec::new();
for step in &program.steps {
let bytes = match step {
MappingStep::FillRegion { region, value, .. } => {
let (_, length) = program.tile.bytes_of(region);
vec![*value; length as usize]
}
MappingStep::ReadRegion { region, .. } => {
let (_, length) = program.tile.bytes_of(region);
vec![READ_GUARD; length as usize]
}
_ => continue,
};
scratch.push(self.buffer(&bytes)?);
}
let held_scratch: Vec<Buffer> = scratch
.iter()
.map(|handle| self.held(*handle).cloned())
.collect::<Answer<Vec<Buffer>>>()?;
let queue = self.queue()?.clone();
let mut run = Mapping {
queue,
command_buffer: None,
blit: None,
state: None,
};
let texture_at = |at: usize| -> Answer<&Texture> {
textures
.get(at)
.ok_or_else(|| Failure::named("NoSuchHandle", format!("texture {at}")))
};
let mut used_size = vec![heap.used_size()];
let mut refused: Vec<Option<Failure>> = Vec::with_capacity(program.steps.len());
let mut statuses = Vec::new();
let mut reads = Vec::new();
let mut pending: Vec<(usize, usize)> = Vec::new();
let mut scratch_at = 0usize;
for step in &program.steps {
let answered: Answer<Committed> =
(|| match step {
MappingStep::Commit => {
run.close_encoders()?;
match run.command_buffer.is_some() {
true => Ok(Committed::Yes),
false => Err(Failure::named("NoCommandBuffer", "a commit of nothing")),
}
}
MappingStep::NextEncoder => {
run.close_encoders()?;
Ok(Committed::No)
}
MappingStep::FillRegion {
texture,
level,
slice,
region,
..
} => {
let held = texture_at(*texture)?.clone();
let source = held_scratch[scratch_at].clone();
let (per_row, bytes) = program.tile.bytes_of(region);
let (origin, extent) = program.tile.texels_of(region);
scratch_at += 1;
run.blit()?
.copy_from_buffer_to_texture(
&source,
0,
per_row,
bytes,
long_size(extent),
&held,
*slice,
*level,
long_origin(origin),
BlitOption::None,
)
.map_err(|error| Failure::of(&error))?;
Ok(Committed::No)
}
MappingStep::ReadRegion {
texture,
level,
slice,
region,
} => {
let held = texture_at(*texture)?.clone();
let into = held_scratch[scratch_at].clone();
let (per_row, bytes) = program.tile.bytes_of(region);
let (origin, extent) = program.tile.texels_of(region);
pending.push((scratch_at, bytes as usize));
scratch_at += 1;
run.blit()?
.copy_from_texture_to_buffer(
&held,
*slice,
*level,
long_origin(origin),
long_size(extent),
&into,
0,
per_row,
bytes,
BlitOption::None,
)
.map_err(|error| Failure::of(&error))?;
Ok(Committed::No)
}
MappingStep::One {
texture,
mode,
region,
level,
slice,
} => {
let held = texture_at(*texture)?.clone();
run.state()?
.update_texture_mapping(
&held,
tile_mapping(*mode),
tile_region(region),
*level,
*slice,
)
.map_err(|error| Failure::of(&error))?;
Ok(Committed::No)
}
MappingStep::Many {
texture,
mode,
regions,
} => {
let held = texture_at(*texture)?.clone();
let rects: Vec<Region> = regions
.iter()
.map(|(region, _, _)| tile_region(region))
.collect();
let levels: Vec<u64> = regions.iter().map(|(_, level, _)| *level).collect();
let slices: Vec<u64> = regions.iter().map(|(_, _, slice)| *slice).collect();
run.state()?
.update_texture_mappings(
&held,
tile_mapping(*mode),
&rects,
&levels,
&slices,
)
.map_err(|error| Failure::of(&error))?;
Ok(Committed::No)
}
MappingStep::Indirect {
texture,
mode,
buffer,
offset,
} => {
let held = texture_at(*texture)?.clone();
let arguments = buffers.get(*buffer).cloned().ok_or_else(|| {
Failure::named("NoSuchHandle", format!("buffer {buffer}"))
})?;
run.state()?
.update_texture_mapping_indirect(
&held,
tile_mapping(*mode),
&arguments,
*offset,
)
.map_err(|error| Failure::of(&error))?;
Ok(Committed::No)
}
MappingStep::Move {
from,
from_slice,
from_level,
from_origin,
size,
to,
to_slice,
to_level,
to_origin,
} => {
let source = texture_at(*from)?.clone();
let destination = texture_at(*to)?.clone();
run.state()?
.move_texture_mappings(
&source,
*from_slice,
*from_level,
long_origin(*from_origin),
long_size(*size),
&destination,
*to_slice,
*to_level,
long_origin(*to_origin),
)
.map_err(|error| Failure::of(&error))?;
Ok(Committed::No)
}
MappingStep::UpdateFence { fence } => {
let held = fences.get(*fence).cloned().ok_or_else(|| {
Failure::named("NoSuchHandle", format!("fence {fence}"))
})?;
run.state()?
.update_fence(&held)
.map_err(|error| Failure::of(&error))?;
Ok(Committed::No)
}
MappingStep::WaitForFence { fence } => {
let held = fences.get(*fence).cloned().ok_or_else(|| {
Failure::named("NoSuchHandle", format!("fence {fence}"))
})?;
run.state()?
.wait_for_fence(&held)
.map_err(|error| Failure::of(&error))?;
Ok(Committed::No)
}
})();
let committed = matches!(answered, Ok(Committed::Yes));
refused.push(answered.err());
if !committed {
continue;
}
let status = match run.command_buffer.take() {
Some(buffer) => {
buffer.commit().map_err(|error| Failure::of(&error))?;
match buffer.wait_until_completed_for(WAIT) {
Ok(()) => status_value(buffer.status()),
Err(_) => Value::Nothing(Negative::NeverReturned),
}
}
None => Value::Absent,
};
statuses.push(status);
used_size.push(heap.used_size());
for &(slot, length) in &pending {
reads.push(self.read_buffer(scratch[slot], 0, length)?);
}
pending.clear();
}
// A program that left an encoder open closes it: its steps' answers stand, and the case's
// own guard holds every program to ending on a commit.
let _ = run.close_encoders();
Ok(SparseMapped {
refused,
used_size,
tails,
statuses,
reads,
})
}
fn command_buffer_facts(&mut self) -> Answer<CommandBufferFacts> {
let scratch = self.buffer(&[0u8; TIMED_BYTES])?;
let target = self.held(scratch)?.clone();
let queue = self.queue()?.clone();
// Two queues with distinct labels, a command buffer on each: whether each command
// buffer's `command_queue` answers **its own** queue's label. Neither API compares two
// queues for identity publicly, so this is the strongest fact both legs compute alike.
let mut queue_label_is_its_own = [false; 2];
for (at, label) in QUEUE_LABELS.iter().enumerate() {
let labelled: CommandQueue = self
.device
.new_command_queue()
.map_err(Failure::from_error)?;
labelled.set_label(label);
let buffer: CommandBuffer = labelled.command_buffer().map_err(Failure::from_error)?;
let answered = buffer.command_queue();
queue_label_is_its_own[at] = answered.label().as_deref() == Some(*label);
}
let held: CommandBuffer = queue.command_buffer().map_err(Failure::from_error)?;
let device_is_the_queues = held.device().registry_id() == queue.device().registry_id();
let kernel_before = [held.kernel_start_time(), held.kernel_end_time()];
let gpu_before = gpu_times(&held);
// One blit of a few bytes of the side's own buffer: enough work that the GPU ran, and no
// shader, draw or dispatch at all.
let mut encoder = held.blit_command_encoder().map_err(Failure::from_error)?;
encoder
.fill_buffer(&target, 0..TIMED_BYTES as u64, 0xa5)
.map_err(Failure::from_error)?;
encoder.end_encoding().map_err(Failure::from_error)?;
held.commit().map_err(Failure::from_error)?;
let status = match held.wait_until_completed_for(WAIT) {
Ok(()) => status_value(held.status()),
Err(_) => Value::Nothing(Negative::NeverReturned),
};
let kernel_after = [held.kernel_start_time(), held.kernel_end_time()];
let gpu_after = gpu_times(&held);
// A command buffer of its own for the encoder, so the timings above are of a command
// buffer that only blitted and this one only opens an encoder.
let state_buffer: CommandBuffer = queue.command_buffer().map_err(Failure::from_error)?;
let opened = state_buffer.resource_state_command_encoder();
let resource_state_encoder_opened = opened.is_ok();
// Ended with nothing encoded into it: it maps nothing and takes no heap memory.
if let Ok(encoder) = opened {
encoder.end_encoding().map_err(Failure::from_error)?;
}
state_buffer.commit().map_err(Failure::from_error)?;
let state_encoder_status = match state_buffer.wait_until_completed_for(WAIT) {
Ok(()) => status_value(state_buffer.status()),
Err(_) => Value::Nothing(Negative::NeverReturned),
};
let gpu = match (gpu_before, gpu_after) {
(Ok(before), Ok(after)) => Ok((before, after)),
(Err(failure), _) | (_, Err(failure)) => Err(failure),
};
Ok(CommandBufferFacts::new(
device_is_the_queues,
queue_label_is_its_own,
kernel_before,
kernel_after,
gpu,
resource_state_encoder_opened,
status,
state_encoder_status,
))
}
}
/// The storage mode a [`Storage`] names, as the runtime's own enumeration spells it.
@@ -0,0 +1,804 @@
//! What a case asks an `MTLResourceStateCommandEncoder` to do: one program of mapping updates, its
//! commands stated in order, and what the heap and the texels said afterwards.
//!
//! `MTLResourceStateCommandEncoder` is the one implemented container the suite reached **no item of
//! at all** before this module: seven items, none exercised, so nothing in the tree held Metal to
//! its sparse mapping behaviour. The runtime's own `sparse/encoder.rs` carries paragraphs of
//! measured Metal behaviour — the tail maps whole, a region of no tiles maps nothing, a move onto a
//! mapped tile leaves it where it is — each of them a probe somebody ran once and wrote down. This
//! is the vocabulary that lets a case measure them instead.
//!
//! # The measurement
//!
//! A mapping takes memory from a sparse heap, so the heap's `usedSize` **is** the answer: it rises
//! by the tiles a map took and falls by the tiles an unmap gave back, and it does neither where
//! Metal maps nothing. It is read after every commit ([`MappingStep::Commit`]), so a program that
//! maps, unmaps and maps again records three numbers rather than one.
//!
//! Beside it, a region's **texels**: a program may write known bytes into tiles it has mapped and
//! read them back ([`MappingStep::FillRegion`], [`MappingStep::ReadRegion`]), which is what says
//! the mapping backed real memory rather than only moving a counter.
//!
//! # Why nothing here can fault
//!
//! Sparse mapping is the one shape in this round's territory where an out-of-range region could
//! fault a device, so **every region is in tiles and bounded by the texture's own tile grid**:
//!
//! - A region is stated in **tiles**, never in texels, so a case cannot state a region whose
//! meaning depends on arithmetic it got wrong.
//! - A case states the tile grid it assumes as one of its inputs and **reads the venue's own tile
//! size first**, aborting with a typed failure where the two disagree
//! ([`SparseMappingProgram::tile`]). A venue whose tiles are another size records that refusal
//! rather than being handed a region past its grid.
//! - A guard over the case's own rows checks every region against that stated grid with no device
//! at all, so a row that grew past it fails in the test suite rather than on a GPU.
//! - A fill or a read names a region of tiles the program **mapped** and nothing else, which a
//! guard also holds: a blit over an unmapped tile is a shape nobody here has measured, and it
//! stays out until somebody does.
//!
//! Nothing dispatches, nothing draws, no shader runs, every wait is bounded and the heap is a few
//! mebibytes. Nothing here reads a device name, a vendor or an environment variable: a venue that
//! refuses one of these updates refuses it typed, at its own step.
use crate::case::Failure;
use crate::transcript::{Node, NodeName, Observed, Value};
/// `MTLSparseTextureMappingMode`: the two modes an update takes, and the whole of that enum.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MappingMode {
/// `MTLSparseTextureMappingModeMap`.
Map,
/// `MTLSparseTextureMappingModeUnmap`.
Unmap,
}
impl MappingMode {
/// The raw `MTLSparseTextureMappingMode`.
pub const fn as_raw(self) -> u64 {
match self {
MappingMode::Map => 0,
MappingMode::Unmap => 1,
}
}
/// The mode's name, for a site and for a case's own prose.
pub const fn word(self) -> &'static str {
match self {
MappingMode::Map => "map",
MappingMode::Unmap => "unmap",
}
}
/// Both modes, which is every value `MTLSparseTextureMappingMode` has.
pub const ALL: [MappingMode; 2] = [MappingMode::Map, MappingMode::Unmap];
}
/// A region of a texture's tile grid: an origin and a size, **in tiles**.
///
/// In tiles and not in texels, because that is the unit Metal's own
/// `updateTextureMapping:mode:region:mipLevel:slice:` takes and the unit a case can bound without
/// knowing a device's tile extent. A side converts it to the texels Metal's `MTLRegion` wants
/// through the venue's own tile size, which is the one number a case reads from the device.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct TileRect {
pub origin: [u64; 3],
pub size: [u64; 3],
}
impl TileRect {
/// A region of one image: `size` tiles at `origin`.
pub const fn new(origin: [u64; 2], size: [u64; 2]) -> Self {
Self {
origin: [origin[0], origin[1], 0],
size: [size[0], size[1], 1],
}
}
/// The one tile at `origin`.
pub const fn one(origin: [u64; 2]) -> Self {
Self::new(origin, [1, 1])
}
/// A region of no tiles at `origin`: the shape Metal maps nothing for, which is a fact and not
/// a nothing.
pub const fn none(origin: [u64; 2]) -> Self {
Self::new(origin, [0, 0])
}
/// The tiles the region holds.
pub const fn tiles(&self) -> u64 {
self.size[0] * self.size[1] * self.size[2]
}
/// The words a case's input fingerprint covers.
pub fn words(&self) -> Vec<u8> {
self.origin
.iter()
.chain(&self.size)
.flat_map(|axis| axis.to_le_bytes())
.collect()
}
}
/// The tile grid a case assumes, in tiles a level, stated as an input and checked against the
/// venue's own `sparseTileSizeWithTextureType:pixelFormat:sampleCount:` before anything is
/// encoded.
///
/// A case cannot derive it: the tile extent is the device's answer, and a region past a level's
/// tiles is the one shape in this territory that could fault. So the case says what it assumes,
/// the side says what the device has, and a disagreement is a typed abort at a named site.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct TileGrid {
/// The texels one tile covers, on each axis.
pub tile: [u64; 3],
/// Bytes one texel of the program's textures takes, which a fill and a read need to size their
/// buffer. A property of the pixel format the case chose, so the case states it.
pub texel_bytes: u64,
}
impl TileGrid {
/// A grid of `width` by `height` texels a tile, one image deep, of `texel_bytes` a texel.
pub const fn new(width: u64, height: u64, texel_bytes: u64) -> Self {
Self {
tile: [width, height, 1],
texel_bytes,
}
}
/// The texel rectangle the tiles `region` cover: the origin and the size, both in texels.
///
/// A fill and a read go through this one function on both sides, so neither can read a
/// region's texels differently from the other.
pub const fn texels_of(&self, region: &TileRect) -> ([u64; 3], [u64; 3]) {
(
[
region.origin[0] * self.tile[0],
region.origin[1] * self.tile[1],
region.origin[2] * self.tile[2],
],
[
region.size[0] * self.tile[0],
region.size[1] * self.tile[1],
region.size[2] * self.tile[2],
],
)
}
/// Bytes a row of the tiles `region` takes, and the bytes the whole region takes.
pub const fn bytes_of(&self, region: &TileRect) -> (u64, u64) {
let (_, size) = self.texels_of(region);
let per_row = size[0] * self.texel_bytes;
(per_row, per_row * size[1] * max_one(size[2]))
}
/// The tiles level `level` of a texture `width` by `height` holds, on each axis: the level's
/// extent in texels, rounded **up** to whole tiles, as Metal's own grid rounds it.
pub const fn tiles_at(&self, width: u64, height: u64, level: u32) -> [u64; 2] {
let level_width = max_one(width >> level);
let level_height = max_one(height >> level);
[
level_width.div_ceil(self.tile[0]),
level_height.div_ceil(self.tile[1]),
]
}
/// The words a case's input fingerprint covers.
pub fn words(&self) -> Vec<u8> {
self.tile
.iter()
.chain(std::iter::once(&self.texel_bytes))
.flat_map(|axis| axis.to_le_bytes())
.collect()
}
}
/// `n`, or 1 where it is 0: a mip level's extent never falls below one texel.
const fn max_one(n: u64) -> u64 {
if n == 0 {
1
} else {
n
}
}
/// One command a case encodes into a sparse mapping program, in the order it lists them.
///
/// The mapping commands go into an `MTLResourceStateCommandEncoder` and the fill and the read into
/// an `MTLBlitCommandEncoder`; the side opens whichever the next command needs and ends the other,
/// because Metal takes one encoder at a time of a command buffer and the runtime refuses a second.
#[derive(Clone, Debug, PartialEq)]
pub enum MappingStep {
/// `updateTextureMapping:mode:region:mipLevel:slice:`.
One {
texture: usize,
mode: MappingMode,
region: TileRect,
level: u64,
slice: u64,
},
/// `updateTextureMappings:mode:regions:mipLevels:slices:numRegions:`: each region with its own
/// level and slice, in one call.
Many {
texture: usize,
mode: MappingMode,
/// The regions, each with the level and the slice it names.
regions: Vec<(TileRect, u64, u64)>,
},
/// `updateTextureMapping:mode:indirectBuffer:indirectBufferOffset:`: the regions the buffer
/// holds at `offset` — a 32-bit count, then that many `MTLMapIndirectArguments`.
Indirect {
texture: usize,
mode: MappingMode,
buffer: usize,
offset: u64,
},
/// `moveTextureMappingsFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toTexture:
/// destinationSlice:destinationLevel:destinationOrigin:`.
Move {
from: usize,
from_slice: u64,
from_level: u64,
from_origin: [u64; 3],
size: [u64; 3],
to: usize,
to_slice: u64,
to_level: u64,
to_origin: [u64; 3],
},
/// `updateFence:` of the resource state encoder.
UpdateFence { fence: usize },
/// `waitForFence:` of the resource state encoder.
WaitForFence { fence: usize },
/// `endEncoding` of whichever encoder is open, **without** committing, so the commands after
/// it go into a second encoder of the same command buffer.
///
/// A fence orders one encoder's work against another's, so a program over
/// [`MappingStep::UpdateFence`] needs two encoders of one command buffer and this is how it
/// says so. [`MappingStep::Commit`] is not that step: it closes the command buffer too, and
/// the queue orders two command buffers anyway.
NextEncoder,
/// A blit of `value` into every byte of the tiles `region` of `level` and `slice`, out of a
/// buffer the side makes: how a program writes known bytes into tiles it has mapped.
///
/// Its region must be tiles the program mapped and has not unmapped, which the case's own
/// guard holds.
FillRegion {
texture: usize,
level: u64,
slice: u64,
region: TileRect,
value: u8,
},
/// A blit of the tiles `region` of `level` and `slice` out to a buffer, which answers a read:
/// the texels those tiles hold.
///
/// Its region must be tiles the program mapped, as [`MappingStep::FillRegion`]'s must.
ReadRegion {
texture: usize,
level: u64,
slice: u64,
region: TileRect,
},
/// `endEncoding`, `commit` and a bounded wait: the command buffer's status is recorded, every
/// read the steps before it asked for is answered, and the heap's `usedSize` is read.
Commit,
}
impl MappingStep {
/// The Metal call the step makes, which is the site its answer is emitted at, so a refusal
/// reads as the call we refused.
pub fn call(&self) -> &'static str {
match self {
MappingStep::One { .. } => "updateTextureMapping",
MappingStep::Many { .. } => "updateTextureMappings",
MappingStep::Indirect { .. } => "updateTextureMappingIndirect",
MappingStep::Move { .. } => "moveTextureMappingsFromTexture",
MappingStep::UpdateFence { .. } => "updateFence",
MappingStep::WaitForFence { .. } => "waitForFence",
MappingStep::NextEncoder => "endEncoding",
MappingStep::FillRegion { .. } => "copyFromBufferToTexture",
MappingStep::ReadRegion { .. } => "copyFromTextureToBuffer",
MappingStep::Commit => "commit",
}
}
/// Whether the step answers a read.
pub fn reads(&self) -> bool {
matches!(self, MappingStep::ReadRegion { .. })
}
/// Whether the step is a mapping update, which is what the guard that bounds a program's
/// regions reads.
pub fn maps(&self) -> bool {
matches!(
self,
MappingStep::One { .. }
| MappingStep::Many { .. }
| MappingStep::Indirect { .. }
| MappingStep::Move { .. }
)
}
/// The parameters the step's own call carries, for a case's input fingerprint: everything but
/// the resources' indices, which the program itself fingerprints.
pub fn parameters(&self) -> Vec<u8> {
let mut words = self.call().as_bytes().to_vec();
let axes = |words: &mut Vec<u8>, of: &[u64]| {
for axis in of {
words.extend(axis.to_le_bytes());
}
};
match self {
MappingStep::One {
texture,
mode,
region,
level,
slice,
} => {
words.extend((*texture as u64).to_le_bytes());
words.extend(mode.as_raw().to_le_bytes());
words.extend(region.words());
axes(&mut words, &[*level, *slice]);
}
MappingStep::Many {
texture,
mode,
regions,
} => {
words.extend((*texture as u64).to_le_bytes());
words.extend(mode.as_raw().to_le_bytes());
words.extend((regions.len() as u64).to_le_bytes());
for (region, level, slice) in regions {
words.extend(region.words());
axes(&mut words, &[*level, *slice]);
}
}
MappingStep::Indirect {
texture,
mode,
buffer,
offset,
} => {
words.extend((*texture as u64).to_le_bytes());
words.extend(mode.as_raw().to_le_bytes());
words.extend((*buffer as u64).to_le_bytes());
words.extend(offset.to_le_bytes());
}
MappingStep::Move {
from,
from_slice,
from_level,
from_origin,
size,
to,
to_slice,
to_level,
to_origin,
} => {
axes(
&mut words,
&[
*from as u64,
*from_slice,
*from_level,
*to as u64,
*to_slice,
*to_level,
],
);
axes(&mut words, from_origin);
axes(&mut words, size);
axes(&mut words, to_origin);
}
MappingStep::UpdateFence { fence } | MappingStep::WaitForFence { fence } => {
words.extend((*fence as u64).to_le_bytes());
}
MappingStep::NextEncoder | MappingStep::Commit => {}
MappingStep::FillRegion {
texture,
level,
slice,
region,
value,
} => {
words.extend((*texture as u64).to_le_bytes());
axes(&mut words, &[*level, *slice]);
words.extend(region.words());
words.push(*value);
}
MappingStep::ReadRegion {
texture,
level,
slice,
region,
} => {
words.extend((*texture as u64).to_le_bytes());
axes(&mut words, &[*level, *slice]);
words.extend(region.words());
}
}
words
}
}
/// One sparse mapping program a case runs: the heap, the textures over it, the buffers an indirect
/// update reads, the fences, the tile grid the regions are stated in, and the commands.
#[derive(Clone, Debug, PartialEq)]
pub struct SparseMappingProgram {
/// The sparse heap every texture of the program is made on.
pub heap: crate::sparse_query::SparseHeapSpec,
/// The sparse textures the program makes, in the order its steps name them.
pub textures: Vec<crate::sparse_query::SparseTextureSpec>,
/// The buffers the program makes, by their bytes: what an indirect update reads.
pub buffers: Vec<Vec<u8>>,
/// How many fences the program makes.
pub fences: usize,
/// The tile grid the program's regions are stated in, checked against the venue's own tile
/// size before anything is encoded.
pub tile: TileGrid,
/// The commands, in order.
pub steps: Vec<MappingStep>,
}
impl SparseMappingProgram {
/// The words a case's input fingerprint covers: the heap, every texture, every buffer, the
/// fence count, the tile grid and every step's own parameters, so a program whose commands or
/// whose order moved is a change to the case's inputs.
pub fn words(&self) -> Vec<u8> {
let mut words = self.heap.words();
for texture in &self.textures {
words.extend(texture.words());
}
for bytes in &self.buffers {
words.extend((bytes.len() as u64).to_le_bytes());
words.extend(bytes);
}
words.extend((self.fences as u64).to_le_bytes());
words.extend(self.tile.words());
for step in &self.steps {
words.extend(step.parameters());
}
words
}
/// How many reads the program asks for.
pub fn reads(&self) -> usize {
self.steps.iter().filter(|step| step.reads()).count()
}
/// How many commits the program makes, which is how many `usedSize` readings it records.
pub fn commits(&self) -> usize {
self.steps
.iter()
.filter(|step| matches!(step, MappingStep::Commit))
.count()
}
}
/// What one sparse mapping program came to.
#[derive(Clone, Debug, PartialEq)]
pub struct SparseMapped {
/// What each step answered, in the order the program gave them: `None` where the call
/// answered, the typed error where it did not. Metal's encoder methods answer nothing, so its
/// leg answers `None` throughout and a refusal of ours reads as a refusal rather than as a
/// shape mismatch.
pub refused: Vec<Option<Failure>>,
/// The heap's `usedSize`, read once with the textures made and nothing encoded, then after
/// every commit in commit order — the measurement a mapping case is about.
///
/// The first reading is the baseline: a sparse heap holds no memory until a mapping takes a
/// tile, so a program that maps nothing records the baseline twice and a program that maps one
/// tile records the tile.
pub used_size: Vec<u64>,
/// Each texture's `firstMipmapInTail` and `tailSizeInBytes`, which say where the program's
/// levels stand relative to the tail.
pub tails: Vec<(u64, u64)>,
/// Each command buffer's status, in commit order.
pub statuses: Vec<Value>,
/// The reads the program asked for, in the order its steps asked.
pub reads: Vec<Vec<u8>>,
}
impl SparseMapped {
/// The program's answer as the sites a case emits under one node, so both sides emit one
/// shape.
///
/// Each step's site is named by its **position and its call**, so two steps that make the same
/// call are two sites rather than one name twice.
pub fn node(&self, name: impl Into<NodeName>, steps: &[MappingStep]) -> Node {
let mut node = Node::branch(name, Vec::new());
for (at, size) in self.used_size.iter().enumerate() {
node = node.with(Node::leaf(
format!("used-size/{at}"),
Observed::value(Value::Uint(*size)),
));
}
for (at, (first, tail)) in self.tails.iter().enumerate() {
node = node.with(Node::leaf(
format!("tail/{at}/first-mipmap"),
Observed::value(Value::Uint(*first)),
));
node = node.with(Node::leaf(
format!("tail/{at}/bytes"),
Observed::value(Value::Uint(*tail)),
));
}
for (at, status) in self.statuses.iter().enumerate() {
node = node.with(Node::leaf(
format!("status/{at}"),
Observed::value(status.clone()),
));
}
for (at, (step, refused)) in steps.iter().zip(&self.refused).enumerate() {
node = node.with(Node::leaf(
format!("step/{at}/{}", step.call()),
Observed::value(match refused {
None => Value::ok(Value::Absent),
Some(failure) => failure.recorded(),
}),
));
}
node
}
/// The first step the program refused, with its position, where one did.
pub fn first_refusal(&self) -> Option<(usize, &Failure)> {
self.refused
.iter()
.enumerate()
.find_map(|(at, refused)| refused.as_ref().map(|failure| (at, failure)))
}
}
#[cfg(test)]
mod tests {
use super::*;
use std::collections::BTreeSet;
use std::mem::discriminant;
/// Every kind of one vocabulary, from `first` through the successor each kind names.
///
/// The exhaustiveness comes from `after`: a `match` over every variant of its enum with **no
/// wildcard arm**, so a variant added to [`MappingStep`] does not compile until it is given an
/// arm, and the arm of the kind it is placed after hands it to this walk. The guards then read
/// the walk rather than an array written out beside the enum, which is the thing a new variant
/// can be added without touching.
fn every_kind<T: std::fmt::Debug>(first: T, after: impl Fn(&T) -> Option<T>) -> Vec<T> {
let mut kinds = vec![first];
let mut walked = vec![discriminant(&kinds[0])];
while let Some(next) = after(kinds.last().expect("the walk starts at its first kind")) {
assert!(
!walked.contains(&discriminant(&next)),
"the walk of {} returns to {next:?}, so it is a cycle rather than each kind once",
std::any::type_name::<T>()
);
walked.push(discriminant(&next));
kinds.push(next);
}
kinds
}
/// Every step a program can hold, one of each kind, in declaration order.
fn every_step() -> Vec<MappingStep> {
every_kind(
MappingStep::One {
texture: 0,
mode: MappingMode::Map,
region: TileRect::one([0, 0]),
level: 0,
slice: 0,
},
step_after,
)
}
/// The step that follows `step` in declaration order, or `None` after the last.
///
/// One arm per variant and no wildcard: see [`every_kind`] for why that is the whole point.
fn step_after(step: &MappingStep) -> Option<MappingStep> {
Some(match step {
MappingStep::One { .. } => MappingStep::Many {
texture: 0,
mode: MappingMode::Map,
regions: vec![(TileRect::one([0, 0]), 0, 0)],
},
MappingStep::Many { .. } => MappingStep::Indirect {
texture: 0,
mode: MappingMode::Map,
buffer: 0,
offset: 0,
},
MappingStep::Indirect { .. } => MappingStep::Move {
from: 0,
from_slice: 0,
from_level: 0,
from_origin: [0, 0, 0],
size: [1, 1, 1],
to: 1,
to_slice: 0,
to_level: 0,
to_origin: [1, 0, 0],
},
MappingStep::Move { .. } => MappingStep::UpdateFence { fence: 0 },
MappingStep::UpdateFence { .. } => MappingStep::WaitForFence { fence: 0 },
MappingStep::WaitForFence { .. } => MappingStep::NextEncoder,
MappingStep::NextEncoder => MappingStep::FillRegion {
texture: 0,
level: 0,
slice: 0,
region: TileRect::one([0, 0]),
value: 1,
},
MappingStep::FillRegion { .. } => MappingStep::ReadRegion {
texture: 0,
level: 0,
slice: 0,
region: TileRect::one([0, 0]),
},
MappingStep::ReadRegion { .. } => MappingStep::Commit,
MappingStep::Commit => return None,
})
}
/// Every step names a Metal call no other step names, so a refusal reads as the call we
/// refused and the fingerprint keys each step by its own name.
///
/// It reads the compiler-kept walk, so a variant added to [`MappingStep`] is in this check the
/// moment it compiles.
#[test]
fn every_step_names_a_call_of_its_own() {
let steps = every_step();
let named: BTreeSet<&str> = steps.iter().map(MappingStep::call).collect();
assert_eq!(named.len(), steps.len(), "{named:?}");
}
/// Two steps that make the same call hold two sites, not one name twice.
#[test]
fn repeated_steps_hold_sites_of_their_own() {
let steps = vec![
MappingStep::One {
texture: 0,
mode: MappingMode::Map,
region: TileRect::one([0, 0]),
level: 0,
slice: 0,
};
4
];
let mapped = SparseMapped {
refused: vec![None; steps.len()],
used_size: vec![0],
tails: vec![(3, 16384)],
statuses: vec![Value::unit_variant("Completed")],
reads: Vec::new(),
};
let node = mapped.node("mapping", &steps);
let names: BTreeSet<String> = node
.children
.iter()
.map(|child| child.name.to_string())
.collect();
assert_eq!(
names.len(),
node.children.len(),
"two of the program's sites share a name: {names:?}"
);
}
/// Both modes of `MTLSparseTextureMappingMode` are named, and their raw values are Metal's.
#[test]
fn both_mapping_modes_are_named_by_their_raw_value() {
assert_eq!(MappingMode::ALL.len(), 2);
assert_eq!(MappingMode::Map.as_raw(), 0);
assert_eq!(MappingMode::Unmap.as_raw(), 1);
let words: BTreeSet<&str> = MappingMode::ALL.iter().map(|mode| mode.word()).collect();
assert_eq!(words.len(), 2);
}
/// A program whose steps or whose order moved fingerprints apart, and the same program twice
/// fingerprints the same.
///
/// Without the first half a recording would stay the answer to a program whose regions had
/// moved — which for this family is the difference between mapping tile 0 and mapping the
/// whole level.
#[test]
fn a_program_fingerprints_by_its_steps() {
let program = |steps: Vec<MappingStep>| SparseMappingProgram {
heap: crate::sparse_query::SparseHeapSpec::new(1 << 20),
textures: Vec::new(),
buffers: Vec::new(),
fences: 0,
tile: TileGrid::new(64, 64, 4),
steps,
};
let steps = every_step();
assert_eq!(
program(steps.clone()).words(),
program(steps.clone()).words()
);
let mut moved = steps.clone();
moved[0] = MappingStep::One {
texture: 0,
mode: MappingMode::Unmap,
region: TileRect::one([0, 0]),
level: 0,
slice: 0,
};
assert_ne!(
program(steps.clone()).words(),
program(moved).words(),
"the mapping mode does not reach the fingerprint"
);
let mut wider = steps.clone();
wider[0] = MappingStep::One {
texture: 0,
mode: MappingMode::Map,
region: TileRect::new([0, 0], [2, 2]),
level: 0,
slice: 0,
};
assert_ne!(
program(steps.clone()).words(),
program(wider).words(),
"a region's size does not reach the fingerprint"
);
let mut reversed = steps.clone();
reversed.reverse();
assert_ne!(program(steps).words(), program(reversed).words());
}
/// A region of no tiles holds none, and one tile holds one: what the rows that state Metal's
/// documented special case lean on.
#[test]
fn a_region_of_no_tiles_holds_none() {
assert_eq!(TileRect::none([1, 1]).tiles(), 0);
assert_eq!(TileRect::one([1, 1]).tiles(), 1);
assert_eq!(TileRect::new([0, 0], [4, 3]).tiles(), 12);
}
/// A level's tiles are its texels rounded **up**, and a level below one tile still holds one.
///
/// The rounding is what bounds every region in this family, so it is checked rather than
/// assumed: a grid that rounded down would call a level of 1 texel a level of no tiles, and
/// every region of it would read as out of range.
#[test]
fn a_levels_tiles_round_up_and_never_reach_zero() {
let grid = TileGrid::new(64, 64, 4);
assert_eq!(grid.tiles_at(256, 256, 0), [4, 4]);
assert_eq!(grid.tiles_at(256, 256, 1), [2, 2]);
assert_eq!(grid.tiles_at(256, 256, 2), [1, 1]);
assert_eq!(grid.tiles_at(256, 256, 3), [1, 1]);
assert_eq!(grid.tiles_at(256, 256, 8), [1, 1]);
// A level whose extent is not a whole number of tiles still holds the tile it part-fills.
assert_eq!(grid.tiles_at(192, 65, 0), [3, 2]);
}
/// Only the mapping steps say they map, and only the read step says it reads, so the guards
/// that bound a program's regions and count its reads read every one and nothing else.
///
/// It reads the compiler-kept walk, so a new step is covered the moment it compiles.
#[test]
fn the_steps_say_which_map_and_which_read() {
let mapping: Vec<&'static str> = every_step()
.iter()
.filter(|step| step.maps())
.map(MappingStep::call)
.collect();
assert_eq!(
mapping,
[
"updateTextureMapping",
"updateTextureMappings",
"updateTextureMappingIndirect",
"moveTextureMappingsFromTexture"
]
);
let reading: Vec<&'static str> = every_step()
.iter()
.filter(|step| step.reads())
.map(MappingStep::call)
.collect();
assert_eq!(reading, ["copyFromTextureToBuffer"]);
}
}
@@ -606,6 +606,19 @@ impl<S: Side, W: Watcher> Side for Watching<S, W> {
self.inner.sparse_tile_size(query)
}
fn sparse_mapping(
&mut self,
program: &crate::sparse_mapping::SparseMappingProgram,
) -> Answer<crate::sparse_mapping::SparseMapped> {
let _span = self.watch("sparse_mapping");
self.inner.sparse_mapping(program)
}
fn command_buffer_facts(&mut self) -> Answer<crate::command_buffer_facts::CommandBufferFacts> {
let _span = self.watch("command_buffer_facts");
self.inner.command_buffer_facts()
}
fn sparse_tile_size_in_bytes(&mut self, page: crate::sparse_query::QueryPage) -> Answer<u64> {
let _span = self.watch("sparse_tile_size_in_bytes");
self.inner.sparse_tile_size_in_bytes(page)
+86 -84
View File
@@ -12,8 +12,8 @@ The suite reaches Metal through `objc2-metal`, whose Rust name for a binding is
Its limits, measured rather than asserted:
- **1242 of 1388 call sites** in the Metal leg resolve to an item of the SDK. 42 of those resolve because only one type in `objc2-metal` binds the name at all, so no typing was needed.
- **117 call sites resolve to no item**: an instance send whose receiver this could not type, or a message to a Metal class whose name `objc2-metal` declares on no Metal type. They cost the count 2 selectors, which the suite calls and which this attributes to no item:
- **1283 of 1435 call sites** in the Metal leg resolve to an item of the SDK. 42 of those resolve because only one type in `objc2-metal` binds the name at all, so no typing was needed.
- **123 call sites resolve to no item**: an instance send whose receiver this could not type, or a message to a Metal class whose name `objc2-metal` declares on no Metal type. They cost the count 2 selectors, which the suite calls and which this attributes to no item:
- `alloc`, which `objc2-metal` declares on no Metal type, so it is an item of no Metal container
- `count`, bound by `MTL4CounterHeap`, `MTL4CounterHeapDescriptor`
So every per-item count below is a **floor**, by at least these. That list is what this derivation recognises as a call to Metal and cannot attribute; it is not a proof that nothing else is unmeasured.
@@ -26,15 +26,15 @@ Its limits, measured rather than asserted:
| | |
|---|---|
| implemented Metal items | 958 |
| of those, exercised by the suite's Metal leg | 610 |
| of those, not exercised | 348 |
| share exercised | 64% |
| of those exercised, no case reaching it loosens anything | 475 |
| of those, exercised by the suite's Metal leg | 625 |
| of those, not exercised | 333 |
| share exercised | 65% |
| of those exercised, no case reaching it loosens anything | 490 |
| of those exercised, a case reaching it loosens some site | 135 |
| case modules | 107 |
| committed recordings | 828 |
| distinct SDK items the Metal leg calls | 618 |
| ledger rows (a case whose gap is recorded) | 42 |
| case modules | 109 |
| committed recordings | 838 |
| distinct SDK items the Metal leg calls | 633 |
| ledger rows (a case whose gap is recorded) | 43 |
A tolerance names a **site of a transcript**, not an item, so the last two rows are read as written: a case that loosens one site of its own transcript may compare every other field of it exactly, and this derivation cannot tell which of a case's fields came from which Metal call. Where the distinction matters, read the case.
@@ -205,11 +205,9 @@ Every container with an implemented item, by how much of it the suite reaches.
| `MTLComputePipelineState` | 15 | 6 | 9 | `compute_threadgroups`, `pipeline_facts` |
| `MTLRasterizationRateLayerDescriptor` | 10 | 1 | 9 | `rate_maps` |
| `MTLSamplerDescriptor` | 16 | 7 | 9 | `argument_encoders`, `border_swizzles`, `chroma_pairs`, `compute_encoder_commands`… |
| `MTLCommandBuffer` | 21 | 13 | 8 | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`… |
| `MTLBinaryArchive` | 7 | 0 | 7 | |
| `MTLRasterizationRateMapDescriptor` | 10 | 3 | 7 | `rate_maps` |
| `MTLRenderPipelineState` | 15 | 8 | 7 | `pipeline_facts`, `tile_threadgroups` |
| `MTLResourceStateCommandEncoder` | 7 | 0 | 7 | |
| `MTLTextureDescriptor` | 19 | 13 | 6 | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`… |
| `MTLDynamicLibrary` | 5 | 0 | 5 | |
| `MTLBlitCommandEncoder` | 22 | 18 | 4 | `blit_encoder_commands`, `buffer_blits`, `buffer_depth_samples`, `buffer_texture_blits`… |
@@ -219,7 +217,6 @@ Every container with an implemented item, by how much of it the suite reaches.
| `MTLRenderPipelineReflection` | 9 | 5 | 4 | `texture_accesses` |
| `MTLVisibleFunctionTable` | 4 | 0 | 4 | |
| `MTLBuffer` | 6 | 3 | 3 | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`… |
| `MTLCommandQueue` | 4 | 1 | 3 | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`… |
| `MTLDepthStencilState` | 3 | 0 | 3 | |
| `MTLFence` | 3 | 0 | 3 | |
| `MTLFunctionHandle` | 3 | 0 | 3 | |
@@ -257,7 +254,9 @@ Every container with an implemented item, by how much of it the suite reaches.
| `MTLBinding` | 7 | 6 | 1 | `function_bindings`, `texture_accesses` |
| `MTLBufferBinding` | 6 | 5 | 1 | `function_bindings` |
| `MTLBufferLayoutDescriptor` | 4 | 3 | 1 | `indirect_commands`, `stage_in_regions` |
| `MTLCommandBuffer` | 21 | 20 | 1 | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`… |
| `MTLCommandEncoder` | 2 | 1 | 1 | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`… |
| `MTLCommandQueue` | 4 | 3 | 1 | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`… |
| `MTLComputePipelineDescriptor` | 16 | 15 | 1 | `compute_pipeline_descriptors`, `indirect_commands`, `pipeline_facts`, `stage_in_regions` |
| `MTLDepthStencilDescriptor` | 5 | 4 | 1 | `render_depth_stencil_state`, `shader_stencil`, `srgb_fetch`, `visibility` |
| `MTLEvent` | 3 | 2 | 1 | `shared_events` |
@@ -278,6 +277,7 @@ Every container with an implemented item, by how much of it the suite reaches.
| `MTLRenderPipelineColorAttachmentDescriptor` | 10 | 9 | 1 | `color_write_masks`, `compute_render_chains`, `discard_hoist`, `draw_state_changes`… |
| `MTLRenderPipelineDescriptor` | 35 | 34 | 1 | `color_write_masks`, `compute_render_chains`, `discard_hoist`, `draw_state_changes`… |
| `MTLResource` | 12 | 11 | 1 | `buffer_textures`, `heap_facts`, `resource_facts` |
| `MTLResourceStateCommandEncoder` | 7 | 6 | 1 | `sparse_mappings` |
| `MTLSharedEventHandle` | 2 | 1 | 1 | `shared_events` |
| `MTLSharedTextureHandle` | 2 | 1 | 1 | `texture_views` |
| `MTLStencilDescriptor` | 7 | 6 | 1 | `render_depth_stencil_state`, `shader_stencil`, `srgb_fetch`, `visibility` |
@@ -312,11 +312,9 @@ A container is one Objective-C type; the SDK header it sits in is the family of
| `MTLSampler.h` | 19 | 8 | 11 |
| `MTLTexture.h` | 57 | 47 | 10 |
| `MTLBinaryArchive.h` | 9 | 0 | 9 |
| `MTLCommandBuffer.h` | 21 | 13 | 8 |
| `MTLStageInputOutputDescriptor.h` | 21 | 13 | 8 |
| `MTLVertexDescriptor.h` | 19 | 11 | 8 |
| `MTLRenderPass.h` | 41 | 34 | 7 |
| `MTLResourceStateCommandEncoder.h` | 7 | 0 | 7 |
| `MTLTypes.h` | 7 | 0 | 7 |
| `MTLVisibleFunctionTable.h` | 7 | 0 | 7 |
| `MTLEvent.h` | 12 | 6 | 6 |
@@ -325,7 +323,6 @@ A container is one Objective-C type; the SDK header it sits in is the family of
| `MTLBlitCommandEncoder.h` | 22 | 18 | 4 |
| `MTLIndirectCommandBuffer.h` | 26 | 22 | 4 |
| `MTLBuffer.h` | 6 | 3 | 3 |
| `MTLCommandQueue.h` | 4 | 1 | 3 |
| `MTLFence.h` | 3 | 0 | 3 |
| `MTLFunctionHandle.h` | 3 | 0 | 3 |
| `MTLPipeline.h` | 5 | 2 | 3 |
@@ -334,11 +331,14 @@ A container is one Objective-C type; the SDK header it sits in is the family of
| `MTLHeap.h` | 25 | 23 | 2 |
| `MTLLinkedFunctions.h` | 6 | 4 | 2 |
| `MTLAllocation.h` | 1 | 0 | 1 |
| `MTLCommandBuffer.h` | 21 | 20 | 1 |
| `MTLCommandEncoder.h` | 2 | 1 | 1 |
| `MTLCommandQueue.h` | 4 | 3 | 1 |
| `MTLFunctionDescriptor.h` | 5 | 4 | 1 |
| `MTLResource.h` | 12 | 11 | 1 |
| `MTLResourceStateCommandEncoder.h` | 7 | 6 | 1 |
8 of 37 headers have no exercised item at all, 42 implemented items between them: `MTLAllocation.h`, `MTLBinaryArchive.h`, `MTLDynamicLibrary.h`, `MTLFence.h`, `MTLFunctionHandle.h`, `MTLResourceStateCommandEncoder.h`, `MTLTypes.h`, `MTLVisibleFunctionTable.h`.
7 of 37 headers have no exercised item at all, 35 implemented items between them: `MTLAllocation.h`, `MTLBinaryArchive.h`, `MTLDynamicLibrary.h`, `MTLFence.h`, `MTLFunctionHandle.h`, `MTLTypes.h`, `MTLVisibleFunctionTable.h`.
## Containers with no case at all
@@ -360,41 +360,40 @@ An implemented container no case's Metal leg touches. These are the families of
| `MTLRasterizationRateLayerArray` | 3 | `MTLRasterizationRate.h` |
| `MTLRasterizationRateSampleArray` | 3 | `MTLRasterizationRate.h` |
| `MTLRenderPipelineFunctionsDescriptor` | 4 | `MTLRenderPipeline.h` |
| `MTLResourceStateCommandEncoder` | 7 | `MTLResourceStateCommandEncoder.h` |
| `MTLSharedEventListener` | 2 | `MTLEvent.h` |
| `MTLType` | 2 | `MTLArgument.h` |
| `MTLVisibleFunctionTable` | 4 | `MTLVisibleFunctionTable.h` |
| `MTLVisibleFunctionTableDescriptor` | 3 | `MTLVisibleFunctionTable.h` |
19 containers, 87 implemented items.
18 containers, 80 implemented items.
## The suite's shape
| | |
|---|---|
| case modules | 107 |
| committed recordings | 828 |
| case modules | 109 |
| committed recordings | 838 |
| recorded runs behind a case, median | 3 |
| recorded runs, least and most | 1 and 30 |
| cases whose recording holds more than one outcome | 0 |
| cases running a committed shader fixture | 452 |
| cases whose Metal answer is `metal_run` | 744 |
| cases whose Metal answer is `metal_run` | 754 |
| cases whose Metal answer is `carried` | 80 |
| cases whose Metal answer is `never_returned` | 4 |
| modules that loosen a measured value | 11 |
| tolerances in all | 12 |
| modules declaring a notice (loosening no value) | 60 |
| modules declaring a notice (loosening no value) | 62 |
| loosenings used | `Unchecked`, `Absolute`, `Ulps` |
| justifications named | `Degradation`, `AcceptedDifference` |
| modules forbidding a re-record | 8 |
| `Side` methods (the suite's whole device vocabulary) | 108 |
| `Side` methods the Metal leg reaches an SDK item through | 103 |
| SDK items a case's Metal leg reaches, median | 43 |
| `Side` methods (the suite's whole device vocabulary) | 110 |
| `Side` methods the Metal leg reaches an SDK item through | 105 |
| SDK items a case's Metal leg reaches, median | 40 |
| the same, least and most | 0 and 142 |
| Metal call sites in the leg | 1388 |
| distinct selectors the leg sends | 556 |
| of those, resolved to an item of the coverage map | 553 |
| oracles the recordings name | `apple-m3-max` ×828 |
| Metal call sites in the leg | 1435 |
| distinct selectors the leg sends | 566 |
| of those, resolved to an item of the coverage map | 563 |
| oracles the recordings name | `apple-m3-max` ×838 |
## By family
@@ -413,6 +412,7 @@ Each case module: the cases it holds, the `Side` methods it calls, and how many
| `buffer_textures` | 3 | 2 | every field | 52 |
| `chroma_pairs` | 6 | 6 | every field | 50 |
| `color_write_masks` | 3 | 3 | every field | 76 |
| `command_buffer_facts` | 1 | 1 | every field | 20 |
| `command_queues` | 1 | 1 | every field | 3 |
| `compressed_blits` | 4 | 4 | every field | 42 |
| `compressed_decode` | 10 | 10 | 1 tolerance(s): `Degradation` | 31 |
@@ -489,6 +489,7 @@ Each case module: the cases it holds, the `Side` methods it calls, and how many
| `simdgroup_lockstep` | 2 | 2 | every field | 16 |
| `snorm_tile_store` | 7 | 7 | 1 tolerance(s): `Degradation` | 76 |
| `sparse_heaps` | 6 | 6 | every field | 22 |
| `sparse_mappings` | 9 | 9 | every field | 39 |
| `sparse_tiles` | 4 | 4 | every field | 4 |
| `srgb_fetch` | 2 | 2 | every field | 89 |
| `stage_in_regions` | 1 | 1 | every field | 33 |
@@ -682,12 +683,12 @@ One row per implemented item of the SDK, in the coverage map's order. *exercised
| `synchronizeResource:` | yes | `blit_encoder_commands` | 9 |
| `synchronizeTexture:slice:level:` | yes | `blit_encoder_commands` | 9 |
| `copyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:` | yes | `buffer_texture_blits`, `chroma_pairs`, `compressed_blits`, `format_copies`, `pvrtc_rows`, `two_plane_heap_blits` | 37 |
| `copyFromBuffer:sourceOffset:sourceBytesPerRow:sourceBytesPerImage:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:` | yes | `blit_encoder_commands` | 9 |
| `copyFromBuffer:sourceOffset:sourceBytesPerRow:sourceBytesPerImage:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:` | yes | `blit_encoder_commands`, `sparse_mappings` | 18 |
| `copyFromBuffer:sourceOffset:sourceBytesPerRow:sourceBytesPerImage:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:options:` | yes | `blit_encoder_commands`, `buffer_depth_samples`, `chroma_pairs`, `compressed_blits`, `compressed_views`, `format_copies`, `fresh_contents`, `pvrtc_cpu_order`, `pvrtc_rows`, `texture_fills`, `two_plane_copies` | 158 |
| `copyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toBuffer:destinationOffset:destinationBytesPerRow:destinationBytesPerImage:` | yes | `blit_encoder_commands`, `compute_render_chains`, `discard_hoist`, `draw_state_changes`, `extended_range_blends`, `extended_range_targets`, `fetch_ordered`, `half_output_blends`, `indirect_commands`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_targets`, `sample_positions`, `shader_stencil`, `srgb_fetch`, `wide_points` | 128 |
| `copyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toBuffer:destinationOffset:destinationBytesPerRow:destinationBytesPerImage:` | yes | `blit_encoder_commands`, `compute_render_chains`, `discard_hoist`, `draw_state_changes`, `extended_range_blends`, `extended_range_targets`, `fetch_ordered`, `half_output_blends`, `indirect_commands`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_targets`, `sample_positions`, `shader_stencil`, `sparse_mappings`, `srgb_fetch`, `wide_points` | 137 |
| `copyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toBuffer:destinationOffset:destinationBytesPerRow:destinationBytesPerImage:options:` | yes | `blit_encoder_commands`, `buffer_depth_samples`, `chroma_pairs`, `compressed_blits`, `format_copies`, `fresh_contents`, `pvrtc_cpu_order`, `pvrtc_rows`, `texture_fills`, `two_plane_copies` | 144 |
| `generateMipmapsForTexture:` | yes | `blit_encoder_commands` | 9 |
| `fillBuffer:range:value:` | yes | `blit_encoder_commands`, `buffer_blits`, `event_orders`, `fresh_contents`, `host_detach`, `scheduled_handlers` | 106 |
| `fillBuffer:range:value:` | yes | `blit_encoder_commands`, `buffer_blits`, `command_buffer_facts`, `event_orders`, `fresh_contents`, `host_detach`, `scheduled_handlers` | 107 |
| `copyFromTexture:sourceSlice:sourceLevel:toTexture:destinationSlice:destinationLevel:sliceCount:levelCount:` | yes | `blit_encoder_commands` | 9 |
| `copyFromTexture:toTexture:` | yes | `blit_encoder_commands` | 9 |
| `copyFromBuffer:sourceOffset:toBuffer:destinationOffset:size:` | yes | `blit_encoder_commands`, `buffer_blits`, `fresh_contents`, `host_page_writes`, `indirect_commands`, `texture_fills`, `two_plane_heap_blits` | 113 |
@@ -706,8 +707,8 @@ One row per implemented item of the SDK, in the coverage map's order. *exercised
| item | exercised | families | cases Metal ran |
|---|---|---|---|
| `MTLBuffer` | no | — | — |
| `length` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `compute_threadgroups`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `extended_range_blends`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_texel_nans`, `host_detach`, `host_page_writes`, `indirect_commands`, `int_attributes`, `level_sizes`, `math_routines`, `mesh_barriers`, `mesh_commands`, `nearest_positions`, `norm_storage_writes`, `pass_bytes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `rate_maps`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `shared_exponent_storage`, `simdgroup_lockstep`, `snorm_tile_store`, `srgb_fetch`, `stage_in_regions`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `tile_threadgroups`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 549 |
| `contents` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `compute_threadgroups`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `event_orders`, `extended_range_blends`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `host_page_writes`, `indirect_commands`, `int_attributes`, `level_sizes`, `math_routines`, `mesh_barriers`, `mesh_commands`, `mesh_draws`, `nearest_positions`, `norm_storage_writes`, `pass_bytes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `rate_maps`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `shared_exponent_storage`, `simdgroup_lockstep`, `snorm_tile_store`, `srgb_fetch`, `stage_in_regions`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `tile_threadgroups`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 574 |
| `length` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `compute_threadgroups`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `extended_range_blends`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_texel_nans`, `host_detach`, `host_page_writes`, `indirect_commands`, `int_attributes`, `level_sizes`, `math_routines`, `mesh_barriers`, `mesh_commands`, `nearest_positions`, `norm_storage_writes`, `pass_bytes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `rate_maps`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `shared_exponent_storage`, `simdgroup_lockstep`, `snorm_tile_store`, `sparse_mappings`, `srgb_fetch`, `stage_in_regions`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `tile_threadgroups`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 558 |
| `contents` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `command_buffer_facts`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `compute_threadgroups`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `event_orders`, `extended_range_blends`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `host_page_writes`, `indirect_commands`, `int_attributes`, `level_sizes`, `math_routines`, `mesh_barriers`, `mesh_commands`, `mesh_draws`, `nearest_positions`, `norm_storage_writes`, `pass_bytes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `rate_maps`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `shared_exponent_storage`, `simdgroup_lockstep`, `snorm_tile_store`, `sparse_mappings`, `srgb_fetch`, `stage_in_regions`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `tile_threadgroups`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 584 |
| `didModifyRange:` | no | — | — |
| `newTextureWithDescriptor:offset:bytesPerRow:` | yes | `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_render_chains`, `denormal_word_fetches`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `extended_range_blends`, `extended_range_targets`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `host_page_writes`, `indirect_commands`, `level_sizes`, `norm_storage_writes`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `resource_facts`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `shared_exponent_storage`, `snorm_tile_store`, `srgb_fetch`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `two_plane_copies`, `two_plane_heap_blits`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 449 |
| `gpuAddress` | no | — | — |
@@ -745,42 +746,42 @@ One row per implemented item of the SDK, in the coverage map's order. *exercised
| item | exercised | families | cases Metal ran |
|---|---|---|---|
| `MTLCommandBuffer` | no | — | — |
| `device` | no | — | — |
| `commandQueue` | no | — | — |
| `kernelStartTime` | no | — | — |
| `kernelEndTime` | no | — | — |
| `GPUStartTime` | no | — | — |
| `GPUEndTime` | no | — | — |
| `commit` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `compute_threadgroups`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `event_orders`, `extended_range_blends`, `extended_range_planes`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `host_detach`, `host_page_writes`, `indirect_commands`, `int_attributes`, `level_sizes`, `math_routines`, `nearest_positions`, `norm_storage_writes`, `pass_bytes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `scheduled_handlers`, `shader_stencil`, `shared_events`, `shared_exponent_storage`, `simdgroup_lockstep`, `snorm_tile_store`, `srgb_fetch`, `stage_in_regions`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 562 |
| `device` | yes | `command_buffer_facts` | 1 |
| `commandQueue` | yes | `command_buffer_facts` | 1 |
| `kernelStartTime` | yes | `command_buffer_facts` | 1 |
| `kernelEndTime` | yes | `command_buffer_facts` | 1 |
| `GPUStartTime` | yes | `command_buffer_facts` | 1 |
| `GPUEndTime` | yes | `command_buffer_facts` | 1 |
| `commit` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `command_buffer_facts`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `compute_threadgroups`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `event_orders`, `extended_range_blends`, `extended_range_planes`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `host_detach`, `host_page_writes`, `indirect_commands`, `int_attributes`, `level_sizes`, `math_routines`, `nearest_positions`, `norm_storage_writes`, `pass_bytes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `scheduled_handlers`, `shader_stencil`, `shared_events`, `shared_exponent_storage`, `simdgroup_lockstep`, `snorm_tile_store`, `srgb_fetch`, `stage_in_regions`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 563 |
| `addScheduledHandler:` | yes | `event_orders`, `scheduled_handlers` | 5 |
| `waitUntilScheduled` | yes | `scheduled_handlers` | 1 |
| `addCompletedHandler:` | yes | `event_orders`, `host_detach`, `scheduled_handlers` | 6 |
| `waitUntilCompleted` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `compute_threadgroups`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `extended_range_blends`, `extended_range_planes`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `host_page_writes`, `indirect_commands`, `int_attributes`, `level_sizes`, `math_routines`, `nearest_positions`, `norm_storage_writes`, `pass_bytes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `shared_events`, `shared_exponent_storage`, `simdgroup_lockstep`, `snorm_tile_store`, `srgb_fetch`, `stage_in_regions`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 556 |
| `status` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `compute_threadgroups`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `event_orders`, `extended_range_blends`, `extended_range_planes`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `host_detach`, `host_page_writes`, `indirect_commands`, `int_attributes`, `level_sizes`, `math_routines`, `nearest_positions`, `norm_storage_writes`, `pass_bytes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `scheduled_handlers`, `shader_stencil`, `shared_exponent_storage`, `simdgroup_lockstep`, `snorm_tile_store`, `srgb_fetch`, `stage_in_regions`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 560 |
| `waitUntilCompleted` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `command_buffer_facts`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `compute_threadgroups`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `extended_range_blends`, `extended_range_planes`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `host_page_writes`, `indirect_commands`, `int_attributes`, `level_sizes`, `math_routines`, `nearest_positions`, `norm_storage_writes`, `pass_bytes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `shared_events`, `shared_exponent_storage`, `simdgroup_lockstep`, `snorm_tile_store`, `srgb_fetch`, `stage_in_regions`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 557 |
| `status` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `command_buffer_facts`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `compute_threadgroups`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `event_orders`, `extended_range_blends`, `extended_range_planes`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `host_detach`, `host_page_writes`, `indirect_commands`, `int_attributes`, `level_sizes`, `math_routines`, `nearest_positions`, `norm_storage_writes`, `pass_bytes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `scheduled_handlers`, `shader_stencil`, `shared_exponent_storage`, `simdgroup_lockstep`, `snorm_tile_store`, `srgb_fetch`, `stage_in_regions`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 561 |
| `error` | yes | `buffer_target_clears`, `color_write_masks`, `compute_encoder_commands`, `compute_render_chains`, `discard_hoist`, `draw_state_changes`, `extended_range_blends`, `extended_range_targets`, `fetch_ordered`, `frame_chains`, `half_output_blends`, `host_page_writes`, `indirect_commands`, `int_attributes`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `snorm_tile_store`, `srgb_fetch`, `visibility`, `wide_points` | 171 |
| `blitCommandEncoder` | yes | `blit_encoder_commands`, `buffer_blits`, `buffer_depth_samples`, `buffer_texture_blits`, `chroma_pairs`, `compressed_blits`, `compressed_views`, `compute_render_chains`, `discard_hoist`, `draw_state_changes`, `event_orders`, `extended_range_blends`, `extended_range_targets`, `fetch_ordered`, `format_copies`, `fresh_contents`, `half_output_blends`, `host_detach`, `host_page_writes`, `indirect_commands`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_targets`, `sample_positions`, `scheduled_handlers`, `shader_stencil`, `srgb_fetch`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits`, `wide_points` | 294 |
| `blitCommandEncoder` | yes | `blit_encoder_commands`, `buffer_blits`, `buffer_depth_samples`, `buffer_texture_blits`, `chroma_pairs`, `command_buffer_facts`, `compressed_blits`, `compressed_views`, `compute_render_chains`, `discard_hoist`, `draw_state_changes`, `event_orders`, `extended_range_blends`, `extended_range_targets`, `fetch_ordered`, `format_copies`, `fresh_contents`, `half_output_blends`, `host_detach`, `host_page_writes`, `indirect_commands`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_targets`, `sample_positions`, `scheduled_handlers`, `shader_stencil`, `sparse_mappings`, `srgb_fetch`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits`, `wide_points` | 304 |
| `renderCommandEncoderWithDescriptor:` | yes | `buffer_depth_samples`, `buffer_target_clears`, `color_write_masks`, `compute_render_chains`, `discard_hoist`, `draw_state_changes`, `extended_range_blends`, `extended_range_targets`, `fetch_ordered`, `frame_chains`, `half_output_blends`, `host_page_writes`, `indirect_commands`, `int_attributes`, `mesh_barriers`, `mesh_commands`, `mesh_draws`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `snorm_tile_store`, `srgb_fetch`, `tile_threadgroups`, `visibility`, `wide_points` | 194 |
| `computeCommandEncoder` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `compute_threadgroups`, `denormal_word_fetches`, `depth_texel_reads`, `etc_textures`, `extended_range_blends`, `extended_range_planes`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `format_copies`, `frame_chains`, `fresh_contents`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `host_page_writes`, `indirect_commands`, `level_sizes`, `math_routines`, `nearest_positions`, `norm_storage_writes`, `pass_bytes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `rgb10a2_srgb`, `shared_exponent_storage`, `simdgroup_lockstep`, `stage_in_regions`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `ycbcr_minify`, `ycbcr_textures` | 445 |
| `computeCommandEncoderWithDispatchType:` | yes | `compute_encoder_commands` | 8 |
| `encodeWaitForEvent:value:` | yes | `event_orders` | 4 |
| `encodeSignalEvent:value:` | yes | `event_orders`, `shared_events` | 6 |
| `resourceStateCommandEncoder` | no | — | — |
| `resourceStateCommandEncoder` | yes | `command_buffer_facts`, `sparse_mappings` | 10 |
### `MTLCommandEncoder`
| item | exercised | families | cases Metal ran |
|---|---|---|---|
| `MTLCommandEncoder` | no | — | — |
| `endEncoding` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `compute_threadgroups`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `event_orders`, `extended_range_blends`, `extended_range_planes`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `host_detach`, `host_page_writes`, `indirect_commands`, `int_attributes`, `level_sizes`, `math_routines`, `nearest_positions`, `norm_storage_writes`, `pass_bytes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `scheduled_handlers`, `shader_stencil`, `shared_exponent_storage`, `simdgroup_lockstep`, `snorm_tile_store`, `srgb_fetch`, `stage_in_regions`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 560 |
| `endEncoding` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `command_buffer_facts`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `compute_threadgroups`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `event_orders`, `extended_range_blends`, `extended_range_planes`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `host_detach`, `host_page_writes`, `indirect_commands`, `int_attributes`, `level_sizes`, `math_routines`, `nearest_positions`, `norm_storage_writes`, `pass_bytes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `scheduled_handlers`, `shader_stencil`, `shared_exponent_storage`, `simdgroup_lockstep`, `snorm_tile_store`, `srgb_fetch`, `stage_in_regions`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 561 |
### `MTLCommandQueue`
| item | exercised | families | cases Metal ran |
|---|---|---|---|
| `MTLCommandQueue` | no | — | — |
| `label` | no | — | — |
| `device` | no | — | — |
| `commandBuffer` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `command_queues`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `compute_threadgroups`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `event_orders`, `extended_range_blends`, `extended_range_planes`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `host_detach`, `host_page_writes`, `indirect_commands`, `int_attributes`, `level_sizes`, `math_routines`, `mesh_barriers`, `mesh_commands`, `mesh_draws`, `nearest_positions`, `norm_storage_writes`, `pass_bytes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `scheduled_handlers`, `shader_stencil`, `shared_events`, `shared_exponent_storage`, `simdgroup_lockstep`, `snorm_tile_store`, `srgb_fetch`, `stage_in_regions`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `tile_threadgroups`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 581 |
| `label` | yes | `command_buffer_facts` | 1 |
| `device` | yes | `command_buffer_facts` | 1 |
| `commandBuffer` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `command_buffer_facts`, `command_queues`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `compute_threadgroups`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `event_orders`, `extended_range_blends`, `extended_range_planes`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `host_detach`, `host_page_writes`, `indirect_commands`, `int_attributes`, `level_sizes`, `math_routines`, `mesh_barriers`, `mesh_commands`, `mesh_draws`, `nearest_positions`, `norm_storage_writes`, `pass_bytes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `scheduled_handlers`, `shader_stencil`, `shared_events`, `shared_exponent_storage`, `simdgroup_lockstep`, `snorm_tile_store`, `sparse_mappings`, `srgb_fetch`, `stage_in_regions`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `tile_threadgroups`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 591 |
### `MTLComputeCommandEncoder`
@@ -896,7 +897,7 @@ One row per implemented item of the SDK, in the coverage map's order. *exercised
|---|---|---|---|
| `MTLDevice` | no | — | — |
| `name` | no | — | — |
| `registryID` | yes | `argument_encoders`, `function_facts`, `heap_facts`, `library_facts`, `pipeline_facts`, `resource_facts`, `shared_events`, `texture_views` | 43 |
| `registryID` | yes | `argument_encoders`, `command_buffer_facts`, `function_facts`, `heap_facts`, `library_facts`, `pipeline_facts`, `resource_facts`, `shared_events`, `texture_views` | 44 |
| `maxThreadsPerThreadgroup` | no | — | — |
| `hasUnifiedMemory` | no | — | — |
| `depth24Stencil8PixelFormatSupported` | no | — | — |
@@ -904,12 +905,12 @@ One row per implemented item of the SDK, in the coverage map's order. *exercised
| `argumentBuffersSupport` | no | — | — |
| `rasterOrderGroupsSupported` | no | — | — |
| `supports32BitFloatFiltering` | no | — | — |
| `newCommandQueue` | yes | `command_queues`, `event_orders`, `host_detach`, `scheduled_handlers` | 7 |
| `newCommandQueue` | yes | `command_buffer_facts`, `command_queues`, `event_orders`, `host_detach`, `scheduled_handlers` | 8 |
| `newCommandQueueWithMaxCommandBufferCount:` | yes | `command_queues` | 1 |
| `heapTextureSizeAndAlignWithDescriptor:` | yes | `compressed_moves`, `heap_metal_sizes`, `two_plane_copies`, `ycbcr_textures` | 24 |
| `heapBufferSizeAndAlignWithLength:options:` | yes | `device_queries` | 5 |
| `newHeapWithDescriptor:` | yes | `blit_encoder_commands`, `buffer_blits`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_moves`, `compressed_views`, `format_copies`, `fresh_contents`, `heap_facts`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_residency`, `resource_facts`, `sparse_heaps`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits` | 198 |
| `newBufferWithLength:options:` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `compute_threadgroups`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `event_orders`, `extended_range_blends`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `host_page_writes`, `indirect_commands`, `int_attributes`, `level_sizes`, `math_routines`, `mesh_barriers`, `mesh_commands`, `mesh_draws`, `nearest_positions`, `norm_storage_writes`, `pass_bytes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `rate_maps`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `resource_facts`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `scheduled_handlers`, `shader_stencil`, `shared_exponent_storage`, `simdgroup_lockstep`, `snorm_tile_store`, `srgb_fetch`, `stage_in_regions`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `tile_threadgroups`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 579 |
| `newHeapWithDescriptor:` | yes | `blit_encoder_commands`, `buffer_blits`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_moves`, `compressed_views`, `format_copies`, `fresh_contents`, `heap_facts`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_residency`, `resource_facts`, `sparse_heaps`, `sparse_mappings`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits` | 207 |
| `newBufferWithLength:options:` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `command_buffer_facts`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `compute_threadgroups`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `event_orders`, `extended_range_blends`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `host_page_writes`, `indirect_commands`, `int_attributes`, `level_sizes`, `math_routines`, `mesh_barriers`, `mesh_commands`, `mesh_draws`, `nearest_positions`, `norm_storage_writes`, `pass_bytes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `rate_maps`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `resource_facts`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `scheduled_handlers`, `shader_stencil`, `shared_exponent_storage`, `simdgroup_lockstep`, `snorm_tile_store`, `sparse_mappings`, `srgb_fetch`, `stage_in_regions`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `tile_threadgroups`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 589 |
| `newBufferWithBytes:length:options:` | yes | `buffer_depth_samples` | 5 |
| `newBufferWithBytesNoCopy:length:options:deallocator:` | yes | `host_detach`, `host_page_writes` | 5 |
| `newDepthStencilStateWithDescriptor:` | yes | `render_depth_stencil_state`, `shader_stencil`, `srgb_fetch`, `visibility` | 17 |
@@ -928,7 +929,7 @@ One row per implemented item of the SDK, in the coverage map's order. *exercised
| `newComputePipelineStateWithFunction:options:completionHandler:` | no | — | — |
| `newComputePipelineStateWithDescriptor:options:reflection:error:` | yes | `indirect_commands`, `pipeline_facts`, `stage_in_regions` | 13 |
| `newComputePipelineStateWithDescriptor:options:completionHandler:` | no | — | — |
| `newFence` | yes | `blit_encoder_commands` | 9 |
| `newFence` | yes | `blit_encoder_commands`, `sparse_mappings` | 18 |
| `supportsFamily:` | no | — | — |
| `supportsTextureSampleCount:` | no | — | — |
| `minimumLinearTextureAlignmentForPixelFormat:` | yes | `device_queries` | 5 |
@@ -945,12 +946,12 @@ One row per implemented item of the SDK, in the coverage map's order. *exercised
| `newEvent` | yes | `event_orders` | 4 |
| `newSharedEvent` | yes | `event_orders`, `shared_events` | 6 |
| `newSharedEventWithHandle:` | yes | `shared_events` | 2 |
| `sparseTileSizeWithTextureType:pixelFormat:sampleCount:` | yes | `sparse_tiles` | 4 |
| `sparseTileSizeWithTextureType:pixelFormat:sampleCount:` | yes | `sparse_mappings`, `sparse_tiles` | 13 |
| `sparseTileSizeInBytes` | yes | `sparse_tiles` | 4 |
| `convertSparsePixelRegions:toTileRegions:withTileSize:alignmentMode:numRegions:` | yes | `device_queries` | 5 |
| `convertSparseTileRegions:toPixelRegions:withTileSize:numRegions:` | yes | `device_queries` | 5 |
| `sparseTileSizeInBytesForSparsePageSize:` | yes | `sparse_tiles` | 4 |
| `sparseTileSizeWithTextureType:pixelFormat:sampleCount:sparsePageSize:` | yes | `sparse_tiles` | 4 |
| `sparseTileSizeWithTextureType:pixelFormat:sampleCount:sparsePageSize:` | yes | `sparse_mappings`, `sparse_tiles` | 13 |
| `maxBufferLength` | no | — | — |
| `newArgumentEncoderWithBufferBinding:` | no | — | — |
| `supportsVertexAmplificationCount:` | yes | `device_queries` | 5 |
@@ -1058,14 +1059,14 @@ One row per implemented item of the SDK, in the coverage map's order. *exercised
| `cpuCacheMode` | yes | `heap_facts`, `resource_facts` | 9 |
| `hazardTrackingMode` | yes | `heap_facts`, `resource_facts` | 9 |
| `resourceOptions` | yes | `heap_facts`, `resource_facts` | 9 |
| `size` | yes | `heap_facts`, `resource_facts`, `sparse_heaps` | 15 |
| `usedSize` | yes | `heap_facts`, `resource_facts`, `sparse_heaps` | 15 |
| `size` | yes | `heap_facts`, `resource_facts`, `sparse_heaps`, `sparse_mappings` | 24 |
| `usedSize` | yes | `heap_facts`, `resource_facts`, `sparse_heaps`, `sparse_mappings` | 24 |
| `currentAllocatedSize` | yes | `heap_facts`, `resource_facts` | 9 |
| `maxAvailableSizeWithAlignment:` | yes | `heap_facts` | 5 |
| `newBufferWithLength:options:` | yes | `heap_facts`, `resource_facts` | 9 |
| `newTextureWithDescriptor:` | yes | `sparse_heaps` | 6 |
| `newTextureWithDescriptor:` | yes | `sparse_heaps`, `sparse_mappings` | 15 |
| `setPurgeableState:` | yes | `heap_facts` | 5 |
| `type` | yes | `heap_facts`, `resource_facts`, `sparse_heaps` | 15 |
| `type` | yes | `heap_facts`, `resource_facts`, `sparse_heaps`, `sparse_mappings` | 24 |
| `newBufferWithLength:options:offset:` | yes | `heap_facts`, `resource_facts`, `texture_fills`, `two_plane_heap_blits` | 12 |
| `newTextureWithDescriptor:offset:` | yes | `compressed_moves`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits` | 18 |
@@ -1074,13 +1075,13 @@ One row per implemented item of the SDK, in the coverage map's order. *exercised
| item | exercised | families | cases Metal ran |
|---|---|---|---|
| `MTLHeapDescriptor` | no | — | — |
| `size` | yes | `blit_encoder_commands`, `buffer_blits`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_moves`, `compressed_views`, `format_copies`, `fresh_contents`, `heap_facts`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_residency`, `resource_facts`, `sparse_heaps`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits` | 198 |
| `storageMode` | yes | `heap_facts`, `render_residency`, `resource_facts`, `sparse_heaps` | 17 |
| `size` | yes | `blit_encoder_commands`, `buffer_blits`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_moves`, `compressed_views`, `format_copies`, `fresh_contents`, `heap_facts`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_residency`, `resource_facts`, `sparse_heaps`, `sparse_mappings`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits` | 207 |
| `storageMode` | yes | `heap_facts`, `render_residency`, `resource_facts`, `sparse_heaps`, `sparse_mappings` | 26 |
| `cpuCacheMode` | yes | `heap_facts`, `resource_facts` | 9 |
| `sparsePageSize` | yes | `render_residency`, `sparse_heaps` | 8 |
| `sparsePageSize` | yes | `render_residency`, `sparse_heaps`, `sparse_mappings` | 17 |
| `hazardTrackingMode` | yes | `heap_facts`, `resource_facts` | 9 |
| `resourceOptions` | yes | `blit_encoder_commands`, `buffer_blits`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_moves`, `compressed_views`, `format_copies`, `fresh_contents`, `pvrtc_cpu_order`, `pvrtc_rows`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits` | 181 |
| `type` | yes | `blit_encoder_commands`, `buffer_blits`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_moves`, `compressed_views`, `format_copies`, `fresh_contents`, `heap_facts`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_residency`, `resource_facts`, `sparse_heaps`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits` | 198 |
| `type` | yes | `blit_encoder_commands`, `buffer_blits`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_moves`, `compressed_views`, `format_copies`, `fresh_contents`, `heap_facts`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_residency`, `resource_facts`, `sparse_heaps`, `sparse_mappings`, `texture_fills`, `two_plane_copies`, `two_plane_heap_blits` | 207 |
### `MTLIndirectCommandBuffer`
@@ -1632,12 +1633,12 @@ One row per implemented item of the SDK, in the coverage map's order. *exercised
| item | exercised | families | cases Metal ran |
|---|---|---|---|
| `MTLResourceStateCommandEncoder` | no | — | — |
| `updateTextureMappings:mode:regions:mipLevels:slices:numRegions:` | no | — | — |
| `updateTextureMapping:mode:region:mipLevel:slice:` | no | — | — |
| `updateTextureMapping:mode:indirectBuffer:indirectBufferOffset:` | no | — | — |
| `updateFence:` | no | — | — |
| `waitForFence:` | no | — | — |
| `moveTextureMappingsFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:` | no | — | — |
| `updateTextureMappings:mode:regions:mipLevels:slices:numRegions:` | yes | `sparse_mappings` | 9 |
| `updateTextureMapping:mode:region:mipLevel:slice:` | yes | `sparse_mappings` | 9 |
| `updateTextureMapping:mode:indirectBuffer:indirectBufferOffset:` | yes | `sparse_mappings` | 9 |
| `updateFence:` | yes | `sparse_mappings` | 9 |
| `waitForFence:` | yes | `sparse_mappings` | 9 |
| `moveTextureMappingsFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:` | yes | `sparse_mappings` | 9 |
### `MTLSamplerDescriptor`
@@ -1763,9 +1764,9 @@ One row per implemented item of the SDK, in the coverage map's order. *exercised
| `arrayLength` | yes | `buffer_textures`, `texture_views` | 6 |
| `usage` | yes | `buffer_textures` | 2 |
| `shareable` | yes | `texture_views` | 4 |
| `firstMipmapInTail` | yes | `sparse_heaps` | 6 |
| `tailSizeInBytes` | yes | `sparse_heaps` | 6 |
| `isSparse` | yes | `sparse_heaps` | 6 |
| `firstMipmapInTail` | yes | `sparse_heaps`, `sparse_mappings` | 15 |
| `tailSizeInBytes` | yes | `sparse_heaps`, `sparse_mappings` | 15 |
| `isSparse` | yes | `sparse_heaps`, `sparse_mappings` | 15 |
| `allowGPUOptimizedContents` | yes | `buffer_textures` | 2 |
| `gpuResourceID` | yes | `half_storage_writes`, `norm_storage_writes`, `pixel_downscales`, `pixel_samplers` | 39 |
| `getBytes:bytesPerRow:bytesPerImage:fromRegion:mipmapLevel:slice:` | yes | `blit_encoder_commands`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `pvrtc_cpu_order`, `two_plane_copies` | 30 |
@@ -1797,19 +1798,19 @@ One row per implemented item of the SDK, in the coverage map's order. *exercised
| `texture2DDescriptorWithPixelFormat:width:height:mipmapped:` | yes | `argument_encoders`, `blit_encoder_commands`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `compressed_blits`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `extended_range_blends`, `extended_range_planes`, `extended_range_targets`, `extended_range_two_planes`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `host_page_writes`, `indirect_commands`, `mesh_barriers`, `mesh_commands`, `mesh_draws`, `nearest_positions`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `snorm_tile_store`, `srgb_fetch`, `texture_fills`, `textures`, `tile_threadgroups`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points` | 534 |
| `textureCubeDescriptorWithPixelFormat:size:mipmapped:` | no | — | — |
| `textureBufferDescriptorWithPixelFormat:width:resourceOptions:usage:` | no | — | — |
| `textureType` | yes | `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `compressed_blits`, `compressed_decode`, `compressed_views`, `compute_render_chains`, `denormal_word_fetches`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `extended_range_blends`, `extended_range_targets`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `heap_metal_sizes`, `host_page_writes`, `indirect_commands`, `level_sizes`, `norm_storage_writes`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `resource_facts`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `shared_exponent_storage`, `snorm_tile_store`, `sparse_heaps`, `srgb_fetch`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `two_plane_copies`, `two_plane_heap_blits`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 448 |
| `pixelFormat` | yes | `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_decode`, `compressed_views`, `denormal_word_fetches`, `etc_textures`, `extended_swizzles`, `format_copies`, `fresh_contents`, `heap_metal_sizes`, `level_sizes`, `norm_storage_writes`, `pvrtc_cpu_order`, `pvrtc_rows`, `resource_facts`, `shared_exponent_storage`, `sparse_heaps`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `two_plane_copies`, `two_plane_heap_blits`, `ycbcr_minify`, `ycbcr_textures` | 286 |
| `width` | yes | `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_decode`, `compressed_views`, `denormal_word_fetches`, `etc_textures`, `extended_swizzles`, `format_copies`, `fresh_contents`, `heap_metal_sizes`, `level_sizes`, `norm_storage_writes`, `pvrtc_cpu_order`, `pvrtc_rows`, `resource_facts`, `shared_exponent_storage`, `sparse_heaps`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `two_plane_copies`, `two_plane_heap_blits`, `ycbcr_minify`, `ycbcr_textures` | 286 |
| `height` | yes | `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_decode`, `compressed_views`, `denormal_word_fetches`, `etc_textures`, `extended_swizzles`, `format_copies`, `fresh_contents`, `heap_metal_sizes`, `level_sizes`, `norm_storage_writes`, `pvrtc_cpu_order`, `pvrtc_rows`, `resource_facts`, `shared_exponent_storage`, `sparse_heaps`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `two_plane_copies`, `two_plane_heap_blits`, `ycbcr_minify`, `ycbcr_textures` | 286 |
| `depth` | yes | `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_decode`, `compressed_views`, `denormal_word_fetches`, `etc_textures`, `extended_swizzles`, `format_copies`, `fresh_contents`, `heap_metal_sizes`, `level_sizes`, `norm_storage_writes`, `pvrtc_cpu_order`, `pvrtc_rows`, `resource_facts`, `shared_exponent_storage`, `sparse_heaps`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `two_plane_copies`, `two_plane_heap_blits`, `ycbcr_textures` | 284 |
| `mipmapLevelCount` | yes | `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_decode`, `compressed_views`, `denormal_word_fetches`, `etc_textures`, `extended_swizzles`, `format_copies`, `fresh_contents`, `heap_metal_sizes`, `level_sizes`, `norm_storage_writes`, `pvrtc_cpu_order`, `pvrtc_rows`, `resource_facts`, `shared_exponent_storage`, `sparse_heaps`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `two_plane_copies`, `two_plane_heap_blits`, `ycbcr_textures` | 284 |
| `sampleCount` | yes | `buffer_target_clears`, `buffer_textures`, `color_write_masks`, `compute_render_chains`, `discard_hoist`, `draw_state_changes`, `extended_range_blends`, `extended_range_targets`, `fetch_ordered`, `frame_chains`, `half_output_blends`, `heap_metal_sizes`, `host_page_writes`, `indirect_commands`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `snorm_tile_store`, `sparse_heaps`, `srgb_fetch`, `texture_views`, `visibility`, `wide_points`, `ycbcr_textures` | 183 |
| `arrayLength` | yes | `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_decode`, `compressed_views`, `denormal_word_fetches`, `etc_textures`, `extended_swizzles`, `format_copies`, `fresh_contents`, `heap_metal_sizes`, `level_sizes`, `norm_storage_writes`, `pvrtc_cpu_order`, `pvrtc_rows`, `resource_facts`, `shared_exponent_storage`, `sparse_heaps`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `two_plane_copies`, `two_plane_heap_blits`, `ycbcr_textures` | 284 |
| `textureType` | yes | `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `compressed_blits`, `compressed_decode`, `compressed_views`, `compute_render_chains`, `denormal_word_fetches`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `extended_range_blends`, `extended_range_targets`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `heap_metal_sizes`, `host_page_writes`, `indirect_commands`, `level_sizes`, `norm_storage_writes`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `resource_facts`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `shared_exponent_storage`, `snorm_tile_store`, `sparse_heaps`, `sparse_mappings`, `srgb_fetch`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `two_plane_copies`, `two_plane_heap_blits`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 457 |
| `pixelFormat` | yes | `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_decode`, `compressed_views`, `denormal_word_fetches`, `etc_textures`, `extended_swizzles`, `format_copies`, `fresh_contents`, `heap_metal_sizes`, `level_sizes`, `norm_storage_writes`, `pvrtc_cpu_order`, `pvrtc_rows`, `resource_facts`, `shared_exponent_storage`, `sparse_heaps`, `sparse_mappings`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `two_plane_copies`, `two_plane_heap_blits`, `ycbcr_minify`, `ycbcr_textures` | 295 |
| `width` | yes | `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_decode`, `compressed_views`, `denormal_word_fetches`, `etc_textures`, `extended_swizzles`, `format_copies`, `fresh_contents`, `heap_metal_sizes`, `level_sizes`, `norm_storage_writes`, `pvrtc_cpu_order`, `pvrtc_rows`, `resource_facts`, `shared_exponent_storage`, `sparse_heaps`, `sparse_mappings`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `two_plane_copies`, `two_plane_heap_blits`, `ycbcr_minify`, `ycbcr_textures` | 295 |
| `height` | yes | `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_decode`, `compressed_views`, `denormal_word_fetches`, `etc_textures`, `extended_swizzles`, `format_copies`, `fresh_contents`, `heap_metal_sizes`, `level_sizes`, `norm_storage_writes`, `pvrtc_cpu_order`, `pvrtc_rows`, `resource_facts`, `shared_exponent_storage`, `sparse_heaps`, `sparse_mappings`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `two_plane_copies`, `two_plane_heap_blits`, `ycbcr_minify`, `ycbcr_textures` | 295 |
| `depth` | yes | `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_decode`, `compressed_views`, `denormal_word_fetches`, `etc_textures`, `extended_swizzles`, `format_copies`, `fresh_contents`, `heap_metal_sizes`, `level_sizes`, `norm_storage_writes`, `pvrtc_cpu_order`, `pvrtc_rows`, `resource_facts`, `shared_exponent_storage`, `sparse_heaps`, `sparse_mappings`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `two_plane_copies`, `two_plane_heap_blits`, `ycbcr_textures` | 293 |
| `mipmapLevelCount` | yes | `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_decode`, `compressed_views`, `denormal_word_fetches`, `etc_textures`, `extended_swizzles`, `format_copies`, `fresh_contents`, `heap_metal_sizes`, `level_sizes`, `norm_storage_writes`, `pvrtc_cpu_order`, `pvrtc_rows`, `resource_facts`, `shared_exponent_storage`, `sparse_heaps`, `sparse_mappings`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `two_plane_copies`, `two_plane_heap_blits`, `ycbcr_textures` | 293 |
| `sampleCount` | yes | `buffer_target_clears`, `buffer_textures`, `color_write_masks`, `compute_render_chains`, `discard_hoist`, `draw_state_changes`, `extended_range_blends`, `extended_range_targets`, `fetch_ordered`, `frame_chains`, `half_output_blends`, `heap_metal_sizes`, `host_page_writes`, `indirect_commands`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `snorm_tile_store`, `sparse_heaps`, `sparse_mappings`, `srgb_fetch`, `texture_views`, `visibility`, `wide_points`, `ycbcr_textures` | 192 |
| `arrayLength` | yes | `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_decode`, `compressed_views`, `denormal_word_fetches`, `etc_textures`, `extended_swizzles`, `format_copies`, `fresh_contents`, `heap_metal_sizes`, `level_sizes`, `norm_storage_writes`, `pvrtc_cpu_order`, `pvrtc_rows`, `resource_facts`, `shared_exponent_storage`, `sparse_heaps`, `sparse_mappings`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `two_plane_copies`, `two_plane_heap_blits`, `ycbcr_textures` | 293 |
| `resourceOptions` | no | — | — |
| `cpuCacheMode` | no | — | — |
| `storageMode` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `extended_range_blends`, `extended_range_planes`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `heap_metal_sizes`, `host_page_writes`, `indirect_commands`, `level_sizes`, `mesh_barriers`, `mesh_commands`, `mesh_draws`, `nearest_positions`, `norm_storage_writes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `resource_facts`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `shared_exponent_storage`, `snorm_tile_store`, `sparse_heaps`, `srgb_fetch`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `textures`, `tile_threadgroups`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 657 |
| `storageMode` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `extended_range_blends`, `extended_range_planes`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `heap_metal_sizes`, `host_page_writes`, `indirect_commands`, `level_sizes`, `mesh_barriers`, `mesh_commands`, `mesh_draws`, `nearest_positions`, `norm_storage_writes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `resource_facts`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `shared_exponent_storage`, `snorm_tile_store`, `sparse_heaps`, `sparse_mappings`, `srgb_fetch`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `textures`, `tile_threadgroups`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 666 |
| `hazardTrackingMode` | no | — | — |
| `usage` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `extended_range_blends`, `extended_range_planes`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `heap_metal_sizes`, `host_page_writes`, `indirect_commands`, `level_sizes`, `mesh_barriers`, `mesh_commands`, `mesh_draws`, `nearest_positions`, `norm_storage_writes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `resource_facts`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `shared_exponent_storage`, `snorm_tile_store`, `sparse_heaps`, `srgb_fetch`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `textures`, `tile_threadgroups`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 657 |
| `usage` | yes | `argument_encoders`, `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_blits`, `buffer_depth_samples`, `buffer_target_clears`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `color_write_masks`, `compressed_blits`, `compressed_decode`, `compressed_moves`, `compressed_views`, `compute_encoder_commands`, `compute_render_chains`, `denormal_word_fetches`, `depth_texel_reads`, `discard_hoist`, `draw_state_changes`, `etc_textures`, `extended_range_blends`, `extended_range_planes`, `extended_range_targets`, `extended_range_two_planes`, `extended_swizzles`, `fetch_ordered`, `format_copies`, `frame_chains`, `fresh_contents`, `half_output_blends`, `half_read_nans`, `half_storage_writes`, `half_texel_nans`, `half_write_nans`, `heap_metal_sizes`, `host_page_writes`, `indirect_commands`, `level_sizes`, `mesh_barriers`, `mesh_commands`, `mesh_draws`, `nearest_positions`, `norm_storage_writes`, `pixel_downscales`, `pixel_samplers`, `pvrtc_cpu_order`, `pvrtc_rows`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `resource_facts`, `rgb10a2_srgb`, `rotated_planes`, `rotated_targets`, `sample_positions`, `shader_stencil`, `shared_exponent_storage`, `snorm_tile_store`, `sparse_heaps`, `sparse_mappings`, `srgb_fetch`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `textures`, `tile_threadgroups`, `two_plane_copies`, `two_plane_heap_blits`, `two_plane_samples`, `visibility`, `wide_points`, `ycbcr_minify`, `ycbcr_textures` | 666 |
| `allowGPUOptimizedContents` | yes | `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_decode`, `compressed_views`, `denormal_word_fetches`, `etc_textures`, `extended_swizzles`, `format_copies`, `fresh_contents`, `level_sizes`, `norm_storage_writes`, `pvrtc_cpu_order`, `pvrtc_rows`, `resource_facts`, `shared_exponent_storage`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `two_plane_copies`, `two_plane_heap_blits` | 269 |
| `swizzle` | yes | `astc_textures`, `blit_encoder_commands`, `border_swizzles`, `buffer_depth_samples`, `buffer_texture_blits`, `buffer_textures`, `chroma_pairs`, `compressed_blits`, `compressed_decode`, `compressed_views`, `denormal_word_fetches`, `etc_textures`, `extended_swizzles`, `format_copies`, `fresh_contents`, `level_sizes`, `norm_storage_writes`, `pvrtc_cpu_order`, `pvrtc_rows`, `resource_facts`, `shared_exponent_storage`, `swizzled_storage`, `texel_swizzles`, `texture_fills`, `texture_views`, `two_plane_copies`, `two_plane_heap_blits` | 269 |
@@ -2049,4 +2050,5 @@ A case whose difference from Metal is recorded rather than compared away. The le
| `resource-own-getters` | `Texture::resource_options` does not carry the hazard tracking mode it resolved. Metal never reports `MTLHazardTrackingModeDefault` from a resource: it resolves… |
| `resource-own-getters` | `Texture::resource_options` does not carry the hazard tracking mode it resolved. Metal never reports `MTLHazardTrackingModeDefault` from a resource: it resolves… |
| `resource-own-getters` | `Texture::resource_options` does not carry the hazard tracking mode it resolved. Metal never reports `MTLHazardTrackingModeDefault` from a resource: it resolves… |
| `sparse-mapping-a-level-past-the-textures` | The runtime refuses a direct mapping update of a mip level past the texture's own levels, where plain Metal takes the call and maps nothing. Measured on this M3… |