From e498cbaa54b3b25f6feec96744ce14b593705f13 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 3 Dec 2026 08:24:38 -0800 Subject: [PATCH] Translator tests: the integer heap slice's refusal is checked by its cause field an_imageblock_slice_writes_an_argument_buffer_texture checked for the text "Imageblocks: SliceWrite;", but a refusal that names its intrinsic prints it after the feature ("Imageblocks (air.write_imageblock_slice_to_texture_2d.i16.v4i16): SliceWrite; needs NotImplemented"), so the text check failed on a refusal whose cause was SliceWrite. The test now compares Unsupported::cause with Cause::Imageblocks(ImageblockCause::SliceWrite). Verified: job m3-max-84245 (CPU) printed the refusal above, cause SliceWrite, with the text check failing; the field check's run follows. --- crates/metal2vulkan/src/tests/engine_handles.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/metal2vulkan/src/tests/engine_handles.rs b/crates/metal2vulkan/src/tests/engine_handles.rs index 9df6a7e90..3f4c45f49 100644 --- a/crates/metal2vulkan/src/tests/engine_handles.rs +++ b/crates/metal2vulkan/src/tests/engine_handles.rs @@ -33,7 +33,8 @@ use crate::device::profile::DeviceProfile; use crate::device::DevicePolicy; use crate::device::{Device, DeviceDescription, Requirements, VkFeature}; use crate::error::{ - AbiError, Error, Feature, InputErrorKind, LowerFamily, Needs, RuntimeInput, Unsupported, + AbiError, Cause, Error, Feature, ImageblockCause, InputErrorKind, LowerFamily, Needs, + RuntimeInput, Unsupported, }; use crate::library::{FunctionArtifact, Library}; use crate::metal::sampler::SamplerWord; @@ -2622,7 +2623,11 @@ fn an_imageblock_slice_writes_an_argument_buffer_texture() { let u = unsupported(compile(&bc, "heap_slice", &m3()).expect_err("heap_slice_integer")); assert_eq!(u.feature, Feature::Imageblocks); assert_eq!(u.needs, Needs::NotImplemented); - assert!(u.to_string().contains("Imageblocks: SliceWrite;"), "{u}"); + assert_eq!( + u.cause, + Some(Cause::Imageblocks(ImageblockCause::SliceWrite)), + "{u}" + ); } pub(super) const OP_IMAGE_SAMPLE_DREF_EXPLICIT_LOD: u16 = 90;