diff --git a/crates/metal2vulkan-conformance/src/cases/alpha_coverage_pairs.rs b/crates/metal2vulkan-conformance/src/cases/alpha_coverage_pairs.rs index 6c85107bc..be8d3ff59 100644 --- a/crates/metal2vulkan-conformance/src/cases/alpha_coverage_pairs.rs +++ b/crates/metal2vulkan-conformance/src/cases/alpha_coverage_pairs.rs @@ -193,8 +193,7 @@ struct Row { /// `blendingEnabled` with RGB factors that read the **source alpha**, which is how a row sees /// what alpha-to-one fed the blend. blended: bool, - /// The degrade notices a driver that is not Metal announced **for this row**, beside the one - /// every row declares ([`crate::replay::shared_memory_notice`]). + /// The degrade notices a driver that is not Metal announced **for this row**. /// /// A measured set, row by row, and not a rule fitted to the rows: the three sets below are what /// the RTX 5080 Laptop (615.71.09) and llvmpipe (Mesa 26.2.4) printed, less the device's own @@ -505,21 +504,12 @@ impl Case for AlphaCoverageCase { // **No value is loosened.** The coverage report is an integer, and the resolve of `k` // covered samples against `4 - k` uncovered is compared exactly, which is this suite's // ruling for the same shape in `super::sample_positions`. Every entry below is a notice - // declaration at `case/notices/*`, which moves no coverage and no texel. - // - // Two parts, and the split is the point. `shared-in-system-memory` belongs to the - // **venue**: every row reads its coverage and its resolve back through a `Shared` buffer, - // and a device without unified memory holds that buffer in host-cached system memory - // (`crate::replay::shared_memory_notice`). It fired for all 17 rows on the RTX 5080 Laptop - // (615.71.09) with the case declaring it nowhere. The rest is [`Row::notices`], which is - // the set measured **for that row** rather than for the family. - std::iter::once(crate::replay::shared_memory_notice()) - .chain( - self.row - .notices - .iter() - .map(|kind| crate::replay::notice_allowance(kind.code())), - ) + // declaration at `case/notices/*`, which moves no coverage and no texel. The notices are + // [`Row::notices`], the set measured **for that row** rather than for the family. + self.row + .notices + .iter() + .map(|kind| crate::replay::notice_allowance(kind.code())) .collect() } @@ -1030,10 +1020,10 @@ mod tests { case.name() ); } - // The venue's notice, and whatever the row itself was measured announcing. + // Whatever the row itself was measured announcing. assert_eq!( case.allowances().len(), - 1 + case.row.notices.len(), + case.row.notices.len(), "{}", case.name() ); diff --git a/crates/metal2vulkan-conformance/src/cases/argument_encoder_crossings.rs b/crates/metal2vulkan-conformance/src/cases/argument_encoder_crossings.rs index 3cb766d46..9add1ab97 100644 --- a/crates/metal2vulkan-conformance/src/cases/argument_encoder_crossings.rs +++ b/crates/metal2vulkan-conformance/src/cases/argument_encoder_crossings.rs @@ -603,17 +603,6 @@ impl Case for CrossingCase { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the notices - // site alone: every value of this family still compares against Metal's exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09), where it fired for all 4 rows of the family - // and each row was divergent on that field and nothing else (replay-nvidia.log). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let fixture = self.fixture(); [RUNTIME_TEXT, METAL_TEXT] diff --git a/crates/metal2vulkan-conformance/src/cases/argument_encoders.rs b/crates/metal2vulkan-conformance/src/cases/argument_encoders.rs index 2b39a2fe0..81c958165 100644 --- a/crates/metal2vulkan-conformance/src/cases/argument_encoders.rs +++ b/crates/metal2vulkan-conformance/src/cases/argument_encoders.rs @@ -62,7 +62,6 @@ //! tolerance. An intermediate byte would have put the 8-bit-to-float conversion in the answer, //! which is a different question and one `pixel_samplers` already asks with the notice it needs. -use crate::allowance::Allowance; use crate::argument_encoders::{ changed_node, changed_words, ArgumentDescriptorSpec, ArgumentWrite, ARGUMENT_WORD, BLANK, }; @@ -525,32 +524,6 @@ impl Case for ArgumentEncoderCase { Ok(inputs) } - /// The notices a venue may announce for these cases: shared storage in system memory, the - /// venue's own. - /// - /// Nothing of a value is loosened here: every sampled word, the encoder's own facts and the - /// argument buffer's changed-word mask are compared exactly on every venue, which is what the - /// texels buy. The texture holds the sixteen patterns of each component at 0 or 255, so every - /// sampled component is exactly 0.0 or 1.0 wherever the sampling happens, and a filter, a - /// denormal or a decode a device does its own way cannot move a word of that. What the two - /// cases that dispatch announce of the sampling on llvmpipe, the device's filter and its sRGB - /// decode (`float-sample-filter`, `srgb-texel-decode`), are the device's own answers, which the - /// suite declares for every case (`crate::replay::NATIVE_NOTES`). - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 5 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn run(&self, side: &mut dyn Side, sites: &mut Sites) -> Result<(), Abort> { let stop = |at: &str, why: String| Abort { at: at.to_owned(), diff --git a/crates/metal2vulkan-conformance/src/cases/astc_textures.rs b/crates/metal2vulkan-conformance/src/cases/astc_textures.rs index 0bd387888..32f18e269 100644 --- a/crates/metal2vulkan-conformance/src/cases/astc_textures.rs +++ b/crates/metal2vulkan-conformance/src/cases/astc_textures.rs @@ -472,25 +472,14 @@ impl Case for AstcTextures { } fn allowances(&self) -> Vec { - // Every row that runs reads its texels back through a `Shared` buffer, so on a device - // without unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the notices - // site alone, so every texel still compares against Metal's exactly. - // - // Measured on the LDR and sRGB rows: on the RTX 5080 Laptop (615.71.09) all 28 of them - // announced it and were divergent on that field and nothing else (replay-nvidia.log). The - // 14 HDR rows, which that card makes through the same carrier and twin since the HDR - // decode, have not run there since: their declaration counts as unchecked until a run on - // a device without unified memory announces it. // Where the device holds the format's block itself, `metal2vulkan-runtime` keeps the blocks in // an image of it and reads the device's decode of them, the static note it announces as // `compressed-texel-decode` for every block-compressed texture it makes. Here it is a // declaration; a linear form's texels also take the entry's bound (below), and an sRGB or // HDR form's compare exactly. - let mut all = vec![ - crate::replay::shared_memory_notice(), - crate::replay::notice_allowance(Degradation::CompressedTexelDecode.code()), - ]; + let mut all = vec![crate::replay::notice_allowance( + Degradation::CompressedTexelDecode.code(), + )]; // A linear channel is the device's decode of the block, the static note // `compressed-texel-decode`, whose catalogue entry bounds an ASTC LDR channel at 1/2048. if self.linear() { diff --git a/crates/metal2vulkan-conformance/src/cases/attribute_formats.rs b/crates/metal2vulkan-conformance/src/cases/attribute_formats.rs index 0994254fc..487203af8 100644 --- a/crates/metal2vulkan-conformance/src/cases/attribute_formats.rs +++ b/crates/metal2vulkan-conformance/src/cases/attribute_formats.rs @@ -102,7 +102,6 @@ //! one dispatch and one wait a row; every fetch is inside the buffer the row bound; no texture, no //! loop. -use crate::allowance::Allowance; use crate::attribute_coding as coding; use crate::attribute_coding::{shape, FILLER, ROWS, SLOT}; use crate::case::{ @@ -516,25 +515,6 @@ impl Case for AttributeFormats { MetalSource::Run } - fn allowances(&self) -> Vec { - // No value is loosened. Every decoding is exact arithmetic on the codes the record holds - // and every site is the raw bits the kernel reported, so a word that differs is a - // difference in the decode and not a rounding. - // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // this case, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for extension in [RUNTIME_TEXT, METAL_TEXT] { @@ -719,14 +699,6 @@ impl Case for ClassCrossings { MetalSource::Run } - fn allowances(&self) -> Vec { - // Nothing is loosened: whether a pipeline was made is not a number that can round, and - // the case reads no buffer back, so the notice a card without unified memory announces for - // a `Shared` buffer cannot reach it. Measured exact on the RTX 5080 Laptop (615.71.09) - // and on llvmpipe, which is why it declares nothing. - Vec::new() - } - fn shaders(&self) -> Result, String> { AttributeFormats.shaders() } diff --git a/crates/metal2vulkan-conformance/src/cases/attribute_strides.rs b/crates/metal2vulkan-conformance/src/cases/attribute_strides.rs index 7be0d0960..6706c88f8 100644 --- a/crates/metal2vulkan-conformance/src/cases/attribute_strides.rs +++ b/crates/metal2vulkan-conformance/src/cases/attribute_strides.rs @@ -71,7 +71,6 @@ //! (`every_fetch_lies_inside_its_buffer`). The fixture is loop-free. Nothing here can hang, fault //! or trip a watchdog. -use crate::allowance::Allowance; use crate::case::{ made, Abort, Case, Failure, Input, MetalSource, Side, StageInAttribute, StageInLayout, StageInput, @@ -475,23 +474,6 @@ impl Case for AttributeStrides { MetalSource::Run } - fn allowances(&self) -> Vec { - // Nothing here is loosened: every byte of every slot compares exactly. - // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 4 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let fixture = Self::fixture(); let mut shaders = Vec::new(); diff --git a/crates/metal2vulkan-conformance/src/cases/bicubic_texel_classes.rs b/crates/metal2vulkan-conformance/src/cases/bicubic_texel_classes.rs index 8ebcabf8d..4a9a7cc5d 100644 --- a/crates/metal2vulkan-conformance/src/cases/bicubic_texel_classes.rs +++ b/crates/metal2vulkan-conformance/src/cases/bicubic_texel_classes.rs @@ -244,13 +244,10 @@ impl Case for BicubicTexelClasses { fn allowances(&self) -> Vec { // The runtime emulates Metal's bicubic footprint and announces that its arithmetic is its - // own (`bicubic-filter-arithmetic`): a declaration, which loosens no value. The output is - // a `Shared` buffer, so a device without unified memory announces - // `shared-in-system-memory` (`crate::replay::shared_memory_notice` holds the whole reason). - vec![ - crate::replay::shared_memory_notice(), - notice_allowance(Degradation::BicubicFilterArithmetic.code()), - ] + // own (`bicubic-filter-arithmetic`): a declaration, which loosens no value. + vec![notice_allowance( + Degradation::BicubicFilterArithmetic.code(), + )] } fn shaders(&self) -> Result, String> { diff --git a/crates/metal2vulkan-conformance/src/cases/blend_interactions.rs b/crates/metal2vulkan-conformance/src/cases/blend_interactions.rs index 4d28e77fd..0bbc6691d 100644 --- a/crates/metal2vulkan-conformance/src/cases/blend_interactions.rs +++ b/crates/metal2vulkan-conformance/src/cases/blend_interactions.rs @@ -92,7 +92,6 @@ //! indexing outside a bound buffer, and every pass's attachment written and read back by the same //! command buffer. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Input, MetalSource, Side}; use crate::recording::ShaderRef; use crate::render::{ @@ -845,26 +844,6 @@ impl Case for BlendInteraction { MetalSource::Run } - fn allowances(&self) -> Vec { - // No value is loosened, and none may be. Every number the float cases form is exact in an - // `f32` channel, and every number the 8-bit cases form is a code, so a texel that differs - // is a difference in the blend and not in a rounding. The sRGB case's color channels are - // Metal's own decode and encode, which are **compared** exactly even though they are not - // modelled: a device whose sRGB blend is not Metal's is divergent, which is the honest - // verdict rather than a tolerance that would hide the thing this cross exists to find. - // - // What is declared is the notice set, a declaration at the notices site that moves no - // texel: `shared-in-system-memory`, the venue's memory model for the `Shared` buffer every - // row reads its texels back through (`crate::replay::shared_memory_notice`). Every row also - // announces `device-color-conversion`, the device's own conversion into the attachment, - // which the suite declares for every case (`crate::replay::NATIVE_NOTES`). - // - // Measured on the RTX 5080 Laptop (615.71.09) and on llvmpipe (Mesa 26.2.4): all four rows - // announced both, each with the case declaring none (replay-nvidia.log, - // replay-llvmpipe.log). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs(FILLS, &[VERTEX, FILL_FLOAT]) } @@ -1416,35 +1395,16 @@ mod tests { } /// Each case states inputs that cover every row of its cross, names Metal as its source, and - /// loosens no value: every allowance it names is a notice declaration. + /// loosens nothing. #[test] fn every_case_states_its_rows_and_loosens_nothing() { let mut names = BTreeSet::new(); for case in all() { assert!(names.insert(case.name()), "{} twice", case.name()); assert_eq!(case.metal_source(), MetalSource::Run); - // **No value is loosened.** Every allowance the family names is a notice declaration - // at `case/notices/*`, which states what our side announced and never a tolerance on a - // texel. - for allowance in case.allowances() { - assert_eq!( - allowance.path, - format!("case/{}/*", crate::replay::NOTICES_SITE), - "{}: a loosened value", - case.name() - ); - assert!( - matches!( - allowance.justified_by, - crate::allowance::Justification::Degradation(_) - ), - "{}: an allowance that is not a notice declaration", - case.name() - ); - } - // The venue's memory model, for every row; the device's own conversion into the - // attachment is the suite's native declaration. - assert_eq!(case.allowances().len(), 1, "{}", case.name()); + // **No value is loosened**, and no notice is declared: the device's own conversion + // into the attachment is the suite's native declaration. + assert!(case.allowances().is_empty(), "{}", case.name()); case.shaders().unwrap(); let inputs = case.inputs().unwrap(); let stated: BTreeSet<&str> = inputs.iter().map(|input| input.name.as_str()).collect(); diff --git a/crates/metal2vulkan-conformance/src/cases/blend_sweeps.rs b/crates/metal2vulkan-conformance/src/cases/blend_sweeps.rs index 318a9d0c5..a7ecb6b28 100644 --- a/crates/metal2vulkan-conformance/src/cases/blend_sweeps.rs +++ b/crates/metal2vulkan-conformance/src/cases/blend_sweeps.rs @@ -171,7 +171,6 @@ //! loop, no indexing outside a bound buffer, and every pass's attachment written and read back by //! the same command buffer. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Input, MetalSource, Side}; use crate::recording::ShaderRef; use crate::render::{ @@ -1265,30 +1264,6 @@ impl Case for BlendSweep { MetalSource::Run } - fn allowances(&self) -> Vec { - // No value is loosened, and none may be. Every number this family forms is exact in the - // target's `f32` channel (the module docs give the arithmetic), so a texel that differs is - // a difference in the blend and not in a rounding, and a tolerance written here would hide - // exactly the bug the sweep exists to find. - // - // One notice declaration, at the notices site and touching no texel: - // `shared-in-system-memory`, the venue's memory model rather than anything of this - // family's. Every row reads its texels back through a `Shared` buffer, and a device - // without unified memory holds that buffer in host-cached system memory - // (`crate::replay::shared_memory_notice`). - // - // `device-color-conversion`, the device's own conversion into the attachment where it is - // not Metal's, is the device's answer, which the suite declares for every case - // (`crate::replay::NATIVE_NOTES`). Its own definition says validation derives no tolerance - // and no explanation from it, so a row whose texels also differ stays divergent on those - // texels, which is the finding. - // - // Measured on the RTX 5080 Laptop (615.71.09): all 11 rows announced both with the case - // declaring neither, and on llvmpipe (Mesa 26.2.4) all 11 announced - // `device-color-conversion` (replay-nvidia.log, replay-llvmpipe.log). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let (name, vertex, fragment) = self.program(); shader_refs(name, &[vertex, fragment]) @@ -1859,35 +1834,16 @@ mod tests { } /// Each case states inputs that cover every row of its sweep, names Metal as its source, and - /// loosens no value: its two allowances are notice declarations. + /// loosens nothing. #[test] fn every_case_states_its_rows_and_loosens_nothing() { let mut names = BTreeSet::new(); for case in all() { assert!(names.insert(case.name()), "{} twice", case.name()); assert_eq!(case.metal_source(), MetalSource::Run); - // **No value is loosened.** Every allowance the family names is a notice declaration - // at `case/notices/*`, which states what our side announced and never a tolerance on a - // texel. - for allowance in case.allowances() { - assert_eq!( - allowance.path, - format!("case/{}/*", crate::replay::NOTICES_SITE), - "{}: a loosened value", - case.name() - ); - assert!( - matches!( - allowance.justified_by, - crate::allowance::Justification::Degradation(_) - ), - "{}: an allowance that is not a notice declaration", - case.name() - ); - } - // The venue's memory model, for every row; the device's own conversion into the - // attachment is the suite's native declaration. - assert_eq!(case.allowances().len(), 1, "{}", case.name()); + // **No value is loosened**, and no notice is declared: the device's own conversion + // into the attachment is the suite's native declaration. + assert!(case.allowances().is_empty(), "{}", case.name()); case.shaders().unwrap(); let inputs = case.inputs().unwrap(); let stated: BTreeSet<&str> = inputs.iter().map(|input| input.name.as_str()).collect(); diff --git a/crates/metal2vulkan-conformance/src/cases/blit_encoder_commands.rs b/crates/metal2vulkan-conformance/src/cases/blit_encoder_commands.rs index 386195e4e..4cb536e57 100644 --- a/crates/metal2vulkan-conformance/src/cases/blit_encoder_commands.rs +++ b/crates/metal2vulkan-conformance/src/cases/blit_encoder_commands.rs @@ -65,9 +65,7 @@ //! uncompressed, linearly filterable colour format, which is the shape `generateMipmapsForTexture:` //! is defined for. Nothing allocates more than a few kibibytes. -use crate::allowance::Allowance; use crate::case::{made, Abort, Case, Failure, Input, MetalSource, Side}; -use crate::degradation::Degradation; use crate::transcript::{ByteLayout, Element, Negative, Node, Observed, Sites, Value}; use crate::work::{Plane, Rect, Resource, Step, Storage, TextureSpec, Work}; use metal2vulkan::metal::{PixelFormat, TextureUsage}; @@ -221,15 +219,6 @@ struct Row { sites: fn(&crate::work::Done) -> Vec, /// What the case sets that no resource's bytes carry, as its input fingerprint. parameters: fn() -> Vec, - /// The degrade notices this case's commands announce on a device that cannot take the exact - /// form. Metal announces none, so a notice of ours is the only field of these cases that may - /// differ at all — every byte compares exactly. - /// - /// **Each code here is one a venue was measured announcing for this case**, named in - /// `NOTICES`'s own documentation with the run behind it. A code nothing was measured - /// announcing is not listed: an unmeasured declaration is itself unchecked, and the replay - /// reports a declaration whose notice stayed quiet as never fired. - notices: &'static [Degradation], } /// A case of the family: one row. @@ -246,14 +235,6 @@ impl Case for BlitEncoderCommands { MetalSource::Run } - fn allowances(&self) -> Vec { - self.row - .notices - .iter() - .map(|kind| crate::replay::notice_allowance(kind.code())) - .collect() - } - fn inputs(&self) -> Result, String> { // Every byte the program feeds its run, in resource order, and the geometry of every step: // either moving makes the recording's answer another program's. @@ -368,7 +349,6 @@ static WHOLE_TEXTURE: Row = Row { ] }, parameters: || b"copyFromTexture:toTexture:".to_vec(), - notices: NOTICES, }; /// The slices and the levels [`texture_slice_counts`] copies, from level 1 of slice 0. @@ -422,7 +402,6 @@ static SLICE_COUNTS: Row = Row { .flat_map(|word| word.to_le_bytes()) .collect() }, - notices: NOTICES, }; /// `copyFromTexture:...sliceCount:levelCount:` of no slices, and of no levels. @@ -479,7 +458,6 @@ static COUNTS_OF_NONE: Row = Row { ] }, parameters: || b"sliceCount 0 levelCount 3; sliceCount 2 levelCount 0".to_vec(), - notices: NOTICES, }; /// Whether every region of an array read-back still holds [`BEFORE`], its guard untouched. @@ -580,7 +558,6 @@ static GENERATED_MIPMAPS: Row = Row { ] }, parameters: || b"generateMipmapsForTexture: over 4 levels of 8x8 RGBA8Unorm".to_vec(), - notices: NOTICES, }; /// The extended-range mipmap cases' texture: 64 by 64, seven levels, the size of the upload whose @@ -673,7 +650,6 @@ static GENERATED_BGR10_XR_MIPMAPS: Row = Row { getBytes: of it, generateMipmapsForTexture:, getBytes: of every level" .to_vec() }, - notices: NOTICES, }; /// `generateMipmapsForTexture:` of a 64 by 64 `BGRA10_XR` texture, its upload's round trip first. @@ -686,7 +662,6 @@ static GENERATED_BGRA10_XR_MIPMAPS: Row = Row { getBytes: of it, generateMipmapsForTexture:, getBytes: of every level" .to_vec() }, - notices: NOTICES, }; /// The four hints [`optimized_contents`] encodes, in that order: `None` is the whole-texture @@ -753,7 +728,6 @@ static OPTIMIZED_CONTENTS: Row = Row { } words }, - notices: NOTICES, }; /// The managed buffer's length, and the fill the case is about: an unaligned range inside it, so @@ -806,11 +780,6 @@ static SYNCHRONIZED_BUFFER: Row = Row { words.push(value); words }, - // The one row of the family that reads its answer back out of a **`Managed`** buffer rather - // than a `Shared` one, so [`NOTICES`]'s venue notice is not its: on the RTX 5080 Laptop - // (615.71.09) it was the only row of the family that did not announce - // `shared-in-system-memory`, and it compared justified there (replay-nvidia.log). - notices: &[], }; /// The managed texture's extent, and the pitch the host reads it at: six times its row, so the @@ -872,7 +841,6 @@ static SYNCHRONIZED_TEXTURE: Row = Row { words.push(GUARD); words }, - notices: NOTICES, }; /// The two un-optioned selectors beside the two that take an option, over the same bytes. @@ -952,7 +920,6 @@ static UNOPTIONED: Row = Row { ] }, parameters: || b"unoptioned at slot 0; MTLBlitOptionNone at slot 1".to_vec(), - notices: NOTICES, }; /// The bytes [`fenced_encoders`] moves. @@ -1006,24 +973,8 @@ static FENCED_ENCODERS: Row = Row { ] }, parameters: || b"updateFence on encoder 0; waitForFence on encoder 1".to_vec(), - notices: NOTICES, }; -/// The notices a case of this family declares, where the case provokes none of its own. -/// -/// **The venue's own, and nothing else.** Each of these rows reads its answer back through a -/// `Shared` buffer, and on a device whose GPU does not share the CPU's memory such a buffer lies -/// in host-cached system memory, which the runtime announces once per device -/// (`crate::replay::shared_memory_notice` holds the whole reason). Measured on the RTX 5080 Laptop -/// (615.71.09): all eight rows that carry this list announced it and were divergent on that field -/// and nothing else (replay-nvidia.log). -/// -/// Nothing of the rows' own joins it until a venue is measured announcing one. Declaring a code on -/// a row from the shape of its path would be a declaration nothing checks: a venue that does -/// announce something reads as `UndeclaredNotice`, naming the code and the case, which is the loud -/// form and the one that makes the next real notice visible. -const NOTICES: &[Degradation] = &[Degradation::SharedInSystemMemory]; - /// The case of `copyFromTexture:toTexture:`. pub fn whole_texture_copy() -> BlitEncoderCommands { BlitEncoderCommands { @@ -1160,34 +1111,6 @@ mod tests { } } - /// Every case loosens the notices site and nothing else: no byte of these cases is ever - /// loosened, whatever form a device's copy or fill takes. - /// - /// And the venue's memory notice is declared only where it was measured: on every row that - /// reads its answer back through a `Shared` buffer, and not on the one that reads it out of a - /// `Managed` buffer. - #[test] - fn only_the_shared_read_backs_declare_a_notice() { - for case in all() { - for allowance in case.allowances() { - assert_eq!( - allowance.path, - format!("case/{}/*", crate::replay::NOTICES_SITE), - "{}", - case.name() - ); - } - } - assert_eq!(NOTICES, [Degradation::SharedInSystemMemory]); - let declaring: Vec<&str> = EVERY_ROW - .iter() - .filter(|row| row.notices != NOTICES) - .map(|row| row.case) - .collect(); - assert_eq!(declaring, [SYNCHRONIZED_BUFFER.case]); - assert!(SYNCHRONIZED_BUFFER.notices.is_empty()); - } - /// Assert that `origin` plus `size` lies inside `extent` on every axis, naming the step. fn inside(case: &str, step: usize, origin: &[u64; 3], size: &[u64; 3], extent: &[u64; 3]) { for (axis, ((from, span), bound)) in origin diff --git a/crates/metal2vulkan-conformance/src/cases/blit_indirect_commands.rs b/crates/metal2vulkan-conformance/src/cases/blit_indirect_commands.rs index 72ac2ef5f..51397d959 100644 --- a/crates/metal2vulkan-conformance/src/cases/blit_indirect_commands.rs +++ b/crates/metal2vulkan-conformance/src/cases/blit_indirect_commands.rs @@ -69,7 +69,6 @@ //! //! [`Side::compute_pipeline_for_commands`]: crate::case::Side::compute_pipeline_for_commands -use crate::allowance::Allowance; use crate::case::{made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::indirect_commands::{ComputeCommandStep, EncodedCommand, IcbDescriptor}; @@ -321,24 +320,6 @@ impl Case for BlitIndirectCommands { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every byte of every leg's output compares exactly, on this venue and under this - // declaration: the only site loosened is the set of notices, which Metal holds empty. - // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 3 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let held = Fixture::new(FIXTURE); [RUNTIME_TEXT, METAL_TEXT] diff --git a/crates/metal2vulkan-conformance/src/cases/border_swizzles.rs b/crates/metal2vulkan-conformance/src/cases/border_swizzles.rs index a26f9ca64..af1f0ac8c 100644 --- a/crates/metal2vulkan-conformance/src/cases/border_swizzles.rs +++ b/crates/metal2vulkan-conformance/src/cases/border_swizzles.rs @@ -299,18 +299,6 @@ impl Case for BorderSwizzles { // for every case, which loosen no word. A word the device's conversion moves is a // `known-gaps.tsv` row of the venue. // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 8 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - // // The fixture's float texture is sampled through the runtime sampler at `[[sampler(0)]]`, // which the runtime's pipelines note as scaled // (`crate::replay::pixel_sampler_scaling_notice` holds why). Measured through the rt side @@ -318,10 +306,7 @@ impl Case for BorderSwizzles { // // Every row sweeps samplers that read an opaque-black border, which the runtime's // sampler states note on every device (`crate::replay::swizzled_border_notice`). - let mut named = vec![ - crate::replay::shared_memory_notice(), - crate::replay::pixel_sampler_scaling_notice(), - ]; + let mut named = vec![crate::replay::pixel_sampler_scaling_notice()]; let black = (SAMPLERS.iter()).any(|&(_, modes, border)| { crate::replay::reads_opaque_black_border(&sampler_spec(modes, border)) }); diff --git a/crates/metal2vulkan-conformance/src/cases/buffer_bind_off_alignment.rs b/crates/metal2vulkan-conformance/src/cases/buffer_bind_off_alignment.rs index a344e2f73..03b51972d 100644 --- a/crates/metal2vulkan-conformance/src/cases/buffer_bind_off_alignment.rs +++ b/crates/metal2vulkan-conformance/src/cases/buffer_bind_off_alignment.rs @@ -14,7 +14,6 @@ //! one dispatch of 64 threads, every access within 8 KiB buffers, which an Apple M3 Max runs at //! addresses rounded down to a multiple of 4. -use crate::allowance::Allowance; use crate::case::{made, Abort, Case, Handle, Input, MetalSource, Side}; use crate::compute_pass::{ComputePass, ComputeStep, Dispatching}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; @@ -71,12 +70,6 @@ impl Case for BufferBindOffAlignment { MetalSource::Run } - fn allowances(&self) -> Vec { - // The pass's buffers are `Shared`, so a device without unified memory announces - // `shared-in-system-memory` (`crate::replay::shared_memory_notice` holds the whole reason). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for extension in [RUNTIME_TEXT, METAL_TEXT] { diff --git a/crates/metal2vulkan-conformance/src/cases/buffer_blits.rs b/crates/metal2vulkan-conformance/src/cases/buffer_blits.rs index 36b82026f..7738d9310 100644 --- a/crates/metal2vulkan-conformance/src/cases/buffer_blits.rs +++ b/crates/metal2vulkan-conformance/src/cases/buffer_blits.rs @@ -43,7 +43,6 @@ //! Nothing here can fault a GPU: every command is a buffer copy or a buffer fill inside its //! buffer, there is no shader, no texture and no loop, and every wait is bounded. -use crate::allowance::Allowance; use crate::case::{call, Abort, Case, Input, MetalSource, Side}; use crate::transcript::{ByteLayout, Element, Negative, Node, Observed, Sites, Value}; use crate::work::{Resource, Step, Storage, Work}; @@ -146,21 +145,6 @@ impl Case for BufferBlits { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 4 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn inputs(&self) -> Result, String> { // Every byte the program feeds its run, in resource order, and the geometry of every step: // either moving makes the recording's answer another program's. diff --git a/crates/metal2vulkan-conformance/src/cases/buffer_depth_samples.rs b/crates/metal2vulkan-conformance/src/cases/buffer_depth_samples.rs index 0c580a0b9..26346822d 100644 --- a/crates/metal2vulkan-conformance/src/cases/buffer_depth_samples.rs +++ b/crates/metal2vulkan-conformance/src/cases/buffer_depth_samples.rs @@ -372,17 +372,6 @@ impl Case for BufferDepthSamples { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the notices - // site alone: every value of this family still compares against Metal's exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09), where it fired for all 5 rows of the family - // and each row was divergent on that field and nothing else (replay-nvidia.log). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let fixture = Fixture::new(KERNELS); Ok(vec![ShaderRef { diff --git a/crates/metal2vulkan-conformance/src/cases/buffer_tails.rs b/crates/metal2vulkan-conformance/src/cases/buffer_tails.rs index fb267d356..47bece689 100644 --- a/crates/metal2vulkan-conformance/src/cases/buffer_tails.rs +++ b/crates/metal2vulkan-conformance/src/cases/buffer_tails.rs @@ -23,12 +23,7 @@ //! by a blit from a buffer (across the length) and rows 252 to 255 by a blit from a texture //! (wholly past it), copies rows 240 to 255 into a texture of its own, and reads every one of //! those back, with the buffer's bytes. -//! -//! Every byte compares exactly. What differs is the announcing: a device without unified memory -//! announces `shared-in-system-memory` for the `Shared` buffers the answers are read back -//! through. Nothing here can fault a GPU: one small texture, one thread a texel, no loop. -use crate::allowance::Allowance; use crate::case::{ call, made, Abort, Bindings, Case, Failure, Handle, Input, MetalSource, PlaneTexture, Side, }; @@ -81,13 +76,6 @@ fn written(n: u64, set: u64) -> Vec { .collect() } -/// What both cases loosen: the notices, and nothing else. -fn allowances() -> Vec { - // Every case reads its answers back through `Shared` buffers, so a device without unified - // memory announces `shared-in-system-memory` (`crate::replay::shared_memory_notice`). - vec![crate::replay::shared_memory_notice()] -} - /// The numbers that place the texture in the buffer, for both cases' inputs. fn shape_words() -> Vec { let mut words = Vec::new(); @@ -228,10 +216,6 @@ impl Case for Kernels { MetalSource::Run } - fn allowances(&self) -> Vec { - allowances() - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for entry in [READ_ENTRY, WRITE_ENTRY] { @@ -474,10 +458,6 @@ impl Case for Blits { MetalSource::Run } - fn allowances(&self) -> Vec { - allowances() - } - fn inputs(&self) -> Result, String> { let mut steps = Vec::new(); for set in 0..3 { diff --git a/crates/metal2vulkan-conformance/src/cases/buffer_target_clears.rs b/crates/metal2vulkan-conformance/src/cases/buffer_target_clears.rs index c70853bda..37199e101 100644 --- a/crates/metal2vulkan-conformance/src/cases/buffer_target_clears.rs +++ b/crates/metal2vulkan-conformance/src/cases/buffer_target_clears.rs @@ -320,20 +320,7 @@ impl Case for BufferTargetClear { // replace with arbitrary data (`DONT_CARE_TEXELS`, `dont_care_texels`). The padding and the // bytes before and after the target compare exactly, Metal's against ours. // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 6 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - let mut named = vec![crate::replay::shared_memory_notice()]; - named.extend(self.row.dont_care_texels()); - named + self.row.dont_care_texels() } fn inputs(&self) -> Result, String> { diff --git a/crates/metal2vulkan-conformance/src/cases/buffer_texture_blits.rs b/crates/metal2vulkan-conformance/src/cases/buffer_texture_blits.rs index d301d7390..3b31920ec 100644 --- a/crates/metal2vulkan-conformance/src/cases/buffer_texture_blits.rs +++ b/crates/metal2vulkan-conformance/src/cases/buffer_texture_blits.rs @@ -468,23 +468,6 @@ impl Case for Blits { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every byte of every one of these programs compares exactly, Metal's against ours. - // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // both rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn inputs(&self) -> Result, String> { // Every row and the order they run in, keyed by the call each one makes and its numbers: a // table that gains, loses or re-points a row is a change to the case's inputs rather than diff --git a/crates/metal2vulkan-conformance/src/cases/buffer_textures.rs b/crates/metal2vulkan-conformance/src/cases/buffer_textures.rs index 5179371b9..b60cae140 100644 --- a/crates/metal2vulkan-conformance/src/cases/buffer_textures.rs +++ b/crates/metal2vulkan-conformance/src/cases/buffer_textures.rs @@ -75,23 +75,6 @@ const READ_WRITE: TextureUsage = TextureUsage::SHADER_READ.union(TextureUsage::S /// The buffer every making row is laid over: 4096 bytes, as the lane's is. const BUFFER: u64 = 4096; -/// What the two recorded cases loosen: the notices, and nothing else. Every fact and every byte of -/// both cases compares exactly. -fn allowances() -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 3 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] -} - /// Every case of the family. pub fn all() -> Vec> { vec![ @@ -202,10 +185,6 @@ impl Case for MadeOverBuffer { MetalSource::Run } - fn allowances(&self) -> Vec { - allowances() - } - fn inputs(&self) -> Result, String> { // Every shape and the order they are asked in: a table that gains, loses or re-points a // row is a change to the case's inputs, so a recording cannot decay into the answers of @@ -309,16 +288,6 @@ impl Case for StrideBelowTheRow { MetalSource::did_not_return(ASSERTED_IN, BELOW_SITE, ASSERTED_SAYS) } - fn allowances(&self) -> Vec { - // The row makes its `Shared` buffer before the texture over it is refused, so on a device - // without unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the notices - // site alone: the refusal at the one value site is still what the row pins. Measured on - // the RTX 5080 Laptop (615.71.09): the whole-set replay announced it here and the row - // was divergent at the notices site and nowhere else. - vec![crate::replay::shared_memory_notice()] - } - fn inputs(&self) -> Result, String> { Ok(vec![Input::bytes("request", &BELOW.words())]) } @@ -606,10 +575,6 @@ impl Case for CpuAccess { MetalSource::Run } - fn allowances(&self) -> Vec { - allowances() - } - fn inputs(&self) -> Result, String> { // The buffer's bytes, and the geometry of every call the program makes, keyed by the call // and its numbers: either moving makes the recording's answer another program's. diff --git a/crates/metal2vulkan-conformance/src/cases/chroma_pairs.rs b/crates/metal2vulkan-conformance/src/cases/chroma_pairs.rs index 1ac7a8351..444fbb20b 100644 --- a/crates/metal2vulkan-conformance/src/cases/chroma_pairs.rs +++ b/crates/metal2vulkan-conformance/src/cases/chroma_pairs.rs @@ -55,7 +55,6 @@ //! ending the process", and the suite's standing rule is that no case may end Metal's process. So //! is the render-target half of the lane, whose pipeline Metal's validation aborts plain too. -use crate::allowance::Allowance; use crate::case::{ made, Abort, Bindings, Case, Failure, Input, MetalSource, SamplerSpec, Side, TextureRole, TextureSpec, @@ -571,24 +570,6 @@ impl Case for ChromaCopies { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every byte of every read-back compares exactly; what differs is the notices site, which - // Metal records empty. - // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // both copy rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn inputs(&self) -> Result, String> { // The tables and the bytes they move, named one by one, so a diff of a failed input // fingerprint says which of them changed rather than "the program". @@ -726,24 +707,6 @@ impl Case for ChromaTexels { Ok(shaders) } - fn allowances(&self) -> Vec { - // Every texel compares exactly; what differs is the notices site, which Metal records - // empty. - // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 4 texel rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn inputs(&self) -> Result, String> { let fixture = self.fixture(); let mut inputs = vec![ diff --git a/crates/metal2vulkan-conformance/src/cases/color_write_masks.rs b/crates/metal2vulkan-conformance/src/cases/color_write_masks.rs index 413f63d6e..5907f6908 100644 --- a/crates/metal2vulkan-conformance/src/cases/color_write_masks.rs +++ b/crates/metal2vulkan-conformance/src/cases/color_write_masks.rs @@ -22,10 +22,9 @@ //! choice: the tile-store family's masked draw can only be compared under a notice, and a mask is //! too ordinary a piece of state to be checked only where a notice is in the way. //! -//! The one site that is loosened is the notices site, by the venue's memory notice alone: the -//! device's own float-to-normalized conversion is a native note the suite declares for every case -//! ([`crate::replay::NATIVE_NOTES`]), and it changes no texel here, because white converts to -//! `0xff` either way. +//! No site is loosened: the device's own float-to-normalized conversion is a native note the suite +//! declares for every case ([`crate::replay::NATIVE_NOTES`]), and it changes no texel here, because +//! white converts to `0xff` either way. //! //! The mask of every channel is the control. Without it a side that quietly stopped drawing at all //! would pass both of the other two, and the family would prove nothing. @@ -57,7 +56,6 @@ //! //! Nothing here can fault a GPU: one 4 by 4 target a case, one triangle, no loop. -use crate::allowance::Allowance; use crate::case::{Abort, Case, Failure, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -189,23 +187,6 @@ impl Case for ColorWriteMaskCase { MetalSource::Run } - fn allowances(&self) -> Vec { - // The texels are not loosened: `RGBA8Unorm` codes survive Metal's store, so which channels - // the mask kept is an exact answer on every device or it is a bug. - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 5 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let fixture = self.fixture(); [RUNTIME_TEXT, METAL_TEXT] @@ -330,10 +311,7 @@ mod tests { //! recording was taken with a different pipeline, and the test says which case. use super::*; - use crate::allowance::Justification; - use crate::degradation::Degradation; use crate::recording::Recording; - use crate::replay::NOTICES_SITE; use crate::transcript::Transcript; /// The texel Metal leaves under `mask`: `0xff` in each channel it names, the prefill byte in @@ -458,32 +436,14 @@ mod tests { } } - /// No case of the family loosens a texel: the notices site is the only loosened site, and the - /// one notice it names is in the degrade catalogue. + /// No case of the family loosens a texel or declares a notice. /// /// This is the family's whole tolerance story in one assertion. A case that ever loosened the /// texels would fail here, which is the field the family exists to compare. #[test] - fn only_the_notices_site_is_loosened() { + fn nothing_is_loosened() { for case in all() { - for allowance in case.allowances() { - assert_eq!( - allowance.path, - format!("case/{NOTICES_SITE}/*"), - "{}: an allowance outside the notices site", - case.name() - ); - match &allowance.justified_by { - // The venue's own memory notice, which every row of the family declares - // because every row reads its answer back through a `Shared` buffer. - Justification::Degradation(code) => assert!( - code == Degradation::SharedInSystemMemory.code(), - "{}: an unexpected notice {code}", - case.name() - ), - other => panic!("{}: an unexpected tolerance: {other:?}", case.name()), - } - } + assert!(case.allowances().is_empty(), "{}", case.name()); assert_eq!(case.metal_source(), MetalSource::Run); case.shaders().unwrap(); let inputs = case.inputs().unwrap(); diff --git a/crates/metal2vulkan-conformance/src/cases/command_buffer_facts.rs b/crates/metal2vulkan-conformance/src/cases/command_buffer_facts.rs index 0ffaf4a44..307229c58 100644 --- a/crates/metal2vulkan-conformance/src/cases/command_buffer_facts.rs +++ b/crates/metal2vulkan-conformance/src/cases/command_buffer_facts.rs @@ -35,7 +35,6 @@ //! it with nothing encoded. No shader, no draw, no dispatch, no loop, no mapping, and every wait is //! bounded. -use crate::allowance::Allowance; use crate::case::{made, Abort, Case, Input, MetalSource, Side}; use crate::transcript::Sites; @@ -86,21 +85,6 @@ impl Case for CommandBufferFactsCase { 5 } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // this case, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn run(&self, side: &mut dyn Side, sites: &mut Sites) -> Result<(), Abort> { // The call's own site and the facts take **different** names: two siblings under one name // are paired by whichever namesake the comparison reaches first, which is how a round @@ -117,22 +101,18 @@ impl Case for CommandBufferFactsCase { mod tests { use super::*; - /// The case states its inputs, names itself once, declares the venue's own memory notice and - /// nothing else. + /// The case states its inputs, names itself once and declares nothing. /// - /// A second notice slipping in would be a value the case took for a reason nobody wrote down, - /// which is what this count is for. + /// A notice slipping in would be a value the case took for a reason nobody wrote down, which + /// is what this check is for. #[test] - fn the_case_states_its_inputs_and_only_the_venue_notice() { + fn the_case_states_its_inputs_and_declares_nothing() { let cases = all(); assert_eq!(cases.len(), 1); let case = &cases[0]; assert_eq!(case.name(), COMMAND_BUFFER_FACTS); assert!(!case.inputs().expect("the inputs").is_empty()); - let allowed = case.allowances(); - // The one a card without unified memory announces for the `Shared` buffer the case reads - // its answer back through. - assert_eq!(allowed.len(), 1); + assert!(case.allowances().is_empty()); // And the case records more than one run, because two of its booleans read a clock. assert!(case.record_runs() > 1); } diff --git a/crates/metal2vulkan-conformance/src/cases/compressed_blits.rs b/crates/metal2vulkan-conformance/src/cases/compressed_blits.rs index 1dc41c7e3..af80d69b1 100644 --- a/crates/metal2vulkan-conformance/src/cases/compressed_blits.rs +++ b/crates/metal2vulkan-conformance/src/cases/compressed_blits.rs @@ -617,21 +617,10 @@ impl Case for CompressedBlits { // Every byte of all four rows compares exactly with Metal's; the declarations cover the // notices site alone. // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 4 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - // // The note of the encoding the device's copy keeps ([`kept_encoding_notice`]). - let mut allowances = vec![crate::replay::shared_memory_notice()]; - allowances.extend(kept_encoding_notice(self.format().format.as_raw())); + let mut allowances: Vec = kept_encoding_notice(self.format().format.as_raw()) + .into_iter() + .collect(); // On a venue that presents no texture compression no texture is compressed: Metal's own // uncompressed texture keeps its bytes through every blit, so each site a blit reaches // through the texture the recording's Mac compressed holds the bytes the device's copy @@ -692,9 +681,9 @@ mod tests { assert_eq!(named.len(), FORMATS.len()); } - /// Every case of the family declares exactly the notice codes it announces: the venue's own - /// for every format, and the note of the encoding its blits keep where it has one that is not - /// a native one the suite declares itself. + /// Every case of the family declares exactly the notice codes it announces: the note of the + /// encoding its blits keep where it has one that is not a native one the suite declares + /// itself. /// /// Stated as the whole set rather than as "the codes are present", because a declaration fires /// on its own code: a code announced and declared nowhere is a divergence at the notices site, @@ -704,11 +693,7 @@ mod tests { fn every_case_declares_exactly_the_notices_it_announces() { use crate::allowance::Justification; for case in all() { - let mut wanted = vec![ - // The venue's own: a card without unified memory holds the `Shared` buffer each - // row reads its answer back through in system memory. - Degradation::SharedInSystemMemory.code().to_owned(), - ]; + let mut wanted = Vec::new(); let note = case.format().note; if let Some(note) = note.filter(|note| !crate::replay::NATIVE_NOTES.contains(note)) { wanted.push(note.code().to_owned()); diff --git a/crates/metal2vulkan-conformance/src/cases/compressed_decode.rs b/crates/metal2vulkan-conformance/src/cases/compressed_decode.rs index 6b5dc106c..d9a8a3120 100644 --- a/crates/metal2vulkan-conformance/src/cases/compressed_decode.rs +++ b/crates/metal2vulkan-conformance/src/cases/compressed_decode.rs @@ -296,28 +296,13 @@ impl Case for CompressedDecode { fn allowances(&self) -> Vec { // The device's decode of the texture's own blocks, announced `compressed-texel-decode` // where the runtime makes it, declared at the notices site, moves a texel by up to the - // largest difference its catalogue entry states for the format's family: on - // `metal2vulkan-runtime`'s run each round's texels are loosened by that number and no further, - // justified by the notice, so a run past it is the note's claim failing. The old - // runtime's run is not loosened: there the notice holds nowhere and faults nothing, and a - // texel the device moves is the venue's ledger row. A texel's `float` value is also the - // device's conversion of its decoded codes (`device-texel-conversion`), which loosens - // nothing. - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 10 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - let mut all = vec![ - crate::replay::shared_memory_notice(), - crate::replay::notice_allowance(Degradation::CompressedTexelDecode.code()), - ]; + // largest difference its catalogue entry states for the format's family: each round's + // texels are loosened by that number and no further, justified by the notice, so a run + // past it is the note's claim failing. A texel's `float` value is also the device's + // conversion of its decoded codes (`device-texel-conversion`), which loosens nothing. + let mut all = vec![crate::replay::notice_allowance( + Degradation::CompressedTexelDecode.code(), + )]; for round in 0..ROUNDS { all.push(Allowance::new( format!("case/round/{round}/texels"), diff --git a/crates/metal2vulkan-conformance/src/cases/compressed_moves.rs b/crates/metal2vulkan-conformance/src/cases/compressed_moves.rs index acff41247..09df1e117 100644 --- a/crates/metal2vulkan-conformance/src/cases/compressed_moves.rs +++ b/crates/metal2vulkan-conformance/src/cases/compressed_moves.rs @@ -841,36 +841,17 @@ pub fn out_tight( }); } -/// The notices a BC case may name as justifying its notices site: the `Shared` buffer each row -/// reads its answer back through, which a device without unified memory announces, and the -/// device's decode of the texture's blocks. +/// The notice a BC case may name as justifying its notices site: the device's decode of the +/// texture's blocks. /// /// A BC texture keeps no decoded twin on any venue: the device holds every BC format in its own /// compressed form and decodes it itself, which the runtime announces as `compressed-texel-decode` -/// for every such texture. Every block still compares exactly: the only site these loosen is the -/// set of notices, which Metal holds empty. -/// -/// What is **not** here: `staged-texture-copy`. Our `replaceRegion:` into a compressed texture does -/// go through a staging buffer, and the notice fires on **no** venue of this suite for these cases -/// (verified over four legs: MoltenVK and lavapipe, exact and default policy). A tolerance naming a -/// mechanism no venue announces is a claim nothing stands behind, so it is gone, as the `formats` -/// stream's `shadowed-texture` went. +/// for every such texture. Every block still compares exactly: the only site it loosens is the set +/// of notices, which Metal holds empty. pub fn block_allowances() -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 14 rows of each of the two families that call this, and each was divergent on that - // field and nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![ - crate::replay::notice_allowance(Degradation::SharedInSystemMemory.code()), - crate::replay::notice_allowance(Degradation::CompressedTexelDecode.code()), - ] + vec![crate::replay::notice_allowance( + Degradation::CompressedTexelDecode.code(), + )] } /// The case for one format. diff --git a/crates/metal2vulkan-conformance/src/cases/compute_encoder_commands.rs b/crates/metal2vulkan-conformance/src/cases/compute_encoder_commands.rs index 5ce025c9e..866813883 100644 --- a/crates/metal2vulkan-conformance/src/cases/compute_encoder_commands.rs +++ b/crates/metal2vulkan-conformance/src/cases/compute_encoder_commands.rs @@ -304,23 +304,11 @@ impl Case for ComputeEncoderCommands { // measured announcing a notice of this family's own; a venue that does reads as // `UndeclaredNotice`, naming the code and the case, which is the loud form. // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 8 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - // // A sampling row's kernel samples its texture through the runtime sampler at slot 0, // which the runtime's pipelines note as scaled // (`crate::replay::pixel_sampler_scaling_notice` holds why). Measured through the rt side // on lavapipe, the Radeon 780M and the RX 550: it fired for both sampling rows. - let mut named = vec![crate::replay::shared_memory_notice()]; + let mut named = Vec::new(); if matches!(self.row.resources, Resources::Sampled { .. }) { named.push(crate::replay::pixel_sampler_scaling_notice()); } @@ -995,10 +983,9 @@ mod tests { assert_eq!(rows, named); } - /// Every case states its inputs and loosens no value: its declarations are notices at the - /// notices site alone, the one a device without unified memory announces for the `Shared` - /// buffer the case reads back through, and on a sampling row the static note of its runtime - /// sampler slot, `pixel-sampler-scaling`. + /// Every case states its inputs and loosens no value: its one declaration, on a sampling row + /// alone, is the static note of its runtime sampler slot, `pixel-sampler-scaling`, at the + /// notices site. #[test] fn every_case_states_its_inputs_and_loosens_nothing() { use crate::degradation::Degradation as D; @@ -1018,10 +1005,10 @@ mod tests { .inputs() .unwrap_or_else(|why| panic!("{}: {why}", case.name())); assert!(!inputs.is_empty(), "{}", case.name()); - let mut wanted = vec![D::SharedInSystemMemory]; - if matches!(case.row.resources, Resources::Sampled { .. }) { - wanted.push(D::PixelSamplerScaling); - } + let wanted = match case.row.resources { + Resources::Sampled { .. } => vec![D::PixelSamplerScaling], + _ => Vec::new(), + }; let named: Vec<_> = case .allowances() .into_iter() diff --git a/crates/metal2vulkan-conformance/src/cases/compute_heap_residency.rs b/crates/metal2vulkan-conformance/src/cases/compute_heap_residency.rs index e4c3b4a11..37f8af587 100644 --- a/crates/metal2vulkan-conformance/src/cases/compute_heap_residency.rs +++ b/crates/metal2vulkan-conformance/src/cases/compute_heap_residency.rs @@ -57,7 +57,6 @@ //! `3 · (THREADS − 1) + 1`, and the input buffer holds `SOURCE_WORDS`, which is more //! (`the_input_holds_every_word_the_kernel_reads`). -use crate::allowance::Allowance; use crate::case::{made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::compute_pass::{ComputePass, ComputeStep, Dispatching}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; @@ -178,23 +177,6 @@ impl Case for ComputeHeapResidency { MetalSource::Run } - fn allowances(&self) -> Vec { - // No value is loosened: both slots compare exactly. - // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // this case, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let fixture = Self::fixture(); [RUNTIME_TEXT, METAL_TEXT] diff --git a/crates/metal2vulkan-conformance/src/cases/compute_render_chains.rs b/crates/metal2vulkan-conformance/src/cases/compute_render_chains.rs index 47d9a8135..dc39b6c03 100644 --- a/crates/metal2vulkan-conformance/src/cases/compute_render_chains.rs +++ b/crates/metal2vulkan-conformance/src/cases/compute_render_chains.rs @@ -298,26 +298,14 @@ impl Case for ComputeRenderChain { // `device-arithmetic` on a device whose float functions are not Metal's own, a native // note the suite declares for every case. Measured: it fires on lavapipe and not on // MoltenVK on this M3 Max, and on lavapipe every value compared **exactly**. - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 3 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. // // The row whose fragment function samples the kernel's texture does so through a runtime // sampler slot, which the runtime's pipelines note as scaled // (`crate::replay::pixel_sampler_scaling_notice` holds why, and the run it rests on). - let mut named = vec![crate::replay::shared_memory_notice()]; - if self.subject.crossing == Crossing::KernelToFragment { - named.push(crate::replay::pixel_sampler_scaling_notice()); + match self.subject.crossing { + Crossing::KernelToFragment => vec![crate::replay::pixel_sampler_scaling_notice()], + _ => Vec::new(), } - named } fn shaders(&self) -> Result, String> { @@ -804,14 +792,15 @@ mod tests { } /// No row of the family loosens a value: every allowance is a notice declaration on the - /// notices site, and the one notice declared is the venue's memory model. + /// notices site, and the one notice declared is `pixel-sampler-scaling`, on the row that + /// samples through a runtime sampler slot. #[test] fn no_row_loosens_a_value() { use crate::allowance::Justification; for case in all() { // Every allowance is a notice declaration on the notices site, so no row loosens a - // value: the venue's memory model, and pixel-sampler-scaling for the row whose - // fragment function samples through a runtime sampler slot. + // value: pixel-sampler-scaling for the row whose fragment function samples through a + // runtime sampler slot, and nothing for the others. let codes: Vec = case .allowances() .iter() @@ -828,10 +817,12 @@ mod tests { } }) .collect(); - let mut wanted = vec![crate::degradation::Degradation::SharedInSystemMemory.code()]; - if case.subject.crossing == Crossing::KernelToFragment { - wanted.push(crate::degradation::Degradation::PixelSamplerScaling.code()); - } + let wanted = match case.subject.crossing { + Crossing::KernelToFragment => { + vec![crate::degradation::Degradation::PixelSamplerScaling.code()] + } + _ => Vec::new(), + }; assert_eq!(codes, wanted, "{}", case.name()); assert_eq!(case.metal_source(), MetalSource::Run); case.shaders().unwrap(); diff --git a/crates/metal2vulkan-conformance/src/cases/compute_threadgroups.rs b/crates/metal2vulkan-conformance/src/cases/compute_threadgroups.rs index f4b128750..b0bd2fb35 100644 --- a/crates/metal2vulkan-conformance/src/cases/compute_threadgroups.rs +++ b/crates/metal2vulkan-conformance/src/cases/compute_threadgroups.rs @@ -198,17 +198,6 @@ impl Case for SimdScratch { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the notices - // site alone: every value of this family still compares against Metal's exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09), where it fired for all this case - // and each row was divergent on that field and nothing else (replay-nvidia.log). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of() } @@ -339,17 +328,6 @@ impl Case for PastMetalsLimit { MetalSource::carried_only(CARRIED_FROM, NEVER_RE_RECORD).measured_on(CARRIED_CHIP) } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the notices - // site alone: every value of this family still compares against Metal's exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09), where it fired for all this case - // and each row was divergent on that field and nothing else (replay-nvidia.log). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of() } diff --git a/crates/metal2vulkan-conformance/src/cases/copy_out_strides.rs b/crates/metal2vulkan-conformance/src/cases/copy_out_strides.rs index 1c4402c56..2a2d7c482 100644 --- a/crates/metal2vulkan-conformance/src/cases/copy_out_strides.rs +++ b/crates/metal2vulkan-conformance/src/cases/copy_out_strides.rs @@ -18,7 +18,6 @@ //! Nothing here can fault a GPU: blit copies between textures and buffers the program makes, every //! region inside its texture and its buffer, no dispatch, no draw and no loop. -use crate::allowance::Allowance; use crate::case::{made, Abort, Case, Failure, Input, MetalSource, Side}; use crate::transcript::{ByteLayout, Element, Observed, Sites, Value}; use crate::work::{Plane, Resource, Step, TextureSpec, Work}; @@ -181,14 +180,6 @@ impl Case for CopyOutStrides { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every read-back goes through a `Shared` buffer, so on a device without unified memory - // the runtime announces `shared-in-system-memory` (`crate::replay::shared_memory_notice` - // holds the whole reason). It loosens the notices site alone; every byte still compares - // against Metal's exactly. No run of this case on such a device has announced it yet. - vec![crate::replay::shared_memory_notice()] - } - fn inputs(&self) -> Result, String> { let shapes: Vec = SHAPES .iter() diff --git a/crates/metal2vulkan-conformance/src/cases/denormal_word_fetches.rs b/crates/metal2vulkan-conformance/src/cases/denormal_word_fetches.rs index 794d85031..0cc8662a7 100644 --- a/crates/metal2vulkan-conformance/src/cases/denormal_word_fetches.rs +++ b/crates/metal2vulkan-conformance/src/cases/denormal_word_fetches.rs @@ -270,17 +270,6 @@ impl Case for DenormalWordFetches { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the notices - // site alone: every value of this family still compares against Metal's exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09), where it fired for all this case - // and each row was divergent on that field and nothing else (replay-nvidia.log). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for extension in [RUNTIME_TEXT, METAL_TEXT] { diff --git a/crates/metal2vulkan-conformance/src/cases/depth_resolve_pairs.rs b/crates/metal2vulkan-conformance/src/cases/depth_resolve_pairs.rs index 7163c3a6d..2ec4a383a 100644 --- a/crates/metal2vulkan-conformance/src/cases/depth_resolve_pairs.rs +++ b/crates/metal2vulkan-conformance/src/cases/depth_resolve_pairs.rs @@ -104,7 +104,6 @@ //! the target and the suite counts the case //! [`LacksFeature`](crate::verdict::Verdict::LacksFeature) rather than leaving it uncompared. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -480,16 +479,6 @@ impl Case for DepthFilters { RUNS } - fn allowances(&self) -> Vec { - // No value is loosened: every resolved depth Metal leaves is a depth we must leave. What is - // declared is a notice at the notices site that touches no resolved depth: a device - // without unified memory holds the `Shared` buffer each row reads its answer back through - // in system memory (`crate::replay::shared_memory_notice`). Measured on the RTX 5080 - // Laptop (615.71.09), where both rows announced it with the case declaring it nowhere - // (replay-nvidia.log). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } @@ -845,9 +834,8 @@ mod tests { for case in all() { assert_eq!(case.record_runs(), RUNS); assert!(matches!(case.metal_source(), MetalSource::Run)); - // The declared allowances loosen no value: each names a notice and nothing else. - // The resolve and the `DontCare` store, and the venue's memory model. - assert_eq!(case.allowances().len(), 3); + // No value is loosened and no notice is declared. + assert!(case.allowances().is_empty(), "{}", case.name()); } } diff --git a/crates/metal2vulkan-conformance/src/cases/depth_stencil_space.rs b/crates/metal2vulkan-conformance/src/cases/depth_stencil_space.rs index 79e54cd4c..7203fa3b3 100644 --- a/crates/metal2vulkan-conformance/src/cases/depth_stencil_space.rs +++ b/crates/metal2vulkan-conformance/src/cases/depth_stencil_space.rs @@ -114,7 +114,6 @@ //! 32 by 32 target, no loop in either stage, every scissor rectangle inside the attachments, every //! vertex inside the clip volume, and no state Metal's own validation refuses. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -960,25 +959,6 @@ impl Case for DepthCompares { RUNS } - fn allowances(&self) -> Vec { - // No value loosened: a texel is four ones or the pass's clear, both of which a - // `RGBA32Float` attachment stores exactly, and the fragment function does no arithmetic a - // device's float bounds could reach. - // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 8 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } @@ -1160,21 +1140,6 @@ impl Case for DepthCodes { RUNS } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 8 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } @@ -1307,21 +1272,6 @@ impl Case for StencilCompares { RUNS } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 8 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } @@ -1505,23 +1455,6 @@ impl Case for StencilOperations { RUNS } - fn allowances(&self) -> Vec { - // Exact: every stencil byte Metal leaves is a byte we must leave. - // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 8 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } @@ -1655,21 +1588,6 @@ impl Case for Faces { RUNS } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 8 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } @@ -1920,24 +1838,6 @@ impl Case for DepthSlot { RUNS } - fn allowances(&self) -> Vec { - // Only the notice set is loosened: every texel and every stencil byte of this case - // compares exactly. - // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 8 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } @@ -2220,23 +2120,6 @@ impl Case for MaskCrossings { RUNS } - fn allowances(&self) -> Vec { - // Exact: every stencil byte Metal leaves is a byte we must leave. - // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 8 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } @@ -2357,26 +2240,6 @@ impl Case for FacesFacing { RUNS } - fn allowances(&self) -> Vec { - // Exact: every stencil byte Metal leaves is a byte we must leave. Metal's cull mode and - // front-facing winding are both encoder state the runtime carries into the pipeline it is - // about to draw with, so no pass of this case is split and nothing of the case's own is - // announced. - // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 8 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } @@ -2868,31 +2731,9 @@ mod tests { assert!(matches!(case.metal_source(), MetalSource::Run)); assert!(case.inputs().is_ok()); // **No row loosens a value**: a texel is white or the clear and a stencil byte is a - // stencil byte, both of which the attachments hold exactly, so every allowance here is - // a notice declaration at `case/notices/*`. - let allowed = case.allowances(); - for allowance in &allowed { - assert_eq!( - allowance.path, - format!("case/{}/*", crate::replay::NOTICES_SITE), - "{}: a loosened value", - case.name() - ); - } - // Every row declares the venue's memory notice, and nothing else. - let named: std::collections::BTreeSet<&str> = allowed - .iter() - .filter_map(|allowance| match &allowance.justified_by { - crate::allowance::Justification::Degradation(code) => Some(code.as_str()), - _ => None, - }) - .collect(); - assert!( - named.contains(crate::degradation::Degradation::SharedInSystemMemory.code()), - "{}", - case.name() - ); - assert_eq!(named.len(), 1, "{}", case.name()); + // stencil byte, both of which the attachments hold exactly, and no row declares a + // notice. + assert!(case.allowances().is_empty(), "{}", case.name()); } // The six programs between them attach every combination the family needs: depth alone, // stencil alone, and the two together as separate textures. diff --git a/crates/metal2vulkan-conformance/src/cases/depth_texel_reads.rs b/crates/metal2vulkan-conformance/src/cases/depth_texel_reads.rs index cfa445084..dfe0bba2d 100644 --- a/crates/metal2vulkan-conformance/src/cases/depth_texel_reads.rs +++ b/crates/metal2vulkan-conformance/src/cases/depth_texel_reads.rs @@ -217,25 +217,11 @@ impl Case for DepthTexelReads { // The fixture's AIR asks for fast math, whose `fast-math-rewrites` the suite declares for // every case (`crate::replay::NATIVE_NOTES`); every one of the 131,072 words still // compares exactly. - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // this case, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. // // Its samples are through a runtime sampler slot, which the runtime's pipelines note // as scaled (`crate::replay::pixel_sampler_scaling_notice` holds why, and the run it // rests on). - vec![ - crate::replay::shared_memory_notice(), - crate::replay::pixel_sampler_scaling_notice(), - ] + vec![crate::replay::pixel_sampler_scaling_notice()] } fn shaders(&self) -> Result, String> { diff --git a/crates/metal2vulkan-conformance/src/cases/discard_hoist.rs b/crates/metal2vulkan-conformance/src/cases/discard_hoist.rs index 2afcc9aff..ec9e39da6 100644 --- a/crates/metal2vulkan-conformance/src/cases/discard_hoist.rs +++ b/crates/metal2vulkan-conformance/src/cases/discard_hoist.rs @@ -209,11 +209,6 @@ impl Case for DiscardHoist { // whole (`quads-split-by-clipping`) and groups a fragment simdgroup its own way // (`fragment-simdgroup-grouping`). Declarations only: the grouping's note derives no // tolerance, so a sum it moves stays divergent, a ledger row (the module doc). - // And the notice a card without unified memory announces for the `Shared` buffer the - // case reads its sums back through, which is the venue's memory model and not this - // case's shape. Measured on the RTX 5080 Laptop (615.71.09), where it fired for this - // case with nothing declaring it (replay-nvidia.log). - .chain(std::iter::once(crate::replay::shared_memory_notice())) .chain( [ Degradation::QuadsCountedBeforeDiscard, diff --git a/crates/metal2vulkan-conformance/src/cases/draw_state_changes.rs b/crates/metal2vulkan-conformance/src/cases/draw_state_changes.rs index bb2388e42..68a3df022 100644 --- a/crates/metal2vulkan-conformance/src/cases/draw_state_changes.rs +++ b/crates/metal2vulkan-conformance/src/cases/draw_state_changes.rs @@ -250,27 +250,10 @@ impl Case for DrawStateChanges { // is the device's own answer, which the suite declares for every case // (`crate::replay::NATIVE_NOTES`). // - // Measured: it fires on lavapipe and not on MoltenVK on this M3 Max, and on lavapipe every - // texel of this case compared **exactly** -- the whole difference was the announcement. - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // this case, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - // // Its samples are through a runtime sampler slot, which the runtime's pipelines note // as scaled (`crate::replay::pixel_sampler_scaling_notice` holds why, and the run it // rests on). - vec![ - crate::replay::shared_memory_notice(), - crate::replay::pixel_sampler_scaling_notice(), - ] + vec![crate::replay::pixel_sampler_scaling_notice()] } fn shaders(&self) -> Result, String> { diff --git a/crates/metal2vulkan-conformance/src/cases/etc_textures.rs b/crates/metal2vulkan-conformance/src/cases/etc_textures.rs index b0dcb5558..6228fc734 100644 --- a/crates/metal2vulkan-conformance/src/cases/etc_textures.rs +++ b/crates/metal2vulkan-conformance/src/cases/etc_textures.rs @@ -283,25 +283,13 @@ impl Case for EtcTextures { } fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 10 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. // Where the device holds the format's block itself, `metal2vulkan-runtime` keeps the blocks in // an image of it and reads the device's decode of them, the static note it announces as // `compressed-texel-decode` for every block-compressed texture it makes. A declaration // and not a tolerance: no ETC2 or EAC bound is stated, so every texel still compares exactly. - vec![ - crate::replay::shared_memory_notice(), - crate::replay::notice_allowance(Degradation::CompressedTexelDecode.code()), - ] + vec![crate::replay::notice_allowance( + Degradation::CompressedTexelDecode.code(), + )] } fn shaders(&self) -> Result, String> { diff --git a/crates/metal2vulkan-conformance/src/cases/event_orders.rs b/crates/metal2vulkan-conformance/src/cases/event_orders.rs index dd3bd64b4..f93b8de90 100644 --- a/crates/metal2vulkan-conformance/src/cases/event_orders.rs +++ b/crates/metal2vulkan-conformance/src/cases/event_orders.rs @@ -213,26 +213,16 @@ impl Case for EventOrder { } fn allowances(&self) -> Vec { - // The cross-queue row is the one row of the family that reads an answer back out of a - // `Shared` buffer, and on a device without unified memory the runtime announces - // `shared-in-system-memory` for it (`crate::replay::shared_memory_notice` holds the whole - // reason). It declares the notices site alone: the scratch words still compare exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): the notice fired for - // `event-cross-queue-wait` alone, which was divergent on that field and nothing else, and - // the other three rows were exact (replay-nvidia.log). So the other three name nothing: - // what they read back is a count our side holds, not a buffer the device wrote. match self.shape { - // The waiting command buffer's scratch is read back out of a `Shared` buffer, as - // the cross-queue row's is. - Shape::CrossQueueWait => vec![crate::replay::shared_memory_notice()], Shape::WaitBehindRunningSignal => { - let mut allowances = vec![crate::replay::shared_memory_notice()]; - allowances.extend(scheduled_once_the_submit_thread_is_free()); + let mut allowances = scheduled_once_the_submit_thread_is_free(); allowances.extend(shared_wait_scheduled_as_submitted()); allowances } - Shape::HighestSignal | Shape::Held | Shape::SignalBeforeWait => Vec::new(), + Shape::CrossQueueWait + | Shape::HighestSignal + | Shape::Held + | Shape::SignalBeforeWait => Vec::new(), } } diff --git a/crates/metal2vulkan-conformance/src/cases/extended_range_blends.rs b/crates/metal2vulkan-conformance/src/cases/extended_range_blends.rs index b8a52dfcd..4dadf680f 100644 --- a/crates/metal2vulkan-conformance/src/cases/extended_range_blends.rs +++ b/crates/metal2vulkan-conformance/src/cases/extended_range_blends.rs @@ -246,21 +246,9 @@ impl Case for ExtendedRangeBlend { // note the suite declares for every case (`crate::replay::NATIVE_NOTES`); the codes still // compare exactly, and a site the device's arithmetic moves is a known gap. // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 18 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![ - crate::replay::shared_memory_notice(), - crate::replay::notice_allowance(Degradation::HalfOutputFastMathBlend.code()), - ] + vec![crate::replay::notice_allowance( + Degradation::HalfOutputFastMathBlend.code(), + )] } fn shaders(&self) -> Result, String> { diff --git a/crates/metal2vulkan-conformance/src/cases/extended_range_gamut.rs b/crates/metal2vulkan-conformance/src/cases/extended_range_gamut.rs index ded54975b..dc6d03cdb 100644 --- a/crates/metal2vulkan-conformance/src/cases/extended_range_gamut.rs +++ b/crates/metal2vulkan-conformance/src/cases/extended_range_gamut.rs @@ -147,15 +147,13 @@ fn fill(pipeline: Handle, values: Handle, extent: Handle) -> [RenderStep; 4] { ] } -/// The notices every case of the family may announce, each with the reason it cannot loosen a -/// code: `shared-in-system-memory` (the read-back buffer is `Shared`; a device without unified -/// memory announces it) and `half-output-fast-math-blend` (the fixture is a fast-math module whose -/// `half4` fill a pipeline stores). Every value still compares exactly. +/// The notice every case of the family may announce, with the reason it cannot loosen a code: +/// `half-output-fast-math-blend` (the fixture is a fast-math module whose `half4` fill a pipeline +/// stores). Every value still compares exactly. fn notices() -> Vec { - vec![ - crate::replay::shared_memory_notice(), - crate::replay::notice_allowance(Degradation::HalfOutputFastMathBlend.code()), - ] + vec![crate::replay::notice_allowance( + Degradation::HalfOutputFastMathBlend.code(), + )] } /// Read `target` (one sample, `format`) back into a buffer after `work`, and record its texels. diff --git a/crates/metal2vulkan-conformance/src/cases/extended_range_gradients.rs b/crates/metal2vulkan-conformance/src/cases/extended_range_gradients.rs index 572fa7039..c464483b1 100644 --- a/crates/metal2vulkan-conformance/src/cases/extended_range_gradients.rs +++ b/crates/metal2vulkan-conformance/src/cases/extended_range_gradients.rs @@ -241,15 +241,13 @@ impl Case for GradientDraw { MetalSource::Run } - /// The notices a draw into such a target may announce, none of which loosens a code (every - /// texel still compares exactly): `shared-in-system-memory` (the read-back buffer is `Shared`; - /// a device without unified memory announces it) and `half-output-fast-math-blend` (the - /// fixture is a fast-math module whose `half4` gradient a pipeline blends). + /// The notice a draw into such a target may announce, which loosens no code (every texel + /// still compares exactly): `half-output-fast-math-blend` (the fixture is a fast-math module + /// whose `half4` gradient a pipeline blends). fn allowances(&self) -> Vec { - vec![ - crate::replay::shared_memory_notice(), - crate::replay::notice_allowance(Degradation::HalfOutputFastMathBlend.code()), - ] + vec![crate::replay::notice_allowance( + Degradation::HalfOutputFastMathBlend.code(), + )] } fn shaders(&self) -> Result, String> { diff --git a/crates/metal2vulkan-conformance/src/cases/extended_range_targets.rs b/crates/metal2vulkan-conformance/src/cases/extended_range_targets.rs index 8a248dac5..15d0d086c 100644 --- a/crates/metal2vulkan-conformance/src/cases/extended_range_targets.rs +++ b/crates/metal2vulkan-conformance/src/cases/extended_range_targets.rs @@ -593,20 +593,8 @@ impl Case for TargetDraw { } fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 22 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - let mut named = vec![crate::replay::shared_memory_notice()]; if !self.half { - return named; + return Vec::new(); } // `rt6_samples` is a fast-math module, so a pipeline that stores its `half4` fill into a // color attachment announces that the half output's rounding into the attachment may not be @@ -617,10 +605,9 @@ impl Case for TargetDraw { // allowance fails the case if the notice stops firing, so it cannot outlive its reason. The // `float4` fill of the same outputs announces nothing and carries no allowance, which is // what makes the pairing worth recording. - named.push(crate::replay::notice_allowance( + vec![crate::replay::notice_allowance( Degradation::HalfOutputFastMathBlend.code(), - )); - named + )] } fn shaders(&self) -> Result, String> { @@ -788,21 +775,6 @@ impl Case for ClearTexels { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 22 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs(PLANES, &[READ_FLOAT]) } @@ -1042,26 +1014,13 @@ impl Case for ClearRoutes { } fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 22 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - let mut named = vec![crate::replay::shared_memory_notice()]; // On a venue that presents no texture compression the blit that reads `plain-16` back, // through the texture the recording's Mac compressed, keeps the device's encoding where // the recording holds the compressor's canonical one, and the runtime rewrites none // under the suite's exact policy (`compressed_blits`'s declaration says why). Measured on // the RTX 5080 Laptop: `case/plain-16/texels/*` alone differ against the recording with // the key and matched before it. - named.push(crate::replay::without_compression("plain-16")); - named + vec![crate::replay::without_compression("plain-16")] } fn shaders(&self) -> Result, String> { diff --git a/crates/metal2vulkan-conformance/src/cases/extended_range_two_planes.rs b/crates/metal2vulkan-conformance/src/cases/extended_range_two_planes.rs index a09ee66e5..a5da837d2 100644 --- a/crates/metal2vulkan-conformance/src/cases/extended_range_two_planes.rs +++ b/crates/metal2vulkan-conformance/src/cases/extended_range_two_planes.rs @@ -418,17 +418,6 @@ impl Case for ExtendedRangeTwoPlanes { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the notices - // site alone: every value of this family still compares against Metal's exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09), where it fired for all 2 rows of the family - // and each row was divergent on that field and nothing else (replay-nvidia.log). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for entry in ENTRIES { diff --git a/crates/metal2vulkan-conformance/src/cases/extended_swizzles.rs b/crates/metal2vulkan-conformance/src/cases/extended_swizzles.rs index be438caa7..eaf795544 100644 --- a/crates/metal2vulkan-conformance/src/cases/extended_swizzles.rs +++ b/crates/metal2vulkan-conformance/src/cases/extended_swizzles.rs @@ -359,8 +359,8 @@ impl Case for ExtendedSwizzles { MetalSource::Run } - /// The venue's memory model, and for a format the module filters itself the device's - /// arithmetic of that filter (`bicubic-filter-arithmetic`). + /// For a format the module filters itself, the device's arithmetic of that filter + /// (`bicubic-filter-arithmetic`). /// /// Each op reads every lane of its sweep in one dispatch, in groups of at most 64 threads, and /// no lane count here is a whole number of such groups. @@ -371,18 +371,6 @@ impl Case for ExtendedSwizzles { /// tolerance. `every_recorded_swizzle_is_the_unswizzled_texture_swizzled` and /// `every_recorded_packed_read_is_metals_rule` hold those words to Metal's own answers. fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 15 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - // // An extended-range or padded 10-bit format's linear sample (`sl`) blends its decoded taps // in the device's arithmetic, announced as `bicubic-filter-arithmetic` (the M3 Max, each // of the four extended-range formats); its values move by it (`known-gaps.tsv`). @@ -391,10 +379,7 @@ impl Case for ExtendedSwizzles { // the runtime's pipelines note as scaled (`crate::replay::pixel_sampler_scaling_notice` // holds why). Measured through the rt side on lavapipe, the Radeon 780M and the RX 550: // it fired for every row the side does not refuse (the four 16-bit packed formats). - let mut named = vec![ - crate::replay::shared_memory_notice(), - crate::replay::pixel_sampler_scaling_notice(), - ]; + let mut named = vec![crate::replay::pixel_sampler_scaling_notice()]; if matches!( self.format().format, PixelFormat::BGRA10XR diff --git a/crates/metal2vulkan-conformance/src/cases/fence_orders.rs b/crates/metal2vulkan-conformance/src/cases/fence_orders.rs index 4bd1d38de..74498b993 100644 --- a/crates/metal2vulkan-conformance/src/cases/fence_orders.rs +++ b/crates/metal2vulkan-conformance/src/cases/fence_orders.rs @@ -91,11 +91,7 @@ impl Case for FenceOrderCase { } fn allowances(&self) -> Vec { - // X and Y are `Shared` buffers the answer is read back out of, and on a device without - // unified memory the runtime announces `shared-in-system-memory` for them - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the notices - // site alone: every word count and status still compares exactly. - let mut allowances = vec![crate::replay::shared_memory_notice()]; + let mut allowances = Vec::new(); // Behind one busy command buffer, the runtime's 1024 is its structure: a writer whose // queue has fewer than three submissions in flight is submitted at once, so the later copy // on another queue reads every word, on every device and run, the order Apple describes diff --git a/crates/metal2vulkan-conformance/src/cases/fetch_ordered.rs b/crates/metal2vulkan-conformance/src/cases/fetch_ordered.rs index d5dccd8cd..b3fe49e14 100644 --- a/crates/metal2vulkan-conformance/src/cases/fetch_ordered.rs +++ b/crates/metal2vulkan-conformance/src/cases/fetch_ordered.rs @@ -257,27 +257,14 @@ impl Case for FetchOrdered { // which is the owner's rule for this family: if Metal allows it we must allow it, so a // byte that differs is a bug and a refusal is a bug, and neither gets a tolerance here. // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 4 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - // // A venue with neither ordered fetch form (no rasterization-order attachment access, no // pixel interlock) reads the input attachment ordered between draws alone and announces // `unordered-fetch-within-draw`, a precision note of what it leaves unordered: overlapping // fragments of one draw. Each draw here is one fullscreen triangle, which overlaps itself // nowhere, so every byte still compares exactly. - vec![ - crate::replay::shared_memory_notice(), - crate::replay::notice_allowance(Degradation::UnorderedFetchWithinDraw.code()), - ] + vec![crate::replay::notice_allowance( + Degradation::UnorderedFetchWithinDraw.code(), + )] } fn shaders(&self) -> Result, String> { diff --git a/crates/metal2vulkan-conformance/src/cases/format_copies.rs b/crates/metal2vulkan-conformance/src/cases/format_copies.rs index 6db9d42ff..9e90721e8 100644 --- a/crates/metal2vulkan-conformance/src/cases/format_copies.rs +++ b/crates/metal2vulkan-conformance/src/cases/format_copies.rs @@ -29,7 +29,6 @@ //! Nothing here can fault a GPU: blit copies between textures the program makes, of formats whose //! copy unit matches, no dispatch, no draw and no loop. -use crate::allowance::Allowance; use crate::case::{made, Abort, Case, Failure, Input, MetalSource, Side}; use crate::transcript::{ByteLayout, Element, Observed, Sites, Value}; use crate::work::{Plane, Resource, Step, TextureSpec, Work}; @@ -298,25 +297,6 @@ impl Case for FormatCopies { MetalSource::Run } - fn allowances(&self) -> Vec { - // A device that flushes denormal depth values announces `depth-denormals`, and a - // `Depth32Float` texture is where that shows (lavapipe does; this Mac does not). It is the - // device's own answer, which the suite declares for every case - // (`crate::replay::NATIVE_NOTES`), and the bytes the copies moved still compare exactly. - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 16 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn inputs(&self) -> Result, String> { let pair = self.pair(); Ok(vec![ diff --git a/crates/metal2vulkan-conformance/src/cases/format_footprints.rs b/crates/metal2vulkan-conformance/src/cases/format_footprints.rs index 4510de85a..e2bb143f8 100644 --- a/crates/metal2vulkan-conformance/src/cases/format_footprints.rs +++ b/crates/metal2vulkan-conformance/src/cases/format_footprints.rs @@ -315,16 +315,6 @@ pub struct FootprintCase { /// The formats a round trip runs for, in order. Empty where Metal makes no texture of any /// format of the case. round_trips: Vec, - /// Whether the runtime makes a `Shared` texture buffer of one of the case's formats: the - /// buffer under it is `Shared` memory, which a device without unified memory places in system - /// memory and announces (`shared-in-system-memory`). Measured on the RTX 5080 Laptop - /// (615.71.09): the plain stragglers' case announced it in the whole-set replay. Measured on - /// the RX 7900 XTX (RADV NAVI31, the round's replay at 6898863f3f): the one-plane YCbCr and - /// padded wide-channel cases announced it too, the runtime now making their formats' - /// `Shared` texture buffers as Metal makes them, and no other case of the family did: the - /// ASTC formats take no texture buffer, the two-plane ones are refused and the packed ones - /// nil. - shared_texture_buffers: bool, } /// Every case of the family. @@ -386,7 +376,6 @@ fn case_over( } else { Vec::new() }, - shared_texture_buffers: false, } } @@ -401,7 +390,6 @@ fn astc_footprints() -> FootprintCase { /// answers are what a reader compares the rest of the family against. fn plain_stragglers() -> FootprintCase { FootprintCase { - shared_texture_buffers: true, ..case_over(PLAIN_STRAGGLERS, &PLAIN, &all_types(), true) } } @@ -410,7 +398,6 @@ fn plain_stragglers() -> FootprintCase { /// **no texture**. fn one_plane_ycbcr() -> FootprintCase { FootprintCase { - shared_texture_buffers: true, ..case_over(ONE_PLANE_YCBCR, &ONE_PLANE, &all_types(), true) } } @@ -419,7 +406,6 @@ fn one_plane_ycbcr() -> FootprintCase { /// `*10A2Unorm` ones. fn padded_wide_channels() -> FootprintCase { FootprintCase { - shared_texture_buffers: true, ..case_over(PADDED_WIDE_CHANNELS, &PADDED, &all_types(), true) } } @@ -570,23 +556,18 @@ impl Case for FootprintCase { } fn allowances(&self) -> Vec { - let mut named = Vec::new(); - // A `Shared` texture buffer's own buffer, on a device without unified memory - // (`crate::replay::shared_memory_notice` holds the whole reason). It loosens the notices - // site alone: the case reads bytes, every one compared with Metal's exactly. - if self.shared_texture_buffers { - named.push(crate::replay::shared_memory_notice()); - } // The runtime's answers are the device's own, held by their property and not by // Metal's numbers (`texture_query::DEVICE_OWN_SIZES`). - named.extend(self.queries.iter().map(|query| { - Allowance::new( - format!("case/{}/{}/Ok/*", query.site(), site::QUERY), - Loosening::Unchecked, - Justification::accepted(crate::texture_query::DEVICE_OWN_SIZES), - ) - })); - named + self.queries + .iter() + .map(|query| { + Allowance::new( + format!("case/{}/{}/Ok/*", query.site(), site::QUERY), + Loosening::Unchecked, + Justification::accepted(crate::texture_query::DEVICE_OWN_SIZES), + ) + }) + .collect() } fn inputs(&self) -> Result, String> { diff --git a/crates/metal2vulkan-conformance/src/cases/frame_chains.rs b/crates/metal2vulkan-conformance/src/cases/frame_chains.rs index 1c0edbd0b..9a0438573 100644 --- a/crates/metal2vulkan-conformance/src/cases/frame_chains.rs +++ b/crates/metal2vulkan-conformance/src/cases/frame_chains.rs @@ -212,27 +212,10 @@ impl Case for FrameChain { // is the device's own answer, which the suite declares for every case // (`crate::replay::NATIVE_NOTES`). // - // Measured: it fires on lavapipe and not on MoltenVK on this M3 Max, and on lavapipe every - // word of this case's chain compared **exactly** -- the whole difference was the announcement. - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // this case, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - // // Its samples are through a runtime sampler slot, which the runtime's pipelines note // as scaled (`crate::replay::pixel_sampler_scaling_notice` holds why, and the run it // rests on). - vec![ - crate::replay::shared_memory_notice(), - crate::replay::pixel_sampler_scaling_notice(), - ] + vec![crate::replay::pixel_sampler_scaling_notice()] } fn shaders(&self) -> Result, String> { diff --git a/crates/metal2vulkan-conformance/src/cases/fresh_contents.rs b/crates/metal2vulkan-conformance/src/cases/fresh_contents.rs index f70d667df..936257a66 100644 --- a/crates/metal2vulkan-conformance/src/cases/fresh_contents.rs +++ b/crates/metal2vulkan-conformance/src/cases/fresh_contents.rs @@ -47,10 +47,6 @@ //! compression. The `written` site, the statuses and every `Shared` and `Managed` row still compare //! exactly there. //! -//! Every row names one notice, and it belongs to the venue rather than to any row: the declaration -//! [`crate::replay::shared_memory_notice`] carries, the notice a device without unified memory -//! announces for the `Shared` buffer each row reads its answer back through. -//! //! # Why one process is the right place for this, and more than the lane had //! @@ -230,19 +226,6 @@ pub struct FreshBuffers { storage: Storage, } -/// The notice every row of this family announces on a device without unified memory: each row -/// reads its answer back through a `Shared` buffer ([`crate::replay::shared_memory_notice`], which -/// holds the whole reason). -/// -/// Measured on the **RTX 5080 Laptop (615.71.09)**: it fired for all 87 rows of the family, and -/// each row read `divergent` on that one field and nothing else -/// (`replay-nvidia.log`, "we announced the degrade notice -/// metal2vulkan-degrade-shared-in-system-memory, which the case declares nowhere"). MoltenVK and -/// lavapipe announce it for no row of the family. -fn shared_memory_notice() -> Allowance { - crate::replay::shared_memory_notice() -} - impl Case for FreshBuffers { fn name(&self) -> &'static str { self.case @@ -252,10 +235,6 @@ impl Case for FreshBuffers { MetalSource::Run } - fn allowances(&self) -> Vec { - vec![shared_memory_notice()] - } - fn inputs(&self) -> Result, String> { let mut words = vec![OLD, BEFORE]; words.extend(self.storage.word().as_bytes()); @@ -1085,13 +1064,12 @@ impl Case for FreshTexture { } fn allowances(&self) -> Vec { - let mut allowances = vec![shared_memory_notice()]; + let mut allowances = Vec::new(); // A new `Private` texture on a device that presents no texture compression holds what // its memory held (the module docs). Expected, not yet run: no such venue replayed it. if self.row.storage == Storage::Private { allowances.push(crate::replay::without_compression("fresh")); } - // A shape of blocks more than one texel square (`BC1_RGBA`) is a block-compressed // texture, whose device decode the runtime announces where it makes it // (`compressed-texel-decode`). At the notices site alone: the case reads bytes. @@ -1347,12 +1325,9 @@ impl Case for FreshPattern { // compressed: the note of the encoding the device's copy keeps, where it is not native // (`compressed_blits::kept_encoding_notice`). The pattern's bytes are each format's // canonical encoding, so every value still compares exactly. - let mut allowances = vec![ - shared_memory_notice(), - // A new `Private` texture on a device that presents no texture compression holds - // what its memory held, never the pattern (the module docs). Expected, not yet run. - crate::replay::without_compression("fresh"), - ]; + // A new `Private` texture on a device that presents no texture compression holds what its + // memory held, never the pattern (the module docs). Expected, not yet run. + let mut allowances = vec![crate::replay::without_compression("fresh")]; allowances.extend(super::compressed_blits::kept_encoding_notice( self.row.format, )); @@ -1458,10 +1433,6 @@ impl Case for FreshOverBuffer { MetalSource::Run } - fn allowances(&self) -> Vec { - vec![shared_memory_notice()] - } - fn inputs(&self) -> Result, String> { let mut words = self.shape().words(); words.extend(self.storage.word().as_bytes()); @@ -1505,7 +1476,6 @@ pub fn all() -> Vec> { #[cfg(test)] mod tests { use super::*; - use crate::allowance::Justification; use std::collections::BTreeSet; /// The runs the recorded site at `path` holds, rebuilt into the bytes they encode. @@ -2056,39 +2026,18 @@ mod tests { /// that presents no texture compression, and nothing else.** On a venue that presents the /// compression (MoltenVK, lavapipe) every byte compares exactly: the one value declaration, /// [`crate::replay::without_compression`], justifies nothing there. - /// - /// Every row names [`shared_memory_notice`], which is the venue's memory model and not the - /// row's; every `Private` texture row and every pattern row names the value declaration at its - /// `fresh` site, and no `Shared` or `Managed` row, buffer row or texture over a buffer does; - /// **only** the pattern row whose read blits out of a texture Metal keeps compressed in a - /// format whose canonical encoding the device's copy may keep apart from Metal's - /// (`RGB9E5Float`) names a further notice, and a block-compressed texture row declares - /// `compressed-texel-decode`, which `metal2vulkan-runtime` announces for every such texture. A row - /// whose notices were a guess would show here as a row loosening a site nothing needed. #[test] fn a_row_loosens_the_notices_site_and_a_private_texture_s_fresh_site() { let notices = format!("case/{}/*", crate::replay::NOTICES_SITE); let fresh = crate::replay::without_compression("fresh"); - let shared = crate::degradation::Degradation::SharedInSystemMemory - .code() - .to_owned(); for case in all() { - let allowances = case.allowances(); - for allowance in &allowances { + for allowance in &case.allowances() { assert!( allowance.path == notices || *allowance == fresh, "{}: {allowance:?}", case.name() ); } - // The venue's notice is the one every row declares, and it is declared exactly once. - let declared = allowances - .iter() - .filter(|allowance| { - allowance.justified_by == Justification::Degradation(shared.clone()) - }) - .count(); - assert_eq!(declared, 1, "{}", case.name()); } for row in TEXTURES { let private = row.storage == Storage::Private; @@ -2096,7 +2045,7 @@ mod tests { let allowances = FreshTexture { row }.allowances(); assert_eq!( allowances.len(), - 1 + usize::from(private) + usize::from(compressed), + usize::from(private) + usize::from(compressed), "{}", row.case ); @@ -2110,25 +2059,23 @@ mod tests { ); assert_eq!(allowances.contains(&fresh), private, "{}", row.case); } - // Everything else is held to Metal exactly, the venue's own notice apart. + // Everything else is held to Metal exactly. for (case, storage) in BUFFERS { - assert_eq!( - FreshBuffers { case, storage }.allowances().len(), - 1, + assert!( + FreshBuffers { case, storage }.allowances().is_empty(), "{case}" ); } for (case, storage) in OVER_BUFFERS { - assert_eq!( - FreshOverBuffer { case, storage }.allowances().len(), - 1, + assert!( + FreshOverBuffer { case, storage }.allowances().is_empty(), "{case}" ); } for row in PATTERNS { let kept = row.case == "fresh-pattern-93"; let allowances = FreshPattern { row }.allowances(); - assert_eq!(allowances.len(), 2 + usize::from(kept), "{}", row.case); + assert_eq!(allowances.len(), 1 + usize::from(kept), "{}", row.case); assert!(allowances.contains(&fresh), "{}", row.case); } } diff --git a/crates/metal2vulkan-conformance/src/cases/function_constants_half3.rs b/crates/metal2vulkan-conformance/src/cases/function_constants_half3.rs index 82a9a17c9..d1cd1a904 100644 --- a/crates/metal2vulkan-conformance/src/cases/function_constants_half3.rs +++ b/crates/metal2vulkan-conformance/src/cases/function_constants_half3.rs @@ -88,12 +88,6 @@ impl Case for FunctionConstantsHalf3 { MetalSource::Run } - fn allowances(&self) -> Vec { - // The output is a `Shared` buffer, so a device without unified memory announces - // `shared-in-system-memory` (`crate::replay::shared_memory_notice` holds the whole reason). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for extension in [RUNTIME_TEXT, METAL_TEXT] { diff --git a/crates/metal2vulkan-conformance/src/cases/half_output_blends.rs b/crates/metal2vulkan-conformance/src/cases/half_output_blends.rs index 47ea40ae1..93671f9db 100644 --- a/crates/metal2vulkan-conformance/src/cases/half_output_blends.rs +++ b/crates/metal2vulkan-conformance/src/cases/half_output_blends.rs @@ -419,21 +419,9 @@ impl Case for HalfOutputBlends { // device's own answers, which the suite declares for every case // (`crate::replay::NATIVE_NOTES`), and neither loosens a stored code. The rows stay // divergent on their texels, on both venues. - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 6 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![ - crate::replay::shared_memory_notice(), - crate::replay::notice_allowance(Degradation::HalfOutputFastMathBlend.code()), - ] + vec![crate::replay::notice_allowance( + Degradation::HalfOutputFastMathBlend.code(), + )] } fn shaders(&self) -> Result, String> { diff --git a/crates/metal2vulkan-conformance/src/cases/half_read_nans.rs b/crates/metal2vulkan-conformance/src/cases/half_read_nans.rs index 01a46404a..acb1a7f24 100644 --- a/crates/metal2vulkan-conformance/src/cases/half_read_nans.rs +++ b/crates/metal2vulkan-conformance/src/cases/half_read_nans.rs @@ -269,25 +269,11 @@ impl Case for HalfReadNans { // decode of a half NaN is not Metal's, and it is deliberately **not** named here: it fired // on neither venue of this round, and an allowance no run justified is a claim without // evidence. A venue that needs it adds it with the run that shows it. - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 6 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. // // Its samples are through a runtime sampler slot, which the runtime's pipelines note // as scaled (`crate::replay::pixel_sampler_scaling_notice` holds why, and the run it // rests on). - vec![ - crate::replay::shared_memory_notice(), - crate::replay::pixel_sampler_scaling_notice(), - ] + vec![crate::replay::pixel_sampler_scaling_notice()] } fn shaders(&self) -> Result, String> { diff --git a/crates/metal2vulkan-conformance/src/cases/half_storage_writes.rs b/crates/metal2vulkan-conformance/src/cases/half_storage_writes.rs index 286967040..3f2844d27 100644 --- a/crates/metal2vulkan-conformance/src/cases/half_storage_writes.rs +++ b/crates/metal2vulkan-conformance/src/cases/half_storage_writes.rs @@ -39,7 +39,6 @@ //! Nothing here can fault a GPU: one compute pass, one texture, one thread a texel inside it, no //! loop and no sampling. -use crate::allowance::Allowance; use crate::case::{ call, made, Abort, ArgumentSlot, Bindings, Case, Failure, Handle, Input, MetalSource, Side, TextureRole, TextureSpec, @@ -299,21 +298,6 @@ impl Case for HalfStorageWrites { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 9 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for extension in [RUNTIME_TEXT, METAL_TEXT] { diff --git a/crates/metal2vulkan-conformance/src/cases/half_texel_nans.rs b/crates/metal2vulkan-conformance/src/cases/half_texel_nans.rs index bf5c45168..e077dc638 100644 --- a/crates/metal2vulkan-conformance/src/cases/half_texel_nans.rs +++ b/crates/metal2vulkan-conformance/src/cases/half_texel_nans.rs @@ -83,7 +83,6 @@ //! Nothing here can fault a GPU: one compute pass, one texture, one thread a texel inside it, no //! loop and no coordinate outside the texture. -use crate::allowance::Allowance; use crate::case::{ call, made, Abort, Bindings, Case, Failure, Input, MetalSource, Side, TextureRole, TextureSpec, }; @@ -349,28 +348,6 @@ impl Case for HalfTexelNans { MetalSource::Run } - fn allowances(&self) -> Vec { - // The device's NaN encoding of a `half` result of a float texel (`device-nan-encoding`) is - // its own answer, which the suite declares for every case (`crate::replay::NATIVE_NOTES`), - // and nothing loosens a stored half: the note's own definition in `pipeline/artifact.rs` - // ends "Validation derives no tolerance from it", so a tolerance written from it would be - // this suite overruling the contract it exists to test. The three 16-bit float formats are - // therefore left **divergent** on this round's MoltenVK, with the measured difference in - // the module docs above. - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 8 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for extension in [RUNTIME_TEXT, METAL_TEXT] { diff --git a/crates/metal2vulkan-conformance/src/cases/half_write_nans.rs b/crates/metal2vulkan-conformance/src/cases/half_write_nans.rs index 6567d5dea..bfb91478a 100644 --- a/crates/metal2vulkan-conformance/src/cases/half_write_nans.rs +++ b/crates/metal2vulkan-conformance/src/cases/half_write_nans.rs @@ -26,7 +26,6 @@ //! Nothing here can fault a GPU: one compute pass, one texture, one thread a texel inside it, no //! loop and no sampling. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Bindings, Case, Failure, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -207,27 +206,6 @@ impl Case for HalfWriteNans { MetalSource::Run } - fn allowances(&self) -> Vec { - // The kernel writes `half` into a storage texture, and every stored word compares exactly - // whatever the device does. A format that cannot hold a NaN's bits (a channel narrower - // than the half it is given has no room for the payload) stores the device's own encoding - // and the runtime announces it (`device-nan-encoding`), the device's own answer, which the - // suite declares for every case (`crate::replay::NATIVE_NOTES`). A device that encodes its - // own way shows the word it stored beside Metal's rather than passing quietly. - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 7 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for extension in [RUNTIME_TEXT, METAL_TEXT] { diff --git a/crates/metal2vulkan-conformance/src/cases/handler_waits.rs b/crates/metal2vulkan-conformance/src/cases/handler_waits.rs index 66224119c..26d732b7b 100644 --- a/crates/metal2vulkan-conformance/src/cases/handler_waits.rs +++ b/crates/metal2vulkan-conformance/src/cases/handler_waits.rs @@ -151,17 +151,6 @@ impl Case for OwnHandlerWait { MetalSource::did_not_return(PROBED_IN, self.wait.site(), self.says) } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the notices - // site alone: every value of this family still compares against Metal's exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09), where it fired for all 3 rows of the family - // and each row was divergent on that field and nothing else (replay-nvidia.log). - vec![crate::replay::shared_memory_notice()] - } - fn inputs(&self) -> Result, String> { Ok(vec![ Input::bytes("wait", &self.wait.words()), diff --git a/crates/metal2vulkan-conformance/src/cases/heap_facts.rs b/crates/metal2vulkan-conformance/src/cases/heap_facts.rs index 04277de1a..de758dc9f 100644 --- a/crates/metal2vulkan-conformance/src/cases/heap_facts.rs +++ b/crates/metal2vulkan-conformance/src/cases/heap_facts.rs @@ -379,17 +379,6 @@ impl Case for HeapFactsCase { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the notices - // site alone: every value of this family still compares against Metal's exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09), where it fired for all 5 rows of the family - // and each row was divergent on that field and nothing else (replay-nvidia.log). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { // Nothing here compiles: every answer is a getter of a heap or of a buffer placed in one. Ok(Vec::new()) diff --git a/crates/metal2vulkan-conformance/src/cases/heap_metal_sizes.rs b/crates/metal2vulkan-conformance/src/cases/heap_metal_sizes.rs index a5c31ef86..6ab97c798 100644 --- a/crates/metal2vulkan-conformance/src/cases/heap_metal_sizes.rs +++ b/crates/metal2vulkan-conformance/src/cases/heap_metal_sizes.rs @@ -355,11 +355,6 @@ impl Case for HeapSizeCase { } fn allowances(&self) -> Vec { - // The family reads no buffer back -- it asks the device for a heap texture's size and - // alignment -- so the notice a card without unified memory announces for a `Shared` buffer - // cannot reach it, and no row declares one. Measured: five of the seven rows were exact on - // both the 5080 and llvmpipe. - // // The runtime's answers are the device's own, held by their property and not by // Metal's numbers (`texture_query::DEVICE_OWN_SIZES`). self.queries diff --git a/crates/metal2vulkan-conformance/src/cases/host_page_writes.rs b/crates/metal2vulkan-conformance/src/cases/host_page_writes.rs index 8279beac2..558741f65 100644 --- a/crates/metal2vulkan-conformance/src/cases/host_page_writes.rs +++ b/crates/metal2vulkan-conformance/src/cases/host_page_writes.rs @@ -118,7 +118,6 @@ //! dispatch of 64 threads, no loop, two command buffers over 16 KiB of memory committed and waited //! for. The shapes that do fault are measured in the probe and are deliberately absent. -use crate::allowance::Allowance; use crate::case::{ call, drawn_or_refused, made, Abort, Case, Failure, Handle, Input, MetalSource, Side, }; @@ -434,26 +433,6 @@ impl Case for HostPageWrite { RUNS } - fn allowances(&self) -> Vec { - // **One declaration per code a venue was measured announcing for this row**, and nothing - // else. A notice our side announces that this list does not name is a divergence at the - // notices site; a code this list names that no run announces is an unfired allowance, - // which is noise the tally exists to show. So this is a measured set and not a guess. - // - // The two **drawing** rows' `fast-math-rewrites` (the arithmetic of `rt6_render_state`'s - // vertex function, which is the fixture, not this family's subject) is the suite's - // (`crate::replay::NATIVE_NOTES`), declared by no row. - // - // `shared-in-system-memory` is every row's and belongs to the venue, not to this family: - // each row reads its pages back through a `Shared` buffer - // (`crate::replay::shared_memory_notice`). Announced by all four on the 5080. - // - // **None of these loosens a byte**, and that matters most here: the read-only rows' pages, - // and what a later command buffer reads of them, are this family's whole subject. Those - // bytes stay compared exactly. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let fixture = Fixture::new(self.row.shape.fixture()); let entry = self.row.shape.entry(); diff --git a/crates/metal2vulkan-conformance/src/cases/indirect_command_depth.rs b/crates/metal2vulkan-conformance/src/cases/indirect_command_depth.rs index e3c9e583d..d22c8dee4 100644 --- a/crates/metal2vulkan-conformance/src/cases/indirect_command_depth.rs +++ b/crates/metal2vulkan-conformance/src/cases/indirect_command_depth.rs @@ -485,20 +485,7 @@ impl Case for PatchDraws { } fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 6 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - std::iter::once(crate::replay::shared_memory_notice()) - .chain(tessellation_notices()) - .collect() + tessellation_notices() } fn shaders(&self) -> Result, String> { @@ -839,21 +826,6 @@ impl Case for InheritedState { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 6 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of(RENDER_FIXTURE, RENDER_FIXTURE) } @@ -1216,21 +1188,6 @@ impl Case for ResetRanges { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 6 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of(COMPUTE_FIXTURE, COMPUTE_FIXTURE) } @@ -1553,21 +1510,6 @@ impl Case for PassStateCommands { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 6 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of(DRAW_FIXTURE, "tob_solid") } @@ -1819,21 +1761,6 @@ impl Case for ResidencyUsage { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 6 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of(COMPUTE_FIXTURE, COMPUTE_FIXTURE) } @@ -2013,21 +1940,6 @@ impl Case for BindLimits { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // all 6 rows of the family, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of(COMPUTE_FIXTURE, COMPUTE_FIXTURE) } diff --git a/crates/metal2vulkan-conformance/src/cases/indirect_commands.rs b/crates/metal2vulkan-conformance/src/cases/indirect_commands.rs index 8bfbbe060..2930cb09d 100644 --- a/crates/metal2vulkan-conformance/src/cases/indirect_commands.rs +++ b/crates/metal2vulkan-conformance/src/cases/indirect_commands.rs @@ -78,7 +78,6 @@ //! - **`gpuResourceID`** and the rows a kernel encodes are [`super::mesh_commands`]' gap, named //! there. -use crate::allowance::Allowance; use crate::case::STAGE_OBJECT; use crate::case::{ call, made, Abort, Case, Failure, Handle, Input, MeshFunctions, MetalSource, Side, @@ -423,21 +422,6 @@ impl Case for ComputeCommands { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // the 5 rows of the family the card could run, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of(COMPUTE_FIXTURE, COMPUTE_FIXTURE) } @@ -611,13 +595,6 @@ impl Case for ImageblockCommands { MetalSource::Run } - fn allowances(&self) -> Vec { - // As every row of the family: the answer is read back through a `Shared` buffer, so a - // device without unified memory announces `shared-in-system-memory` and the declaration - // covers the notices site alone, leaving every value compared exactly. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of(IMAGEBLOCK_FIXTURE, IMAGEBLOCK_FIXTURE) } @@ -811,21 +788,6 @@ impl Case for StageInCommand { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // the 5 rows of the family the card could run, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of(STAGE_IN_FIXTURE, STAGE_IN_FIXTURE) } @@ -1050,21 +1012,6 @@ impl Case for RenderCommands { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // the 5 rows of the family the card could run, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of(RENDER_FIXTURE, RENDER_FIXTURE) } @@ -1281,16 +1228,6 @@ impl Case for ObjectLengthCommands { MetalSource::Run } - fn allowances(&self) -> Vec { - // A mesh pass's notices, plus the host step a device announces for commands it draws - // itself, both named by kind in `mesh_draws`; and the shared-memory note every row of this - // family carries, since the answer is read back through a `Shared` buffer. Each declares a - // notices site alone, so every value still compares against Metal's exactly. - let mut allowances = super::mesh_draws::mesh_notice_allowances(); - allowances.push(crate::replay::shared_memory_notice()); - allowances - } - fn shaders(&self) -> Result, String> { shaders_of(OBJECT_LENGTH_FIXTURE, OBJECT_LENGTH_FUNCTIONS.mesh) } @@ -1571,13 +1508,6 @@ impl Case for StrideCommands { MetalSource::Run } - fn allowances(&self) -> Vec { - // As every row of the family: the answer is read back through a `Shared` buffer, so a - // device without unified memory announces `shared-in-system-memory` and the declaration - // covers the notices site alone, leaving every value compared exactly. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of(STRIDE_FIXTURE, STRIDE_FIXTURE) } @@ -1845,21 +1775,6 @@ impl Case for DrawnCommands { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // the 5 rows of the family the card could run, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of(DRAW_FIXTURE, "tob_solid") } @@ -2085,14 +2000,6 @@ impl Case for DescriptorProperties { MetalSource::Run } - fn allowances(&self) -> Vec { - // Nothing: the case reads a descriptor's own properties back, never a buffer, so the - // notice a card without unified memory announces for a `Shared` buffer cannot reach it. - // Measured exact on the RTX 5080 Laptop (615.71.09) and on llvmpipe, which is why it - // declares nothing where the other five rows of the family declare the venue's notice. - Vec::new() - } - fn shaders(&self) -> Result, String> { Ok(Vec::new()) } diff --git a/crates/metal2vulkan-conformance/src/cases/indirect_private_types.rs b/crates/metal2vulkan-conformance/src/cases/indirect_private_types.rs index eb6e9e5be..3b3278fa8 100644 --- a/crates/metal2vulkan-conformance/src/cases/indirect_private_types.rs +++ b/crates/metal2vulkan-conformance/src/cases/indirect_private_types.rs @@ -141,17 +141,6 @@ impl Case for IndirectPrivateTypes { MetalSource::carried_only(MEASURED_IN, NO_PUBLIC_CALL) } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the notices - // site alone: every value of this family still compares against Metal's exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09), where it fired for all this case - // and each row was divergent on that field and nothing else (replay-nvidia.log). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { Ok(Vec::new()) } diff --git a/crates/metal2vulkan-conformance/src/cases/int_attributes.rs b/crates/metal2vulkan-conformance/src/cases/int_attributes.rs index 786dcf7e0..1ede666ac 100644 --- a/crates/metal2vulkan-conformance/src/cases/int_attributes.rs +++ b/crates/metal2vulkan-conformance/src/cases/int_attributes.rs @@ -32,7 +32,6 @@ //! Nothing here can fault a GPU: no rasterization, no attachment, eight points a draw, and every //! fetch is inside a record the case bound. -use crate::allowance::Allowance; use crate::case::{ call, drawn_or_refused, made, Abort, Case, Failure, Handle, Input, MetalSource, Side, }; @@ -205,25 +204,6 @@ impl Case for IntAttributes { MetalSource::Run } - fn allowances(&self) -> Vec { - // No value: Metal's conversion of an integer format to a float attribute is exact, and - // both step functions must answer the same values on any device. A row that differs is a - // bug in the fetch, not a tolerance. - // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the - // notices site alone, so every value of this family still compares against Metal's - // exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09): it fired for - // this case, and each was divergent on that field and - // nothing else (replay-nvidia.log). On MoltenVK, where - // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no - // recording of this suite declares it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for (entry, _) in CONVERSIONS { diff --git a/crates/metal2vulkan-conformance/src/cases/layered_targets.rs b/crates/metal2vulkan-conformance/src/cases/layered_targets.rs index f8e5c260f..5b983b4b5 100644 --- a/crates/metal2vulkan-conformance/src/cases/layered_targets.rs +++ b/crates/metal2vulkan-conformance/src/cases/layered_targets.rs @@ -76,7 +76,6 @@ //! target and the suite counts the resolve case [`LacksFeature`](crate::verdict::Verdict::LacksFeature) //! rather than leaving it uncompared. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -883,20 +882,6 @@ impl Case for LayeredTargets { RUNS } - fn allowances(&self) -> Vec { - // **No value here is loosened, the resolve case included.** Every texel Metal leaves is - // one we must leave. What is declared is the notice set, which this M3 Max's own run holds - // empty and a driver that is not Metal does not. - // - // `shared-in-system-memory` is every row's and belongs to the venue, not to the case: - // every row reads its texels back through a `Shared` buffer, and a device without unified - // memory holds that buffer in host-cached system memory - // (`crate::replay::shared_memory_notice`). Measured on the RTX 5080 Laptop (615.71.09), - // where all five rows announced it with the case declaring it nowhere and each was - // divergent on that field and nothing else (replay-nvidia.log). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut refs = Vec::new(); for (fixture, vertex, fragment) in self.functions() { diff --git a/crates/metal2vulkan-conformance/src/cases/level_sizes.rs b/crates/metal2vulkan-conformance/src/cases/level_sizes.rs index 79731c9e5..17b8e5f04 100644 --- a/crates/metal2vulkan-conformance/src/cases/level_sizes.rs +++ b/crates/metal2vulkan-conformance/src/cases/level_sizes.rs @@ -153,17 +153,6 @@ impl Case for LevelSizes { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the notices - // site alone: every value of this family still compares against Metal's exactly. - // - // Measured on the RTX 5080 Laptop (615.71.09), where it fired for all 2 rows of the family - // and each row was divergent on that field and nothing else (replay-nvidia.log). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let fixture = self.which.fixture(); [RUNTIME_TEXT, METAL_TEXT] diff --git a/crates/metal2vulkan-conformance/src/cases/math_routines.rs b/crates/metal2vulkan-conformance/src/cases/math_routines.rs index 77cba05cb..1b92344f7 100644 --- a/crates/metal2vulkan-conformance/src/cases/math_routines.rs +++ b/crates/metal2vulkan-conformance/src/cases/math_routines.rs @@ -16,13 +16,11 @@ //! Each word is a column of its own, because the eight words are different answers: a diff names //! `frexp-mantissa` or `ilogb` of one input rather than a row of eight numbers. Every column //! compares exactly; there is nothing here a device may round differently, and no value is -//! loosened. The only allowance is the declaration of the notice a device without unified memory -//! announces for the pass's `Shared` buffers (`SharedInSystemMemory`). +//! loosened. //! //! Nothing here can fault a GPU: one compute pass a case, two buffers, no texture, no loop, and //! each thread reads its own word. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Bindings, Case, Failure, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -173,13 +171,6 @@ impl Case for MathRoutines { MetalSource::Run } - fn allowances(&self) -> Vec { - // One declaration and no tolerance: both of this pass's buffers is `Shared`, which is - // what [`crate::replay::shared_memory_notice`] is for. It loosens the notices site alone, - // so every value this case reads still compares exactly. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { [RUNTIME_TEXT, METAL_TEXT] .into_iter() diff --git a/crates/metal2vulkan-conformance/src/cases/mesh_barriers.rs b/crates/metal2vulkan-conformance/src/cases/mesh_barriers.rs index 9c70d4904..15e24ff4a 100644 --- a/crates/metal2vulkan-conformance/src/cases/mesh_barriers.rs +++ b/crates/metal2vulkan-conformance/src/cases/mesh_barriers.rs @@ -26,7 +26,6 @@ //! //! Nothing here can fault a GPU: every grid is one or two threadgroups. -use crate::allowance::Allowance; use crate::case::{ Abort, Case, Failure, Handle, Input, MeshFunctions, MeshStep, MetalSource, Side, SCOPE_BUFFERS, STAGE_FRAGMENT, STAGE_MESH, STAGE_OBJECT, TARGET_TEXEL, @@ -435,10 +434,6 @@ impl Case for MeshBarriers { MetalSource::Run } - fn allowances(&self) -> Vec { - super::mesh_draws::mesh_notice_allowances() - } - fn shaders(&self) -> Result, String> { let fixture = self.fixture(); [RUNTIME_TEXT, METAL_TEXT] diff --git a/crates/metal2vulkan-conformance/src/cases/mesh_commands.rs b/crates/metal2vulkan-conformance/src/cases/mesh_commands.rs index fbf0129e9..4ed33663f 100644 --- a/crates/metal2vulkan-conformance/src/cases/mesh_commands.rs +++ b/crates/metal2vulkan-conformance/src/cases/mesh_commands.rs @@ -183,12 +183,6 @@ impl Case for MeshCommands { MetalSource::Run } - fn allowances(&self) -> Vec { - // The pass's notices are a mesh pass's, plus the host step a device announces for commands - // it draws itself; both are named by kind in `mesh_draws`. - super::mesh_draws::mesh_notice_allowances() - } - fn shaders(&self) -> Result, String> { let fixture = self.fixture(); [RUNTIME_TEXT, METAL_TEXT] @@ -522,13 +516,11 @@ impl Case for UnorderedDraws { } fn allowances(&self) -> Vec { - let mut allowances = super::mesh_draws::mesh_notice_allowances(); - allowances.push(Allowance::new( + vec![Allowance::new( format!("case/{UNORDERED_ROW}/{ATTACHMENT_SITE}"), Loosening::Unchecked, Justification::accepted(crate::allowance::accepted_slug(ORDER_IS_ACCEPTED)), - )); - allowances + )] } fn shaders(&self) -> Result, String> { diff --git a/crates/metal2vulkan-conformance/src/cases/mesh_draws.rs b/crates/metal2vulkan-conformance/src/cases/mesh_draws.rs index ccbbc48a5..e768ed80b 100644 --- a/crates/metal2vulkan-conformance/src/cases/mesh_draws.rs +++ b/crates/metal2vulkan-conformance/src/cases/mesh_draws.rs @@ -34,7 +34,6 @@ //! belong to a later batch, and one of their rows is a grid Metal's GPU discards — a recovery //! victim, which this round must not run. -use crate::allowance::Allowance; use crate::case::{ Abort, Case, Failure, Handle, Input, MeshFunctions, MeshStep, MetalSource, Side, TARGET_TEXEL, }; @@ -353,15 +352,6 @@ const PAST_LIMITS: &str = "mesh-object-draws-past-limits"; /// The fragment function every case's pipeline writes its attachments through. const FRAGMENT: &str = "mesh_draws_fragment"; -/// The allowance a mesh case keeps: the notice a device's own memory model provokes. These passes -/// read their payloads, draw arguments and attachments back through `Shared` buffers -/// ([`crate::replay::shared_memory_notice`]). Every row of the three mesh families but -/// `mesh-object-draws-past-limits` was measured announcing it on the RTX 5080; that row stops -/// before it allocates one, so it declares nothing ([`MeshDraws::allowances`]). -pub fn mesh_notice_allowances() -> Vec { - vec![crate::replay::shared_memory_notice()] -} - impl MeshDraws { /// The fixture both sides read. fn fixture(&self) -> Fixture { @@ -580,18 +570,6 @@ impl Case for MeshDraws { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row of this family but one declares the notice a device's own memory model - // provokes for the `Shared` buffers a mesh pass carries. `mesh-object-draws-past-limits` - // asks for an object grid past the device's limits, so the pass stops before it allocates - // one: the RTX 5080 announced the notice for every other row of the three mesh families - // and not for this one, and a declaration no run justifies is one nobody is checking. - match self.name == PAST_LIMITS { - true => Vec::new(), - false => mesh_notice_allowances(), - } - } - fn shaders(&self) -> Result, String> { let fixture = self.fixture(); [RUNTIME_TEXT, METAL_TEXT] diff --git a/crates/metal2vulkan-conformance/src/cases/mesh_partial_barriers.rs b/crates/metal2vulkan-conformance/src/cases/mesh_partial_barriers.rs index 4622165ee..3595fe95c 100644 --- a/crates/metal2vulkan-conformance/src/cases/mesh_partial_barriers.rs +++ b/crates/metal2vulkan-conformance/src/cases/mesh_partial_barriers.rs @@ -18,7 +18,6 @@ //! Nothing here can fault a GPU: every grid is a few threadgroups, and every object threadgroup //! launches no mesh threadgroup. -use crate::allowance::Allowance; use crate::case::{ Abort, Case, Failure, Handle, Input, MeshFunctions, MeshStep, MetalSource, Side, }; @@ -342,10 +341,6 @@ impl Case for MeshPartialBarriers { MetalSource::Run } - fn allowances(&self) -> Vec { - super::mesh_draws::mesh_notice_allowances() - } - fn shaders(&self) -> Result, String> { let fixture = self.fixture(); [RUNTIME_TEXT, METAL_TEXT] diff --git a/crates/metal2vulkan-conformance/src/cases/nan_integer_conversions.rs b/crates/metal2vulkan-conformance/src/cases/nan_integer_conversions.rs index 2e4be1636..8cecea1c2 100644 --- a/crates/metal2vulkan-conformance/src/cases/nan_integer_conversions.rs +++ b/crates/metal2vulkan-conformance/src/cases/nan_integer_conversions.rs @@ -361,10 +361,7 @@ impl Case for NanIntegerConversions { } fn allowances(&self) -> Vec { - // Every word compares exactly. Both answers come back through `Shared` buffers, so a - // device without unified memory announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). - let mut allowances = vec![crate::replay::shared_memory_notice()]; + let mut allowances = Vec::new(); // A `long` of either infinity, the one answer past a range where Metal on the M3 Max // (job m3-max-55436) does not saturate: it answers 0, and the translator the bound. MSL // states no answer past the range, so the two elements of each `long` column hold either, diff --git a/crates/metal2vulkan-conformance/src/cases/nearest_positions.rs b/crates/metal2vulkan-conformance/src/cases/nearest_positions.rs index 4a0dfdf85..e3cb23945 100644 --- a/crates/metal2vulkan-conformance/src/cases/nearest_positions.rs +++ b/crates/metal2vulkan-conformance/src/cases/nearest_positions.rs @@ -290,15 +290,11 @@ impl Case for NearestPositions { } fn allowances(&self) -> Vec { - // One declaration and no tolerance: the output buffer the threads write their samples into is `Shared`, which is - // what [`crate::replay::shared_memory_notice`] is for. It loosens the notices site alone, - // so every value this case reads still compares exactly. Its samples are through a runtime - // sampler slot, which the runtime's pipelines note as scaled - // (`crate::replay::pixel_sampler_scaling_notice` holds why, and the run it rests on). - vec![ - crate::replay::shared_memory_notice(), - crate::replay::pixel_sampler_scaling_notice(), - ] + // One declaration and no tolerance: its samples are through a runtime sampler slot, which + // the runtime's pipelines note as scaled (`crate::replay::pixel_sampler_scaling_notice` + // holds why, and the run it rests on). It loosens the notices site alone, so every value + // this case reads still compares exactly. + vec![crate::replay::pixel_sampler_scaling_notice()] } fn shaders(&self) -> Result, String> { diff --git a/crates/metal2vulkan-conformance/src/cases/norm_storage_writes.rs b/crates/metal2vulkan-conformance/src/cases/norm_storage_writes.rs index 16e789b2e..a7882cc1e 100644 --- a/crates/metal2vulkan-conformance/src/cases/norm_storage_writes.rs +++ b/crates/metal2vulkan-conformance/src/cases/norm_storage_writes.rs @@ -41,7 +41,6 @@ //! Nothing here can fault a GPU: one compute pass a route, no loop, no sampling, and every //! dispatch a whole number of threadgroups. -use crate::allowance::Allowance; use crate::case::{ call, made, Abort, ArgumentSlot, Bindings, Case, Failure, Handle, Input, MetalSource, Side, }; @@ -457,13 +456,6 @@ impl Case for NormStorageWrites { MetalSource::Run } - fn allowances(&self) -> Vec { - // One declaration and no tolerance: the buffer each dispatch reads its words back through - // is `Shared`, which is what [`crate::replay::shared_memory_notice`] is for. It loosens the - // notices site alone, so every value this case reads still compares exactly. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for route in Route::ALL { diff --git a/crates/metal2vulkan-conformance/src/cases/padded_blends.rs b/crates/metal2vulkan-conformance/src/cases/padded_blends.rs index c892a9521..e6e3c1ca3 100644 --- a/crates/metal2vulkan-conformance/src/cases/padded_blends.rs +++ b/crates/metal2vulkan-conformance/src/cases/padded_blends.rs @@ -286,15 +286,12 @@ impl Case for PaddedBlend { } fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without unified - // memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason); it loosens the notices - // site alone. Every stored word compares exactly. `rt6_samples` is a fast-math module, so a - // pipeline that blends its `half4` fill announces `half-output-fast-math-blend`. The blend - // in the device's arithmetic announces `extended-range-blend-source`, a native note the - // suite declares for every case (`crate::replay::NATIVE_NOTES`); a word the device's - // arithmetic moves is a known gap. - let mut named = vec![crate::replay::shared_memory_notice()]; + // Every stored word compares exactly. `rt6_samples` is a fast-math module, so a pipeline + // that blends its `half4` fill announces `half-output-fast-math-blend`. The blend in the + // device's arithmetic announces `extended-range-blend-source`, a native note the suite + // declares for every case (`crate::replay::NATIVE_NOTES`); a word the device's arithmetic + // moves is a known gap. + let mut named = Vec::new(); if self.draw == Draw::PremulHalf { named.push(crate::replay::notice_allowance( Degradation::HalfOutputFastMathBlend.code(), diff --git a/crates/metal2vulkan-conformance/src/cases/padded_fetch.rs b/crates/metal2vulkan-conformance/src/cases/padded_fetch.rs index cf9bfb99a..79cbe9227 100644 --- a/crates/metal2vulkan-conformance/src/cases/padded_fetch.rs +++ b/crates/metal2vulkan-conformance/src/cases/padded_fetch.rs @@ -32,7 +32,6 @@ //! Nothing here can fault a GPU: single-sampled targets of the case's own extent, one or two //! full-screen triangles a pass, no loop, and every fetch inside its buffer. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Input, MetalSource, Side}; use crate::recording::ShaderRef; use crate::render::{ @@ -229,14 +228,6 @@ impl Case for PaddedFetch { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It loosens the notices - // site alone: every value read still compares exactly. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut entries = vec![VERTEX, self.read()]; if self.leg == Leg::Draw { diff --git a/crates/metal2vulkan-conformance/src/cases/pass_attachment_pairs.rs b/crates/metal2vulkan-conformance/src/cases/pass_attachment_pairs.rs index f95f9c0d2..d42203d3c 100644 --- a/crates/metal2vulkan-conformance/src/cases/pass_attachment_pairs.rs +++ b/crates/metal2vulkan-conformance/src/cases/pass_attachment_pairs.rs @@ -82,7 +82,6 @@ //! refuses the target and the suite counts the case //! [`LacksFeature`](crate::verdict::Verdict::LacksFeature) rather than leaving it uncompared. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -688,16 +687,6 @@ impl Case for AttachmentPairs { RUNS } - fn allowances(&self) -> Vec { - // **No value is loosened**: every texel Metal leaves is one we must leave. - // - // Both cases read their attachments back through a `Shared` buffer, and a device with no - // unified memory keeps a `Shared` allocation in system memory because that is the only - // memory both sides can reach. That belongs to the venue's memory model rather than to - // either crossing, so both declare it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { match self.cross { Cross::Loads => shader_refs(&[BOTH, SECOND]), @@ -906,8 +895,6 @@ impl Case for AttachmentPairs { #[cfg(test)] mod tests { use super::*; - use crate::allowance::Loosening; - use crate::replay::NOTICES_SITE; use crate::transcript::Transcript; use std::collections::BTreeSet; @@ -1222,32 +1209,10 @@ mod tests { assert_eq!(case.record_runs(), RUNS); assert!(matches!(case.metal_source(), MetalSource::Run)); } - // Every allowance of either case is a declaration over the notices site: the loads case - // stores every attachment and declares only the notice a device with no unified memory - // announces for the read-back buffer, and the resolves case adds the two its `DontCare` - // store and its emulated resolve provoke. + // Neither case loosens a value or declares a notice. for case in all() { - for allowance in case.allowances() { - assert_eq!(allowance.path, format!("case/{NOTICES_SITE}/*")); - assert_eq!(allowance.loosening, Loosening::Unchecked); - } + assert!(case.allowances().is_empty(), "{}", case.name()); } - assert_eq!( - AttachmentPairs { - cross: Cross::Loads - } - .allowances() - .len(), - 1 - ); - assert_eq!( - AttachmentPairs { - cross: Cross::Resolves - } - .allowances() - .len(), - 3 - ); // Both fragment functions the family names are the fixture's, and the loads case names // both while the resolves case names one. assert_eq!(shader_refs(&[BOTH, SECOND]).expect("the fixture").len(), 4); diff --git a/crates/metal2vulkan-conformance/src/cases/pass_bound_pairs.rs b/crates/metal2vulkan-conformance/src/cases/pass_bound_pairs.rs index 89ec2567d..74a2ac642 100644 --- a/crates/metal2vulkan-conformance/src/cases/pass_bound_pairs.rs +++ b/crates/metal2vulkan-conformance/src/cases/pass_bound_pairs.rs @@ -140,7 +140,6 @@ //! case off `setScissorRect:` past the render target, the one shape Metal's validation calls a //! programming error), every vertex inside the clip volume, and no multisampling. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -468,18 +467,6 @@ impl Case for BoundReach { RUNS } - fn allowances(&self) -> Vec { - // **Nothing is loosened.** Every texel Metal leaves is one we must leave, every attachment - // of every pass here is stored with `Store`, and no cell states a `DontCare` load, which - // is the one shape of this subject our runtime reaches by a near-equivalent. - // - // One notice is declared. The case reads its attachments back through a `Shared` buffer, - // and a device with no unified memory keeps a `Shared` allocation in system memory because - // that is the only memory both sides can reach: the venue's memory model, not this - // subject. A device whose driver is Metal announces nothing for it. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } @@ -625,8 +612,6 @@ impl Case for BoundReach { #[cfg(test)] mod tests { use super::*; - use crate::allowance::Loosening; - use crate::replay::NOTICES_SITE; use crate::transcript::Transcript; use std::collections::{BTreeMap, BTreeSet}; @@ -880,13 +865,9 @@ mod tests { assert!(primed.steps.is_empty()); assert_eq!(primed.colors[0].load, LoadAction::Clear); assert_eq!(primed.colors[0].store, StoreAction::Store); - // The case loosens no value: its one allowance is the declaration of the notice a - // device with no unified memory announces for the read-back buffer, over the notices site. + // The case loosens no value and declares no notice. for case in all() { - let allowances = case.allowances(); - assert_eq!(allowances.len(), 1, "{allowances:?}"); - assert_eq!(allowances[0].path, format!("case/{NOTICES_SITE}/*")); - assert_eq!(allowances[0].loosening, Loosening::Unchecked); + assert!(case.allowances().is_empty(), "{}", case.name()); assert_eq!(case.record_runs(), RUNS); assert!(matches!(case.metal_source(), MetalSource::Run)); } diff --git a/crates/metal2vulkan-conformance/src/cases/pass_bytes.rs b/crates/metal2vulkan-conformance/src/cases/pass_bytes.rs index dff6c1c56..fd19551bf 100644 --- a/crates/metal2vulkan-conformance/src/cases/pass_bytes.rs +++ b/crates/metal2vulkan-conformance/src/cases/pass_bytes.rs @@ -9,7 +9,6 @@ //! difference hides and where one word moving is a readable failure. None reads a texture or an //! input buffer, each binds one buffer, and none can fault a GPU. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Bindings, Case, Failure, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -228,14 +227,6 @@ impl Case for PassBytes { MetalSource::Run } - fn allowances(&self) -> Vec { - // The pass's input and output buffers are `Shared`, and a device with no unified memory - // keeps a `Shared` allocation in system memory because that is the only memory both sides - // can reach. It is the venue's memory model rather than a column's answer, so it is - // declared at the notices site alone and loosens no column. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { [RUNTIME_TEXT, METAL_TEXT] .into_iter() diff --git a/crates/metal2vulkan-conformance/src/cases/pass_sequence_actions.rs b/crates/metal2vulkan-conformance/src/cases/pass_sequence_actions.rs index 0f054feeb..05d51b38c 100644 --- a/crates/metal2vulkan-conformance/src/cases/pass_sequence_actions.rs +++ b/crates/metal2vulkan-conformance/src/cases/pass_sequence_actions.rs @@ -861,12 +861,7 @@ impl Case for SequenceActions { // attachment's contents with arbitrary data: Metal's answer on the M3 Max (the texels it // held before pass A) is one outcome of that, the runtime's (what pass A rendered) // another. Every other texel compares exactly. - // - // `SharedInSystemMemory`: both cases read their attachments back through a `Shared` - // buffer, and a device with no unified memory keeps a `Shared` allocation in system memory - // because that is the only memory both sides can reach. It belongs to the venue's memory - // model rather than to a load or a store action. - let mut allowances = vec![crate::replay::shared_memory_notice()]; + let mut allowances = Vec::new(); if self.cross == Cross::Color { for cell in color_cells() { let site = cell.site(); diff --git a/crates/metal2vulkan-conformance/src/cases/pass_start_reads.rs b/crates/metal2vulkan-conformance/src/cases/pass_start_reads.rs index 620e78493..dc10567d7 100644 --- a/crates/metal2vulkan-conformance/src/cases/pass_start_reads.rs +++ b/crates/metal2vulkan-conformance/src/cases/pass_start_reads.rs @@ -42,10 +42,6 @@ //! the answer changes down the target and along a row, so a target whose answer changes at a //! scissor's edges is a few rows of a few runs each, where its runs of texels alone would be two a //! row (1,042 for each of the chain's targets, 1.46 MB of recording for the three). -//! -//! **What the runtime announces, and the case declares.** Every row reads its answer back through a -//! `Shared` buffer, which a device without unified memory announces as `shared-in-system-memory` -//! (the RTX 5080 Laptop announces it on every row). The declaration loosens the notices site alone. use crate::allowance::{Allowance, Justification, Loosening}; use crate::case::{ @@ -846,11 +842,6 @@ impl Case for PassStartRead { Justification::accepted(DRAWN_WITHOUT_BARRIER), )); } - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason): the RTX 5080 Laptop's - // replay announced it on every row. - allowances.push(crate::replay::shared_memory_notice()); allowances } diff --git a/crates/metal2vulkan-conformance/src/cases/pixel_downscales.rs b/crates/metal2vulkan-conformance/src/cases/pixel_downscales.rs index 19d0ddcd2..478badafc 100644 --- a/crates/metal2vulkan-conformance/src/cases/pixel_downscales.rs +++ b/crates/metal2vulkan-conformance/src/cases/pixel_downscales.rs @@ -426,9 +426,6 @@ impl Case for PixelDownscales { vec![ notice_allowance(Degradation::PixelSamplerScaling.code()), notice_allowance(Degradation::ArgumentPixelSamplerScaling.code()), - // The buffer each pass writes its sampled texels into is `Shared` - // ([`crate::replay::shared_memory_notice`]). - crate::replay::shared_memory_notice(), ] } diff --git a/crates/metal2vulkan-conformance/src/cases/pixel_samplers.rs b/crates/metal2vulkan-conformance/src/cases/pixel_samplers.rs index e336e2a65..a121e575c 100644 --- a/crates/metal2vulkan-conformance/src/cases/pixel_samplers.rs +++ b/crates/metal2vulkan-conformance/src/cases/pixel_samplers.rs @@ -547,12 +547,9 @@ impl Case for PixelSamplers { .then(|| notice_allowance(Degradation::PixelSamplerScaling.code())); scaled .into_iter() - .chain([ - notice_allowance(Degradation::ArgumentPixelSamplerScaling.code()), - // The buffer each pass writes its sampled texels into is `Shared` - // ([`crate::replay::shared_memory_notice`]). - crate::replay::shared_memory_notice(), - ]) + .chain([notice_allowance( + Degradation::ArgumentPixelSamplerScaling.code(), + )]) .collect() } diff --git a/crates/metal2vulkan-conformance/src/cases/primitive_type_crossings.rs b/crates/metal2vulkan-conformance/src/cases/primitive_type_crossings.rs index 07b18624b..703bedb81 100644 --- a/crates/metal2vulkan-conformance/src/cases/primitive_type_crossings.rs +++ b/crates/metal2vulkan-conformance/src/cases/primitive_type_crossings.rs @@ -326,20 +326,16 @@ impl Case for RestartIndices { // **Nothing is loosened.** Every draw here is the direct indexed form, which reaches no // bounds pass, and every texel of every cell still compares exactly. // - // Two kinds are declared over the notices site. The vertex function writes + // One kind is declared over the notices site. The vertex function writes // `[[point_size]]`, which a device whose largest point is below Metal's announces at the // `Point` cells' draws, the only ones it sizes (`device-point-size`; a line or triangle - // cell announces nothing of it); and the positions, indices, marks, frames and read-back are all - // `Shared`, which a device with no unified memory keeps in system memory because that is - // the only memory both sides can reach (`shared-in-system-memory`). Both belong to the - // venue -- its point-size guarantee and its memory model -- rather than to a primitive - // type or an index type. The vertex stage's arithmetic on a device whose float arithmetic - // is not Metal's (`device-arithmetic`) is the device's own answer, which the suite - // declares for every case (`crate::replay::NATIVE_NOTES`). - vec![ - crate::replay::notice_allowance(Degradation::DevicePointSize.code()), - crate::replay::shared_memory_notice(), - ] + // cell announces nothing of it). It belongs to the venue's point-size guarantee rather + // than to a primitive type or an index type. The vertex stage's arithmetic on a device + // whose float arithmetic is not Metal's (`device-arithmetic`) is the device's own answer, + // which the suite declares for every case (`crate::replay::NATIVE_NOTES`). + vec![crate::replay::notice_allowance( + Degradation::DevicePointSize.code(), + )] } fn shaders(&self) -> Result, String> { diff --git a/crates/metal2vulkan-conformance/src/cases/pvrtc_cpu_order.rs b/crates/metal2vulkan-conformance/src/cases/pvrtc_cpu_order.rs index fdf92fe7c..ec4d40a7c 100644 --- a/crates/metal2vulkan-conformance/src/cases/pvrtc_cpu_order.rs +++ b/crates/metal2vulkan-conformance/src/cases/pvrtc_cpu_order.rs @@ -45,7 +45,6 @@ //! Nothing here can fault a GPU: host copies and blit copies over textures the program makes, no //! dispatch, no draw, no loop, every region a whole level. -use crate::allowance::Allowance; use crate::case::{made, Abort, Case, Failure, Input, MetalSource, Side}; use crate::cases::pvrtc_rows::{blocks, Linear, BEFORE, BLOCK}; use crate::transcript::{ByteLayout, Element, Observed, Sites, Value}; @@ -284,12 +283,6 @@ impl Case for PvrtcCpuOrder { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every block compares exactly. The buffer each row reads its blocks back through is - // `Shared` ([`crate::replay::shared_memory_notice`]). - vec![crate::replay::shared_memory_notice()] - } - fn inputs(&self) -> Result, String> { let format = self.format(); Ok(vec![ diff --git a/crates/metal2vulkan-conformance/src/cases/pvrtc_rows.rs b/crates/metal2vulkan-conformance/src/cases/pvrtc_rows.rs index 54ca913f8..943aa07da 100644 --- a/crates/metal2vulkan-conformance/src/cases/pvrtc_rows.rs +++ b/crates/metal2vulkan-conformance/src/cases/pvrtc_rows.rs @@ -34,7 +34,6 @@ //! Nothing here can fault a GPU: blit copies between textures and buffers the program makes, no //! dispatch, no draw, no loop, every region block-aligned and inside its level. -use crate::allowance::Allowance; use crate::case::{made, Abort, Case, Failure, Input, MetalSource, Side}; use crate::transcript::{ByteLayout, Element, Node, Observed, Sites, Value}; use crate::work::{Plane, Rect, Resource, Step, TextureSpec, Work}; @@ -548,14 +547,6 @@ impl Case for PvrtcRows { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every block compares exactly. The buffer each pass reads its blocks back through is - // `Shared`, which a device with no unified memory keeps in system memory because that is - // the only memory both sides can reach: the venue's memory model, not this family's - // subject. - vec![crate::replay::shared_memory_notice()] - } - fn inputs(&self) -> Result, String> { let format = self.format(); Ok(vec![ diff --git a/crates/metal2vulkan-conformance/src/cases/rate_map_degenerate_forms.rs b/crates/metal2vulkan-conformance/src/cases/rate_map_degenerate_forms.rs index 2ce722842..34fed1e12 100644 --- a/crates/metal2vulkan-conformance/src/cases/rate_map_degenerate_forms.rs +++ b/crates/metal2vulkan-conformance/src/cases/rate_map_degenerate_forms.rs @@ -185,14 +185,11 @@ impl Case for DegenerateFormCase { // catalogue). Metal announces nothing, so the notices set is the one field that may differ, // and the allowance is held to its evidence — the notice must actually have been announced // on the run compared. - vec![ - crate::replay::shared_memory_notice(), - Allowance::new( - format!("case/{NOTICES_SITE}/*"), - Loosening::Unchecked, - Justification::notice(Degradation::RasterizationRateMap), - ), - ] + vec![Allowance::new( + format!("case/{NOTICES_SITE}/*"), + Loosening::Unchecked, + Justification::notice(Degradation::RasterizationRateMap), + )] } fn run(&self, side: &mut dyn Side, sites: &mut Sites) -> Result<(), Abort> { @@ -376,17 +373,15 @@ mod tests { let allowances = case.allowances(); assert_eq!( allowances.len(), - 2, - "{}: the rate-map degradation and the venue's system-memory notice are the two \ - this shape declares", + 1, + "{}: the rate-map degradation is the one notice this shape declares", case.name ); for allowance in allowances { match &allowance.justified_by { Justification::Degradation(code) => { assert!( - *code == Degradation::RasterizationRateMap.code() - || *code == Degradation::SharedInSystemMemory.code(), + *code == Degradation::RasterizationRateMap.code(), "{}: {code}", case.name ); diff --git a/crates/metal2vulkan-conformance/src/cases/rate_map_sweeps.rs b/crates/metal2vulkan-conformance/src/cases/rate_map_sweeps.rs index fb2270204..7d5ce13c4 100644 --- a/crates/metal2vulkan-conformance/src/cases/rate_map_sweeps.rs +++ b/crates/metal2vulkan-conformance/src/cases/rate_map_sweeps.rs @@ -489,9 +489,6 @@ impl Case for RateMapSweep { // The allowance is held to its evidence by the suite itself — the notice must have been // announced on the run compared — and it is the only loosening this family declares. Every // derived answer compares exactly, which is the point of the sweep. - // A sweep answers the map's own derived values and reads nothing back through a buffer, - // so it declares no system-memory notice: the RTX 5080 announced none for any of the five - // sweep rows. The three parameter cases, which do read a target back, declare it. if self.walk.points().iter().all(|point| point.identity()) { return Vec::new(); } @@ -646,21 +643,14 @@ impl Case for RateMapParameterData { .into_iter() .all(|axis| axis.iter().all(|sample| *sample >= 1.0)) }); - // Either way the case declares the notice its `Shared` read-back buffer provokes - // ([`crate::replay::shared_memory_notice`]); the RTX 5080 announced it for all three - // parameter rows, the identity one among them. - let shared = crate::replay::shared_memory_notice(); if identity { - return vec![shared]; + return Vec::new(); } - vec![ - shared, - Allowance::new( - format!("case/{NOTICES_SITE}/*"), - Loosening::Unchecked, - Justification::notice(Degradation::RasterizationRateMap), - ), - ] + vec![Allowance::new( + format!("case/{NOTICES_SITE}/*"), + Loosening::Unchecked, + Justification::notice(Degradation::RasterizationRateMap), + )] } fn run(&self, side: &mut dyn Side, sites: &mut Sites) -> Result<(), Abort> { diff --git a/crates/metal2vulkan-conformance/src/cases/rate_maps.rs b/crates/metal2vulkan-conformance/src/cases/rate_maps.rs index 3228e96ed..39c957806 100644 --- a/crates/metal2vulkan-conformance/src/cases/rate_maps.rs +++ b/crates/metal2vulkan-conformance/src/cases/rate_maps.rs @@ -169,25 +169,19 @@ impl Case for RateMapCase { // carries no allowance at all: a tolerance that never fires is one nobody is checking, and // a device that does announce something there should fail the case until somebody names // why. - // Either way the case declares the notice its `Shared` read-back buffer provokes - // ([`crate::replay::shared_memory_notice`]), which the RTX 5080 announced for both rows. - let shared = crate::replay::shared_memory_notice(); if self.identity { - return vec![shared]; + return Vec::new(); } // A map that is not the identity announces the rate-map degradation when it is made, a // near-equivalent the runtime declares (`docs/API.md`'s degrade catalogue): a pass over // such a map is drawn region by region, on this crate's tile lines. Metal announces // nothing, so the notices set is the one field that may differ, and the allowance is held // to its evidence — the notice must actually have been announced on the run compared. - vec![ - shared, - Allowance::new( - format!("case/{NOTICES_SITE}/*"), - Loosening::Unchecked, - Justification::notice(Degradation::RasterizationRateMap), - ), - ] + vec![Allowance::new( + format!("case/{NOTICES_SITE}/*"), + Loosening::Unchecked, + Justification::notice(Degradation::RasterizationRateMap), + )] } fn run(&self, side: &mut dyn Side, sites: &mut Sites) -> Result<(), Abort> { diff --git a/crates/metal2vulkan-conformance/src/cases/read_through.rs b/crates/metal2vulkan-conformance/src/cases/read_through.rs index cd519e650..b9da8f887 100644 --- a/crates/metal2vulkan-conformance/src/cases/read_through.rs +++ b/crates/metal2vulkan-conformance/src/cases/read_through.rs @@ -772,17 +772,6 @@ impl Case for ReadThrough { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every read binds its positions and its output in `Shared` buffers, so on a device - // without unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the notices - // site alone, so every word still compares against Metal's exactly. Measured on the - // RX 7900 XTX (RADV NAVI31, the round's replay at 6898863f3f): it fired for all 13 cases, - // each divergent at the notices site and nothing else; on MoltenVK and lavapipe, whose - // GPU shares the CPU's memory, it cannot fire. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for entry in self.entries() { diff --git a/crates/metal2vulkan-conformance/src/cases/read_write_tiers.rs b/crates/metal2vulkan-conformance/src/cases/read_write_tiers.rs index d310e14f8..d75900565 100644 --- a/crates/metal2vulkan-conformance/src/cases/read_write_tiers.rs +++ b/crates/metal2vulkan-conformance/src/cases/read_write_tiers.rs @@ -114,11 +114,9 @@ //! //! # Exactness //! -//! Every value is a word or a byte and the family declares no tolerance beyond the one notice a -//! venue without unified memory announces for the `Shared` buffer each case reads its answer back -//! through. A format the runtime holds no read-write image of refuses its site with a typed error, -//! which the comparison reads as [`Refused`](crate::verdict::Verdict::Refused) and never as a -//! pass. +//! Every value is a word or a byte and the family declares no tolerance. A format the runtime holds +//! no read-write image of refuses its site with a typed error, which the comparison reads as +//! [`Refused`](crate::verdict::Verdict::Refused) and never as a pass. use crate::allowance::Allowance; use crate::case::{ @@ -559,14 +557,6 @@ impl Case for ReadWriteRoundTrip { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every row reads its answer back through a `Shared` buffer and a `Shared` texture, so on - // a device without unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the notice's - // site alone, so every value still compares against Metal's exactly. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for extension in [RUNTIME_TEXT, METAL_TEXT] { @@ -881,12 +871,6 @@ impl Case for HeldReadWrite { MetalSource::Run } - fn allowances(&self) -> Vec { - // The venue's memory model for the `Shared` read-back ([`crate::replay::shared_memory_notice`]), - // at the notices site alone: every texel is still compared. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for extension in [RUNTIME_TEXT, METAL_TEXT] { diff --git a/crates/metal2vulkan-conformance/src/cases/render_chains.rs b/crates/metal2vulkan-conformance/src/cases/render_chains.rs index b6e641bc0..d8bf1a9f2 100644 --- a/crates/metal2vulkan-conformance/src/cases/render_chains.rs +++ b/crates/metal2vulkan-conformance/src/cases/render_chains.rs @@ -397,20 +397,13 @@ impl Case for RenderChain { // measured to interpolate as Metal does. Measured announced by those two rows on // lavapipe, where their texels still compared exactly: the interpolation the note covers // did not move a sampled texel of this geometry. - // - // Every value of every row compared **exactly** on both venues, which is the evidence that - // these declarations loosen nothing: the whole difference they cover is the announcement. - // - `shared-in-system-memory`, for every row, because the buffer the chain reads its - // target back through is `Shared`, which a device with no unified memory keeps in - // system memory because that is the only memory both sides can reach. It belongs to - // the venue's memory model rather than to a chain's shape. // - `pixel-sampler-scaling`, for every row, because each samples its target through a // runtime sampler slot, which the runtime's pipelines note as scaled // (`crate::replay::pixel_sampler_scaling_notice` holds why, and the run it rests on). - let mut named = vec![ - crate::replay::shared_memory_notice(), - crate::replay::pixel_sampler_scaling_notice(), - ]; + // + // Every value of every row compared **exactly** on both venues, which is the evidence that + // these declarations loosen nothing: the whole difference they cover is the announcement. + let mut named = vec![crate::replay::pixel_sampler_scaling_notice()]; if self.subject.sample.half_output { named.push(crate::replay::notice_allowance( Degradation::HalfOutputFastMathBlend.code(), @@ -791,10 +784,7 @@ mod tests { // The whole set, one declaration a code the row can announce: a code the row // announces and declares nowhere is a divergence, and a code it declares but cannot // announce is an allowance standing behind nothing, so the set is stated exactly. - let mut wanted = vec![ - Degradation::SharedInSystemMemory.code().to_owned(), - Degradation::PixelSamplerScaling.code().to_owned(), - ]; + let mut wanted = vec![Degradation::PixelSamplerScaling.code().to_owned()]; if case.subject.sample.half_output { wanted.push(Degradation::HalfOutputFastMathBlend.code().to_owned()); } diff --git a/crates/metal2vulkan-conformance/src/cases/render_depth_stencil_state.rs b/crates/metal2vulkan-conformance/src/cases/render_depth_stencil_state.rs index 7e782d9dd..5e6d9047b 100644 --- a/crates/metal2vulkan-conformance/src/cases/render_depth_stencil_state.rs +++ b/crates/metal2vulkan-conformance/src/cases/render_depth_stencil_state.rs @@ -41,7 +41,6 @@ //! by 16 target, no loop in either fixture, every scissor rectangle inside the target, and no bias //! larger in magnitude than two. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -181,15 +180,6 @@ fn read_target(texture: Handle, into: Handle) -> RenderWork { } } -/// The notice every row of the family declares, measured firing for all three rows on the 5080: -/// the buffer each pass reads its colour target back through is `Shared` -/// ([`crate::replay::shared_memory_notice`]). -/// -/// It loosens no value: it sits at the notices site, so a texel that differs still fails the case. -fn pass_notices() -> Vec { - vec![crate::replay::shared_memory_notice()] -} - /// The shader reference both texts of `fixture` give, under `entries`. fn shader_refs(fixture: &'static str, entries: &str) -> Result, String> { let held = Fixture::new(fixture); @@ -521,14 +511,6 @@ impl Case for DepthBias { RUNS } - fn allowances(&self) -> Vec { - // **Nothing is loosened.** A texel is four ones or the pass's clear, both of which a - // `RGBA32Float` attachment stores exactly, and the fragment function does no arithmetic a - // device's float bounds could reach. The family's declaration ([`pass_notices`]) sits at - // the notices site. - pass_notices() - } - fn shaders(&self) -> Result, String> { shader_refs(DEPTH_FIXTURE, DEPTH_ENTRIES) } @@ -697,13 +679,6 @@ impl Case for DepthClip { RUNS } - fn allowances(&self) -> Vec { - // Nothing loosened, and the family's two declarations, for the reason - // `render-state-depth-bias` states. This case states no depth bias, so it does not - // declare the notice one provokes. - pass_notices() - } - fn shaders(&self) -> Result, String> { shader_refs(DEPTH_FIXTURE, DEPTH_ENTRIES) } @@ -951,13 +926,6 @@ impl Case for StencilReferences { RUNS } - fn allowances(&self) -> Vec { - // Nothing loosened, and the family's two declarations, for the reason - // `render-state-depth-bias` states. This case states no depth bias, so it does not - // declare the notice one provokes. - pass_notices() - } - fn shaders(&self) -> Result, String> { shader_refs(STENCIL_FIXTURE, STENCIL_ENTRIES) } @@ -1037,8 +1005,6 @@ impl Case for StencilReferences { #[cfg(test)] mod tests { use super::*; - use crate::allowance::Loosening; - use crate::replay::NOTICES_SITE; use crate::transcript::Transcript; use std::collections::BTreeSet; @@ -1499,14 +1465,8 @@ mod tests { for case in all() { assert_eq!(case.record_runs(), RUNS); assert!(matches!(case.metal_source(), MetalSource::Run)); - // Every case declares the family's notice, and it loosens no value, so each allowance - // sits at the notices site: a value tolerance added later fails here. - let allowances = case.allowances(); - assert_eq!(allowances.len(), pass_notices().len(), "{}", case.name()); - for allowance in &allowances { - assert_eq!(allowance.path, format!("case/{NOTICES_SITE}/*")); - assert_eq!(allowance.loosening, Loosening::Unchecked); - } + // No case loosens a value or declares a notice: an allowance added later fails here. + assert!(case.allowances().is_empty(), "{}", case.name()); } // The prefill pipeline writes no channel and the region pipeline writes every one, which // is what keeps the prefill's depth out of the colour target. diff --git a/crates/metal2vulkan-conformance/src/cases/render_draw_forms.rs b/crates/metal2vulkan-conformance/src/cases/render_draw_forms.rs index 971b101d2..ca430fe55 100644 --- a/crates/metal2vulkan-conformance/src/cases/render_draw_forms.rs +++ b/crates/metal2vulkan-conformance/src/cases/render_draw_forms.rs @@ -148,14 +148,10 @@ fn pass_kinds() -> Vec { /// The allowances a case of the family keeps: one declaration per kind of [`pass_kinds`]. fn pass_notices() -> Vec { - let mut allowances: Vec = pass_kinds() + pass_kinds() .iter() .map(|kind| crate::replay::notice_allowance(kind.code())) - .collect(); - // The positions, the indices, the indirect arguments and the read-back are all `Shared` - // ([`crate::replay::shared_memory_notice`]). - allowances.push(crate::replay::shared_memory_notice()); - allowances + .collect() } /// Every case of the family, in the order the report lists them. @@ -2050,8 +2046,7 @@ mod tests { ); assert_eq!( declared.len(), - // The family's own list and the notice a device's own memory model provokes. - pass_kinds().len() + 1, + pass_kinds().len(), "{} declares the wrong number of notices", case.name() ); diff --git a/crates/metal2vulkan-conformance/src/cases/render_residency.rs b/crates/metal2vulkan-conformance/src/cases/render_residency.rs index ca26441de..37d82644c 100644 --- a/crates/metal2vulkan-conformance/src/cases/render_residency.rs +++ b/crates/metal2vulkan-conformance/src/cases/render_residency.rs @@ -46,7 +46,6 @@ //! or 4 by 4 target, no loop in the fixture, and a heap that holds no memory until a mapping takes //! a tile, which nothing here asks for. -use crate::allowance::Allowance; use crate::case::{ call, made, Abort, Case, Failure, Handle, Input, MetalSource, Side, TextureRole, TextureSpec, }; @@ -444,18 +443,6 @@ impl Case for RenderBarriers { RUNS } - fn allowances(&self) -> Vec { - // No value is loosened. A `RGBA32Float` texel is the `float4` the fragment function - // returned, the fixture's arithmetic is a multiplication by an eighth of an integer, and a - // texel read at integer coordinates takes no device's float bounds, so every texel here is - // an exact answer or a bug. - // - // One notice is declared, and it is the venue's rather than this case's: the buffer the - // pass reads its target back through is `Shared`, which a device with no unified memory - // keeps in system memory because that is the only memory both sides can reach. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } @@ -574,12 +561,6 @@ impl Case for HeapResidency { RUNS } - fn allowances(&self) -> Vec { - // Nothing loosened, for the reason the barrier case states. What is declared is the one - // notice the venue's own memory model provokes for the `Shared` read-back buffer. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } @@ -635,7 +616,6 @@ impl Case for HeapResidency { #[cfg(test)] mod tests { use super::*; - use crate::allowance::Justification; use crate::transcript::Transcript; use std::collections::BTreeSet; @@ -805,21 +785,8 @@ mod tests { for case in all() { assert_eq!(case.record_runs(), RUNS); assert!(matches!(case.metal_source(), MetalSource::Run)); - // Both cases declare the notice the venue's own memory model provokes for the - // `Shared` read-back buffer, and nothing else. No value of either is loosened, so - // every declaration sits at the notices site. - let declared = case.allowances(); - for allowance in &declared { - assert!(allowance.path.starts_with("case/notices"), "{allowance:?}"); - } - let codes: Vec<&Justification> = - declared.iter().map(|held| &held.justified_by).collect(); - let shared = Justification::Degradation( - crate::degradation::Degradation::SharedInSystemMemory - .code() - .to_owned(), - ); - assert_eq!(codes, vec![&shared], "{}", case.name()); + // No value of either case is loosened, and neither declares a notice. + assert!(case.allowances().is_empty(), "{}", case.name()); } // The barriers name the stage whose writes the next draw reads, on both sides of each. assert_eq!(FRAGMENT, RenderStages::FRAGMENT); diff --git a/crates/metal2vulkan-conformance/src/cases/render_state.rs b/crates/metal2vulkan-conformance/src/cases/render_state.rs index 6f8f3a244..6c6a66c1c 100644 --- a/crates/metal2vulkan-conformance/src/cases/render_state.rs +++ b/crates/metal2vulkan-conformance/src/cases/render_state.rs @@ -40,7 +40,6 @@ //! viewport inside its target, which `every_box_lies_inside_its_target` holds with no device //! asked. -use crate::allowance::Allowance; use crate::case::{ call, made, Abort, Case, Failure, Handle, Input, MetalSource, SamplerSpec, Side, TextureRole, TextureSpec, @@ -530,19 +529,6 @@ impl Case for Boxes { RUNS } - fn allowances(&self) -> Vec { - // Nothing is loosened. A `RGBA32Float` texel is the `float4` a fragment function - // returned, so what each draw saw is an exact answer or it is a bug; there is no - // normalized conversion here and no arithmetic of the shader's -- `tob_solid` returns its - // binding and `tob_read` reads a texel at integer coordinates, neither of which can take a - // device's float bounds. - // - // One notice is declared, and it is the venue's and not this case's: the buffer the pass - // reads its target back through is `Shared`, which a device with no unified memory keeps - // in system memory because that is the only memory both sides can reach. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } @@ -732,13 +718,6 @@ impl Case for Facing { RUNS } - fn allowances(&self) -> Vec { - // No value is loosened, for the reason `render-state-boxes` states: every texel this case - // reads compared exactly. What is declared is the notice the venue's own memory model - // provokes for the `Shared` read-back buffer. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } @@ -903,12 +882,6 @@ impl Case for UnreadSlots { RUNS } - fn allowances(&self) -> Vec { - // Nothing loosened, for the reason `render-state-boxes` states, and the one notice the - // venue's own memory model provokes for the `Shared` read-back buffer. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } @@ -984,7 +957,6 @@ impl Case for UnreadSlots { #[cfg(test)] mod tests { use super::*; - use crate::allowance::Justification; use crate::transcript::Transcript; use std::collections::BTreeSet; @@ -1364,21 +1336,8 @@ mod tests { for case in all() { assert_eq!(case.record_runs(), RUNS); assert!(matches!(case.metal_source(), MetalSource::Run)); - // Every case declares the notice the venue's own memory model provokes for the - // `Shared` read-back buffer, and nothing else. No value of any case is loosened, so - // every declaration sits at the notices site. - let declared = case.allowances(); - for allowance in &declared { - assert!(allowance.path.starts_with("case/notices"), "{allowance:?}"); - } - let codes: Vec<&Justification> = - declared.iter().map(|held| &held.justified_by).collect(); - let shared = Justification::Degradation( - crate::degradation::Degradation::SharedInSystemMemory - .code() - .to_owned(), - ); - assert_eq!(codes, vec![&shared], "{}", case.name()); + // No value of any case is loosened, and no case declares a notice. + assert!(case.allowances().is_empty(), "{}", case.name()); } } } diff --git a/crates/metal2vulkan-conformance/src/cases/resolve_then_load.rs b/crates/metal2vulkan-conformance/src/cases/resolve_then_load.rs index 6d4e2b0fe..2a301a0a6 100644 --- a/crates/metal2vulkan-conformance/src/cases/resolve_then_load.rs +++ b/crates/metal2vulkan-conformance/src/cases/resolve_then_load.rs @@ -64,7 +64,6 @@ //! samples of the format refuses the target and the suite counts the case //! [`LacksFeature`](crate::verdict::Verdict::LacksFeature). -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -343,13 +342,6 @@ impl Case for ResolveThenLoad { RUNS } - fn allowances(&self) -> Vec { - // No value is loosened. The buffers the kernel and the blits write are `Shared` - // ([`crate::replay::shared_memory_notice`]): it was announced on the RTX 2080 (job - // m3-max-55760), and nothing else differed there. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } diff --git a/crates/metal2vulkan-conformance/src/cases/resource_facts.rs b/crates/metal2vulkan-conformance/src/cases/resource_facts.rs index 9d83e1fe4..032488b70 100644 --- a/crates/metal2vulkan-conformance/src/cases/resource_facts.rs +++ b/crates/metal2vulkan-conformance/src/cases/resource_facts.rs @@ -91,7 +91,6 @@ //! the placement offsets': an offset that is not a multiple of 256, or a placement that runs past //! the heap, is one Metal's validation stops. This module's own tests hold every row to both with no device. -use crate::allowance::Allowance; use crate::case::{Abort, Case, Handle, Input, MetalSource, Side}; use crate::heap_query::{ cache_word, hazard_word, purgeable_pairs, purgeable_word, HeapBufferSpec, HeapSpec, @@ -442,13 +441,6 @@ impl Case for ResourceFactsCase { MetalSource::Run } - fn allowances(&self) -> Vec { - // One declaration and no tolerance: the `Shared` buffers these getters answer about is `Shared`, which is - // what [`crate::replay::shared_memory_notice`] is for. It loosens the notices site alone, - // so every value this case reads still compares exactly. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { // Nothing here compiles: every answer is a getter of a resource. Ok(Vec::new()) diff --git a/crates/metal2vulkan-conformance/src/cases/rgb10a2_srgb.rs b/crates/metal2vulkan-conformance/src/cases/rgb10a2_srgb.rs index d092be12d..82e902d0f 100644 --- a/crates/metal2vulkan-conformance/src/cases/rgb10a2_srgb.rs +++ b/crates/metal2vulkan-conformance/src/cases/rgb10a2_srgb.rs @@ -742,10 +742,7 @@ impl Case for Rgb10A2Srgb { /// module's filter of the decoded taps. The read and write cases name no notice of their own. fn allowances(&self) -> Vec { use crate::degradation::Degradation as D; - // Every question reads its answer back through a `Shared` buffer, and a device with no - // unified memory keeps a `Shared` allocation in system memory because that is the only - // memory both sides can reach: the venue's memory model rather than this format's answer. - let mut named = vec![crate::replay::shared_memory_notice()]; + let mut named = Vec::new(); match &self.question { Question::Stores { lanes: Lanes::Half } => { named.push(notice_allowance(D::HalfOutputFastMathBlend.code())) diff --git a/crates/metal2vulkan-conformance/src/cases/rotated_planes.rs b/crates/metal2vulkan-conformance/src/cases/rotated_planes.rs index 00e08d32a..9ff8b2da8 100644 --- a/crates/metal2vulkan-conformance/src/cases/rotated_planes.rs +++ b/crates/metal2vulkan-conformance/src/cases/rotated_planes.rs @@ -60,7 +60,6 @@ //! and **keeps every texel of the tile it did not reach** (512 of 512). A one-tile frame cannot //! tell that from mirroring every tile, which is why the lane's own 32x32 test never did. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Input, MetalSource, Side}; use crate::recording::ShaderRef; use crate::render::{ @@ -297,14 +296,6 @@ impl Case for RotatedPlane { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every plane byte compares exactly. The buffer every case reads its plane back through is - // `Shared`, which a device with no unified memory keeps in system memory because that is - // the only memory both sides can reach (`shared-in-system-memory`): the venue's memory - // model, not a rotation. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs(RENDERS, &[RECT, READ]) } diff --git a/crates/metal2vulkan-conformance/src/cases/rotated_targets.rs b/crates/metal2vulkan-conformance/src/cases/rotated_targets.rs index 009e94bd3..c542052c8 100644 --- a/crates/metal2vulkan-conformance/src/cases/rotated_targets.rs +++ b/crates/metal2vulkan-conformance/src/cases/rotated_targets.rs @@ -41,7 +41,6 @@ //! Nothing here can fault a GPU: single-sampled targets of the case's own extent, one full-screen //! triangle a pass, no loop, and every fetch inside its buffer. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Input, MetalSource, Side}; use crate::recording::ShaderRef; use crate::render::{ @@ -484,25 +483,6 @@ impl Case for RotatedTarget { MetalSource::Run } - fn allowances(&self) -> Vec { - // One allowance, and it loosens **no texel**: the notice the venue's own memory model - // provokes. The buffer each case reads its target back through is `Shared`, which a - // device with no unified memory keeps in system memory because that is the only memory - // both sides can reach. - // - // Every state stores through the device's own conversion of the channels it writes, blended - // or not (`PrecisionNote::DeviceColorConversion`), a native note the suite declares for - // every case ([`crate::replay::NATIVE_NOTES`]), so the case names no notice of its own. - // - // **No tolerance on any texel, deliberately.** On lavapipe the blended states store a code - // one apart from Metal's, and that is exactly the shape `DeviceColorConversion` describes - // -- but the note's own definition ends "validation derives no tolerance and no explanation - // from it: a difference stays a mismatch for review". Loosening a texel here would be this - // suite overruling that, so the blended states stay divergent on lavapipe and are a - // per-venue divergence to carry, not a tolerance to write. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs(FILLS, &[VERTEX, FILL_FLOAT]) } diff --git a/crates/metal2vulkan-conformance/src/cases/sample_fills.rs b/crates/metal2vulkan-conformance/src/cases/sample_fills.rs index 58d5cc236..26c98abc1 100644 --- a/crates/metal2vulkan-conformance/src/cases/sample_fills.rs +++ b/crates/metal2vulkan-conformance/src/cases/sample_fills.rs @@ -25,12 +25,11 @@ //! Metal's answer is **carried** and re-recording is **forbidden**: Metal fills a texture through //! private API. -use crate::allowance::Allowance; use crate::case::{answered, call, Abort, Case, Failure, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::measured::{hex_bytes, public_fixture}; use crate::recording::ShaderRef; -use crate::replay::{notice_allowance, NOTICES_SITE}; +use crate::replay::NOTICES_SITE; use crate::transcript::{Digest, DigestKind, Node, Observed, Sites, Transcript, Value}; use crate::work::{Clear, Rect, Resource, Step, TextureSpec, Work}; @@ -430,18 +429,6 @@ impl Case for SampleFills { ]) } - fn allowances(&self) -> Vec { - // A multisample fill and its read-back announce shared storage in system memory on a - // device without unified memory. Metal announces none, so the notices site differs on such - // a device, and the difference is justified where it fired. A depth texture's denormals - // and a `Depth32Float` target's signed test (`depth-denormals`, `signed-depth-test`) are - // the device's own answers, which the suite declares for every case - // (`crate::replay::NATIVE_NOTES`); every depth word still compares exactly. - vec![notice_allowance( - crate::degradation::Degradation::SharedInSystemMemory.code(), - )] - } - fn carried_transcript(&self) -> Result, String> { let text = public_fixture(METAL_LINES)?; let mut sites = Sites::new(); diff --git a/crates/metal2vulkan-conformance/src/cases/sample_positions.rs b/crates/metal2vulkan-conformance/src/cases/sample_positions.rs index be8cafc35..6423c0bc0 100644 --- a/crates/metal2vulkan-conformance/src/cases/sample_positions.rs +++ b/crates/metal2vulkan-conformance/src/cases/sample_positions.rs @@ -240,8 +240,6 @@ const MEASURED_RUNS: u32 = 1; /// a case never branches on the device: it runs and reads what came back, and a venue that /// announces a kind not here fails the case until the kind is added. const PASS_NOTICES: &[Degradation] = &[ - // A `Shared` buffer the device keeps in system memory, which the triangle's vertices are. - Degradation::SharedInSystemMemory, // The fixture's vertex function writes `[[point_size]]`, which sizes no triangle. Where the // device's `pointSizeRange` ends below Metal's largest point, its translation records the // static note `PrecisionNote::DevicePointSize`, which the runtime's side announces as the diff --git a/crates/metal2vulkan-conformance/src/cases/sampler_crossings.rs b/crates/metal2vulkan-conformance/src/cases/sampler_crossings.rs index f43a5b775..9c2f22a15 100644 --- a/crates/metal2vulkan-conformance/src/cases/sampler_crossings.rs +++ b/crates/metal2vulkan-conformance/src/cases/sampler_crossings.rs @@ -967,10 +967,7 @@ impl Case for SamplerCrossings { // runtime's pipelines note as scaled (`crate::replay::pixel_sampler_scaling_notice` holds // why). Measured through the rt side on lavapipe, the Radeon 780M and the RX 550: it fired // for every row the side does not refuse (the axis and mip-filter rows). - let mut allowances = vec![ - crate::replay::shared_memory_notice(), - crate::replay::pixel_sampler_scaling_notice(), - ]; + let mut allowances = vec![crate::replay::pixel_sampler_scaling_notice()]; // The opaque-black axis-border rows read that border, which the runtime's sampler // states note on every device (`crate::replay::swizzled_border_notice`). if matches!( diff --git a/crates/metal2vulkan-conformance/src/cases/sampler_filtering.rs b/crates/metal2vulkan-conformance/src/cases/sampler_filtering.rs index ce6117193..49bcb9e1c 100644 --- a/crates/metal2vulkan-conformance/src/cases/sampler_filtering.rs +++ b/crates/metal2vulkan-conformance/src/cases/sampler_filtering.rs @@ -863,22 +863,17 @@ impl Case for SamplerFiltering { // notices site is the whole of the difference. The other families provoke no notice and // declare none, so a notice any of them starts announcing reads as divergent at once. // - // One more is declared: the `Shared` buffer every row writes its samples into - // ([`crate::replay::shared_memory_notice`]), for all fifteen rows (the RTX 5080). Where - // the device filters a float texture its own way (`float-sample-filter`, + // Where the device filters a float texture its own way (`float-sample-filter`, // `sampler-mip-linear` and `sampler-r-address-modes` on llvmpipe and the 5080), the note // is the device's own answer, which the suite declares for every case // (`crate::replay::NATIVE_NOTES`). // - // And every family samples through the runtime sampler at `[[sampler(0)]]`, which the new + // And every family samples through the runtime sampler at `[[sampler(0)]]`, which the // runtime's pipelines note as scaled (`crate::replay::pixel_sampler_scaling_notice` holds // why). Measured through the rt side on lavapipe, the Radeon 780M and the RX 550: it fired // for every row the side does not refuse (the mip, third-address-mode, reduction and // border rows). - let mut named = vec![ - crate::replay::shared_memory_notice(), - crate::replay::pixel_sampler_scaling_notice(), - ]; + let mut named = vec![crate::replay::pixel_sampler_scaling_notice()]; // The border family's opaque-black rows read that border, which the runtime's sampler // states note on every device (`crate::replay::swizzled_border_notice`). if matches!(self.family, Family::Border) { diff --git a/crates/metal2vulkan-conformance/src/cases/shader_stencil.rs b/crates/metal2vulkan-conformance/src/cases/shader_stencil.rs index 47400355c..67c9e5899 100644 --- a/crates/metal2vulkan-conformance/src/cases/shader_stencil.rs +++ b/crates/metal2vulkan-conformance/src/cases/shader_stencil.rs @@ -36,7 +36,6 @@ //! Nothing here can fault a GPU: two render passes of three triangles each over a 4 by 1 target, //! no loop in either fixture, and one blit of four bytes. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -238,13 +237,6 @@ impl Case for ShaderStencil { MetalSource::Run } - fn allowances(&self) -> Vec { - // Exact: every stencil byte Metal leaves is a byte we must leave. The one declaration is - // the `Shared` buffer the pass reads its stencil back through - // ([`crate::replay::shared_memory_notice`]), measured firing for both rows on the RTX 5080. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for (name, entry) in [(VERTEX_FIXTURE, VERTEX), (STENCIL_FIXTURE, FRAGMENT)] { diff --git a/crates/metal2vulkan-conformance/src/cases/shared_exponent_storage.rs b/crates/metal2vulkan-conformance/src/cases/shared_exponent_storage.rs index f0ac9fb66..6b7be396a 100644 --- a/crates/metal2vulkan-conformance/src/cases/shared_exponent_storage.rs +++ b/crates/metal2vulkan-conformance/src/cases/shared_exponent_storage.rs @@ -38,7 +38,6 @@ //! Nothing here can fault a GPU: one compute pass a case, one thread a texel, no loop and no //! sampling. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Bindings, Case, Failure, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -366,13 +365,6 @@ impl Case for SharedExponentStorage { MetalSource::Run } - fn allowances(&self) -> Vec { - // One declaration and no tolerance: the buffer each dispatch reads its words back through is `Shared`, which is - // what [`crate::replay::shared_memory_notice`] is for. It loosens the notices site alone, - // so every value this case reads still compares exactly. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for kernel in self.kernels() { diff --git a/crates/metal2vulkan-conformance/src/cases/simdgroup_lockstep.rs b/crates/metal2vulkan-conformance/src/cases/simdgroup_lockstep.rs index a43c06d8a..48a85299c 100644 --- a/crates/metal2vulkan-conformance/src/cases/simdgroup_lockstep.rs +++ b/crates/metal2vulkan-conformance/src/cases/simdgroup_lockstep.rs @@ -154,14 +154,12 @@ impl Case for Lockstep { fn allowances(&self) -> Vec { // The output words are lockstep's alone, which the runtime does not give (the module - // documentation). And two declarations, each loosening the notices site alone. The buffer - // each dispatch writes its per-lane record into is `Shared`, which is what - // [`crate::replay::shared_memory_notice`] is for. And both kernels hold simdgroup-scoped - // accesses inside divergent loops, so on a device whose answer lacks maximal reconvergence - // (`shaderMaximalReconvergence`, the SIMD groups' query form) the stage carries its static - // note, `DeviceReconvergence`, which the sides announce as `device-reconvergence`. The - // device's answer decides it: a device with maximal reconvergence announces nothing, and - // this declaration then holds nowhere. + // documentation). And one declaration, loosening the notices site alone: both kernels + // hold simdgroup-scoped accesses inside divergent loops, so on a device whose answer lacks + // maximal reconvergence (`shaderMaximalReconvergence`, the SIMD groups' query form) the + // stage carries its static note, `DeviceReconvergence`, which the sides announce as + // `device-reconvergence`. The device's answer decides it: a device with maximal + // reconvergence announces nothing, and this declaration then holds nowhere. vec![ Allowance::new( "case/output", @@ -170,7 +168,6 @@ impl Case for Lockstep { "the-threads-of-a-simd-group-run-in-no-order-between-barriers".to_owned(), ), ), - crate::replay::shared_memory_notice(), crate::replay::notice_allowance( crate::degradation::Degradation::DeviceReconvergence.code(), ), diff --git a/crates/metal2vulkan-conformance/src/cases/snorm_tile_store.rs b/crates/metal2vulkan-conformance/src/cases/snorm_tile_store.rs index ccf16f6f5..599401df2 100644 --- a/crates/metal2vulkan-conformance/src/cases/snorm_tile_store.rs +++ b/crates/metal2vulkan-conformance/src/cases/snorm_tile_store.rs @@ -310,9 +310,6 @@ impl Case for SnormTileStore { Justification::notice(*kind), )); } - // The buffer each pass reads the stored tiles back through is `Shared` - // ([`crate::replay::shared_memory_notice`]). - allowances.push(crate::replay::shared_memory_notice()); allowances } @@ -515,10 +512,8 @@ mod tests { ); match &allowance.justified_by { Justification::Degradation(code) => assert!( - PASS_NOTICES.iter().any(|kind| kind.code() == code) - || code == Degradation::SharedInSystemMemory.code(), - "{}: {code} is neither a tile-store notice nor the one a device's own \ - memory model provokes", + PASS_NOTICES.iter().any(|kind| kind.code() == code), + "{}: {code} is not a tile-store notice", case.name() ), other => panic!("{}: an unexpected tolerance: {other:?}", case.name()), diff --git a/crates/metal2vulkan-conformance/src/cases/sparse_mappings.rs b/crates/metal2vulkan-conformance/src/cases/sparse_mappings.rs index ae7f53a88..938dfe5cb 100644 --- a/crates/metal2vulkan-conformance/src/cases/sparse_mappings.rs +++ b/crates/metal2vulkan-conformance/src/cases/sparse_mappings.rs @@ -88,7 +88,6 @@ //! Nothing dispatches, nothing draws, no shader runs, every wait is bounded, and the heap is 4 //! MiB of which the rows map at most a few dozen pages. -use crate::allowance::Allowance; use crate::case::{Abort, Case, Input, MetalSource, Side}; use crate::sparse_mapping::{MappingMode, MappingStep, SparseMappingProgram, TileGrid, TileRect}; use crate::sparse_query::{SparseHeapSpec, SparseTextureSpec}; @@ -176,21 +175,6 @@ fn last_tile(level: u32) -> TileRect { TileRect::one([across - 1, down - 1]) } -/// Whether a program reaches a `Shared` buffer of its own: it reads tiles out to one -/// ([`MappingStep::ReadRegion`], which the fills before it write into), or it makes one for an -/// indirect update to read its regions from. A program that only maps, moves and fences allocates -/// none, so a device's own memory model has nothing to announce for it. -/// -/// It is a structural test of the program rather than a flag on the row, so a row that grows a -/// read or an indirect buffer declares the notice without anybody remembering to say so. -fn reaches_a_shared_buffer(program: &SparseMappingProgram) -> bool { - !program.buffers.is_empty() - || program - .steps - .iter() - .any(|step| matches!(step, MappingStep::ReadRegion { .. })) -} - /// One row of the family: a case name, and the program it runs. struct Row { /// The case's name: its recording's file name, and its row in the report. @@ -1028,19 +1012,6 @@ impl Case for SparseMappings { MetalSource::Run } - fn allowances(&self) -> Vec { - // **No value is loosened**: every number and every byte of every row compares exactly. The - // one declaration is the `Shared` buffer a row that reads texels back carries - // ([`crate::replay::shared_memory_notice`]), which the RTX 5080 announced for the two rows - // that read any -- `sparse-mapping-mapped-tiles-hold-their-texels` and - // `sparse-mapping-indirect-updates`. The rest answer mappings and numbers alone, so they - // allocate no such buffer and declare nothing for one. - match reaches_a_shared_buffer(&(self.row.program)()) { - true => vec![crate::replay::shared_memory_notice()], - false => Vec::new(), - } - } - fn inputs(&self) -> Result, String> { // The program itself: the heap, every texture, the indirect arguments, the tile grid the // regions are stated in, and every command with its own numbers. A program whose regions, @@ -1224,23 +1195,7 @@ mod tests { .inputs() .unwrap_or_else(|why| panic!("{}: {why}", case.name())); assert!(!inputs.is_empty(), "{}", case.name()); - // The two rows that reach a `Shared` buffer declare the one a device's own memory - // model provokes, and no other row declares anything. No value tolerance appears - // anywhere in this family. - let allowed = case.allowances(); - let expects = usize::from(reaches_a_shared_buffer(&(EVERY_ROW - .iter() - .find(|row| row.case == case.name()) - .expect("a row of the family") - .program)())); - assert_eq!(allowed.len(), expects, "{}", case.name()); - for allowance in &allowed { - assert!( - matches!(allowance.loosening, crate::allowance::Loosening::Unchecked), - "{}: a value tolerance in a family that loosens none", - case.name() - ); - } + assert!(case.allowances().is_empty(), "{}", case.name()); digests.insert(crate::sha256_hex( &inputs[0].digest.hex.clone().into_bytes(), )); diff --git a/crates/metal2vulkan-conformance/src/cases/srgb_fetch.rs b/crates/metal2vulkan-conformance/src/cases/srgb_fetch.rs index b7cef0d65..ba8766ca5 100644 --- a/crates/metal2vulkan-conformance/src/cases/srgb_fetch.rs +++ b/crates/metal2vulkan-conformance/src/cases/srgb_fetch.rs @@ -226,12 +226,10 @@ impl Case for SrgbFetch { // // A venue with neither ordered fetch form reads the input attachment ordered between draws // alone, announced `unordered-fetch-within-draw`; each draw is one fullscreen triangle, - // which overlaps itself nowhere, so every byte still compares exactly. The buffer each - // pass reads its target back through is `Shared` ([`crate::replay::shared_memory_notice`]). - vec![ - crate::replay::notice_allowance(Degradation::UnorderedFetchWithinDraw.code()), - crate::replay::shared_memory_notice(), - ] + // which overlaps itself nowhere, so every byte still compares exactly. + vec![crate::replay::notice_allowance( + Degradation::UnorderedFetchWithinDraw.code(), + )] } fn shaders(&self) -> Result, String> { diff --git a/crates/metal2vulkan-conformance/src/cases/stage_in_regions.rs b/crates/metal2vulkan-conformance/src/cases/stage_in_regions.rs index 276c7c281..c4883834a 100644 --- a/crates/metal2vulkan-conformance/src/cases/stage_in_regions.rs +++ b/crates/metal2vulkan-conformance/src/cases/stage_in_regions.rs @@ -20,7 +20,6 @@ //! Nothing here can fault a GPU: one compute pass a row, four buffers, no texture, no loop, and //! every fetch inside its buffer. -use crate::allowance::Allowance; use crate::case::{ call, made, Abort, Bindings, Case, Failure, Handle, Input, MetalSource, Side, StageInAttribute, StageInLayout, StageInRegion, StageInput, @@ -499,14 +498,6 @@ impl Case for StageInRegions { MetalSource::Run } - fn allowances(&self) -> Vec { - // The words the rows write compare exactly. The one declaration is the venue's own: the - // buffers this dispatch reads its arguments and writes its answer through are `Shared`, - // which a device with no unified memory keeps in system memory because that is the only - // memory both sides can reach. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for entry in [WORD, PAIR] { diff --git a/crates/metal2vulkan-conformance/src/cases/stage_in_unread.rs b/crates/metal2vulkan-conformance/src/cases/stage_in_unread.rs index dafc4910e..140f66826 100644 --- a/crates/metal2vulkan-conformance/src/cases/stage_in_unread.rs +++ b/crates/metal2vulkan-conformance/src/cases/stage_in_unread.rs @@ -80,7 +80,6 @@ //! the 31 slots Metal's descriptor holds (`tests::every_row_is_a_descriptor_metal_admits`). The fixture is loop-free. Nothing here //! can hang, fault or trip a watchdog. -use crate::allowance::Allowance; use crate::case::{ call, made, probe, Abort, Bindings, Case, Failure, Input, MetalSource, Side, StageInAttribute, StageInLayout, StageInRegion, StageInput, @@ -822,17 +821,6 @@ impl Case for StageInUnread { MetalSource::Run } - fn allowances(&self) -> Vec { - // Nothing here is loosened: every byte of every row compares exactly, the guard past the - // grid included. - // - // Every row reads its answer back through a `Shared` buffer, so on a device without - // unified memory the runtime announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). It declares the notices - // site alone, so every value of this family still compares against Metal's exactly. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let fixture = Self::fixture(); let mut shaders = Vec::new(); diff --git a/crates/metal2vulkan-conformance/src/cases/stencil_resolve_pairs.rs b/crates/metal2vulkan-conformance/src/cases/stencil_resolve_pairs.rs index df197a58a..d8e9ab81d 100644 --- a/crates/metal2vulkan-conformance/src/cases/stencil_resolve_pairs.rs +++ b/crates/metal2vulkan-conformance/src/cases/stencil_resolve_pairs.rs @@ -115,7 +115,6 @@ //! count refuses the target and the suite counts the case //! [`LacksFeature`](crate::verdict::Verdict::LacksFeature) rather than leaving it uncompared. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -651,14 +650,6 @@ impl Case for StencilResolves { RUNS } - fn allowances(&self) -> Vec { - // **No value is loosened**: every resolved byte and every resolved depth Metal leaves is - // one we must leave. The one declaration is the buffer each pass reads its resolved - // aspects back through, which is `Shared` ([`crate::replay::shared_memory_notice`], - // measured firing on the 5080). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } @@ -1195,14 +1186,8 @@ mod tests { for case in all() { assert_eq!(case.record_runs(), RUNS); assert!(matches!(case.metal_source(), MetalSource::Run)); - // The declared allowances loosen no value: each names a notice and nothing else, and - // the pair case declares the three its separate textures and split resolve provoke - // beside the one both cases share. - let expected = match case.name() { - "resolve-stencil-under-depth-filters" => 5, - _ => 2, - }; - assert_eq!(case.allowances().len(), expected, "{}", case.name()); + // No value is loosened and no notice is declared. + assert!(case.allowances().is_empty(), "{}", case.name()); } let stores = StencilResolves { cross: Cross::Stores, diff --git a/crates/metal2vulkan-conformance/src/cases/stencil_resolved_sample.rs b/crates/metal2vulkan-conformance/src/cases/stencil_resolved_sample.rs index 93c45f884..a15242970 100644 --- a/crates/metal2vulkan-conformance/src/cases/stencil_resolved_sample.rs +++ b/crates/metal2vulkan-conformance/src/cases/stencil_resolved_sample.rs @@ -125,7 +125,6 @@ //! the case's sample count or make its format refuses the target and the suite counts the case //! [`LacksFeature`](crate::verdict::Verdict::LacksFeature) rather than leaving it uncompared. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -571,14 +570,6 @@ impl Case for ResolvedSample { RUNS } - fn allowances(&self) -> Vec { - // **No value is loosened**: every resolved byte and every resolved depth Metal leaves is - // one we must leave. The one declaration is the buffer each pass reads its resolved - // aspects back through, which is `Shared` ([`crate::replay::shared_memory_notice`], - // measured firing on the 5080). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shader_refs() } diff --git a/crates/metal2vulkan-conformance/src/cases/surface_fills.rs b/crates/metal2vulkan-conformance/src/cases/surface_fills.rs index d5170a9bf..77cf64a05 100644 --- a/crates/metal2vulkan-conformance/src/cases/surface_fills.rs +++ b/crates/metal2vulkan-conformance/src/cases/surface_fills.rs @@ -26,7 +26,6 @@ //! four bytes (a texture-buffer fill pattern over 32752 bytes, which ends Metal's process, is a //! case this round must not run). -use crate::allowance::Allowance; use crate::case::{Abort, Case, Fill, Input, MetalSource, PlaneTexture, Side}; use crate::recording::ShaderRef; use crate::replay::NOTICES_SITE; @@ -451,13 +450,6 @@ impl Case for SurfaceFills { MetalSource::carried_only(MEASURED_IN, NO_PUBLIC_CALL) } - fn allowances(&self) -> Vec { - // Metal announces nothing, so the notices site is the one field that may differ: the - // buffer the case reads the filled surfaces back through is `Shared` - // ([`crate::replay::shared_memory_notice`]). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { Ok(Vec::new()) } diff --git a/crates/metal2vulkan-conformance/src/cases/surface_textures.rs b/crates/metal2vulkan-conformance/src/cases/surface_textures.rs index 98c24b85c..98c63eb96 100644 --- a/crates/metal2vulkan-conformance/src/cases/surface_textures.rs +++ b/crates/metal2vulkan-conformance/src/cases/surface_textures.rs @@ -28,7 +28,6 @@ //! case, how many surfaces of each form it made. A case reads the texture's texels alone, never the //! surface's bytes, so where a side laid the planes is not compared. -use crate::allowance::Allowance; use crate::case::{ call, made, Abort, Case, Input, MetalSource, Side, SurfacePlane, SurfaceRoute, SurfaceTexture, }; @@ -226,12 +225,6 @@ impl Case for SurfaceTextures { MetalSource::Run } - fn allowances(&self) -> Vec { - // The GPU read lands in a `Shared` buffer, which is what - // [`crate::replay::shared_memory_notice`] is for; it loosens the notices site alone. - vec![crate::replay::shared_memory_notice()] - } - fn inputs(&self) -> Result, String> { let surface = &self.surface; let mut layout = Vec::new(); diff --git a/crates/metal2vulkan-conformance/src/cases/swizzled_storage.rs b/crates/metal2vulkan-conformance/src/cases/swizzled_storage.rs index 8ca0f15ce..6caac89ad 100644 --- a/crates/metal2vulkan-conformance/src/cases/swizzled_storage.rs +++ b/crates/metal2vulkan-conformance/src/cases/swizzled_storage.rs @@ -39,7 +39,6 @@ //! Nothing here can fault a GPU: one compute pass a dispatch, at most four threads, no loop and no //! sampling. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Bindings, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -436,13 +435,6 @@ impl Case for SwizzledStorage { MetalSource::Run } - fn allowances(&self) -> Vec { - // One declaration and no tolerance: the buffer each dispatch reads its texels back through is `Shared`, which is - // what [`crate::replay::shared_memory_notice`] is for. It loosens the notices site alone, - // so every value this case reads still compares exactly. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for kernel in self.kernels() { diff --git a/crates/metal2vulkan-conformance/src/cases/tessellation_sweeps.rs b/crates/metal2vulkan-conformance/src/cases/tessellation_sweeps.rs index d3f07794b..8a9fecdb2 100644 --- a/crates/metal2vulkan-conformance/src/cases/tessellation_sweeps.rs +++ b/crates/metal2vulkan-conformance/src/cases/tessellation_sweeps.rs @@ -345,11 +345,7 @@ pub(super) fn tessellation_notices() -> Vec { ] .into_iter() .map(|notice| crate::replay::notice_allowance(notice.code())) - .chain([ - // The factor, control-point and read-back buffers a tessellated draw carries are all - // `Shared` ([`crate::replay::shared_memory_notice`]). - crate::replay::shared_memory_notice(), - ]) + .chain([]) .collect() } diff --git a/crates/metal2vulkan-conformance/src/cases/texel_swizzles.rs b/crates/metal2vulkan-conformance/src/cases/texel_swizzles.rs index e1cbb8c7f..7c267678b 100644 --- a/crates/metal2vulkan-conformance/src/cases/texel_swizzles.rs +++ b/crates/metal2vulkan-conformance/src/cases/texel_swizzles.rs @@ -38,7 +38,6 @@ //! MSL 4.1 defines (a read out of bounds reads zero, a write out of bounds is ignored), so they are //! not an out-of-bounds access the device may fault on. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Bindings, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -532,13 +531,6 @@ impl Case for TexelSwizzles { MetalSource::Run } - fn allowances(&self) -> Vec { - // One declaration and no tolerance: the buffer each dispatch writes its swizzled texels into is `Shared`, which is - // what [`crate::replay::shared_memory_notice`] is for. It loosens the notices site alone, - // so every value this case reads still compares exactly. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of(self.fixture()) } @@ -637,13 +629,6 @@ impl Case for ViewedTexelSwizzles { MetalSource::Run } - fn allowances(&self) -> Vec { - // One declaration and no tolerance: the buffer each dispatch writes its swizzled texels into is `Shared`, which is - // what [`crate::replay::shared_memory_notice`] is for. It loosens the notices site alone, - // so every value this case reads still compares exactly. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of(FLOAT_FIXTURE) } diff --git a/crates/metal2vulkan-conformance/src/cases/texture_buffer_fills.rs b/crates/metal2vulkan-conformance/src/cases/texture_buffer_fills.rs index 145e91094..7f29e4228 100644 --- a/crates/metal2vulkan-conformance/src/cases/texture_buffer_fills.rs +++ b/crates/metal2vulkan-conformance/src/cases/texture_buffer_fills.rs @@ -522,12 +522,6 @@ impl Case for ByteFills { Ok(Some((MEASURED_RUNS, sites.finish()))) } - fn allowances(&self) -> Vec { - // The texture buffer these fills write into is backed by a `Shared` buffer - // ([`crate::replay::shared_memory_notice`]). - vec![crate::replay::shared_memory_notice()] - } - fn run(&self, side: &mut dyn Side, sites: &mut Sites) -> Result<(), Abort> { let work = self.work().map_err(|why| Abort { at: "work".to_owned(), @@ -653,12 +647,6 @@ impl Case for LongFills { Ok(Some((MEASURED_RUNS, sites.finish()))) } - fn allowances(&self) -> Vec { - // The texture buffer these fills write into is backed by a `Shared` buffer - // ([`crate::replay::shared_memory_notice`]). - vec![crate::replay::shared_memory_notice()] - } - fn run(&self, side: &mut dyn Side, sites: &mut Sites) -> Result<(), Abort> { let done = call(sites, "work", side.work(&self.work()), |_| Value::Absent)?; for (at, &(format, _, _, width, pattern, _)) in LONG.iter().enumerate() { diff --git a/crates/metal2vulkan-conformance/src/cases/texture_buffer_tails.rs b/crates/metal2vulkan-conformance/src/cases/texture_buffer_tails.rs index 2d3e168e0..93562b22a 100644 --- a/crates/metal2vulkan-conformance/src/cases/texture_buffer_tails.rs +++ b/crates/metal2vulkan-conformance/src/cases/texture_buffer_tails.rs @@ -22,13 +22,7 @@ //! wrote every texel, with the buffer's 20000 bytes after each write; and, in a program of blits, //! reads it into a buffer as made, writes texels 880 to 943 by a blit from a buffer, and reads it //! back by a blit and by `getBytes:`, with the buffer's bytes. -//! -//! Every byte compares exactly. What differs is the announcing: a device without unified memory -//! announces `shared-in-system-memory` for the `Shared` buffers the answers are read back -//! through. Nothing here can fault a GPU: one -//! small texture buffer, eight threads, no loop. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Bindings, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -297,12 +291,6 @@ impl Case for TextureBufferTails { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every answer is read back through `Shared` buffers, so a device without unified memory - // announces `shared-in-system-memory` (`crate::replay::shared_memory_notice`). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for extension in [RUNTIME_TEXT, METAL_TEXT] { diff --git a/crates/metal2vulkan-conformance/src/cases/texture_descriptor_pairs.rs b/crates/metal2vulkan-conformance/src/cases/texture_descriptor_pairs.rs index be5a1f914..2d8b10384 100644 --- a/crates/metal2vulkan-conformance/src/cases/texture_descriptor_pairs.rs +++ b/crates/metal2vulkan-conformance/src/cases/texture_descriptor_pairs.rs @@ -586,12 +586,6 @@ impl Case for DescriptorPairs { crate::degradation::Degradation::CompressedTexelDecode.code(), )); } - if self.name == STORAGE { - // The storage table names `Shared` among the modes it crosses, so this row alone - // makes a `Shared` allocation ([`crate::replay::shared_memory_notice`]). Measured - // firing for this row alone, on the 5080. - named.push(crate::replay::shared_memory_notice()); - } // The runtime's answers are the device's own, held by their property and not by // Metal's numbers (`texture_query::DEVICE_OWN_SIZES`). named.extend(self.queries.iter().map(|query| { diff --git a/crates/metal2vulkan-conformance/src/cases/texture_fills.rs b/crates/metal2vulkan-conformance/src/cases/texture_fills.rs index 55e70aad4..dd8f126c8 100644 --- a/crates/metal2vulkan-conformance/src/cases/texture_fills.rs +++ b/crates/metal2vulkan-conformance/src/cases/texture_fills.rs @@ -714,16 +714,14 @@ impl Case for TextureFills { fn allowances(&self) -> Vec { // What this work announces on a device that needs it: a block-compressed texture's device - // decode, announced where the runtime makes it (`compressed-texel-decode`), and shared - // storage in system memory. Metal announces neither, so the notices site differs on such a - // device, and the difference is justified where one of these fired. A float depth's - // denormals are the device's own answer, which the suite declares for every case - // (`crate::replay::NATIVE_NOTES`). The format's own digest still compares. - use crate::degradation::Degradation as D; - [D::CompressedTexelDecode, D::SharedInSystemMemory] - .into_iter() - .map(|kind| notice_allowance(kind.code())) - .collect() + // decode, announced where the runtime makes it (`compressed-texel-decode`). Metal + // announces none, so the notices site differs on such a device, and the difference is + // justified where it fired. A float depth's denormals are the device's own answer, which + // the suite declares for every case (`crate::replay::NATIVE_NOTES`). The format's own + // digest still compares. + vec![notice_allowance( + crate::degradation::Degradation::CompressedTexelDecode.code(), + )] } fn carried_transcript(&self) -> Result, String> { @@ -852,13 +850,6 @@ impl Case for TwoPlaneHeapFill { MetalSource::Run } - /// What the work declares: every byte of the heap compares exactly, and the buffer this case - /// reads the filled planes back through is `Shared`, which a device with no unified memory - /// keeps in system memory because that is the only memory both sides can reach. - fn allowances(&self) -> Vec { - vec![crate::replay::shared_memory_notice()] - } - fn inputs(&self) -> Result, String> { let p = self.probe()?; let Fill::Bytes(n) = p.fill else { diff --git a/crates/metal2vulkan-conformance/src/cases/texture_view_casts.rs b/crates/metal2vulkan-conformance/src/cases/texture_view_casts.rs index 01936385d..3112c2ccd 100644 --- a/crates/metal2vulkan-conformance/src/cases/texture_view_casts.rs +++ b/crates/metal2vulkan-conformance/src/cases/texture_view_casts.rs @@ -33,7 +33,6 @@ //! names its level and slice in sixteenths and eighths, which a half holds exactly, so each sample //! is the colour cleared where the view and the parent share the texel, or it is a difference. -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -394,13 +393,6 @@ impl Case for TextureViewCast { MetalSource::Run } - fn allowances(&self) -> Vec { - // The samples land in a `Shared` buffer, and the points are read from one, which is what - // [`crate::replay::shared_memory_notice`] is for; it loosens the notices site alone, and - // every sample still compares exactly. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let fixture = Fixture::new(FIXTURE); let entry = [kernel(self.pair.parent), kernel(self.pair.view)].join("+"); diff --git a/crates/metal2vulkan-conformance/src/cases/threadgroup_start.rs b/crates/metal2vulkan-conformance/src/cases/threadgroup_start.rs index c34431cea..beb9482b8 100644 --- a/crates/metal2vulkan-conformance/src/cases/threadgroup_start.rs +++ b/crates/metal2vulkan-conformance/src/cases/threadgroup_start.rs @@ -14,7 +14,6 @@ //! compares exactly. Nothing here can fault a GPU: one pass of six dispatches, every access inside //! the threadgroup's own memory or the output's 16 bytes, loops bounded by the array's words. -use crate::allowance::Allowance; use crate::case::{made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::compute_pass::{ComputePass, ComputeStep, Dispatching}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; @@ -99,13 +98,6 @@ impl Case for ThreadgroupStart { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every byte compares exactly. The answer is read back through a `Shared` buffer, so a - // device without unified memory announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for extension in [RUNTIME_TEXT, METAL_TEXT] { diff --git a/crates/metal2vulkan-conformance/src/cases/tile_threadgroups.rs b/crates/metal2vulkan-conformance/src/cases/tile_threadgroups.rs index e8deacc58..14d17aa22 100644 --- a/crates/metal2vulkan-conformance/src/cases/tile_threadgroups.rs +++ b/crates/metal2vulkan-conformance/src/cases/tile_threadgroups.rs @@ -680,16 +680,7 @@ impl Case for TileThreadgroups { } fn allowances(&self) -> Vec { - let mut allowances = tile_notice_allowances(); - // The record buffer a tile-order or tile-grid pass writes its order into is `Shared` - // ([`crate::replay::shared_memory_notice`]), and the RTX 5080 was measured announcing it - // for each of those five rows. The thread-limit case answers getters and the two blur - // cases were measured announcing nothing of the kind on either venue, so neither declares - // it: a declaration no run justifies is one nobody is checking. - if matches!(self.shape, Shape::Order { .. } | Shape::Grid) { - allowances.push(crate::replay::shared_memory_notice()); - } - allowances + tile_notice_allowances() } fn shaders(&self) -> Result, String> { @@ -1071,16 +1062,9 @@ mod tests { assert_eq!(case.metal_source(), MetalSource::Run); case.shaders().unwrap(); let allowances = case.allowances(); - // Every case declares the family's own list, and the five that read a record buffer - // back declare the notice a device's own memory model provokes besides. Nothing else - // is named and nothing is loosened, so a value tolerance added later fails here. - let reads_a_buffer = matches!(case.shape, Shape::Order { .. } | Shape::Grid); - assert_eq!( - allowances.len(), - TILE_PASS_NOTICES.len() + usize::from(reads_a_buffer), - "{}", - case.name() - ); + // Every case declares the family's own list. Nothing else is named and nothing is + // loosened, so a value tolerance added later fails here. + assert_eq!(allowances.len(), TILE_PASS_NOTICES.len(), "{}", case.name()); for allowance in &allowances { assert_eq!( allowance.path, @@ -1091,10 +1075,8 @@ mod tests { assert_eq!(allowance.loosening, Loosening::Unchecked, "{allowance:?}"); match &allowance.justified_by { Justification::Degradation(code) => assert!( - TILE_PASS_NOTICES.iter().any(|kind| kind.code() == code) - || code == Degradation::SharedInSystemMemory.code(), - "{}: {code} is neither a tile-pass notice nor the one a device's own \ - memory model provokes", + TILE_PASS_NOTICES.iter().any(|kind| kind.code() == code), + "{}: {code} is not a tile-pass notice", case.name() ), other => panic!("{}: an unexpected tolerance: {other:?}", case.name()), diff --git a/crates/metal2vulkan-conformance/src/cases/topology_classes.rs b/crates/metal2vulkan-conformance/src/cases/topology_classes.rs index d1e3082f0..5255e3373 100644 --- a/crates/metal2vulkan-conformance/src/cases/topology_classes.rs +++ b/crates/metal2vulkan-conformance/src/cases/topology_classes.rs @@ -231,11 +231,7 @@ impl Case for TopologyClassCase { // `rt6_full` computes its clip position from the vertex id under the fixture's default fast // math, whose `fast-math-rewrites` the suite declares for every case // (`crate::replay::NATIVE_NOTES`); it moves no pixel of a fullscreen triangle. - // - // One is declared for both cases, and it belongs to the venue rather than to a - // topology class: the positions and the read-back are `Shared` - // ([`crate::replay::shared_memory_notice`], measured on the 5080). It loosens no texel. - let mut allowances: Vec = vec![crate::replay::shared_memory_notice()]; + let mut allowances: Vec = Vec::new(); // And the point-size function's case alone, whose draws are points, declares what a // device whose largest point is below Metal's announces at a draw of points of the size it // writes: measured on llvmpipe for that row and for neither the plain row, which draws @@ -513,8 +509,8 @@ mod tests { } } // Only the notices site may be loosened, and only the point-size case declares the - // point-size notice beside the venue's memory model; the fast-math notice is the - // suite's (`crate::replay::NATIVE_NOTES`), declared by neither case. + // point-size notice; the fast-math notice is the suite's + // (`crate::replay::NATIVE_NOTES`), declared by neither case. for allowance in case.allowances() { assert_eq!( allowance.path, @@ -535,7 +531,7 @@ mod tests { ); assert_eq!( case.allowances().len(), - 1 + usize::from(writes_point_size(&case.subject)), + usize::from(writes_point_size(&case.subject)), "{}: an unexpected number of declarations", case.name() ); diff --git a/crates/metal2vulkan-conformance/src/cases/two_plane_copies.rs b/crates/metal2vulkan-conformance/src/cases/two_plane_copies.rs index d1d810555..f1530775a 100644 --- a/crates/metal2vulkan-conformance/src/cases/two_plane_copies.rs +++ b/crates/metal2vulkan-conformance/src/cases/two_plane_copies.rs @@ -36,7 +36,6 @@ //! - its chained-blit case asserts a notice fired on the second copy and not the first, which is a //! per-device once rule rather than a Metal observation. -use crate::allowance::Allowance; use crate::case::{answered, call, Abort, Case, Input, MetalSource, Side}; use crate::measured::hex_bytes; use crate::replay::NOTICES_SITE; @@ -423,14 +422,6 @@ impl Case for RowBlits { ]) } - fn allowances(&self) -> Vec { - // Every word compares exactly. Every case declares the notice the venue's own memory model - // provokes: the buffer it reads the copied planes back through is `Shared`, which a device - // with no unified memory keeps in system memory because that is the only memory both sides - // can reach. - vec![crate::replay::shared_memory_notice()] - } - fn carried_transcript(&self) -> Result, String> { if self.announced { // Record mode runs this one on Metal. Its probe's table stays as the cross-check @@ -652,12 +643,6 @@ impl Case for PadFills { MetalSource::carried_only(MEASURED_IN, PRIVATE_FILL) } - fn allowances(&self) -> Vec { - // Every digest compares exactly. The venue's own, for the `Shared` read-back buffer, as - // the row blits state. - vec![crate::replay::shared_memory_notice()] - } - fn inputs(&self) -> Result, String> { let mut rows = String::new(); let mut patterns = Vec::new(); diff --git a/crates/metal2vulkan-conformance/src/cases/two_plane_heap_blits.rs b/crates/metal2vulkan-conformance/src/cases/two_plane_heap_blits.rs index 03bc26b13..0bb3eafbf 100644 --- a/crates/metal2vulkan-conformance/src/cases/two_plane_heap_blits.rs +++ b/crates/metal2vulkan-conformance/src/cases/two_plane_heap_blits.rs @@ -39,7 +39,6 @@ //! recovered under MoltenVK, which is *our* answer, not Metal's — so until record mode ran, that //! site's expectation was never tied to Metal at all. -use crate::allowance::Allowance; use crate::case::{call, Abort, Case, Input, MetalSource, Side}; use crate::measured::public_fixture; use crate::replay::NOTICES_SITE; @@ -573,12 +572,6 @@ impl Case for HeapBlits { ]) } - fn allowances(&self) -> Vec { - // Every heap byte the case reads compares exactly. The buffer the case reads the blitted - // planes back through is `Shared` ([`crate::replay::shared_memory_notice`]). - vec![crate::replay::shared_memory_notice()] - } - fn run(&self, side: &mut dyn Side, sites: &mut Sites) -> Result<(), Abort> { for (at, case) in CASES.iter().enumerate() { let mut work = Work::new(); diff --git a/crates/metal2vulkan-conformance/src/cases/two_plane_samples.rs b/crates/metal2vulkan-conformance/src/cases/two_plane_samples.rs index 330a793b8..c0ab4158a 100644 --- a/crates/metal2vulkan-conformance/src/cases/two_plane_samples.rs +++ b/crates/metal2vulkan-conformance/src/cases/two_plane_samples.rs @@ -382,13 +382,11 @@ impl Case for TwoPlaneSamples { } fn allowances(&self) -> Vec { - // Declarations and no tolerance: the buffer each pass writes its samples into is `Shared`, - // which is what [`crate::replay::shared_memory_notice`] is for, and a linear case's filter - // of the decoded taps is the device's arithmetic (`bicubic-filter-arithmetic`, announced on - // the M3 Max for the eight linear cases; a nearest sampler's word holds no such note). - // Each loosens the notices site alone, so every value this case reads still compares - // exactly. - let mut named = vec![crate::replay::shared_memory_notice()]; + // A declaration and no tolerance: a linear case's filter of the decoded taps is the + // device's arithmetic (`bicubic-filter-arithmetic`, announced on the M3 Max for the eight + // linear cases; a nearest sampler's word holds no such note). It loosens the notices site + // alone, so every value this case reads still compares exactly. + let mut named = Vec::new(); if self.state.starts_with('l') { named.push(crate::replay::notice_allowance( crate::degradation::Degradation::BicubicFilterArithmetic.code(), diff --git a/crates/metal2vulkan-conformance/src/cases/vector_word_phases.rs b/crates/metal2vulkan-conformance/src/cases/vector_word_phases.rs index 3d23abba5..b41c75834 100644 --- a/crates/metal2vulkan-conformance/src/cases/vector_word_phases.rs +++ b/crates/metal2vulkan-conformance/src/cases/vector_word_phases.rs @@ -16,7 +16,6 @@ //! device, and every byte compares exactly. Nothing here can fault a GPU: one pass of two //! dispatches of 64 threads, each access inside its buffer, no loop. -use crate::allowance::Allowance; use crate::case::{made, Abort, Case, Failure, Input, MetalSource, Side}; use crate::compute_pass::{ComputePass, ComputeStep, Dispatching}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; @@ -121,13 +120,6 @@ impl Case for VectorWordPhases { MetalSource::Run } - fn allowances(&self) -> Vec { - // Every byte compares exactly. The answers are read back through `Shared` buffers, so a - // device without unified memory announces `shared-in-system-memory` - // (`crate::replay::shared_memory_notice` holds the whole reason). - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for entry in [WORDS, VEC16] { diff --git a/crates/metal2vulkan-conformance/src/cases/vertex_attribute_strides.rs b/crates/metal2vulkan-conformance/src/cases/vertex_attribute_strides.rs index 9c03931cc..0803ade66 100644 --- a/crates/metal2vulkan-conformance/src/cases/vertex_attribute_strides.rs +++ b/crates/metal2vulkan-conformance/src/cases/vertex_attribute_strides.rs @@ -43,7 +43,6 @@ use super::indirect_commands::{ first_refused_piece, fixture_inputs, program_node, shaders_of, UNWRITTEN, }; -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::compute_pass::ATTRIBUTE_STRIDE_STATIC; use crate::fixture::Fixture; @@ -169,12 +168,6 @@ impl Case for VertexAttributeStrides { MetalSource::Run } - fn allowances(&self) -> Vec { - // The answer is read back through a `Shared` buffer, so a device without unified memory - // announces `shared-in-system-memory`; the declaration covers the notices site alone. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of(FIXTURE, FIXTURE) } diff --git a/crates/metal2vulkan-conformance/src/cases/vertex_constant_step.rs b/crates/metal2vulkan-conformance/src/cases/vertex_constant_step.rs index b69f5e4d7..5eb710498 100644 --- a/crates/metal2vulkan-conformance/src/cases/vertex_constant_step.rs +++ b/crates/metal2vulkan-conformance/src/cases/vertex_constant_step.rs @@ -35,7 +35,6 @@ use super::indirect_commands::{ first_refused_piece, fixture_inputs, program_node, shaders_of, UNWRITTEN, }; -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::Fixture; use crate::recording::ShaderRef; @@ -178,12 +177,6 @@ impl Case for VertexConstantStep { MetalSource::Run } - fn allowances(&self) -> Vec { - // The answer is read back through a `Shared` buffer, so a device without unified memory - // announces `shared-in-system-memory`; the declaration covers the notices site alone. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of(FIXTURE, FIXTURE) } diff --git a/crates/metal2vulkan-conformance/src/cases/vertex_fetch_reach.rs b/crates/metal2vulkan-conformance/src/cases/vertex_fetch_reach.rs index ef77bbf1d..531457046 100644 --- a/crates/metal2vulkan-conformance/src/cases/vertex_fetch_reach.rs +++ b/crates/metal2vulkan-conformance/src/cases/vertex_fetch_reach.rs @@ -50,7 +50,6 @@ use super::indirect_commands::{ first_refused_piece, fixture_inputs, program_node, shaders_of, UNWRITTEN, }; -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::Fixture; use crate::recording::ShaderRef; @@ -253,12 +252,6 @@ impl Case for VertexFetchReach { MetalSource::Run } - fn allowances(&self) -> Vec { - // The answer is read back through a `Shared` buffer, so a device without unified memory - // announces `shared-in-system-memory`; the declaration covers the notices site alone. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of(FIXTURE, FIXTURE) } diff --git a/crates/metal2vulkan-conformance/src/cases/vertex_formats.rs b/crates/metal2vulkan-conformance/src/cases/vertex_formats.rs index b5f81b248..04cc68c06 100644 --- a/crates/metal2vulkan-conformance/src/cases/vertex_formats.rs +++ b/crates/metal2vulkan-conformance/src/cases/vertex_formats.rs @@ -154,7 +154,6 @@ //! every fetch is inside a record the case bound, and the whole case is one command buffer, one //! commit and one wait. -use crate::allowance::Allowance; use crate::attribute_coding as coding; use crate::attribute_coding::{shape, FILLER, ROWS, SLOT}; use crate::case::{ @@ -352,19 +351,6 @@ impl Case for VertexFormats { MetalSource::Run } - fn allowances(&self) -> Vec { - // Nothing is loosened. Every decoding here is exact arithmetic on the codes the record - // holds -- an integer widened, a code divided by its own maximum, a half or a float - // widened, a packed field extracted -- so a component that differs is a difference in the - // decode and not a rounding, and a tolerance written here would hide the bug the sweep - // exists to find. - // - // One notice is declared, and it is the venue's and not this sweep's: the buffer each draw - // reads its fetched rows back through is `Shared`, which a device with no unified memory - // keeps in system memory because that is the only memory both sides can reach. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for extension in [RUNTIME_TEXT, METAL_TEXT] { diff --git a/crates/metal2vulkan-conformance/src/cases/vertex_step_rate.rs b/crates/metal2vulkan-conformance/src/cases/vertex_step_rate.rs index 3c4de260d..95523cb26 100644 --- a/crates/metal2vulkan-conformance/src/cases/vertex_step_rate.rs +++ b/crates/metal2vulkan-conformance/src/cases/vertex_step_rate.rs @@ -37,7 +37,6 @@ use super::indirect_commands::{ first_refused_piece, fixture_inputs, program_node, shaders_of, UNWRITTEN, }; -use crate::allowance::Allowance; use crate::case::{call, made, Abort, Case, Failure, Handle, Input, MetalSource, Side}; use crate::fixture::Fixture; use crate::recording::ShaderRef; @@ -179,12 +178,6 @@ impl Case for VertexStepRate { MetalSource::Run } - fn allowances(&self) -> Vec { - // The answer is read back through a `Shared` buffer, so a device without unified memory - // announces `shared-in-system-memory`; the declaration covers the notices site alone. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { shaders_of(FIXTURE, FIXTURE) } diff --git a/crates/metal2vulkan-conformance/src/cases/visibility.rs b/crates/metal2vulkan-conformance/src/cases/visibility.rs index 11a9e9eea..3a69fd64e 100644 --- a/crates/metal2vulkan-conformance/src/cases/visibility.rs +++ b/crates/metal2vulkan-conformance/src/cases/visibility.rs @@ -62,16 +62,13 @@ //! //! //! Nothing here can fault a GPU: one 4 by 4 target a pass, three vertices a draw, no loop. -use crate::allowance::{Allowance, Justification, Loosening}; use crate::case::{Abort, Case, Failure, Handle, Input, MetalSource, Side}; -use crate::degradation::Degradation; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; use crate::render::{ ColorState, PassColor, PassDepth, RenderPass, RenderPipelineSpec, RenderStep, RenderWork, TargetSpec, }; -use crate::replay::NOTICES_SITE; use crate::transcript::{ByteLayout, Digest, Element, Node, Observed, Sites, Value}; use crate::values::{StoreAction, VisibilityResultMode, VisibilityResultType}; use metal2vulkan::metal::state::DepthStencilDescriptor; @@ -524,14 +521,6 @@ pub fn all() -> Vec { SHAPES.iter().map(|shape| Visibility { shape }).collect() } -/// The degrade notices a visibility pass may announce. As with every family, it is a list rather -/// than a device query, because a case never branches on the device: it asks by running and reads -/// what came back. A venue that announces a kind not here fails the case until its kind is added. -const PASS_NOTICES: &[Degradation] = &[ - // A `Shared` buffer the device keeps in system memory, which the visibility buffer is. - Degradation::SharedInSystemMemory, -]; - /// The shape's passes by command buffer, as indices: all in one where it is `joined`, else one /// each. fn groups(shape: &Shape) -> Vec> { @@ -794,21 +783,6 @@ impl Case for Visibility { MetalSource::Run } - fn allowances(&self) -> Vec { - // The notices site alone: a visibility result is a number Metal wrote, and any number - // that differs is a bug, not a near-equivalent. - PASS_NOTICES - .iter() - .map(|kind| { - Allowance::new( - format!("case/{NOTICES_SITE}/*"), - Loosening::Unchecked, - Justification::notice(*kind), - ) - }) - .collect() - } - fn shaders(&self) -> Result, String> { let fixture = self.fixture(); [RUNTIME_TEXT, METAL_TEXT] @@ -1211,13 +1185,12 @@ mod tests { } } - /// Every case of the family is in the table, states its inputs, and loosens **only** its - /// notices site. + /// Every case of the family is in the table, states its inputs, and loosens nothing. /// /// A visibility result is a number Metal wrote; a number that differs is a bug, never a /// near-equivalent. A case that ever loosened a word would fail here. #[test] - fn every_case_is_tabled_and_loosens_its_notices_alone() { + fn every_case_is_tabled_and_loosens_nothing() { for case in all() { assert!( TABLE.iter().any(|(name, _)| *name == case.name()), @@ -1232,22 +1205,7 @@ mod tests { ); assert_eq!(case.metal_source(), MetalSource::Run); case.shaders().unwrap(); - for allowance in case.allowances() { - assert_eq!( - allowance.path, - format!("case/{NOTICES_SITE}/*"), - "{}: an allowance outside the notices site", - case.name() - ); - match &allowance.justified_by { - Justification::Degradation(code) => assert!( - PASS_NOTICES.iter().any(|kind| kind.code() == code), - "{}: {code} is not a visibility-pass notice", - case.name() - ), - other => panic!("{}: an unexpected tolerance: {other:?}", case.name()), - } - } + assert!(case.allowances().is_empty(), "{}", case.name()); } } diff --git a/crates/metal2vulkan-conformance/src/cases/visible_tables.rs b/crates/metal2vulkan-conformance/src/cases/visible_tables.rs index efdb48d2a..acd6d3258 100644 --- a/crates/metal2vulkan-conformance/src/cases/visible_tables.rs +++ b/crates/metal2vulkan-conformance/src/cases/visible_tables.rs @@ -102,7 +102,6 @@ //! Every field is a number, a name, an enumerator or a bool. The family declares no tolerance and //! announces nothing: no float, no texture object and no sampler is touched. -use crate::allowance::Allowance; use crate::case::{Abort, Case, Failure, Input, MetalSource, Side}; use crate::fixture::{Fixture, METAL_TEXT, RUNTIME_TEXT}; use crate::recording::ShaderRef; @@ -367,19 +366,6 @@ impl Case for VisibleTablesCase { MetalSource::Run } - fn allowances(&self) -> Vec { - // One declaration and no tolerance, and only the compute cases make it: those dispatch the - // caller and read their answers back through a `Shared` buffer, which is what - // [`crate::replay::shared_memory_notice`] is for. A drawing-stage case makes pipelines and - // tables and reads nothing back, so it allocates no such buffer, announces nothing and - // declares nothing -- which is the falsification of the declaration rather than a - // restatement of it. - match self.spec.maker { - Maker::Compute => vec![crate::replay::shared_memory_notice()], - Maker::DrawingStage(_) | Maker::TileStage(_) => Vec::new(), - } - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for fixture in [self.caller(), self.functions()] { diff --git a/crates/metal2vulkan-conformance/src/cases/wide_int_attributes.rs b/crates/metal2vulkan-conformance/src/cases/wide_int_attributes.rs index e7b9f5b05..f264eb68f 100644 --- a/crates/metal2vulkan-conformance/src/cases/wide_int_attributes.rs +++ b/crates/metal2vulkan-conformance/src/cases/wide_int_attributes.rs @@ -68,7 +68,6 @@ //! costs one commit and one wait; every fetch is inside the record the case bound; no texture, no //! loop, no rasterization. -use crate::allowance::Allowance; use crate::attribute_coding as coding; use crate::attribute_coding::{shape, FILLER, ROWS, SLOT}; use crate::case::{ @@ -260,17 +259,6 @@ impl Case for WideIntAttributes { MetalSource::Run } - fn allowances(&self) -> Vec { - // Nothing is loosened, and nothing here could be: an integer attribute converts nothing, so - // every component the fetch answers is the code the record holds, bit for bit. A tolerance - // would hide the only bug this sweep exists to find. - // - // One notice is declared, and it is the venue's and not this sweep's: the buffer each draw - // reads its fetched rows back through is `Shared`, which a device with no unified memory - // keeps in system memory because that is the only memory both sides can reach. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for extension in [RUNTIME_TEXT, METAL_TEXT] { diff --git a/crates/metal2vulkan-conformance/src/cases/wide_points.rs b/crates/metal2vulkan-conformance/src/cases/wide_points.rs index cba629e32..fdd593e50 100644 --- a/crates/metal2vulkan-conformance/src/cases/wide_points.rs +++ b/crates/metal2vulkan-conformance/src/cases/wide_points.rs @@ -210,19 +210,10 @@ impl Case for WidePoints { // handling and says so. Measured: lavapipe announces it here and MoltenVK does not, so the // case reads `announced` on lavapipe and `exact` on MoltenVK. No other notice fired for // this case on either venue, and a tolerance no run justifies is not carried. - // - // The positions and the read-back are `Shared`, and a device with no unified memory keeps - // a `Shared` allocation in system memory because that is the only memory both sides can - // reach (`shared-in-system-memory`). That is the venue's memory model, not this case's - // point. [Degradation::DevicePointSize] .into_iter() .map(|kind| crate::replay::notice_allowance(kind.code())) - .chain([ - // The positions and the read-back are `Shared` - // ([`crate::replay::shared_memory_notice`]). - crate::replay::shared_memory_notice(), - ]) + .chain([]) .collect() } diff --git a/crates/metal2vulkan-conformance/src/cases/ycbcr_gathers.rs b/crates/metal2vulkan-conformance/src/cases/ycbcr_gathers.rs index 4ac6e9a39..e650a1361 100644 --- a/crates/metal2vulkan-conformance/src/cases/ycbcr_gathers.rs +++ b/crates/metal2vulkan-conformance/src/cases/ycbcr_gathers.rs @@ -22,7 +22,6 @@ //! //! Two 576-byte surfaces, one sampler and four dispatches of 3,024 threads each, with no loop. -use crate::allowance::Allowance; use crate::case::{ made, Abort, Bindings, Case, Failure, Input, MetalSource, PlaneTexture, SamplerSpec, Side, }; @@ -187,13 +186,6 @@ impl Case for YCbCrGathers { MetalSource::Run } - fn allowances(&self) -> Vec { - // One declaration and no tolerance: the buffers the kernels write into are `Shared` - // ([`crate::replay::shared_memory_notice`]). It loosens the notices site alone, so every - // value still compares exactly. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let mut shaders = Vec::new(); for (entry, _, _) in ENTRIES { diff --git a/crates/metal2vulkan-conformance/src/cases/ycbcr_minify.rs b/crates/metal2vulkan-conformance/src/cases/ycbcr_minify.rs index d908c076a..0ffedc0f8 100644 --- a/crates/metal2vulkan-conformance/src/cases/ycbcr_minify.rs +++ b/crates/metal2vulkan-conformance/src/cases/ycbcr_minify.rs @@ -49,7 +49,6 @@ //! 23.7 MiB shared buffer, which is the largest input in the suite and well inside the project's //! 500 MiB ceiling. -use crate::allowance::Allowance; use crate::case::{ made, Abort, Bindings, Case, Failure, Input, MetalSource, PlaneTexture, SamplerSpec, Side, }; @@ -256,13 +255,6 @@ impl Case for MinifyBand { MetalSource::Run } - fn allowances(&self) -> Vec { - // One declaration and no tolerance: the buffer each band writes its minified samples into is `Shared`, which is - // what [`crate::replay::shared_memory_notice`] is for. It loosens the notices site alone, - // so every value this case reads still compares exactly. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let fixture = Fixture { name: SAMPLE_FIXTURE, diff --git a/crates/metal2vulkan-conformance/src/cases/ycbcr_textures.rs b/crates/metal2vulkan-conformance/src/cases/ycbcr_textures.rs index 12be78937..fcae1bb3f 100644 --- a/crates/metal2vulkan-conformance/src/cases/ycbcr_textures.rs +++ b/crates/metal2vulkan-conformance/src/cases/ycbcr_textures.rs @@ -368,13 +368,6 @@ impl Case for TexelReads { MetalSource::Run } - fn allowances(&self) -> Vec { - // One declaration and no tolerance: the buffer the texel-read case writes its reads into is `Shared`, which is - // what [`crate::replay::shared_memory_notice`] is for. It loosens the notices site alone, - // so every value this case reads still compares exactly. - vec![crate::replay::shared_memory_notice()] - } - fn shaders(&self) -> Result, String> { let fixture = Fixture { name: READ_FIXTURE, diff --git a/crates/metal2vulkan-conformance/src/degradation.rs b/crates/metal2vulkan-conformance/src/degradation.rs index 5b154a15b..9bde03ab2 100644 --- a/crates/metal2vulkan-conformance/src/degradation.rs +++ b/crates/metal2vulkan-conformance/src/degradation.rs @@ -4,7 +4,7 @@ //! A case loosens a field by naming a code ([`crate::allowance`]), and the comparison holds it //! there only where the run announced that code. The runtime's side announces the codes of //! the precision notes its states, textures and sampler states carry -//! ([`Degradation::from_precision_note`]); a code no note announces justifies nothing on its run. +//! ([`Degradation::from_precision_note`]), and every kind here is one of those notes'. use metal2vulkan::pipeline::PrecisionNote; @@ -15,8 +15,6 @@ pub enum Degradation { DeviceRoundedResolve, /// `metal2vulkan-degrade-device-reconvergence`. DeviceReconvergence, - /// `metal2vulkan-degrade-shared-in-system-memory`. - SharedInSystemMemory, /// `metal2vulkan-degrade-device-filtered-mipmaps`. DeviceFilteredMipmaps, /// `metal2vulkan-degrade-capped-lod-bias`. @@ -196,7 +194,6 @@ impl Degradation { pub const ALL: &'static [Degradation] = &[ Degradation::DeviceRoundedResolve, Degradation::DeviceReconvergence, - Degradation::SharedInSystemMemory, Degradation::DeviceFilteredMipmaps, Degradation::CappedLodBias, Degradation::SnormMinimumKept, @@ -290,7 +287,6 @@ impl Degradation { match self { Degradation::DeviceRoundedResolve => "metal2vulkan-degrade-device-rounded-resolve", Degradation::DeviceReconvergence => "metal2vulkan-degrade-device-reconvergence", - Degradation::SharedInSystemMemory => "metal2vulkan-degrade-shared-in-system-memory", Degradation::DeviceFilteredMipmaps => "metal2vulkan-degrade-device-filtered-mipmaps", Degradation::CappedLodBias => "metal2vulkan-degrade-capped-lod-bias", Degradation::SnormMinimumKept => "metal2vulkan-degrade-snorm-minimum-kept", diff --git a/crates/metal2vulkan-conformance/src/replay.rs b/crates/metal2vulkan-conformance/src/replay.rs index d0712687a..9e7e738b6 100644 --- a/crates/metal2vulkan-conformance/src/replay.rs +++ b/crates/metal2vulkan-conformance/src/replay.rs @@ -337,33 +337,6 @@ pub fn notice_allowance(code: &str) -> crate::allowance::Allowance { ) } -/// The declaration a case needs for the one notice a **venue's memory model** provokes and no -/// recording of this suite could have declared: `shared-in-system-memory`, which the runtime -/// announces for a `Shared` buffer or heap on a device whose GPU does not share the CPU's memory -/// ([`crate::degradation::Degradation::SharedInSystemMemory`]). -/// -/// **Why it is the venue's and not ours.** Every recording here was taken on an Apple chip, where -/// the GPU and the CPU hold one memory, so a `Shared` resource is in device memory by construction -/// and the notice cannot fire at all — Metal recorded nothing for a case to compare it against, -/// and MoltenVK on the same chip announces nothing either. A discrete card has no such memory: the -/// same resource lies in host-cached system memory and the GPU reads it across the bus, which is -/// exactly what the notice says. So the difference belongs to the device, the notice is the -/// runtime reporting it honestly, and a case that reads its answer back through a `Shared` buffer -/// has to name it or read `Divergent` on every such card for a reason that is not a wrong answer. -/// -/// **It is a declaration and never an excuse.** Like every [`notice_allowance`] it loosens the -/// notices site alone, so a case that names it holds every one of its values to Metal's exactly. -/// A case whose values also differ on such a device is a separate finding and keeps its strict -/// value comparison. -/// -/// **It is still held to its evidence.** A case names it where a run on a device without unified -/// memory announced it; where no run has, the suite counts the claim as one nothing checked -/// ([`crate::report::Report::unchecked_everywhere`]), and the case that names it says in a comment -/// which run it rests on. -pub fn shared_memory_notice() -> crate::allowance::Allowance { - notice_allowance(crate::degradation::Degradation::SharedInSystemMemory.code()) -} - /// The declaration a case that samples through a runtime sampler slot needs on the runtime: /// `pixel-sampler-scaling` ([`crate::degradation::Degradation::PixelSamplerScaling`]), the /// static note of a sample whose sampler may state pixel coordinates, which the translator then @@ -395,9 +368,9 @@ pub const WITHOUT_COMPRESSION: &str = "a-device-answers-as-the-class-of-mac-it-p /// as that Mac: the new texture reads zero (`WorkCounts::private_textures_zero_filled`), what such /// a Mac's reads where its memory held nothing, and the blit keeps the bytes. /// -/// **Why it is the venue's and not ours**, as [`shared_memory_notice`] is: no recording holds what -/// a Mac without the compression reads, and its answer for a new texture is not one value but -/// whatever its memory held. Metal's API leaves the contents undefined. +/// **Why it is the venue's and not ours**: no recording holds what a Mac without the compression +/// reads, and its answer for a new texture is not one value but whatever its memory held. Metal's +/// API leaves the contents undefined. /// /// **It loosens the value, and only on such a venue.** The site is unchecked, justified by /// [`Justification::WithoutCompression`], which holds only on a run whose venue presents no diff --git a/crates/metal2vulkan-conformance/src/tests.rs b/crates/metal2vulkan-conformance/src/tests.rs index cba856526..b1e8640ba 100644 --- a/crates/metal2vulkan-conformance/src/tests.rs +++ b/crates/metal2vulkan-conformance/src/tests.rs @@ -1005,6 +1005,31 @@ fn one_word_moving_names_its_row_and_index() { assert!(printed.contains("Metal 3"), "{printed}"); } +/// Every kind a case can name is a precision note's: `docs/API.md` section 9, the catalogue of +/// the notes the runtime carries, lists its code. The runtime's side announces only the codes of +/// those notes, so a kind outside the catalogue would never be announced, and a case that +/// declared it would hold a claim no run can check. +#[test] +fn every_kind_is_a_catalogued_precision_note() { + let api = include_str!("../../../docs/API.md"); + let catalogue = api + .split_once("\n## 9. Degrade notices") + .and_then(|(_, rest)| rest.split_once("\n## 10.")) + .map(|(section, _)| section) + .expect("docs/API.md holds sections 9 and 10"); + let missing: Vec<&str> = Degradation::ALL + .iter() + .map(|kind| kind.code()) + .filter(|code| !catalogue.contains(&format!("\n- `{code}` (precision)"))) + .collect(); + assert!( + missing.is_empty(), + "{} kind(s) the catalogue does not list:\n{}", + missing.len(), + missing.join("\n") + ); +} + #[test] fn a_notice_we_announce_and_metal_does_not_is_divergent_until_it_is_named() { let kind = Degradation::ALL[0]; @@ -3272,17 +3297,12 @@ fn the_rate_map_cases_name_what_justifies_them() { inputs.iter().any(|input| input.name == "descriptor"), "{inputs:?}" ); - // Every allowance names something that exists -- the rate-map degradation, or the notice - // a device with no unified memory announces for the `Shared` read-back buffer -- over the + // Every allowance names something that exists -- the rate-map degradation -- over the // notices site alone, so every answer of the map itself still compares exactly. for allowance in case.allowances() { match &allowance.justified_by { Justification::Degradation(code) => { - assert!( - code == Degradation::RasterizationRateMap.code() - || code == Degradation::SharedInSystemMemory.code(), - "{code}" - ); + assert!(code == Degradation::RasterizationRateMap.code(), "{code}"); assert_eq!(allowance.path, "case/notices/*"); } other => panic!("an unexpected tolerance: {other:?}"), @@ -3290,9 +3310,8 @@ fn the_rate_map_cases_name_what_justifies_them() { } } // The map of the identity announces no rate-map degradation and declares none; the one that is - // not the identity announces it when the map is made. Both declare the venue's own - // system-memory notice. Neither rests on the validated oracle any more: the zero-screen-width - // refusal that did is closed. + // not the identity announces it when the map is made. Neither rests on the validated oracle: + // the zero-screen-width refusal that did is closed. let codes = |case: &crate::cases::rate_maps::RateMapCase| -> Vec { case.allowances() .iter() @@ -3302,16 +3321,10 @@ fn the_rate_map_cases_name_what_justifies_them() { }) .collect() }; - assert_eq!( - codes(&cases[0]), - vec![Degradation::SharedInSystemMemory.code().to_owned()] - ); + assert!(codes(&cases[0]).is_empty()); assert_eq!( codes(&cases[1]), - vec![ - Degradation::SharedInSystemMemory.code().to_owned(), - Degradation::RasterizationRateMap.code().to_owned() - ] + vec![Degradation::RasterizationRateMap.code().to_owned()] ); for case in &cases { assert!( diff --git a/scripts/conformance-coverage/coverage.py b/scripts/conformance-coverage/coverage.py index 7b3129648..43afc0e5c 100644 --- a/scripts/conformance-coverage/coverage.py +++ b/scripts/conformance-coverage/coverage.py @@ -485,15 +485,10 @@ def _is_declaration(path: str) -> bool: def _declarations(text: str) -> int: - """How many notice declarations `text` makes. - - `shared_memory_notice` is one of them: it is `notice_allowance` of the one code a venue's - memory model provokes, which every family that reads an answer back through a `Shared` buffer - has to declare, so a module that calls it has declared a notice. - """ - return len( - re.findall(r"\b(?:notice_allowance|shared_memory_notice)\s*\(", text) - ) + sum(1 for path in _allowance_paths(text) if _is_declaration(path)) + """How many notice declarations `text` makes.""" + return len(re.findall(r"\bnotice_allowance\s*\(", text)) + sum( + 1 for path in _allowance_paths(text) if _is_declaration(path) + ) def _tolerances(text: str) -> int: