From ed618c71026446bbe13840c537cf3a7a7dc7ffb5 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sun, 8 Nov 2026 04:33:53 -0800 Subject: [PATCH] Read the made conversion's refresh; the sample-and-gather test reads the note's clauses m3-max-8228: the conversion's record still named self.refresh. An artifact lists a specialized note among its precision notes too, so the test checks that every clause of the model's note tests the bound sampler word. (cherry picked from commit 6ceb3a2d3ecc76bca49d83bac92d11eb072b31ed) --- crates/metal2vulkan-runtime/src/ycbcr.rs | 2 +- .../src/tests/engine_ycbcr_in_place.rs | 26 ++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/crates/metal2vulkan-runtime/src/ycbcr.rs b/crates/metal2vulkan-runtime/src/ycbcr.rs index 83912da9e..904810f6d 100644 --- a/crates/metal2vulkan-runtime/src/ycbcr.rs +++ b/crates/metal2vulkan-runtime/src/ycbcr.rs @@ -954,7 +954,7 @@ impl YCbCrConversion { let state_at = made.shape_at + STATE_AT; let completed_at = made.shape_at + COMPLETED_AT; let word = |w: u32| w.to_le_bytes(); - let refresh = self + let refresh = made .refresh .as_ref() .filter(|refresh| refresh.planes == source); diff --git a/crates/metal2vulkan/src/tests/engine_ycbcr_in_place.rs b/crates/metal2vulkan/src/tests/engine_ycbcr_in_place.rs index 3323d08b2..4c101a5a8 100644 --- a/crates/metal2vulkan/src/tests/engine_ycbcr_in_place.rs +++ b/crates/metal2vulkan/src/tests/engine_ycbcr_in_place.rs @@ -1292,9 +1292,29 @@ fn a_slot_that_samples_and_gathers_reads_its_planes_in_place() { }; assert!(!notes(&a).contains(&other), "{what}: {:?}", notes(&a)); // The model's note holds only under the bound format and word, never outright. - assert!(!a.precision.contains(&filter), "{what}: {:?}", a.precision); - let noted = a.specialized.iter().any(|s| s.note == filter); - assert_eq!(noted, policy == "model", "{what}: {:?}", a.specialized); + let clauses: Vec<_> = a + .specialized + .iter() + .filter(|s| s.note == filter) + .flat_map(|s| &s.when) + .collect(); + let word = |c: &&crate::pipeline::artifact::SpecClause| { + c.all + .iter() + .any(|t| matches!(t.key, SpecKey::BoundSamplerWord(_))) + }; + assert_eq!( + !clauses.is_empty() && clauses.iter().all(word), + policy == "model", + "{what}: {:?}", + a.specialized + ); + assert_eq!( + notes(&a).contains(&filter), + policy == "model", + "{what}: {:?}", + notes(&a) + ); } } }