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
<error>", 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)
This commit is contained in:
Anees Iqbal committed 2026-11-08 10:33:06 -08:00
1 parent c1f7900cf2
commit da07727a6a
3 files changed
+66 -16

No files matched your search

@@ -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<String>,
/// 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<String>,
}
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)]
+2 -16
View File
@@ -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<S: Side>(case: &dyn Case, side: S) -> Result<crate::times::CaseRound, S
let mut announced = side.announced();
announced.extend(sites.finish().announced_notices().into_keys());
let degraded = crate::replay::degrading(announced);
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());
Ok(crate::times::CaseRound {
observed,
window_wall,
@@ -3956,6 +3956,49 @@ fn a_site_the_venue_lacks_is_the_venues_gap_and_not_a_refusal() {
assert_eq!(replayed.verdict.word(), "refused");
}
/// A run that stops at a typed refusal reports that error, not a call that never answered:
/// `cost` and `times` print and record the line [`Abort::stopped`] makes. A failure outside the
/// runtime's typed errors still reads as a call that did not answer, and the venue's own gap as
/// what it lacks.
#[test]
fn a_run_stopped_at_a_typed_refusal_reports_the_error() {
use metal2vulkan::error::{Feature, Unsupported};
let at = "MTLPixelFormatRGB10A8_2P/Type2D/makes-texture".to_owned();
let error =
metal2vulkan_runtime::Error::Unsupported(Unsupported::not_implemented(Feature::Format));
let refused = Abort {
at: at.clone(),
failure: Failure::of(&error),
};
assert_eq!(refused.stopped(), format!("refused {error}, at {at}"));
assert!(
refused.stopped().contains("NotImplemented"),
"{}",
refused.stopped()
);
// The same through the annotation a program's interpreter adds.
let stepped = Abort {
at: at.clone(),
failure: Failure::of(&error).at_step(3),
};
assert_eq!(stepped.stopped(), refused.stopped());
let untyped = Abort {
at: at.clone(),
failure: Failure::named("NoSuchBarrierScope", "0x9: no such bits"),
};
assert_eq!(untyped.stopped(), format!("a call did not answer, at {at}"));
let mut lacking = Failure::of(&error);
lacking.lacks = Some("the device enables no such capability".to_owned());
let lacks = Abort {
at: at.clone(),
failure: lacking,
};
assert_eq!(
lacks.stopped(),
format!("the device enables no such capability, at {at}")
);
}
#[test]
fn an_allowance_no_site_needed_is_counted_and_named_rather_than_silently_kept() {
// The hole this closes: the up-front check over a case's allowances has to exempt a degrade