diff --git a/crates/metal2vulkan-validation/src/bin/candidate_batch.rs b/crates/metal2vulkan-validation/src/bin/candidate_batch.rs index fd4c7ab88..42358146d 100644 --- a/crates/metal2vulkan-validation/src/bin/candidate_batch.rs +++ b/crates/metal2vulkan-validation/src/bin/candidate_batch.rs @@ -50,9 +50,10 @@ byte location, read only, falling back to the source's shard wherever the index stale, or wrong.\n\ --batch-report prints DIR's build record against this build (batch-build), then, over\n\ the cases --batch selects with the same --case-id list (other cases' runs are not counted), the\n\ -runs by class (match, mismatch, refusal, failure), then the same per family (batch-family: the\n\ -stage and first resource family) and per scope (batch-scope: public or private AIR), and every\n\ -run that did not match (batch-run, with its scope and family, and a refusal's recorded class).\n\ +runs by class (match, mismatch, noted_difference, refusal, failure), then the same per family\n\ +(batch-family: the stage and first resource family) and per scope (batch-scope: public or\n\ +private AIR), and every run that did not match (batch-run, with its scope and family, and a\n\ +refusal's recorded class).\n\ A last line of done.tsv, rows.jsonl, or refusals.jsonl without its newline (an append cut\n\ short) is dropped. --batch-install writes into the store at DIR, for each case, the\n\ evidence of its last run that recorded any (its row, or its refusal) through the store's\n\ @@ -283,10 +284,12 @@ fn main(mode: &str, args: Vec) -> Result<(), String> { .sum() }; println!( - "batch-summary ran={} match={} mismatch={} refusal={} failure={}", - of(Class::Match) + of(Class::Mismatch) + of(Class::Refusal) + of(Class::Failure), + "batch-summary ran={} match={} mismatch={} noted_difference={} refusal={} \ + failure={}", + finished.len(), of(Class::Match), of(Class::Mismatch), + of(Class::NotedDifference), of(Class::Refusal), of(Class::Failure) ); diff --git a/crates/metal2vulkan-validation/src/bin/candidate_common.rs b/crates/metal2vulkan-validation/src/bin/candidate_common.rs index e49cfce9b..74dea0917 100644 --- a/crates/metal2vulkan-validation/src/bin/candidate_common.rs +++ b/crates/metal2vulkan-validation/src/bin/candidate_common.rs @@ -2,6 +2,7 @@ use metal2vulkan_validation::candidate::{engine, exit_status}; use metal2vulkan_validation::check::admission::ExecutorError; use metal2vulkan_validation::gpu::wait::{parse_wait_timeout, set_wait_timeout}; use metal2vulkan_validation::gpu::DeviceType; +use metal2vulkan_validation::observation::CandidateStatus; use metal2vulkan_validation::source::corpus_root; use metal2vulkan_validation::store::CorpusStore; use metal2vulkan_validation::worker::alloc::CountingAllocator; @@ -100,6 +101,8 @@ fn run() -> Result<(), ExecutorError> { case it cannot run as not_supported{{...}} (exit 4). The device half runs\n\ in a child of this executable; a child a signal ends is\n\ device_crash{{SIGNAL}} (exit 5).\n\ + A row that differs from Metal's exits 1: Mismatch, or NotedDifference\n\ + where its bytes differ under precision notes that can explain a difference.\n\ --profiles-layer P: run on the device restricted to the committed\n\ profile validation/profiles/P.json through VK_LAYER_KHRONOS_profiles, after\n\ checking that the device has P and reports exactly P; the row records the layer\n\ @@ -141,16 +144,30 @@ fn run() -> Result<(), ExecutorError> { &CompileWorker::current()?, )?; println!( - "{:?} {} candidate_output_sha256={}", - observation.status, observation.case_id, observation.candidate_output_sha256 + "{:?} {} candidate_output_sha256={}{}", + observation.status, + observation.case_id, + observation.candidate_output_sha256, + observation + .held_open_by + .map(|gap| format!(" held_open_by={}", gap.as_str())) + .unwrap_or_default() ); if let Some(withheld) = observation.environment.get("withheld_validation_messages") { println!("withheld validation messages: {withheld}"); } - if observation.status == metal2vulkan_validation::observation::CandidateStatus::Mismatch { - return Err("candidate output does not match the exact Metal observation".into()); + match observation.status { + CandidateStatus::Match => Ok(()), + CandidateStatus::Mismatch => { + Err("candidate output does not match the exact Metal observation".into()) + } + CandidateStatus::NotedDifference => Err(format!( + "candidate output differs from the Metal observation under the notes of {:?}, which \ + can explain a difference: a noted difference, never a match", + observation.comparison + ) + .into()), } - Ok(()) } fn required(args: &mut impl Iterator, flag: &str) -> Result { diff --git a/crates/metal2vulkan-validation/src/bin/corpus-status.rs b/crates/metal2vulkan-validation/src/bin/corpus-status.rs index c286270f3..6e99a423e 100644 --- a/crates/metal2vulkan-validation/src/bin/corpus-status.rs +++ b/crates/metal2vulkan-validation/src/bin/corpus-status.rs @@ -77,7 +77,8 @@ fn run() -> Result<(), String> { observation shards alone: per engine slot of each venue of the venue list\n\ (default validation/cutover/c3-venues.json), each case's verdict\n\ (match, reviewed, device_gap, out_of_scope_ray_tracing, reference_gap,\n\ - mismatch, refused, stale, missing). A case whose current Metal row is a\n\ + mismatch, a noted difference's too, refused, stale, missing). A case whose\n\ + current Metal row is a\n\ reference gap (the reference device lacks the Apple GPU family its pipeline\n\ needs) reads reference_gap, is printed (c3-reference-gap), and needs the\n\ reviewed list's reference_gaps entry signed off. A venue's\n\ @@ -218,9 +219,13 @@ fn run() -> Result<(), String> { ); } // The engine slots (`ENV@engine`), the only candidate evidence (cutover X2b): a case - // the executor has not run yet is not a problem, a failed or stale row is. - let candidate_problem = - |state: EvidenceState| matches!(state, EvidenceState::Failed | EvidenceState::Stale); + // the executor has not run yet is not a problem, a failed, noted or stale row is. + let candidate_problem = |state: EvidenceState| { + matches!( + state, + EvidenceState::Failed | EvidenceState::NotedDifference | EvidenceState::Stale + ) + }; // A venue's records are held to its committed profile, and those of another build to this // build's artifacts. let keys = Venues::load(&Venues::committed_path())?.keys(CurrentArtifacts::load(&root)?)?; diff --git a/crates/metal2vulkan-validation/src/c3.rs b/crates/metal2vulkan-validation/src/c3.rs index 493507493..3ba49408a 100644 --- a/crates/metal2vulkan-validation/src/c3.rs +++ b/crates/metal2vulkan-validation/src/c3.rs @@ -16,10 +16,11 @@ //! open, deferred until the exact path exists (the user's decision of 2026-10-03). //! //! The list ([`ReviewedList`], `validation/cutover/c3-reviewed.json`) is data a person reviewed. -//! Only this report reads it; translation, classification, and the evidence census never do. It is -//! read, checked, and written as C1's list is ([`List`]), and every entry carries the review both -//! cutover lists share ([`Review`]: its evidence, the reviewer's note, and the user's -//! [`SignOff`]). Beside its reference gaps and answer gaps, it holds readings: +//! Only this report reads it, and the executor its answer gaps, which keep a case's difference a +//! mismatch ([`ReviewedList::holding_open`]); translation, classification, and the evidence census +//! never do. It is read, checked, and written as C1's list is ([`List`]), and every entry carries +//! the review both cutover lists share ([`Review`]: its evidence, the reviewer's note, and the +//! user's [`SignOff`]). Beside its reference gaps and answer gaps, it holds readings: //! //! - **Readings** ([`Reading`]): per case, the cause, the bound Metal states, and the reviewed //! observations. Each observation names an engine slot, the candidate (`spv_sha256`), its @@ -153,7 +154,7 @@ impl Cause { } /// Whether `row` shows this cause, for a cause a reading is keyed by - /// ([`Cause::keyed_by_cause`]): a [`Cause::FastMathRegrouping`] row mismatches Metal and its + /// ([`Cause::keyed_by_cause`]): a [`Cause::FastMathRegrouping`] row differs from Metal and its /// comparison is unbounded by `PrecisionNote::FastMathRewrites`, the product's record that a /// module it executed leaves an operation the AIR flags `reassoc` and `contract` to the /// device's grouping, or by `PrecisionNote::HalfOutputFastMathBlend`, its record that a @@ -165,7 +166,7 @@ impl Cause { match self { Self::AppleReading => false, Self::FastMathRegrouping => { - row.status == CandidateStatus::Mismatch + row.status != CandidateStatus::Match && matches!( &row.comparison, ComparisonClass::Unbounded(notes) @@ -547,6 +548,20 @@ impl List for ReviewedList { } impl ReviewedList { + /// The answer gap the list holds `case_id`'s case under, among the gaps `reaches` says reach + /// it: C3's rule, with the venue's device and the case's structure, and the executor's + /// (`candidate::engine::difference_status`), with the case's structure alone. + pub fn holding_open( + &self, + case_id: &str, + reaches: impl Fn(AnswerGap) -> bool, + ) -> Option { + self.answer_gaps + .iter() + .find(|entry| entry.case_id == case_id && reaches(entry.gap)) + .map(|entry| entry.gap) + } + /// The reading that reviews `row`, if the list holds one: of the same case and, for a cause /// keyed by candidate, with an observation of the same slot, candidate, output, and Metal /// output; for a cause keyed by its cause, an engine row of any slot that shows the cause. @@ -1281,13 +1296,12 @@ pub fn report( // and, for a gap the case's structure decides, the case meets it. A case whose structure is // unknown meets no such gap. let answer_gap = |case: &AuthoredCase, slot: &str| { - list.answer_gaps.iter().find(|entry| { - entry.case_id == case.case_id - && keys.has_gap(slot, entry.gap) - && (!entry.gap.decided_by_case() + list.holding_open(&case.case_id, |gap| { + keys.has_gap(slot, gap) + && (!gap.decided_by_case() || facts .answer_gaps(case) - .is_some_and(|gaps| gaps.contains(&entry.gap))) + .is_some_and(|gaps| gaps.contains(&gap))) }) }; let verdict = |case: &AuthoredCase, slot: &str| -> Option { @@ -1319,12 +1333,13 @@ pub fn report( Some( match crate::index::candidate_slot_state(case, judging.as_slice(), row, keys) { EvidenceState::Current => Verdict::Match, - EvidenceState::Failed + // A noted difference is no match: C3 reads it as a mismatch. + EvidenceState::Failed | EvidenceState::NotedDifference if list.reviews(row).is_some() && deferred_note(row).is_none() => { Verdict::Reviewed } - EvidenceState::Failed => Verdict::Mismatch, + EvidenceState::Failed | EvidenceState::NotedDifference => Verdict::Mismatch, // A candidate slot is never a reference gap; the case's gap is judged below. EvidenceState::Stale | EvidenceState::Missing | EvidenceState::ReferenceGap => { Verdict::Stale @@ -1431,10 +1446,7 @@ pub fn report( .get(&(case.case_id.as_str(), slot.as_str())) .and_then(|row| deferred_note(row)) .map(OpenReason::NearEquivalent) - .or_else(|| { - answer_gap(case, slot.as_str()) - .map(|entry| OpenReason::AnswerGap(entry.gap)) - }), + .or_else(|| answer_gap(case, slot.as_str()).map(OpenReason::AnswerGap)), Verdict::Missing | Verdict::Refused => rate_map_refusal(case), _ => None, }; @@ -1477,7 +1489,9 @@ pub fn report( !row_on_other_device(row) && matches!( crate::index::candidate_slot_state(case, judging.as_slice(), row, keys,), - EvidenceState::Current | EvidenceState::Failed + EvidenceState::Current + | EvidenceState::Failed + | EvidenceState::NotedDifference ) } _ => false, diff --git a/crates/metal2vulkan-validation/src/c3/tests.rs b/crates/metal2vulkan-validation/src/c3/tests.rs index a79a44eac..ee1f5fbc2 100644 --- a/crates/metal2vulkan-validation/src/c3/tests.rs +++ b/crates/metal2vulkan-validation/src/c3/tests.rs @@ -248,6 +248,7 @@ fn row( } else { CandidateStatus::Mismatch }, + held_open_by: None, } } @@ -1116,6 +1117,7 @@ fn a_device_interpolation_row_stays_a_mismatch() { artifact: None, }); row.comparison = ComparisonClass::Unbounded([note].into()); + row.status = noted_if_different(row.status); assert!(row.class_holds()); row }; @@ -1213,6 +1215,7 @@ fn deferred_and_never_reviewed(note: PrecisionNote, label: &str) { artifact: None, }); row.comparison = ComparisonClass::Unbounded([note].into()); + row.status = noted_if_different(row.status); assert!(row.class_holds()); row }; @@ -1984,11 +1987,21 @@ fn a_reading_reviewed_in_one_venue_does_not_cover_another() { assert_eq!(verdict_of(slot(&report, RADV), &bounded), Verdict::Reviewed); } +/// The status the executor records for a row of an unbounded class whose status was `status` +/// under an exact one: a difference is a noted one. +fn noted_if_different(status: CandidateStatus) -> CandidateStatus { + match status { + CandidateStatus::Match => CandidateStatus::Match, + _ => CandidateStatus::NotedDifference, + } +} + /// `row` recording, in its one executed module, the precision notes `notes` and the unbounded /// class they derive. fn unbounded_by(row: CandidateObservation, notes: &[PrecisionNote]) -> CandidateObservation { let mut row = noting(row, notes); row.comparison = ComparisonClass::Unbounded(notes.iter().copied().collect()); + row.status = noted_if_different(row.status); assert!(row.class_holds()); row } @@ -2996,6 +3009,7 @@ fn a_deferred_near_equivalent_stays_open_with_its_reason() { artifact: None, }); row.comparison = ComparisonClass::Unbounded([PrecisionNote::RasterizationRateMap].into()); + row.status = noted_if_different(row.status); assert!(row.class_holds()); let mut refused = case(2, "refused"); refused.buffers[0].rasterization_rate_map = Some(RateMapLiteral { diff --git a/crates/metal2vulkan-validation/src/candidate/engine.rs b/crates/metal2vulkan-validation/src/candidate/engine.rs index 93c2d0a23..bdd7641b6 100644 --- a/crates/metal2vulkan-validation/src/candidate/engine.rs +++ b/crates/metal2vulkan-validation/src/candidate/engine.rs @@ -39,7 +39,7 @@ //! `ExecutorError::DeviceCrash`. use crate::acceptance::{LinkedLibrary, PipelineRequest, RequestFunction}; -use crate::c3::{VenueProfile, Venues, VENUE_PROFILE}; +use crate::c3::{AnswerGap, ReviewedList, VenueProfile, Venues, VENUE_PROFILE}; use crate::case::out_of_bounds::{OutOfBoundsResource, OutOfBoundsTarget}; use crate::case::{ ArgumentBufferSamplerResource, AuthoredCase, OutputSelection, SamplerResource, Stage, @@ -51,6 +51,7 @@ use crate::check::interface::AirInterface; use crate::check::CheckedCase; use crate::companion::{Companion, Spelling}; use crate::coverage::ExecutedCensus; +use crate::cutover::List as _; use crate::engine::{bounded_detail, Outcome, RowSource}; use crate::executor_contract::out_of_bounds::{self, OutOfBoundsRun, TargetRun}; use crate::gpu::wait::wait_timeout; @@ -60,8 +61,8 @@ use crate::library_module::ResolvedLinkedFunctions; use crate::literal::{LiteralDepthStencil, LiteralResources, LiteralTexture}; use crate::metal::ORACLE_ABI; use crate::observation::{ - CandidateDependencies, CandidateObservation, CandidateStatus, CaseTiming, MetalObservation, - RUNTIME_CRATE_FINGERPRINT, TRANSLATOR_FINGERPRINT, + may_be_noted, CandidateDependencies, CandidateObservation, CandidateStatus, CaseTiming, + MetalObservation, RUNTIME_CRATE_FINGERPRINT, TRANSLATOR_FINGERPRINT, }; use crate::observation_contract::ComparisonClass; use crate::refusal::{Refusal, RefusalObservation}; @@ -110,7 +111,7 @@ pub mod variants; /// how it decides a match. A change no recorded row can observe (a case kind no earlier executor /// ran, or one it refused) needs no bump; its commit says why. The commit that bumps it says what /// changed; this comment keeps no history. -pub const ENGINE_EXECUTOR_ABI: &str = "vulkan-engine-v211"; +pub const ENGINE_EXECUTOR_ABI: &str = "vulkan-engine-v212"; /// One kernel case in the terms the binder takes: what this executor supports of an /// [`AuthoredCase`] (buffers, device buffer arrays, argument-buffer buffers and textures, @@ -2083,16 +2084,22 @@ pub fn execute_prepared( .decode(&metal.output_b64) .map_err(|error| format!("decode the Metal observation's output: {error}"))?; // A case with out-of-bounds targets is judged by their containment property. - let status = if crate::executor_contract::out_of_bounds::matches( + let (status, held_open_by) = if crate::executor_contract::out_of_bounds::matches( case, &run.comparison, &golden, &run.output, run.census.out_of_bounds.as_ref(), ) { - CandidateStatus::Match + (CandidateStatus::Match, None) } else { - CandidateStatus::Mismatch + difference_status( + &checked, + candidate_output_sha256 != metal.metal_output_sha256, + &run.comparison, + run.census.out_of_bounds.as_ref(), + || ReviewedList::load(&ReviewedList::committed_path()), + )? }; let observation = CandidateObservation { case_id: case.case_id.clone(), @@ -2110,6 +2117,7 @@ pub fn execute_prepared( census: Some(run.census.clone()), timing: Some(run.timing), status, + held_open_by, }; // The row contract first, so a refusal (such as a row under an unrequested profiles layer) // reports its own reason. @@ -2129,6 +2137,32 @@ pub fn execute_prepared( Ok(observation) } +/// The status of a run of `checked` whose output does not match Metal's under its class +/// `comparison` (`differs`: its bytes differ; `run`: its out-of-bounds facts), and the answer gap +/// that holds it open: a noted difference where it may be one ([`may_be_noted`]), unless the C3 +/// reviewed list (`list`, read only then) holds the case under an answer gap its structure meets +/// ([`AnswerGap::met_by`]), which keeps it a mismatch (the user's decision of 2026-10-06). Which +/// venues' devices have the gap is C3's to judge; here the case's difference is a mismatch on every +/// device, which hides none. +pub fn difference_status( + checked: &CheckedCase, + differs: bool, + comparison: &ComparisonClass, + run: Option<&OutOfBoundsRun>, + list: impl FnOnce() -> Result, +) -> Result<(CandidateStatus, Option), String> { + if !may_be_noted(differs, comparison, run) { + return Ok((CandidateStatus::Mismatch, None)); + } + let case_id = &checked.primary.case.case_id; + Ok( + match list()?.holding_open(case_id, |gap| gap.met_by(checked)) { + Some(gap) => (CandidateStatus::Mismatch, Some(gap)), + None => (CandidateStatus::NotedDifference, None), + }, + ) +} + /// The bytes of `output` from the final buffer contents and the final texture contents, by Metal /// index, and the final argument-buffer buffer and texture contents, by `(owner, field offset)`. pub fn select_output( diff --git a/crates/metal2vulkan-validation/src/candidate/engine/tests.rs b/crates/metal2vulkan-validation/src/candidate/engine/tests.rs index 285977048..9453d8d98 100644 --- a/crates/metal2vulkan-validation/src/candidate/engine/tests.rs +++ b/crates/metal2vulkan-validation/src/candidate/engine/tests.rs @@ -98,6 +98,45 @@ fn the_status_starts_zero_and_stops_non_evidence() { assert!(status_verdict(&missed).is_err()); } +/// A difference under notes is a noted difference unless the C3 reviewed list holds its case under +/// an answer gap the case's structure meets: then it stays a mismatch naming the gap. Judged over +/// the committed list's every answer gap and its committed case, and a committed case it does not +/// hold; a difference no note can explain is a mismatch for either. +#[test] +fn a_difference_under_notes_is_noted_unless_an_answer_gap_holds_its_case_open() { + let root = crate::source::corpus_root(); + let store = CorpusStore::new(&root); + let list = ReviewedList::load(&ReviewedList::committed_path()).unwrap(); + let noted = ComparisonClass::Unbounded( + [metal2vulkan::pipeline::PrecisionNote::ClippedCoverageSplit].into(), + ); + let status = |case: &AuthoredCase, comparison: &ComparisonClass| { + let checked = crate::check::check_case(&root, case.clone()) + .unwrap_or_else(|errors| panic!("{}: {errors:?}", case.name)); + difference_status(&checked, true, comparison, None, || Ok(list.clone())).unwrap() + }; + for entry in &list.answer_gaps { + let case = store.find_case(&entry.case_id).unwrap().unwrap(); + let held = (CandidateStatus::Mismatch, Some(entry.gap)); + assert_eq!(status(&case, ¬ed), held, "{}", case.name); + let unexplained = (CandidateStatus::Mismatch, None); + assert_eq!(status(&case, &ComparisonClass::Exact), unexplained); + } + assert!(list.answer_gaps.len() >= 5); + let unheld = store + .read_all_cases() + .unwrap() + .into_iter() + .find(|case| { + case.public_source.is_some() && list.holding_open(&case.case_id, |_| true).is_none() + }) + .unwrap(); + let difference = (CandidateStatus::NotedDifference, None); + assert_eq!(status(&unheld, ¬ed), difference); + let unexplained = (CandidateStatus::Mismatch, None); + assert_eq!(status(&unheld, &ComparisonClass::Exact), unexplained); +} + /// [`compute_case`] of a case whose entry declares no stage input: every case here but the /// stage-input ones, which map against their own interface. fn map_kernel(case: &AuthoredCase) -> Result { diff --git a/crates/metal2vulkan-validation/src/executor_contract/out_of_bounds/tests.rs b/crates/metal2vulkan-validation/src/executor_contract/out_of_bounds/tests.rs index 4ef542782..eadeffcba 100644 --- a/crates/metal2vulkan-validation/src/executor_contract/out_of_bounds/tests.rs +++ b/crates/metal2vulkan-validation/src/executor_contract/out_of_bounds/tests.rs @@ -601,6 +601,7 @@ fn candidate_row( artifact: None, }), status, + held_open_by: None, } } diff --git a/crates/metal2vulkan-validation/src/index.rs b/crates/metal2vulkan-validation/src/index.rs index 518341ac0..48ae20f42 100644 --- a/crates/metal2vulkan-validation/src/index.rs +++ b/crates/metal2vulkan-validation/src/index.rs @@ -34,6 +34,9 @@ pub enum QueueState { pub enum EvidenceState { Current, Failed, + /// A current candidate row that differs from Metal under notes that can explain a difference + /// (`CandidateStatus::NotedDifference`): never current, and counted apart from a failure. + NotedDifference, Missing, Stale, /// A Metal slot whose row is a current reference gap: the reference device cannot run the case, @@ -178,6 +181,7 @@ impl EvidenceState { match self { Self::Current => "current", Self::Failed => "failed", + Self::NotedDifference => "noted_difference", Self::Missing => "missing", Self::Stale => "stale", Self::ReferenceGap => "reference_gap", @@ -2109,6 +2113,8 @@ fn candidate_state( fn summarize_existing_states(states: &[EvidenceState]) -> EvidenceState { if states.contains(&EvidenceState::Failed) { EvidenceState::Failed + } else if states.contains(&EvidenceState::NotedDifference) { + EvidenceState::NotedDifference } else if states.contains(&EvidenceState::Stale) { EvidenceState::Stale } else if states.is_empty() { @@ -2304,7 +2310,8 @@ pub(crate) fn candidate_staleness( } /// The state of one candidate row of `case` under this build ([`candidate_staleness`]): `Current` -/// when it matched and is current, `Failed` when it mismatched and is current, `Stale` otherwise. +/// when it matched and is current, `Failed` when it mismatched and is current, `NotedDifference` +/// when it is a current noted difference, `Stale` otherwise. /// `metals` are the case's current Metal rows. pub(crate) fn candidate_slot_state( case: &crate::case::AuthoredCase, @@ -2318,6 +2325,7 @@ pub(crate) fn candidate_slot_state( match candidate.status { crate::observation::CandidateStatus::Match => EvidenceState::Current, crate::observation::CandidateStatus::Mismatch => EvidenceState::Failed, + crate::observation::CandidateStatus::NotedDifference => EvidenceState::NotedDifference, } } @@ -2489,6 +2497,7 @@ mod tests { comparison: ComparisonClass::Exact, census: None, status: CandidateStatus::Match, + held_open_by: None, }; (metal, candidate) } diff --git a/crates/metal2vulkan-validation/src/observation.rs b/crates/metal2vulkan-validation/src/observation.rs index d320bcdbc..5e26fd664 100644 --- a/crates/metal2vulkan-validation/src/observation.rs +++ b/crates/metal2vulkan-validation/src/observation.rs @@ -212,13 +212,35 @@ pub struct CandidateObservation { #[serde(default, skip_serializing_if = "Option::is_none")] pub timing: Option, pub status: CandidateStatus, + /// The C3 answer gap that keeps a difference its notes could explain a mismatch: the C3 + /// reviewed list holds the case under it and the case's structure meets it + /// (`candidate::engine::difference_status`). `None` for every other row. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub held_open_by: Option, } +/// How a candidate's output compares with Metal's: a difference is never a match. #[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum CandidateStatus { Match, + /// A difference no recorded note can explain (an exact class, or one past a bounded table), + /// an out-of-bounds target that escaped, or the difference of a case an answer gap holds open + /// ([`CandidateObservation::held_open_by`]): the user's decision of 2026-10-06 keeps an answer + /// gap's difference an open mismatch until an exact emulation exists. Mismatch, + /// The bytes differ under a class unbounded by precision notes + /// ([`ComparisonClass::Unbounded`]): the row's notes can explain a difference, which says + /// nothing of whether they explain this one. Never a match, and never accepted. + NotedDifference, +} + +/// Whether a row whose output does not match Metal's may be a noted difference: its bytes differ, +/// its class is unbounded by notes, and no out-of-bounds target escaped, which no note explains. +pub fn may_be_noted(differs: bool, class: &ComparisonClass, run: Option<&OutOfBoundsRun>) -> bool { + differs + && matches!(class, ComparisonClass::Unbounded(_)) + && !run.is_some_and(OutOfBoundsRun::escapes) } impl MetalObservation { @@ -382,9 +404,15 @@ impl CandidateObservation { // target's guard. `dependency_matches` re-decides each from the Metal bytes. let tolerated = self.comparison.tolerates_differences() || run.is_some_and(OutOfBoundsRun::tolerates_differences); + // A difference that may be noted is a noted one, unless an answer gap holds it open. + let noted = may_be_noted(!hashes_match, &self.comparison, run); let contradicts = match self.status { - CandidateStatus::Match => !hashes_match && !tolerated, - CandidateStatus::Mismatch => hashes_match && !run.is_some_and(OutOfBoundsRun::escapes), + CandidateStatus::Match => (!hashes_match && !tolerated) || self.held_open_by.is_some(), + CandidateStatus::Mismatch => { + (hashes_match && !run.is_some_and(OutOfBoundsRun::escapes)) + || noted != self.held_open_by.is_some() + } + CandidateStatus::NotedDifference => !noted || self.held_open_by.is_some(), }; if contradicts { return Err(format!( @@ -785,6 +813,7 @@ mod tests { comparison: ComparisonClass::Exact, census: None, status: CandidateStatus::Match, + held_open_by: None, }; let mut missing = serde_json::to_value(&candidate).unwrap(); missing @@ -871,6 +900,7 @@ mod tests { comparison: ComparisonClass::Exact, census: None, status: CandidateStatus::Match, + held_open_by: None, }; assert!(row.validate_content().is_ok()); row.output_b64 = "AgAAAA==".into(); @@ -912,6 +942,7 @@ mod tests { artifact: None, }), status: CandidateStatus::Match, + held_open_by: None, }; let validation = serde_json::json!({"layer": "VK_LAYER_KHRONOS_validation"}); let profiles = serde_json::json!({"layer": "VK_LAYER_KHRONOS_profiles"}); @@ -984,6 +1015,7 @@ mod tests { comparison: ComparisonClass::Exact, census: None, status: CandidateStatus::Match, + held_open_by: None, }; assert!(candidate.validate_content().is_ok()); candidate.candidate_output_sha256 = "00".repeat(32); @@ -1068,6 +1100,7 @@ mod tests { census: (comparison != ComparisonClass::Exact).then(|| census.clone()), comparison, status, + held_open_by: None, }; let spv_sha256 = "33".repeat(32); let translator_fingerprint = "55".repeat(32); @@ -1115,6 +1148,51 @@ mod tests { // A mismatch never has equal bytes. let equal = row(&golden, ComparisonClass::Exact, CandidateStatus::Mismatch); assert!(equal.validate_content().is_err()); + + // Under an unbounded class a difference is a noted difference, never a match, and a + // mismatch only where an answer gap holds it open; no other class or status is noted. + let unbounded = ComparisonClass::Unbounded([PrecisionNote::DeviceSampling].into()); + let valid = |output: &[u8], comparison: &ComparisonClass, status, held| { + let mut row = row(output, comparison.clone(), status); + row.held_open_by = held; + row.validate_content().is_ok() + }; + let gap = Some(crate::c3::AnswerGap::ClippedPrimitiveSplit); + assert!(valid( + &far, + &unbounded, + CandidateStatus::NotedDifference, + None + )); + assert!(valid(&far, &unbounded, CandidateStatus::Mismatch, gap)); + assert!(!valid(&far, &unbounded, CandidateStatus::Match, None)); + assert!(!valid(&far, &unbounded, CandidateStatus::Mismatch, None)); + assert!(!valid( + &far, + &unbounded, + CandidateStatus::NotedDifference, + gap + )); + assert!(!valid( + &golden, + &unbounded, + CandidateStatus::NotedDifference, + None + )); + assert!(!valid(&golden, &unbounded, CandidateStatus::Match, gap)); + let bounded = ComparisonClass::derive([PrecisionNote::F16FmaDoubleRounding], []); + assert!(!valid( + &far, + &bounded, + CandidateStatus::NotedDifference, + None + )); + assert!(!valid( + &far, + &ComparisonClass::Exact, + CandidateStatus::Mismatch, + gap + )); } /// A recorded timing reaches no digest, no fingerprint and no verdict. @@ -1228,6 +1306,7 @@ mod tests { census: None, timing, status: CandidateStatus::Match, + held_open_by: None, }; let golden = metal(Some(fast)); let dependencies = CandidateDependencies { diff --git a/crates/metal2vulkan-validation/src/observation_contract/comparison.rs b/crates/metal2vulkan-validation/src/observation_contract/comparison.rs index dbe68110f..f013fa299 100644 --- a/crates/metal2vulkan-validation/src/observation_contract/comparison.rs +++ b/crates/metal2vulkan-validation/src/observation_contract/comparison.rs @@ -6,8 +6,10 @@ //! chooses a class. Byte equality is a match under every class; a class only ever widens what //! counts as a match on lanes of a structurally known float format ([`ObservationLanes`]), and //! only by a bound that follows from the note ([`allowance`]). A note whose effect on a stored -//! value no table bounds makes the class [`ComparisonClass::Unbounded`]: a difference stays a -//! mismatch, recorded with the notes that may explain it, and is never accepted. +//! value no table bounds makes the class [`ComparisonClass::Unbounded`]. A difference is never a +//! match: under such notes it is a noted difference, recorded with the notes that can explain it +//! and counted apart (unless a C3 answer gap holds its case open), else a mismatch +//! (`crate::observation::CandidateStatus`). //! //! The class is per observation, not per lane: every lane of the declared format gets the //! tolerance, including lanes the noted operation did not produce, and a tolerance says nothing @@ -35,8 +37,8 @@ pub enum ComparisonClass { /// reassociation bound of the widest sum of that format the census records /// ([`reduction_table`]), together with the table of the other notes. ReductionOrderTolerant(UlpTable), - /// These notes accept a difference that no table bounds on the stored value: only byte - /// equality is a match. + /// These notes record a difference from Metal that no table bounds on the stored value: only + /// byte equality is a match. Unbounded(BTreeSet), } diff --git a/crates/metal2vulkan-validation/src/store.rs b/crates/metal2vulkan-validation/src/store.rs index d2aa33832..07ae64fb1 100644 --- a/crates/metal2vulkan-validation/src/store.rs +++ b/crates/metal2vulkan-validation/src/store.rs @@ -1417,6 +1417,7 @@ mod tests { comparison: ComparisonClass::Exact, census: None, status: CandidateStatus::Match, + held_open_by: None, } } diff --git a/crates/metal2vulkan-validation/src/vulkan_batch.rs b/crates/metal2vulkan-validation/src/vulkan_batch.rs index 813dad540..018a1fe45 100644 --- a/crates/metal2vulkan-validation/src/vulkan_batch.rs +++ b/crates/metal2vulkan-validation/src/vulkan_batch.rs @@ -46,8 +46,8 @@ //! the executor's own writes. //! - **Report.** [`report`] reads the done-list, rows, and refusals back beside the committed cases //! and Metal rows: [`family`] and [`scope`], the runs by [`Class`], and every run that -//! did not match with its detail (for a mismatch, the 32-bit words that differ from Metal's -//! output; for a refusal, the class of its recorded refusal). +//! did not match with its detail (for a mismatch or a noted difference, the 32-bit words that +//! differ from Metal's output; for a refusal, the class of its recorded refusal). use crate::candidate::engine::{engine_slot, ENGINE_EXECUTOR_ABI}; use crate::candidate::exit_status; @@ -107,6 +107,9 @@ pub enum Outcome { ReferenceGap, /// Exit 1 with a mismatching row. Mismatch, + /// Exit 1 with a noted-difference row: its bytes differ under precision notes that can explain + /// a difference (`CandidateStatus::NotedDifference`). Never a match. + NotedDifference, /// `not_supported{...}`: the product refused the case, the device does not enable what it /// needs, or the executor does not implement it. NotSupported, @@ -128,11 +131,12 @@ pub enum Outcome { Failed, } -const OUTCOMES: [Outcome; 12] = [ +const OUTCOMES: [Outcome; 13] = [ Outcome::Match, Outcome::Qualified, Outcome::ReferenceGap, Outcome::Mismatch, + Outcome::NotedDifference, Outcome::NotSupported, Outcome::Refused, Outcome::DeviceCrash, @@ -143,21 +147,24 @@ const OUTCOMES: [Outcome; 12] = [ Outcome::Failed, ]; -/// The report's four classes of [`Outcome`]. +/// The report's five classes of [`Outcome`]. #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum Class { /// A match, or a Metal run that qualified. Match, Mismatch, + /// A noted difference, counted apart from a mismatch and never a match. + NotedDifference, /// The case did not run: a typed refusal. Refusal, /// The run did not finish as evidence: a crash, a timeout, or a tooling failure. Failure, } -const CLASSES: [Class; 4] = [ +const CLASSES: [Class; 5] = [ Class::Match, Class::Mismatch, + Class::NotedDifference, Class::Refusal, Class::Failure, ]; @@ -169,6 +176,7 @@ impl Outcome { Self::Qualified => "qualified", Self::ReferenceGap => "reference_gap", Self::Mismatch => "mismatch", + Self::NotedDifference => "noted_difference", Self::NotSupported => "not_supported", Self::Refused => "refused", Self::DeviceCrash => "device_crash", @@ -190,6 +198,7 @@ impl Outcome { match self { Self::Match | Self::Qualified => Class::Match, Self::Mismatch => Class::Mismatch, + Self::NotedDifference => Class::NotedDifference, Self::NotSupported | Self::Refused | Self::ReferenceGap => Class::Refusal, Self::DeviceCrash | Self::NeedsMetal @@ -206,6 +215,7 @@ impl Class { match self { Self::Match => "match", Self::Mismatch => "mismatch", + Self::NotedDifference => "noted_difference", Self::Refusal => "refusal", Self::Failure => "failure", } @@ -272,15 +282,16 @@ impl Ended { } /// The outcome of a run that ended as `ended` with `row` (the status of the row it recorded in -/// its slot, if any) and `refused` (whether it recorded a refusal there). Only a match or a -/// mismatch records a row, and only one whose status agrees with the exit; only a typed refusal -/// (`not_supported`) records a refusal, and it may not (one before a device opened records -/// none): anything else is [`Outcome::Failed`]. +/// its slot, if any) and `refused` (whether it recorded a refusal there). Only a match, a mismatch +/// or a noted difference records a row, and only one whose status agrees with the exit; only a +/// typed refusal (`not_supported`) records a refusal, and it may not (one before a device opened +/// records none): anything else is [`Outcome::Failed`]. pub fn classify(ended: Ended, row: Option, refused: bool) -> Outcome { match (ended, row, refused) { (Ended::TimedOut, _, _) => Outcome::Timeout, (Ended::Code(0), Some(CandidateStatus::Match), false) => Outcome::Match, (Ended::Code(1), Some(CandidateStatus::Mismatch), false) => Outcome::Mismatch, + (Ended::Code(1), Some(CandidateStatus::NotedDifference), false) => Outcome::NotedDifference, (Ended::Code(exit_status::NOT_SUPPORTED), None, _) => Outcome::NotSupported, (Ended::Code(exit_status::REFUSED), None, false) => Outcome::Refused, (Ended::Code(exit_status::DEVICE_CRASH), None, false) => Outcome::DeviceCrash, @@ -1156,6 +1167,7 @@ fn execute_run(config: &BatchConfig, store: &Path, run: &Run) -> Result Result Result { let mut last = HashMap::<(String, Pass), Evidence>::new(); for run in output.done { let evidence = match run.outcome { - Outcome::Match | Outcome::Mismatch => Evidence::Row, + Outcome::Match | Outcome::Mismatch | Outcome::NotedDifference => Evidence::Row, Outcome::NotSupported => Evidence::Refusal, _ => continue, }; @@ -1480,13 +1496,16 @@ pub fn family(case: &AuthoredCase) -> String { /// `environment_id` (restricted to the profile `restricted_to`, if any: its rows and refusals are /// in that profile's slots). Lines: /// -/// - `batch-report selected=N ran=N pending=N match=N mismatch=N refusal=N failure=N`, then -/// the count of each refusal and failure [`Outcome`] (`not_supported=N ... failed=N`); -/// - `batch-family family=F cases=N match=N mismatch=N refusal=N failure=N` per [`family`], -/// and `batch-scope scope=S ...` the same per [`scope`]; +/// - `batch-report selected=N ran=N pending=N match=N mismatch=N noted_difference=N refusal=N +/// failure=N`, then the count of each refusal and failure [`Outcome`] (`not_supported=N ... +/// failed=N`); +/// - `batch-family family=F cases=N match=N mismatch=N noted_difference=N refusal=N failure=N` +/// per [`family`], and `batch-scope scope=S ...` the same per [`scope`]; /// - `batch-run case=ID scope=S family=F outcome=O seconds=S name=NAME detail=D` for every -/// run that did not match; a mismatch adds `comparison=C words=DIFFERING/TOTAL -/// first=I:METAL/CANDIDATE` from its row and the case's current Metal row, and a typed refusal +/// run that did not match; a mismatch or a noted difference adds `comparison=C` (the class, and +/// for a noted difference its notes), `held_open_by=GAP` for a mismatch an answer gap holds +/// open, and `words=DIFFERING/TOTAL first=I:METAL/CANDIDATE` from its row and the case's current +/// Metal row, and a typed refusal /// `refusal=CLASS` from its recorded refusal (`device`, `product`, `executor`), or /// `refusal=unrecorded` for one before a device opened; /// - `batch-slowest case=ID pass=P seconds=S outcome=O` for the slowest run. @@ -1565,12 +1584,16 @@ pub fn report( for class in CLASSES { line.push_str(&format!(" {}={}", class.label(), class_count(class))); } - // A match and a mismatch are their own classes; the other classes' outcomes follow (a - // Metal run's outcomes are no candidate run's). + // A match, a mismatch and a noted difference are their own classes; the other classes' + // outcomes follow (a Metal run's outcomes are no candidate run's). for outcome in OUTCOMES.into_iter().filter(|outcome| { !matches!( outcome, - Outcome::Match | Outcome::Mismatch | Outcome::Qualified | Outcome::ReferenceGap + Outcome::Match + | Outcome::Mismatch + | Outcome::NotedDifference + | Outcome::Qualified + | Outcome::ReferenceGap ) }) { line.push_str(&format!( @@ -1607,12 +1630,15 @@ pub fn report( case.name, run.detail ); - if run.outcome == Outcome::Mismatch { + if matches!(run.outcome, Outcome::Mismatch | Outcome::NotedDifference) { match row_of.get(&(run.case_id.as_str(), slot.as_str())) { Some(row) => { let comparison = serde_json::to_string(&row.comparison) .unwrap_or_else(|error| format!("?{error}")); line.push_str(&format!(" comparison={comparison}")); + if let Some(gap) = row.held_open_by { + line.push_str(&format!(" held_open_by={}", gap.as_str())); + } if let Some(metal) = metal_of.get(run.case_id.as_str()) { line.push_str(&format!( " {}", diff --git a/crates/metal2vulkan-validation/src/vulkan_batch/tests.rs b/crates/metal2vulkan-validation/src/vulkan_batch/tests.rs index bc75f63e1..b03c7bb5b 100644 --- a/crates/metal2vulkan-validation/src/vulkan_batch/tests.rs +++ b/crates/metal2vulkan-validation/src/vulkan_batch/tests.rs @@ -9,6 +9,7 @@ use crate::hash::sha256_bytes; use crate::observation::{MetalStatus, ReferenceGap}; use crate::observation_contract::ComparisonClass; use crate::refusal::Refusal; +use metal2vulkan::pipeline::PrecisionNote; const METAL_ENV: &str = "metal-test"; const ENV: &str = "lavapipe-test"; @@ -133,9 +134,26 @@ fn row( } else { CandidateStatus::Mismatch }, + held_open_by: None, } } +/// `row` under a class unbounded by `note`, with the status the executor gives it: a difference +/// is a noted one unless the answer gap `held_open_by` keeps it a mismatch. +fn under_note( + mut row: CandidateObservation, + note: PrecisionNote, + held_open_by: Option, +) -> CandidateObservation { + row.comparison = ComparisonClass::Unbounded([note].into()); + row.status = match held_open_by { + Some(_) => CandidateStatus::Mismatch, + None => CandidateStatus::NotedDifference, + }; + row.held_open_by = held_open_by; + row +} + /// A refusal of `case` in the slot `environment_id`: a feature the device did not enable. fn refusal(case: &AuthoredCase, environment_id: &str) -> RefusalObservation { RefusalObservation { @@ -302,7 +320,7 @@ fn the_done_list_round_trips_and_drops_a_cut_line() { /// refusal or not (one before a device opened records none). #[test] fn an_outcome_reads_the_exit_and_the_row_together() { - use CandidateStatus::{Match, Mismatch}; + use CandidateStatus::{Match, Mismatch, NotedDifference}; for (ended, row, expected) in [ ( Ended::Code(exit_status::NOT_SUPPORTED), @@ -330,6 +348,12 @@ fn an_outcome_reads_the_exit_and_the_row_together() { let cases = [ (Ended::Code(0), Some(Match), Outcome::Match), (Ended::Code(1), Some(Mismatch), Outcome::Mismatch), + ( + Ended::Code(1), + Some(NotedDifference), + Outcome::NotedDifference, + ), + (Ended::Code(0), Some(NotedDifference), Outcome::Failed), ( Ended::Code(exit_status::NOT_SUPPORTED), None, @@ -376,6 +400,7 @@ fn an_outcome_reads_the_exit_and_the_row_together() { assert_eq!(Outcome::parse(outcome.label()), Some(outcome)); } assert_eq!(Outcome::NotSupported.class(), Class::Refusal); + assert_eq!(Outcome::NotedDifference.class(), Class::NotedDifference); assert_eq!(Outcome::DeviceCrash.class(), Class::Failure); assert_eq!(Outcome::VenueMismatch.class(), Class::Failure); assert_eq!(Outcome::VenueMismatch.label(), "venue_mismatch"); @@ -798,7 +823,7 @@ fn session_member_is_zombie(_pid: libc::pid_t) -> bool { /// has not run as pending. #[test] fn the_report_counts_by_family_and_class_and_names_each_non_match() { - let (matching, mismatching) = (case(1, "a"), case(2, "b")); + let (matching, mismatching, noted) = (case(1, "a"), case(2, "b"), case(5, "e")); let mut refused = case(3, "c"); refused.public_source = Some("crates/metal2vulkan-validation/fixtures/public/c.ll".into()); let mut vertex = case(4, "d"); @@ -811,9 +836,21 @@ fn the_report_counts_by_family_and_class_and_names_each_non_match() { metal(&mismatching, METAL_ENV, ORACLE_ABI, &golden), metal(&refused, METAL_ENV, ORACLE_ABI, &[0; 4]), metal(&vertex, METAL_ENV, ORACLE_ABI, &[0; 4]), + metal(¬ed, METAL_ENV, ORACLE_ABI, &golden), ]; let slot = engine_slot(ENV, None); - let rows = [row(&mismatching, &slot, &output, &golden)]; + let gap = crate::c3::AnswerGap::ClippedPrimitiveSplit; + let held = under_note( + row(&mismatching, &slot, &output, &golden), + PrecisionNote::ClippedCoverageSplit, + Some(gap), + ); + let differs = under_note( + row(¬ed, &slot, &output, &golden), + PrecisionNote::DeviceSampling, + None, + ); + let rows = [held.clone(), differs.clone()]; let runs = [ done(&matching, Pass::Engine, Outcome::Failed, 9.0, "first try"), done(&matching, Pass::Engine, Outcome::Match, 1.0, ""), @@ -838,6 +875,13 @@ fn the_report_counts_by_family_and_class_and_names_each_non_match() { 3.0, "device_crash{SIGSEGV}", ), + done( + ¬ed, + Pass::Engine, + Outcome::NotedDifference, + 1.5, + "NotedDifference", + ), ]; let lines = report( &qualified_cases( @@ -846,6 +890,7 @@ fn the_report_counts_by_family_and_class_and_names_each_non_match() { mismatching.clone(), refused.clone(), vertex.clone(), + noted.clone(), ], &metals, METAL_ENV, @@ -862,25 +907,40 @@ fn the_report_counts_by_family_and_class_and_names_each_non_match() { ); let expect = |line: &str| assert!(lines.iter().any(|l| l == line), "{line}\n{lines:#?}"); expect( - "batch-report selected=4 ran=4 pending=0 match=1 mismatch=1 refusal=1 \ - failure=1 not_supported=1 refused=0 device_crash=1 needs_metal=0 venue_mismatch=0 \ - wait_timeout=0 timeout=0 failed=0", + "batch-report selected=5 ran=5 pending=0 match=1 mismatch=1 noted_difference=1 \ + refusal=1 failure=1 not_supported=1 refused=0 device_crash=1 needs_metal=0 \ + venue_mismatch=0 wait_timeout=0 timeout=0 failed=0", ); expect( - "batch-family family=kernel.buffers cases=3 match=1 mismatch=1 refusal=1 \ - failure=0", + "batch-family family=kernel.buffers cases=4 match=1 mismatch=1 noted_difference=1 \ + refusal=1 failure=0", ); expect( - "batch-family family=vertex.buffers cases=1 match=0 mismatch=0 refusal=0 \ + "batch-family family=vertex.buffers cases=1 match=0 mismatch=0 noted_difference=0 \ + refusal=0 failure=1", + ); + expect( + "batch-scope scope=private cases=4 match=1 mismatch=1 noted_difference=1 refusal=0 \ failure=1", ); - expect("batch-scope scope=private cases=3 match=1 mismatch=1 refusal=0 failure=1"); - expect("batch-scope scope=public cases=1 match=0 mismatch=0 refusal=1 failure=0"); + expect( + "batch-scope scope=public cases=1 match=0 mismatch=0 noted_difference=0 refusal=1 \ + failure=0", + ); + let class = |row: &CandidateObservation| serde_json::to_string(&row.comparison).unwrap(); expect(&format!( "batch-run case={} scope=private family=kernel.buffers outcome=mismatch \ - seconds=2.000 name=b detail=Mismatch comparison=\"exact\" words=1/2 \ + seconds=2.000 name=b detail=Mismatch comparison={} held_open_by=clipped_primitive_split \ + words=1/2 first=1:00000002/00000003", + mismatching.case_id, + class(&held) + )); + expect(&format!( + "batch-run case={} scope=private family=kernel.buffers outcome=noted_difference \ + seconds=1.500 name=e detail=NotedDifference comparison={} words=1/2 \ first=1:00000002/00000003", - mismatching.case_id + noted.case_id, + class(&differs) )); expect(&format!( "batch-run case={} scope=public family=kernel.buffers \ @@ -987,7 +1047,11 @@ fn installed_evidence_is_each_slots_last_run() { let out = scratch.path().join("out"); fs::create_dir_all(&out).unwrap(); let stale = row(&first, &stated, &[9, 0, 0, 0], &[0; 4]); - let fresh = row(&first, &stated, &[0; 4], &[0; 4]); + let fresh = under_note( + row(&first, &stated, &[9, 0, 0, 0], &[0; 4]), + PrecisionNote::DeviceSampling, + None, + ); let cut = row(&unlisted, &stated, &[0; 4], &[0; 4]); let replaced = row(&second, &stated, &[0; 4], &[0; 4]); let after_refusal = row(&third, &stated, &[0; 4], &[0; 4]); @@ -1008,7 +1072,7 @@ fn installed_evidence_is_each_slots_last_run() { let runs = [ done(&first, Pass::Engine, Outcome::Mismatch, 1.0, ""), done(&second, Pass::Engine, Outcome::Match, 1.0, ""), - done(&first, Pass::Engine, Outcome::Match, 1.0, ""), + done(&first, Pass::Engine, Outcome::NotedDifference, 1.0, ""), done(&third, Pass::Engine, Outcome::NotSupported, 1.0, ""), done(&second, Pass::Engine, Outcome::NotSupported, 1.0, ""), done(&third, Pass::Engine, Outcome::Match, 1.0, ""), diff --git a/docs/VALIDATION.md b/docs/VALIDATION.md index fdc8e307c..7bc51139b 100644 --- a/docs/VALIDATION.md +++ b/docs/VALIDATION.md @@ -551,6 +551,13 @@ cargo run -p metal2vulkan-validation --release --bin corpus-vulkan -- \ case's facts, and no SPIR-V, status, subgroup shape, module containment or artifact. The comparison bounds `ReductionOrder` by the simdgroup float sums and products the case's AIR calls, the operations the translator's census names for that note. +- **The verdict.** A row whose bytes equal Metal's, or differ within its comparison class's + bound, is a `Match`. A difference is never a match: under a class unbounded by precision notes + it is a `NotedDifference` (the notes can explain a difference; whether they explain this one is + not checked), counted in its own `noted_difference` column, and otherwise a `Mismatch`. A + difference of a case the C3 reviewed list holds under an answer gap its structure meets stays a + `Mismatch`, its row and batch line naming the gap (`held_open_by`): the user's decision of + 2026-10-06 keeps answer gaps open until an exact emulation exists. - **Batches.** `--batch --out OUT` runs every selected case, one process per case, each killed whole after `--run-timeout`, resuming from `OUT/done.tsv`; `--batch-report` and `--batch-install STORE` read and install the results. A batch starts no GPU run while the @@ -582,9 +589,10 @@ with its declared identity; each case is judged against its row. `corpus-status --c3` judges every venue's slot of every case: `match`, `reviewed`, `device_gap`, `out_of_scope_ray_tracing`, `reference_gap`, `mismatch`, `refused`, `stale` or -`missing`. A row recorded on a device or driver its venue does not allow is rejected. A change that -moves a venue's profile fingerprint without changing any artifact is handled by rekeying its -records (`corpus-status --venue-keys`, then `--rekey-venues`); a change that moves artifacts needs a +`missing`; a noted difference reads `mismatch` there, since C3 asks for a match. A row recorded +on a device or driver its venue does not allow is rejected. A change that moves a venue's profile +fingerprint without changing any artifact is handled by rekeying its records +(`corpus-status --venue-keys`, then `--rekey-venues`); a change that moves artifacts needs a re-record on that venue. ### Command replay