From f43cff7e761ea9abbaff9f32645b99dbc9aa82f2 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 3 Dec 2026 15:39:41 -0800 Subject: [PATCH] METAL-COVERAGE: the sparse tile sizes and region conversions are sparse tiles, not tile pipelines Six MTLDevice items were filed in the coverage map as tile render pipelines ("tile render pipelines; metal2vulkan-runtime makes none", size L, group tile): sparseTileSizeInBytes, sparseTileSizeInBytesForSparsePageSize:, the two sparseTileSizeWithTextureType:pixelFormat: sampleCount: forms and convertSparsePixelRegions:toTileRegions:... and convertSparseTileRegions:toPixelRegions:.... They answer a sparse texture's tile size and convert regions between pixels and its tiles, and have nothing to do with tile render pipelines. They now read "sparse tiles", size S, group sparse, as MTLTexture.firstMipmapInTail, tailSizeInBytes and isSparse already do; that group's name, "placement sparse page sizes", becomes "sparse page and tile sizes", which it held already with those three. The tile render pipeline group keeps its other 20 items. docs/METAL-COVERAGE.md is regenerated: missing by size S 178 -> 184 and L 313 -> 307, the sparse group 5 -> 11 items, the tile group 26 -> 20; the status totals do not move. Verified, on the CPU with no device: scripts/metal-coverage/coverage.py --check reads the document current; the table's status counts, which the validation suite's the_coverage_documents_totals_are_the_tables compares with the document, are unchanged, and every missing row keeps a size and a group. --- docs/CONFORMANCE-COVERAGE.md | 12 ++++++------ docs/METAL-COVERAGE.md | 18 +++++++++--------- scripts/metal-coverage/coverage.py | 2 +- scripts/metal-coverage/coverage.tsv | 12 ++++++------ 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/CONFORMANCE-COVERAGE.md b/docs/CONFORMANCE-COVERAGE.md index 60441c24e..bda79b40a 100644 --- a/docs/CONFORMANCE-COVERAGE.md +++ b/docs/CONFORMANCE-COVERAGE.md @@ -1865,8 +1865,8 @@ An item the suite's Metal leg calls whose coverage-map status is not implemented | `MTLComputePipelineDescriptor` `label` | out of scope | the consumer's (metal2vulkan-runtime's README, What the consumer implements) | `compute_pipeline_descriptors`, `pipeline_facts`, `pipeline_handlers` | | `MTLComputePipelineState` `device` | missing | a query or call metal2vulkan-runtime does not answer | `pipeline_facts`, `pipeline_handlers` | | `MTLComputePipelineState` `label` | out of scope | the consumer's (metal2vulkan-runtime's README, What the consumer implements) | `pipeline_facts`, `pipeline_handlers` | -| `MTLDevice` `convertSparsePixelRegions:toTileRegions:withTileSize:alignmentMode:numRegions:` | missing | tile render pipelines; metal2vulkan-runtime makes none | `device_queries` | -| `MTLDevice` `convertSparseTileRegions:toPixelRegions:withTileSize:numRegions:` | missing | tile render pipelines; metal2vulkan-runtime makes none | `device_queries` | +| `MTLDevice` `convertSparsePixelRegions:toTileRegions:withTileSize:alignmentMode:numRegions:` | missing | sparse tiles | `device_queries` | +| `MTLDevice` `convertSparseTileRegions:toPixelRegions:withTileSize:numRegions:` | missing | sparse tiles | `device_queries` | | `MTLDevice` `newArgumentEncoderWithArguments:` | missing | argument encoders | `argument_encoder_crossings`, `argument_encoders` | | `MTLDevice` `newBinaryArchiveWithDescriptor:error:` | out of scope | the consumer's (metal2vulkan-runtime's README, What the consumer implements) | `binary_archives` | | `MTLDevice` `newBufferWithBytes:length:options:` | missing | a buffer made with bytes; Managed: `Device::new_managed_buffer` | `buffer_depth_samples` | @@ -1890,10 +1890,10 @@ An item the suite's Metal leg calls whose coverage-map status is not implemented | `MTLDevice` `newSharedTextureWithHandle:` | missing | texture and event handles shared across processes | `shared_creator_formats`, `texture_views` | | `MTLDevice` `newTextureWithDescriptor:iosurface:plane:` | out of scope | IOSurface is the consumer's; the runtime offers the plane over a no-copy buffer | `alpha_coverage_pairs`, `blend_interactions`, `blend_sweeps`, `buffer_tails`, `buffer_target_clears`, `color_write_masks`, `compute_render_chains`, `depth_resolve_pairs`, `depth_stencil_space`, `discard_hoist`, `draw_state_changes`, `extended_range_blends`, `extended_range_gamut`, `extended_range_gradients`, `extended_range_targets`, `fetch_ordered`, `frame_chains`, `half_output_blends`, `host_page_writes`, `indirect_command_depth`, `indirect_commands`, `layered_targets`, `padded_blends`, `padded_fetch`, `pass_attachment_pairs`, `pass_bound_pairs`, `pass_sequence_actions`, `pass_start_reads`, `pass_unattached_between`, `pass_unattached_colors`, `primitive_type_crossings`, `quad_helpers`, `reconvergence`, `render_chains`, `render_depth_stencil_state`, `render_draw_forms`, `render_residency`, `render_state`, `resolve_then_load`, `rotated_planes`, `rotated_targets`, `sample_positions`, `sampler_bind_clamps`, `shader_stencil`, `snorm_tile_store`, `srgb_fetch`, `srgb_storage_fragment_writes`, `stencil_resolve_pairs`, `stencil_resolved_sample`, `surface_textures`, `tessellation_rendered`, `topology_classes`, `viewport_cuts`, `visibility`, `wide_points`, `ycbcr_gathers`, `ycbcr_minify`, `ycbcr_textures` | | `MTLDevice` `registryID` | missing | a query or call metal2vulkan-runtime does not answer | `argument_encoder_crossings`, `argument_encoders`, `binary_archives`, `command_buffer_facts`, `dynamic_libraries`, `function_facts`, `heap_facts`, `library_facts`, `pipeline_facts`, `pipeline_handlers`, `resource_facts`, `shared_creator_formats`, `shared_events`, `texture_descriptor_pairs`, `texture_views`, `visible_tables` | -| `MTLDevice` `sparseTileSizeInBytes` | missing | tile render pipelines; metal2vulkan-runtime makes none | `sparse_tiles` | -| `MTLDevice` `sparseTileSizeInBytesForSparsePageSize:` | missing | tile render pipelines; metal2vulkan-runtime makes none | `sparse_tiles` | -| `MTLDevice` `sparseTileSizeWithTextureType:pixelFormat:sampleCount:` | missing | tile render pipelines; metal2vulkan-runtime makes none | `sparse_mappings`, `sparse_tiles` | -| `MTLDevice` `sparseTileSizeWithTextureType:pixelFormat:sampleCount:sparsePageSize:` | missing | tile render pipelines; metal2vulkan-runtime makes none | `sparse_mappings`, `sparse_tiles` | +| `MTLDevice` `sparseTileSizeInBytes` | missing | sparse tiles | `sparse_tiles` | +| `MTLDevice` `sparseTileSizeInBytesForSparsePageSize:` | missing | sparse tiles | `sparse_tiles` | +| `MTLDevice` `sparseTileSizeWithTextureType:pixelFormat:sampleCount:` | missing | sparse tiles | `sparse_mappings`, `sparse_tiles` | +| `MTLDevice` `sparseTileSizeWithTextureType:pixelFormat:sampleCount:sparsePageSize:` | missing | sparse tiles | `sparse_mappings`, `sparse_tiles` | | `MTLDevice` `supportsRasterizationRateMapWithLayerCount:` | missing | rasterization rate maps; the render pass descriptor has no field for one | `device_queries` | | `MTLDevice` `supportsVertexAmplificationCount:` | missing | a query or call metal2vulkan-runtime does not answer | `device_queries` | | `MTLDynamicLibrary` `device` | missing | function tables of the render stages, binary functions and dynamic libraries; a draw's function that reads a function table is refused (`Gap::DrawInput`) | `dynamic_libraries` | diff --git a/docs/METAL-COVERAGE.md b/docs/METAL-COVERAGE.md index 2ac8fb01e..0536d1930 100644 --- a/docs/METAL-COVERAGE.md +++ b/docs/METAL-COVERAGE.md @@ -15,7 +15,7 @@ Every public item of the macOS 27.2 SDK (Xcode 27.2, 27B52)'s Metal headers, by | out of scope | 424 | 5 | | all | 2135 | 68 | -Implemented by the runtime: 293; by the translator's values: 357. Missing by size: S 178, M 194, L 313, XL 376. +Implemented by the runtime: 293; by the translator's values: 357. Missing by size: S 184, M 194, L 307, XL 376. ## Missing, in build order @@ -41,7 +41,7 @@ Cheap items a plain app calls first, then medium pieces by how often a plain app | more binary archive entries | S | 3 | `MTLBinaryArchive.addLibraryWithDescriptor:error:`, `MTLBinaryArchive.addFunctionWithDescriptor:library:error:`, `MTLFunctionDescriptor.binaryArchives` | | the shared event listener | S | 3 | `MTLSharedEventListener`, `MTLSharedEventListener.init`, `MTLSharedEventListener.sharedListener` | | mesh pipeline descriptor fields | S | 3 | `MTLMeshRenderPipelineDescriptor.objectBuffers`, `MTLMeshRenderPipelineDescriptor.meshBuffers`, `MTLMeshRenderPipelineDescriptor.fragmentBuffers` | -| placement sparse page sizes | S | 5 | `MTLHeapDescriptor.maxCompatiblePlacementSparsePageSize`, `MTLTextureDescriptor.placementSparsePageSize`, `MTLTexture.firstMipmapInTail`, ... | +| sparse page and tile sizes | S | 11 | `MTLDevice.sparseTileSizeWithTextureType:pixelFormat:sampleCount:`, `MTLDevice.sparseTileSizeInBytes`, `MTLDevice.convertSparsePixelRegions:toTileRegions:withTileSize:alignmentMode:numRegions:`, ... | | parallel render encoding | M | 9 | `MTLCommandBuffer.parallelRenderCommandEncoderWithDescriptor:`, `MTLParallelRenderCommandEncoder`, `MTLParallelRenderCommandEncoder.renderCommandEncoder`, ... | | depth/stencil states in argument buffers | M | 2 | `MTLArgumentEncoder.setDepthStencilState:atIndex:`, `MTLArgumentEncoder.setDepthStencilStates:withRange:` | | depth bounds | M | 1 | `MTLRenderCommandEncoder.setDepthTestMinBound:maxBound:` | @@ -56,7 +56,7 @@ Cheap items a plain app calls first, then medium pieces by how often a plain app | function tables, function handles and dynamic libraries | L | 24 | `MTLComputePipelineState.functionHandleWithBinaryFunction:`, `MTLComputePipelineState.newComputePipelineStateWithBinaryFunctions:error:`, `MTLComputePipelineState.newComputePipelineStateWithAdditionalBinaryFunctions:error:`, ... | | rasterization rate maps | L | 12 | `MTLDevice.supportsRasterizationRateMapWithLayerCount:`, `MTLDevice.newRasterizationRateMapWithDescriptor:`, `MTLRasterizationRateMap`, ... | | mesh render pipelines and their encoder calls | L | 33 | `MTLDevice.newRenderPipelineStateWithMeshDescriptor:options:reflection:error:`, `MTLDevice.newRenderPipelineStateWithMeshDescriptor:options:completionHandler:`, `MTLRenderCommandEncoder.setObjectBytes:length:atIndex:`, ... | -| tile render pipelines and their encoder calls | L | 26 | `MTLDevice.newRenderPipelineStateWithTileDescriptor:options:reflection:error:`, `MTLDevice.newRenderPipelineStateWithTileDescriptor:options:completionHandler:`, `MTLDevice.sparseTileSizeWithTextureType:pixelFormat:sampleCount:`, ... | +| tile render pipelines and their encoder calls | L | 20 | `MTLDevice.newRenderPipelineStateWithTileDescriptor:options:reflection:error:`, `MTLDevice.newRenderPipelineStateWithTileDescriptor:options:completionHandler:`, `MTLRenderCommandEncoder.tileWidth`, ... | | counter sample buffers | M | 54 | `MTLBlitCommandEncoder.sampleCountersInBuffer:atSampleIndex:withBarrier:`, `MTLBlitCommandEncoder.resolveCounters:inRange:destinationBuffer:destinationOffset:`, `MTLBlitPassSampleBufferAttachmentDescriptor`, ... | | residency sets | M | 25 | `MTLCommandBuffer.useResidencySet:`, `MTLCommandBuffer.useResidencySets:count:`, `MTLCommandQueue.addResidencySet:`, ... | | color attachment mapping | M | 6 | `MTLRenderCommandEncoder.setColorAttachmentMap:`, `MTLRenderPassDescriptor.supportColorAttachmentMapping`, `MTLLogicalToPhysicalColorAttachmentMap`, ... | @@ -1471,12 +1471,12 @@ Cheap items a plain app calls first, then medium pieces by how often a plain app | `MTLDevice.newIOHandleWithURL:compressionMethod:error:` (deprecated) | method | missing | L: fast resource loading | | `MTLDevice.newIOFileHandleWithURL:error:` | method | missing | L: fast resource loading | | `MTLDevice.newIOFileHandleWithURL:compressionMethod:error:` | method | missing | L: fast resource loading | -| `MTLDevice.sparseTileSizeWithTextureType:pixelFormat:sampleCount:` | method | missing | L: tile render pipelines; metal2vulkan-runtime makes none | -| `MTLDevice.sparseTileSizeInBytes` | property | missing | L: tile render pipelines; metal2vulkan-runtime makes none | -| `MTLDevice.convertSparsePixelRegions:toTileRegions:withTileSize:alignmentMode:numRegions:` | method | missing | L: tile render pipelines; metal2vulkan-runtime makes none | -| `MTLDevice.convertSparseTileRegions:toPixelRegions:withTileSize:numRegions:` | method | missing | L: tile render pipelines; metal2vulkan-runtime makes none | -| `MTLDevice.sparseTileSizeInBytesForSparsePageSize:` | method | missing | L: tile render pipelines; metal2vulkan-runtime makes none | -| `MTLDevice.sparseTileSizeWithTextureType:pixelFormat:sampleCount:sparsePageSize:` | method | missing | L: tile render pipelines; metal2vulkan-runtime makes none | +| `MTLDevice.sparseTileSizeWithTextureType:pixelFormat:sampleCount:` | method | missing | S: sparse tiles | +| `MTLDevice.sparseTileSizeInBytes` | property | missing | S: sparse tiles | +| `MTLDevice.convertSparsePixelRegions:toTileRegions:withTileSize:alignmentMode:numRegions:` | method | missing | S: sparse tiles | +| `MTLDevice.convertSparseTileRegions:toPixelRegions:withTileSize:numRegions:` | method | missing | S: sparse tiles | +| `MTLDevice.sparseTileSizeInBytesForSparsePageSize:` | method | missing | S: sparse tiles | +| `MTLDevice.sparseTileSizeWithTextureType:pixelFormat:sampleCount:sparsePageSize:` | method | missing | S: sparse tiles | | `MTLDevice.maxBufferLength` | property | out of scope | the consumer's: it states one no larger than `MAX_BUFFER_LENGTH` (metal2vulkan-runtime's README, Memory blocks and buffers) | | `MTLDevice.counterSets` | property | missing | S: counter sets; the runtime samples none, so an empty list would be its answer | | `MTLDevice.newCounterSampleBufferWithDescriptor:error:` | method | missing | M: counter sample buffers | diff --git a/scripts/metal-coverage/coverage.py b/scripts/metal-coverage/coverage.py index 45e096857..3995ffcb2 100644 --- a/scripts/metal-coverage/coverage.py +++ b/scripts/metal-coverage/coverage.py @@ -61,7 +61,7 @@ GROUP_NAMES = { "archive": "more binary archive entries", "events": "the shared event listener", "mesh-descriptor": "mesh pipeline descriptor fields", - "sparse": "placement sparse page sizes", + "sparse": "sparse page and tile sizes", "parallel": "parallel render encoding", "icb-depth-stencil": "depth/stencil states in argument buffers", "depthbounds": "depth bounds", diff --git a/scripts/metal-coverage/coverage.tsv b/scripts/metal-coverage/coverage.tsv index b0959b1ae..48aec4b85 100644 --- a/scripts/metal-coverage/coverage.tsv +++ b/scripts/metal-coverage/coverage.tsv @@ -1135,12 +1135,12 @@ MTLDevice.h MTLDevice method newIOCommandQueueWithDescriptor:error: M fast re MTLDevice.h MTLDevice method newIOHandleWithURL:compressionMethod:error: yes M fast resource loading L io MTLDevice.h MTLDevice method newIOFileHandleWithURL:error: M fast resource loading L io MTLDevice.h MTLDevice method newIOFileHandleWithURL:compressionMethod:error: M fast resource loading L io -MTLDevice.h MTLDevice method sparseTileSizeWithTextureType:pixelFormat:sampleCount: M tile render pipelines; metal2vulkan-runtime makes none L tile -MTLDevice.h MTLDevice property sparseTileSizeInBytes M tile render pipelines; metal2vulkan-runtime makes none L tile -MTLDevice.h MTLDevice method convertSparsePixelRegions:toTileRegions:withTileSize:alignmentMode:numRegions: M tile render pipelines; metal2vulkan-runtime makes none L tile -MTLDevice.h MTLDevice method convertSparseTileRegions:toPixelRegions:withTileSize:numRegions: M tile render pipelines; metal2vulkan-runtime makes none L tile -MTLDevice.h MTLDevice method sparseTileSizeInBytesForSparsePageSize: M tile render pipelines; metal2vulkan-runtime makes none L tile -MTLDevice.h MTLDevice method sparseTileSizeWithTextureType:pixelFormat:sampleCount:sparsePageSize: M tile render pipelines; metal2vulkan-runtime makes none L tile +MTLDevice.h MTLDevice method sparseTileSizeWithTextureType:pixelFormat:sampleCount: M sparse tiles S sparse +MTLDevice.h MTLDevice property sparseTileSizeInBytes M sparse tiles S sparse +MTLDevice.h MTLDevice method convertSparsePixelRegions:toTileRegions:withTileSize:alignmentMode:numRegions: M sparse tiles S sparse +MTLDevice.h MTLDevice method convertSparseTileRegions:toPixelRegions:withTileSize:numRegions: M sparse tiles S sparse +MTLDevice.h MTLDevice method sparseTileSizeInBytesForSparsePageSize: M sparse tiles S sparse +MTLDevice.h MTLDevice method sparseTileSizeWithTextureType:pixelFormat:sampleCount:sparsePageSize: M sparse tiles S sparse MTLDevice.h MTLDevice property maxBufferLength O the consumer's: it states one no larger than `MAX_BUFFER_LENGTH` (metal2vulkan-runtime's README, Memory blocks and buffers) MTLDevice.h MTLDevice property counterSets M counter sets; the runtime samples none, so an empty list would be its answer S queries MTLDevice.h MTLDevice method newCounterSampleBufferWithDescriptor:error: M counter sample buffers M counters