From da07727a6aca87dfb910eb465f3342dd2c6ccbf4 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sun, 8 Nov 2026 10:10:58 -0800 Subject: [PATCH] conformance: a run stopped at a typed refusal reports the error, not "a call did not answer" Round 058's cost leg printed "the run stopped: a call did not answer, at MTLPixelFormatRGB10A8_2P/..." for format-footprints-two-plane-ten-bit, which read as a hang. The case had stopped at its known typed refusal, Unsupported{Format, NotImplemented}. Both stop lines (cost's and times') fell back to "a call did not answer" for any abort whose failure names no device gap. A Failure now keeps the typed runtime error's text where it is one (Failure::of, kept through at_step and at_resource), and Abort::stopped makes the line both sites print: what the venue lacks, else "refused ", else "a call did not answer" for a failure outside the runtime's typed errors (Failure::named, Failure::unavailable). Test: tests::a_run_stopped_at_a_typed_refusal_reports_the_error. The 14 recordings whose "stopped" text reads "a call did not answer" take the new line at their next cost write, where their abort is typed. (cherry picked from commit 0073cfd7cbb0e433414bbbdd2ae86ad828a439b0) --- crates/metal2vulkan-conformance/src/case.rs | 21 ++++++++++ crates/metal2vulkan-conformance/src/run.rs | 18 +------- crates/metal2vulkan-conformance/src/tests.rs | 43 ++++++++++++++++++++ 3 files changed, 66 insertions(+), 16 deletions(-) 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