diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73a4609f9..ce0c554ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,7 +153,7 @@ jobs: metal2vulkan-air=3 \ metal2vulkan-runtime=73 \ metal2vulkan-validation=4 \ - metal2vulkan-conformance=21 \ + metal2vulkan-conformance=1 \ metal2vulkan-devtools=0 do crate=${row%=*} diff --git a/crates/metal2vulkan-conformance/probes/sparse_move_past_the_bounds.m b/crates/metal2vulkan-conformance/probes/sparse_move_past_the_bounds.m index c453bc4f0..404e156e6 100644 --- a/crates/metal2vulkan-conformance/probes/sparse_move_past_the_bounds.m +++ b/crates/metal2vulkan-conformance/probes/sparse_move_past_the_bounds.m @@ -53,8 +53,8 @@ // THE SHAPES // // control an entirely IN-BOUNDS move: tile (0,0) of texture A to tile (3,3) of texture -// B. Its reading MUST move -- B(3,3) holding A(0,0)'s word and A(0,0) reading 0 -- -// or nothing below is a measurement of anything. A control that cannot move +// B. Its reading MUST move -- B(3,3) reading A(0,0)'s word and A(0,0) reading 0 +// -- or nothing below is a measurement of anything. A control that cannot move // proves nothing. // region-open source origin (2,0), source size 4 by 1 where level 0 holds 4 by 4 tiles, so // source tiles 2 and 3 are inside and 4 and 5 are not; destination origin (0,0) @@ -100,25 +100,34 @@ // shows only past an edge, and why `dest-2d` was the shape worth taking: without an in-bounds 2D // reading, "the destination is the region" and "the destination is a run" could not be told apart. // +// WHAT "TOOK" MEANS BELOW. A destination tile the move wrote did NOT read uniform: it printed +// `MIXED(first=)`. The source word is that tile's FIRST TEXEL, and the +// rest of the tile is not that word. So "B(3,3) took A(0,0)" below says WHICH source tile a +// destination tile took, read off its first texel, and says nothing about what the rest of that +// tile holds. This printout cannot say: its `differing>=` count stops at the first row of the tile +// that differs, so the count is a floor and never a share. Which tile each destination took is the +// whole question here, and the rule above rests on nothing else -- how much of a tile's bytes a +// move carries is a separate question, and one this probe does not read. +// // Shape by shape: // -// control B(3,3) held A(0,0)'s word, A(0,0) read zero, every other tile as it was. -// region-open source (2,0) 4x1: B(0,0) and B(1,0) held A(2,0) and A(3,0); B(2,0) and B(3,0) +// control B(3,3) took A(0,0), A(0,0) read zero, every other tile as it was. +// region-open source (2,0) 4x1: B(0,0) and B(1,0) took A(2,0) and A(3,0); B(2,0) and B(3,0) // read zero and A's other rows were whole, so the two tiles past the level moved // nowhere. // region-mapped the same move onto a B holding its own words at (2,0) and (3,0): both still // held them, so the destination tiles the overhang named are left as they were // rather than zeroed. // region-dest source (0,0) 4x1 onto (2,0): ALL FOUR moved -- B(2,0), B(3,0), B(2,1), B(3,1) -// held A(0,0), A(1,0), A(2,0), A(3,0) -- and A's whole row 0 read zero. +// took A(0,0), A(1,0), A(2,0), A(3,0) -- and A's whole row 0 read zero. // dest-row the same onto (2,1): B(2,1), B(3,1), B(2,2), B(3,2). The run's row starts at the // origin's own column, not at the level's left edge. // src-clip-2d source (2,2) 4x4, clipped to 2x2, onto (1,1) with three tiles to its right: -// B(1,1), B(2,1), B(3,1), B(1,2) held A(2,2), A(3,2), A(2,3), A(3,3). This is the +// B(1,1), B(2,1), B(3,1), B(1,2) took A(2,2), A(3,2), A(2,3), A(3,3). This is the // reading that says the row is the STATED width's: a row of the clipped two would // have put the third tile at (1,2). // dest-2d source (0,0) 2x2 onto (1,1), both sides inside: B(1,1), B(2,1), B(1,2), B(2,2) -// held A(0,0), A(1,0), A(0,1), A(1,1) -- the region's own offsets. +// took A(0,0), A(1,0), A(0,1), A(1,1) -- the region's own offsets. // slice source slice 2 of a two-slice texture: nothing moved, both slices whole. // level source level 9 of a nine-level texture: nothing moved. // diff --git a/crates/metal2vulkan-conformance/src/cases/depth_resolve_pairs.rs b/crates/metal2vulkan-conformance/src/cases/depth_resolve_pairs.rs index 6cb4d7169..46c992591 100644 --- a/crates/metal2vulkan-conformance/src/cases/depth_resolve_pairs.rs +++ b/crates/metal2vulkan-conformance/src/cases/depth_resolve_pairs.rs @@ -178,7 +178,7 @@ const RESOLVING: [StoreAction; 2] = [ /// Every `MTLMultisampleDepthResolveFilter`, named value by value so the suite's option-space axis /// reads them, and held against the runtime's own list by -/// [`tests::the_swept_filters_are_every_value_metal_defines`]. +/// `tests::the_swept_filters_are_every_value_metal_defines`. const FILTERS: [MultisampleDepthResolveFilter; 3] = [ MultisampleDepthResolveFilter::Sample0, MultisampleDepthResolveFilter::Min, diff --git a/crates/metal2vulkan-conformance/src/cases/heap_facts.rs b/crates/metal2vulkan-conformance/src/cases/heap_facts.rs index 9fe1cbcd1..9d0dcdf3c 100644 --- a/crates/metal2vulkan-conformance/src/cases/heap_facts.rs +++ b/crates/metal2vulkan-conformance/src/cases/heap_facts.rs @@ -325,7 +325,7 @@ fn labels() -> HeapFactsCase { /// The two buffers the available-size sweep places, in order: an offset and a length each. /// /// The offsets are multiples of Metal's 256-byte placement grain and both placements lie inside -/// `SIZE`, which [`tests::every_placement_of_the_available_size_sweep_is_one_metal_takes`] holds +/// `SIZE`, which `tests::every_placement_of_the_available_size_sweep_is_one_metal_takes` holds /// them to. const PLACEMENTS: [(u64, u64); 2] = [(0, 4096), (1 << 13, 1 << 16)]; diff --git a/crates/metal2vulkan-conformance/src/cases/indirect_commands.rs b/crates/metal2vulkan-conformance/src/cases/indirect_commands.rs index 5846e7984..eb7e77d63 100644 --- a/crates/metal2vulkan-conformance/src/cases/indirect_commands.rs +++ b/crates/metal2vulkan-conformance/src/cases/indirect_commands.rs @@ -736,7 +736,7 @@ const STAGE_IN_SIZE: [u32; 3] = [3, 1, 1]; /// fetches past the buffer**. The first recording of this row was taken with three, and Metal /// answered 0 for the two elements past the end — an out-of-bounds read whose value Metal leaves /// undefined, which is not an answer a case may compare. -/// [`tests::the_attribute_buffer_covers_the_region`] holds the margin. +/// `tests::the_attribute_buffer_covers_the_region` holds the margin. const ATTRIBUTES: [u32; 10] = [0xa0, 0, 0xa1, 0, 0xa2, 0, 0xa3, 0, 0xa4, 0]; /// Words the stage-in row's output buffer holds: the kernel writes a `uint4` at diff --git a/crates/metal2vulkan-conformance/src/cases/render_chains.rs b/crates/metal2vulkan-conformance/src/cases/render_chains.rs index 98e6d5a70..db53bce8d 100644 --- a/crates/metal2vulkan-conformance/src/cases/render_chains.rs +++ b/crates/metal2vulkan-conformance/src/cases/render_chains.rs @@ -139,7 +139,7 @@ const OVERDRAW: [u8; 4] = [208, 224, 240, 240]; /// The rectangle the fifth draw covers: half the clip-space height, over every column. /// /// Which half of the target that is -- the first rows or the last -- is Metal's answer, and nothing -/// here states it ([`tests::metal_drew_the_bands_and_then_the_half_overdraw`]). +/// here states it (`tests::metal_drew_the_bands_and_then_the_half_overdraw`). const HALF: [f32; 4] = [-1.0, -1.0, 1.0, 0.0]; /// The owned fixture whose `tob_rect` draws a rectangle from a buffer's two corners, whose diff --git a/crates/metal2vulkan-conformance/src/cases/render_draw_forms.rs b/crates/metal2vulkan-conformance/src/cases/render_draw_forms.rs index 372e44c38..82cade438 100644 --- a/crates/metal2vulkan-conformance/src/cases/render_draw_forms.rs +++ b/crates/metal2vulkan-conformance/src/cases/render_draw_forms.rs @@ -367,7 +367,7 @@ struct Row { /// A draw whose base instance is not 0 states **0** here, so where its instance ids start is a /// question about a channel rather than about which pixels it covered. Metal's `instance_id` /// may or may not include the base instance, and this family does not assume either - /// ([`iids_either_convention`]). + /// (`tests::iids_either_convention`). shift: u32, form: Form, } diff --git a/crates/metal2vulkan-conformance/src/cases/sparse_mappings.rs b/crates/metal2vulkan-conformance/src/cases/sparse_mappings.rs index a195c4fb8..0010e5421 100644 --- a/crates/metal2vulkan-conformance/src/cases/sparse_mappings.rs +++ b/crates/metal2vulkan-conformance/src/cases/sparse_mappings.rs @@ -714,7 +714,7 @@ static MOVES: Row = Row { /// It is written as fields rather than as a table because the probe this family's move rows came /// from got it wrong the other way: its first form OR'd the row into a constant that already held /// that bit, so two rows shared a word and a tile's provenance was recoverable only by -/// elimination. [`tests::every_tiles_marker_is_its_own`] reads every marker of the grid back and +/// elimination. `tests::every_tiles_marker_is_its_own` reads every marker of the grid back and /// fails on a repeat, so the distinctness is checked rather than argued. const fn marker(texture: usize, x: u64, y: u64) -> u8 { 0x40 | ((texture as u8) << 5) | ((y as u8) << 2) | (x as u8) @@ -848,12 +848,14 @@ static MOVE_INSIDE_THE_LEVEL: Row = Row { /// **A destination row that overflows the level, which does not clip**: the reading nobody could /// have guessed and the one our own clipping got wrong. /// -/// Source (0, 0) of 4 by 1 tiles — every tile inside level 0's four — onto destination origin -/// (2, 0), where the level has two tiles to the right of the origin and the stated region would -/// need four. Metal moved **all four** source tiles: B(2,0), B(3,0), B(2,1) and B(3,1) held -/// A(0,0), A(1,0), A(2,0) and A(3,0), and A's whole row 0 read zero afterwards -/// (`probes/sparse_move_past_the_bounds.m`, shape `region-dest`, an M3 Max under macOS 27.0.1, -/// plain Metal, each tile's verdict read off all 4,096 of its texels). +/// Source (0, 0) of 4 by 1 tiles — every tile inside level 0's four — onto destination +/// origin (2, 0), where the level has two tiles to the right of the origin and the stated region +/// would need four. Metal moved **all four** source tiles: B(2,0), B(3,0), B(2,1) and B(3,1) took +/// A(0,0), A(1,0), A(2,0) and A(3,0), each read off the destination tile's own first texel, and +/// A's whole row 0 read zero afterwards (`probes/sparse_move_past_the_bounds.m`, shape +/// `region-dest`, an M3 Max under macOS 27.0.1, plain Metal, every tile's verdict read off all +/// 4,096 of its texels, and a destination tile reading as mixed rather than as that word +/// throughout). /// /// So the destination is a **run of tiles rather than a region**: it starts at the destination /// origin, is laid out `sourceSize.width` tiles to a row — clipped only by the tiles to the right @@ -882,12 +884,12 @@ static MOVE_PAST_THE_DESTINATIONS_ROW: Row = Row { /// destination tiles the stated region named but the run did not reach keep their own texels. /// /// Source (2, 0) of 4 by 1 tiles where level 0 holds four, so tiles (2,0) and (3,0) are inside and -/// the two past the edge are not, onto destination origin (0, 0). Metal moved the two: -/// B(0,0) and B(1,0) held A(2,0) and A(3,0), and A's row 1 was whole -/// (`probes/sparse_move_past_the_bounds.m`, shape `region-open`). So the overhang does not -/// **wrap** — a rule that continued into the next row would have put A(0,1) and A(1,1) into -/// B(2,0) and B(3,0) and left A's row 1 unmapped, and this row reads A(0,1) and A(1,1) after the -/// move for exactly that reason. +/// the two past the edge are not, onto destination origin (0, 0). Metal moved the two: B(0,0) and +/// B(1,0) took A(2,0) and A(3,0), each read off the destination tile's own first texel, and A's +/// row 1 was whole (`probes/sparse_move_past_the_bounds.m`, shape `region-open`). So the overhang +/// does not **wrap** — a rule that continued into the next row would have put A(0,1) and A(1,1) +/// into B(2,0) and B(3,0) and left A's row 1 unmapped, and this row reads A(0,1) and A(1,1) after +/// the move for exactly that reason. /// /// And B(2,0) and B(3,0) are **mapped and filled with their own markers before the move**, which /// is the probe's `region-mapped` shape: the stated destination region names them and the run @@ -924,9 +926,9 @@ static MOVE_OF_A_SOURCE_PAST_THE_LEVEL: Row = Row { /// **A source clipped on both axes**, which is the shape a pairing by list index gets wrong. /// /// Source (2, 2) of 4 by 4 tiles on a level holding four by four, so 2 by 2 survive, onto -/// destination origin (1, 1), where three tiles lie to the right. Metal read B(1,1), B(2,1), -/// B(3,1) and B(1,2) holding A(2,2), A(3,2), A(2,3) and A(3,3) -/// (`probes/sparse_move_past_the_bounds.m`, shape `src-clip-2d`). +/// destination origin (1, 1), where three tiles lie to the right. B(1,1), B(2,1), B(3,1) and +/// B(1,2) took A(2,2), A(3,2), A(2,3) and A(3,3), each read off the destination tile's own first +/// texel (`probes/sparse_move_past_the_bounds.m`, shape `src-clip-2d`). /// /// Its third tile at (3, 1) is the whole reading: the run's row is the **stated** width's three /// and not the clipped source's two, which would have put it at (1, 2). And pairing two clipped diff --git a/crates/metal2vulkan-conformance/src/cases/textures.rs b/crates/metal2vulkan-conformance/src/cases/textures.rs index cfb9150ed..6ef8ba8b0 100644 --- a/crates/metal2vulkan-conformance/src/cases/textures.rs +++ b/crates/metal2vulkan-conformance/src/cases/textures.rs @@ -60,9 +60,9 @@ pub const BEFORE: u8 = 0xee; /// and the name its case holds. /// /// The table is the case names' home, because a case names itself with a static string. Nothing -/// here may drift: [`tests::the_table_is_exactly_the_formats_whose_texels_are_metals_bytes`] holds +/// here may drift: `tests::the_table_is_exactly_the_formats_whose_texels_are_metals_bytes` holds /// it against the predicate over every format Metal describes, and -/// [`tests::every_case_names_its_own_format`] holds each name against its format's ordinal. +/// `tests::every_case_names_its_own_format` holds each name against its format's ordinal. /// /// Each row names its format through [`PixelFormat`] rather than by ordinal. The two spellings /// were both here — the ordinal in the row and the enumerator in a comment beside it — which is diff --git a/crates/metal2vulkan-conformance/src/compare.rs b/crates/metal2vulkan-conformance/src/compare.rs index e90d67202..e2b97c0c2 100644 --- a/crates/metal2vulkan-conformance/src/compare.rs +++ b/crates/metal2vulkan-conformance/src/compare.rs @@ -369,12 +369,11 @@ fn notice_declarations( /// /// Our side's answer has one shape: a typed error, which a [`crate::case::Failure`] can only record /// as an `Err`. Metal's answer has **every other** shape there is, and the rule is written that way -/// round on purpose: a value, a tree of facts whose own value is -/// [`Value::Absent`](crate::transcript::Value::Absent), a digest with no value beside it, or a -/// negative fact ([`crate::transcript::Negative`]) are all Metal answering the call. Only two of -/// Metal's answers are not: its **own** error, where the two sides agree and the difference is -/// between the errors; and the one fact that says Metal never came back from the call, which is -/// [`NeverReturned`] and not a gap of ours at all. +/// round on purpose: a value, a tree of facts whose own value is [`Value::Absent`], a digest with +/// no value beside it, or a negative fact ([`crate::transcript::Negative`]) are all Metal answering +/// the call. Only two of Metal's answers are not: its **own** error, where the two sides agree and +/// the difference is between the errors; and the one fact that says Metal never came back from the +/// call, which is [`NeverReturned`] and not a gap of ours at all. /// /// Reading `Ok` against `Err` alone was how a refusal went invisible three ways over. A site whose /// answer is a tree — a queue's slots, an event's order, a buffer-backed texture's facts — records diff --git a/crates/metal2vulkan-conformance/src/lib.rs b/crates/metal2vulkan-conformance/src/lib.rs index bed19e650..4372df89e 100644 --- a/crates/metal2vulkan-conformance/src/lib.rs +++ b/crates/metal2vulkan-conformance/src/lib.rs @@ -111,8 +111,6 @@ pub mod work; #[cfg(target_os = "macos")] pub mod metal_side; -/// The IOSurfaces the Metal side lays a two-plane YCbCr texture over. Its own module because it -/// reaches CoreFoundation and IOSurface through their C functions, which nothing else here does. #[cfg(target_os = "macos")] mod metal_surface; #[cfg(target_os = "macos")] diff --git a/crates/metal2vulkan-conformance/src/metal_side.rs b/crates/metal2vulkan-conformance/src/metal_side.rs index 1b5e9cfcc..9ed6a28fe 100644 --- a/crates/metal2vulkan-conformance/src/metal_side.rs +++ b/crates/metal2vulkan-conformance/src/metal_side.rs @@ -630,9 +630,8 @@ fn metal_binding(binding: &ProtocolObject) -> Answer Answer { let read = |bindings: &NSArray>| -> Answer> { let mut found = Vec::new(); @@ -1680,8 +1679,8 @@ fn state_mutability( } } -/// Set every field [`ComputeAway`] states on a compute pipeline descriptor, each away from Metal's -/// own default. +/// Set every field [`crate::compute_descriptors::AWAY`] states on a compute pipeline descriptor, +/// each away from Metal's own default. /// /// The label is set only because the table states one: `setLabel:nil` ends Metal's process. fn state_compute_descriptor(descriptor: &Retained) { @@ -1767,7 +1766,7 @@ fn read_compute_supplied( } } -/// Set every field [`TileAway`] states on a tile render pipeline descriptor. +/// Set every field [`crate::tile_descriptors::AWAY`] states on a tile render pipeline descriptor. /// /// `resets` says whether the caller will send `reset` afterwards, because the buffer mutability is /// stated only where it will not: subscripting `tileBuffers` and then resetting the descriptor @@ -1858,7 +1857,7 @@ fn read_tile_supplied(descriptor: &Retained) -> } } -/// Set every field [`MeshAway`] states on a mesh render pipeline descriptor. +/// Set every field [`crate::mesh_descriptors::AWAY`] states on a mesh render pipeline descriptor. fn state_mesh_descriptor(descriptor: &Retained) { descriptor.setLabel(Some(&NSString::from_str(MESH_AWAY.label))); // SAFETY: the sample count is the stated table's own 4, a count every Metal device supports, diff --git a/crates/metal2vulkan-conformance/src/metal_surface.rs b/crates/metal2vulkan-conformance/src/metal_surface.rs index bbadfb881..2e8624bb4 100644 --- a/crates/metal2vulkan-conformance/src/metal_surface.rs +++ b/crates/metal2vulkan-conformance/src/metal_surface.rs @@ -46,8 +46,8 @@ //! **ends the process** when it is broken (`crate::surface::PlaneSpec::unsafe_stride`). //! //! The frameworks are reached through their C functions (CoreFoundation and IOSurface), as -//! `metal2vulkan-validation`'s own surface probe reaches them; each object made here is released -//! here. +//! `metal2vulkan-validation`'s own surface probe reaches them and nothing else in this crate does, +//! which is why this is a module of its own; each object made here is released here. use core::ffi::c_void; use core::ptr::NonNull; diff --git a/crates/metal2vulkan-conformance/src/run.rs b/crates/metal2vulkan-conformance/src/run.rs index 82ec9d7c3..2bc63ca5d 100644 --- a/crates/metal2vulkan-conformance/src/run.rs +++ b/crates/metal2vulkan-conformance/src/run.rs @@ -494,7 +494,7 @@ pub fn record_all(cases: &[Box]) -> Vec<(String, Result Result { use crate::recording::Validated;