From 192f60a0d8bb393c4e470b09122cf236a1efdd49 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 5 Nov 2026 21:22:26 -0800 Subject: [PATCH] Conformance: a failing row prints the native notes its own run announced The suite declares the device's native notes (`replay::NATIVE_NOTES`) 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. Nothing in the report said whether that note fired: a declared native note never reads as a difference, so a row could cite a note the case never announced on its venue and nothing would tell. Under the suite's device options a note fires at each occurrence, so the case's own transcript holds what its run announced. Each failing row of the report now ends with "the device's native notes this case announced: ...", where it announced any. It is a line below the row's verdict, outside the ledger's identity fields (the site and the answer) and outside the ready-to-paste rows, so no row moves. Test: `tests::a_failing_row_names_the_native_notes_its_run_announced` (a divergent row whose run announced `device-texel-conversion` prints it; one that announced nothing prints no such line). (cherry picked from commit 2776dd8f061b31033949586950cb15419ef701ba) --- crates/metal2vulkan-conformance/src/report.rs | 28 +++++++++++++++++ crates/metal2vulkan-conformance/src/tests.rs | 31 +++++++++++++++++++ 2 files changed, 59 insertions(+) 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