From 9cb2a219130d17eca4e79cdbb95704dfaeee2207 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sun, 25 Oct 2026 14:29:38 +0200 Subject: [PATCH] Record the runtime sources' hash after the stale-record corrections The steps this packet landed as, in order: - Record the runtime sources' hash after the stale-record corrections Content: the tree of `development` at f5c1a00903, unchanged. --- .../src/buffer_texture.rs | 6 ++-- .../runtime-sources.sha256 | 2 +- .../src/runtime_lane/mipmaps_exact.rs | 4 +-- docs/FAST-PATHS.md | 28 +++++++++++++++---- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/crates/metal2vulkan-runtime/src/buffer_texture.rs b/crates/metal2vulkan-runtime/src/buffer_texture.rs index 0f103f4ce..cbdf681e3 100644 --- a/crates/metal2vulkan-runtime/src/buffer_texture.rs +++ b/crates/metal2vulkan-runtime/src/buffer_texture.rs @@ -1187,8 +1187,10 @@ impl Texels { /// Whether Metal's GPU reads and writes two of the texels' rows over bytes they share: an /// IOSurface plane's at its pitch rounded down to 16, the one shape that does /// ([`plane_rows_share_bytes`]). The shadow's copies hold the sharing - /// ([`plane_copy_regions`]); a blit that addresses the rows as bytes does not - /// (`blit_texture.rs`). + /// ([`plane_copy_regions`]); a blit that would write the rows as bytes does not and is refused + /// instead, as is a copy between them and an image texture either way, while a blit that reads + /// them into a buffer is served: a write must settle which of two rows leaves the shared bytes + /// behind and Metal settles it no one way, while a read settles nothing (`blit_texture.rs`). pub(super) fn plane_rows_overlap(&self) -> bool { plane_rows_share_bytes(&self.layout, &self.cpu) } diff --git a/crates/metal2vulkan-validation/runtime-sources.sha256 b/crates/metal2vulkan-validation/runtime-sources.sha256 index 2233e0dda..941faef3b 100644 --- a/crates/metal2vulkan-validation/runtime-sources.sha256 +++ b/crates/metal2vulkan-validation/runtime-sources.sha256 @@ -1 +1 @@ -3e6dfc1d942cb947e149566f1e3d7230a2cfd39ee083b41e8c4559b6d188eef0 +53c85bbd60b2aa39d3c856eed92b7a51ca2a3f213a7b820c59df1fdfbf5632b9 diff --git a/crates/metal2vulkan-validation/src/runtime_lane/mipmaps_exact.rs b/crates/metal2vulkan-validation/src/runtime_lane/mipmaps_exact.rs index b7d94f71e..5756ffce5 100644 --- a/crates/metal2vulkan-validation/src/runtime_lane/mipmaps_exact.rs +++ b/crates/metal2vulkan-validation/src/runtime_lane/mipmaps_exact.rs @@ -554,7 +554,7 @@ fn every_format_the_filter_computes_is_its_filter_level_by_level() { "the mipmap filter on {}: {formats} formats, {checked} bytes, every one the filter's", device.name() ); - assert_eq!(formats, 35, "the formats the filter computes"); + assert_eq!(formats, 36, "the formats the filter computes"); let kinds: Vec = [ (Degradation::MipmapsAsAppleM4, unlike_an_m3), (Degradation::MipmapTieRounding, near_ties), @@ -1085,7 +1085,7 @@ fn a_first_level_read_in_place_recovers_every_code() { ); assert_eq!( in_place.len() + copied.len(), - 35, + 36, "the formats the filter computes" ); assert!( diff --git a/docs/FAST-PATHS.md b/docs/FAST-PATHS.md index 0b52b0ebc..7cadad316 100644 --- a/docs/FAST-PATHS.md +++ b/docs/FAST-PATHS.md @@ -605,6 +605,13 @@ driver's. Each is open work. (`DriverWorkaround::EarlyTestsDropMultisampledImageWrites`), a function declaring early tests that discards, returns depth, stencil or a sample mask, or writes other memory. A form testing at the function's entry against the stand-in is not built. +- **Threads per tile past the pass's tile.** `dispatch_threads_per_tile` refuses threads per tile + wider or taller than the pass's tile when they are within Metal's limit for the state + (`DrawProblem::ThreadsPerTilePastTile`). Plain Metal runs such a dispatch over every tile of the + pass from that tile's origin, so a pixel inside the threads per tile of more than one tile's + origin runs once per tile, on overlapping threadgroups the runtime does not model; a dispatch of + the tile's own threads would store once where Metal stores repeatedly, so no narrower dispatch + serves it. - **A vertex function that selects its slice, on a device without `shaderOutputLayer` and `geometryShader`.** Metal renders each primitive into the slice its first vertex selects. Vulkan stores `Layer` from a vertex function only with `shaderOutputLayer`, and the generated geometry @@ -867,11 +874,20 @@ else. leaves of the shared bytes is unmeasured; a two-plane YCbCr texture's rows of codes, which no row rule holds and which overlap by any amount across any number of rows, and the other formats whose rows no row rule bounds (a two-plane extended-range one's, a 4:2:2 one's pairs, a depth or stencil - plane's elements), which two regions do not express; and a blit that addresses such a plane's rows - as bytes (`blit_texture.rs`), which would write every shared byte from one fixed row where Metal - has no one order: the row Metal leaves there follows the command, the GPU pitch and the row count, - one shape of `copyFromTexture:toTexture:` gives three whole-plane outcomes from run to run, and a - kernel's winner moves with the threadgroup shape (an Apple M3 Max under macOS 27.0.1, one case a - process, `probes/overlapping_plane_row_writes.m`). A rotated plane never reaches any of this: its + plane's elements), which two regions do not express; a blit that would write such a plane's rows + as bytes (`blit_texture.rs`: a copy into it from a buffer, and one between two textures over + buffers, refused whichever side the plane is on, the destination having no one order and what + Metal reads out of a source plane there being unmeasured), which would write every shared byte + from one fixed row where Metal has no one order: the row Metal leaves there follows the command, + the GPU pitch and the row count, one shape of `copyFromTexture:toTexture:` gives three whole-plane + outcomes from run to run, and a kernel's winner moves with the threadgroup shape (an Apple M3 Max + under macOS 27.0.1, one case a process, `probes/overlapping_plane_row_writes.m`); and a copy + between such a plane and an image texture, either way, whose one `bufferRowLength` states no + sharing. A blit out of such a plane into a buffer is served: its rows are read, not written, and + each of the caller's rows takes the plane's bytes at its own GPU row, so a byte two rows share is + read once for each of them, which is what Metal's `copyFromTexture:toBuffer:` reads + (`probes/overlapping_plane_row_reads.m`). A read is not the mirror of a write here -- a write must + settle which of two rows leaves the shared bytes behind and Metal settles it no one way, while a + read settles nothing. A rotated plane never reaches any of this: its `bytesPerRow` must be a multiple of 16, so its GPU rows lie at the pitch itself and share no byte.