diff --git a/crates/metal2vulkan-conformance/src/case.rs b/crates/metal2vulkan-conformance/src/case.rs index 5a26a61ed..2f47ba642 100644 --- a/crates/metal2vulkan-conformance/src/case.rs +++ b/crates/metal2vulkan-conformance/src/case.rs @@ -457,6 +457,10 @@ pub struct Failure { /// What the venue lacks, where the typed refusal names capabilities a device could enable or /// a measured driver defect ([`device_gap`]). `None` where the refusal is ours to answer for. pub lacks: Option, + /// The typed runtime error's own text where the failure is one ([`Failure::of`]); `None` for + /// a failure outside the runtime's typed errors. What a run that stopped at it reports + /// ([`Abort::stopped`]). + refusal: Option, } impl Failure { @@ -468,6 +472,7 @@ impl Failure { payload: Box::new(Value::Lines(vec![error.to_string()])), }, lacks: device_gap(error), + refusal: Some(error.to_string()), } } @@ -495,6 +500,7 @@ impl Failure { payload: Box::new(payload), }, lacks: None, + refusal: None, } } @@ -558,6 +564,7 @@ impl Failure { Self { error: Value::fields([(part, Value::Uint(index as u64)), (REFUSED, self.error)]), lacks: self.lacks, + refusal: self.refusal, } } } @@ -612,6 +619,20 @@ pub struct Abort { pub failure: Failure, } +impl Abort { + /// The line a run that stopped here reports, then the site: what the venue lacks where the + /// refusal is its own gap, else the typed runtime error the call answered, else that the call + /// did not answer (a failure outside the runtime's typed errors). + pub fn stopped(&self) -> String { + let what = match (&self.failure.lacks, &self.failure.refusal) { + (Some(lacks), _) => lacks.clone(), + (None, Some(error)) => format!("refused {error}"), + (None, None) => "a call did not answer".to_owned(), + }; + format!("{what}, at {}", self.at) + } +} + /// The venue a side runs on: what a result carries so a report can say where it ran. A case never /// branches on any of it. #[derive(Clone, Debug, PartialEq, Eq)] diff --git a/crates/metal2vulkan-conformance/src/run.rs b/crates/metal2vulkan-conformance/src/run.rs index 799ef5087..8b989c6c4 100644 --- a/crates/metal2vulkan-conformance/src/run.rs +++ b/crates/metal2vulkan-conformance/src/run.rs @@ -258,14 +258,7 @@ pub fn cost_on_under( let nanos = u64::try_from(started.elapsed().as_nanos()).unwrap_or(u64::MAX); let moved = read_counts(&device)?.since(&before); let states = crate::states::made().saturating_sub(states_before); - let stopped = abort.map(|abort| { - let what = abort - .failure - .lacks - .as_deref() - .unwrap_or("a call did not answer"); - format!("{what}, at {}", abort.at) - }); + let stopped = abort.map(|abort| abort.stopped()); announced.extend(sites.finish().announced_notices().into_keys()); let announced = crate::replay::degrading(announced); if round == 0 { @@ -776,14 +769,7 @@ fn timed(case: &dyn Case, side: S) -> Result