diff --git a/crates/metal2vulkan-conformance/src/report.rs b/crates/metal2vulkan-conformance/src/report.rs index a70107bdb..c4e7a7c7c 100644 --- a/crates/metal2vulkan-conformance/src/report.rs +++ b/crates/metal2vulkan-conformance/src/report.rs @@ -405,6 +405,13 @@ impl Report { "\n{} on {}: {}\n", row.case, row.venue, row.verdict )); + let native = native_notes_announced(row); + if !native.is_empty() { + out.push_str(&format!( + " the device's native notes this case announced: {}\n", + native.join(", ") + )); + } } out.push_str(&self.render_cost()); out @@ -621,3 +628,24 @@ pub fn must_hold(verdict: &Verdict) -> Result<(), String> { } Err(verdict.to_string()) } + +/// The device's native notes ([`crate::replay::NATIVE_NOTES`]) `row`'s own run announced, by code. +/// +/// The suite declares them for every case and they loosen no value, so a value the device's +/// native answer moves is a `known-gaps.tsv` row whose words name the note that records it. That +/// row's claim is only as good as the note having fired, and nothing else in the report says so: +/// a declared note never reads as a difference. Printed under each failing row, it is the +/// evidence a row needs that the note fired in the case it describes, on the venue it is scoped +/// to; a note fires at each occurrence under the suite's device options, so the case's own run +/// is the one that announced it. +fn native_notes_announced(row: &Replayed) -> Vec { + row.ours + .announced_notices() + .into_keys() + .filter(|code| { + crate::replay::NATIVE_NOTES + .iter() + .any(|kind| kind.code() == code) + }) + .collect() +} diff --git a/crates/metal2vulkan-conformance/src/tests.rs b/crates/metal2vulkan-conformance/src/tests.rs index d4a6ce09a..0b394f5f3 100644 --- a/crates/metal2vulkan-conformance/src/tests.rs +++ b/crates/metal2vulkan-conformance/src/tests.rs @@ -1241,6 +1241,37 @@ fn no_case_names_a_native_note() { assert!(named.is_empty(), "{}:\n{}", named.len(), named.join("\n")); } +/// A failing row says which of the device's native notes its own run announced, and names no +/// other notice there: a value the device's native answer moves is a ledger row that names the +/// note recording it, and that note never reads as a difference, so this line is the report's one +/// evidence that it fired in the case the row describes. +#[test] +fn a_failing_row_names_the_native_notes_its_run_announced() { + let native = Degradation::DeviceTexelConversion; + assert!(crate::replay::NATIVE_NOTES.contains(&native)); + let case = WordsCase::new("words", 2); + let recording = recording_of(&case, case.transcript(words(&[1, 2]), "Completed", &[]), 3); + let render = |side: &mut StubSide| { + let replayed = replay_against(&case, side, &recording).unwrap(); + assert!( + matches!(replayed.verdict, Verdict::Divergent { .. }), + "{}", + replayed.verdict + ); + let mut report = Report::new(); + report.add(replayed); + report.render() + }; + let line = "the device's native notes this case announced:"; + let noted = render(&mut StubSide::new(words(&[1, 7])).announcing(&[native])); + assert!( + noted.contains(&format!("{line} {}", native.code())), + "{noted}" + ); + let silent = render(&mut StubSide::new(words(&[1, 7]))); + assert!(!silent.contains(line), "{silent}"); +} + /// Every accepted difference a case names is an entry of `docs/API.md` section 10, a venue's /// answer (`Justification::WithoutCompression`) included. A slug that names no entry justifies /// nothing on any venue, and a replay says so only where the site it loosens differs: the