Conformance: the run-kind branch for the deleted runtime goes
The suite scoped some allowances to metal2vulkan-rt's run, so that the old runtime's run, where they held nowhere, kept its exact rows. The old runtime is deleted, so nothing can produce that other run, and the branch was dead: - Unjustified::OldRuntime goes, with its arms in unjustified(), faults_the_case() and Display. - Justification::NewRuntimeNotice and NewRuntimeAccepted decided "on rt's run, as Degradation or AcceptedDifference does". They fold into those two plain forms: their constructors become Justification::notice and Justification::accepted at every case (astc_textures, compressed_decode, buffer_target_clears, pass_sequence_actions, event_orders, fence_orders, format_footprints, heap_metal_sizes, texture_descriptor_pairs, ycbcr_textures). - Offered::new_runtime and Offered::on_new_runtime go. - Venue::new_runtime goes. It only repeated which side ran (Metal's false, rt's true), and once the scoped justifications fold, nothing reads it. It was never stored: Venue is not serialized, and no recording holds the field, so no recording is rewritten and no format or fingerprint version moves. Tests: the one that held the scope itself (a_notice_scoped_to_the_new_runtime_leaves_the_old_runtimes_site_its_one_row) goes with it. buffer_target_clears' DontCare test and the running-signal test keep their rt halves and drop the old-run halves, under names that no longer say "on the new runtime alone". The prose that described the branch changes with it, and the suite's remaining "the new runtime" says "the runtime". One effect is on a replay of Metal's own side, which the stability and watch tests stub. There, an accepted difference these cases name now loosens its site, where before it held nowhere. A notice whose site differs there is now a bad allowance, as every other notice already is on that side, since Metal announces none.
This commit is contained in:
1 parent
c03e3300ca
commit
61344e6b7a
46 files changed
+132
-301
No files matched your search
@@ -15,7 +15,7 @@ readme = "README.md"
|
||||
# builds, so one target directory builds the product (and the runtime on it) once for every suite
|
||||
# rather than once per feature set.
|
||||
metal2vulkan = { path = "../metal2vulkan", features = ["serde", "ash", "cli"] }
|
||||
# The new runtime, which the suite replays through its public API alone (`src/rt_side.rs`).
|
||||
# The runtime, which the suite replays through its public API alone (`src/rt_side.rs`).
|
||||
metal2vulkan-rt = { path = "../metal2vulkan-rt" }
|
||||
# Fixture paths, `llvm_assemble` and the scratch root: the suite's shaders are the owned public
|
||||
# fixtures.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Plain Metal's bytes for the new runtime's blit copy tests (metal2vulkan-rt, tests::blit): the
|
||||
// Plain Metal's bytes for the runtime's blit copy tests (metal2vulkan-rt, tests::blit): the
|
||||
// same textures, buffers, byte patterns and copies, each destination read back whole and printed
|
||||
// as its length and FNV-1a 64 hash, which the tests hold their own results to.
|
||||
//
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
// Run: ./row_barrier_reads <path of workloads.metal>, MTL_DEBUG_LAYER unset.
|
||||
//
|
||||
// It compiles the fixture's source, then dispatches `row_barrier` with `dispatchThreads` over the
|
||||
// grids the new runtime's device test runs (512 x 3 and 512 x 4 in threadgroups of 32 x 2, 96 x 5
|
||||
// grids the runtime's device test runs (512 x 3 and 512 x 4 in threadgroups of 32 x 2, 96 x 5
|
||||
// in threadgroups of 32 x 4), and prints for each the words that differ from that answer and the
|
||||
// SHA-256 of `seen`.
|
||||
//
|
||||
// WHAT IT MEASURED (Apple M3 Max, macOS 27.0.1): see the new runtime's device test
|
||||
// WHAT IT MEASURED (Apple M3 Max, macOS 27.0.1): see the runtime's device test
|
||||
// `every_device_keeps_a_kernel_that_reads_across_rows_after_a_barrier_at_its_own_size`.
|
||||
#import <CommonCrypto/CommonDigest.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@@ -64,21 +64,6 @@ pub enum Justification {
|
||||
/// ran, the report counts it as a claim nothing checked
|
||||
/// ([`crate::report::Report::unchecked_everywhere`]), as it does a notice no run announced.
|
||||
WithoutCompression(String),
|
||||
/// **A degrade notice that loosens the site on `metal2vulkan-rt` alone**, by its code. On the
|
||||
/// new runtime's run it holds as [`Justification::Degradation`] does, where the run announced
|
||||
/// it. On the old runtime's it holds nowhere and faults nothing
|
||||
/// ([`Unjustified::OldRuntime`]): the site compares as if the case loosened nothing there,
|
||||
/// and the old runtime's answers keep the rows they had. It is for a bound that is the new
|
||||
/// runtime's contract, a static note it answers by a format's class on every device, where
|
||||
/// the old runtime announces the same notice under other facts.
|
||||
NewRuntimeNotice(String),
|
||||
/// **An entry of `docs/API.md`'s accepted differences that holds on `metal2vulkan-rt` alone**,
|
||||
/// by its slug. On the new runtime's run it holds as [`Justification::AcceptedDifference`]
|
||||
/// does; on the old runtime's it holds nowhere and faults nothing
|
||||
/// ([`Unjustified::OldRuntime`]), so the old runtime's answers at the site still compare
|
||||
/// exactly. It is for an answer the new runtime gives where Metal's documentation is silent
|
||||
/// and the old runtime gives Metal's measured one.
|
||||
NewRuntimeAccepted(String),
|
||||
}
|
||||
|
||||
impl Justification {
|
||||
@@ -103,17 +88,6 @@ impl Justification {
|
||||
Self::WithoutCompression(slug.into())
|
||||
}
|
||||
|
||||
/// A degrade notice's justification on `metal2vulkan-rt`'s run alone.
|
||||
pub fn new_runtime_notice(kind: Degradation) -> Self {
|
||||
Self::NewRuntimeNotice(kind.code().to_owned())
|
||||
}
|
||||
|
||||
/// An accepted difference's justification on `metal2vulkan-rt`'s run alone, by its entry's
|
||||
/// slug.
|
||||
pub fn new_runtime_accepted(slug: impl Into<String>) -> Self {
|
||||
Self::NewRuntimeAccepted(slug.into())
|
||||
}
|
||||
|
||||
/// What the report prints for it.
|
||||
pub fn describe(&self) -> String {
|
||||
match self {
|
||||
@@ -128,20 +102,13 @@ impl Justification {
|
||||
"a venue presenting no texture compression, the accepted difference {slug} \
|
||||
(docs/API.md section 10)"
|
||||
),
|
||||
Justification::NewRuntimeNotice(code) => {
|
||||
format!("the degrade notice {code}, on metal2vulkan-rt")
|
||||
}
|
||||
Justification::NewRuntimeAccepted(slug) => format!(
|
||||
"the accepted difference {slug} (docs/API.md section 10), on metal2vulkan-rt"
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
/// Why the justification does not hold: the code names no degrade kind, the slug names no
|
||||
/// entry, the notice the code names was not announced among `offered`'s notices, the
|
||||
/// recording's validated oracle does not say what the case claims it says, the venue
|
||||
/// presents the compression a venue's own answer needs it not to, or the run is the old
|
||||
/// runtime's where the notice loosens the new runtime's alone.
|
||||
/// recording's validated oracle does not say what the case claims it says, or the venue
|
||||
/// presents the compression a venue's own answer needs it not to.
|
||||
pub fn unjustified(&self, offered: &Offered<'_>) -> Option<Unjustified> {
|
||||
let notice = |code: &String| {
|
||||
if !Degradation::ALL.iter().any(|kind| kind.code() == code) {
|
||||
@@ -154,21 +121,10 @@ impl Justification {
|
||||
};
|
||||
match self {
|
||||
Justification::Degradation(code) => notice(code),
|
||||
Justification::NewRuntimeNotice(code) => match notice(code) {
|
||||
Some(missing @ Unjustified::NoSuchDegradation(_)) => Some(missing),
|
||||
_ if !offered.new_runtime => Some(Unjustified::OldRuntime),
|
||||
missing => missing,
|
||||
},
|
||||
Justification::AcceptedDifference(slug) => {
|
||||
(!accepted_differences().iter().any(|entry| entry == slug))
|
||||
.then(|| Unjustified::NoSuchAcceptedDifference(slug.clone()))
|
||||
}
|
||||
Justification::NewRuntimeAccepted(slug) => {
|
||||
if !accepted_differences().iter().any(|entry| entry == slug) {
|
||||
return Some(Unjustified::NoSuchAcceptedDifference(slug.clone()));
|
||||
}
|
||||
(!offered.new_runtime).then_some(Unjustified::OldRuntime)
|
||||
}
|
||||
Justification::MetalValidation { says } => match offered.metal_validation {
|
||||
Validated::Stopped { message, .. } if message.contains(says) => None,
|
||||
Validated::Stopped { message, .. } => {
|
||||
@@ -209,10 +165,6 @@ pub struct Offered<'a> {
|
||||
/// `true` unless the run says otherwise ([`Offered::on_venue`]), so a venue's answer justifies
|
||||
/// nothing by default.
|
||||
pub lossless_compression: bool,
|
||||
/// Whether the run is `metal2vulkan-rt`'s ([`Justification::NewRuntimeNotice`],
|
||||
/// [`Justification::NewRuntimeAccepted`]). `false` unless the run says otherwise
|
||||
/// ([`Offered::on_new_runtime`]).
|
||||
pub new_runtime: bool,
|
||||
}
|
||||
|
||||
impl<'a> Offered<'a> {
|
||||
@@ -222,7 +174,6 @@ impl<'a> Offered<'a> {
|
||||
announced,
|
||||
metal_validation: &Validated::NotRun,
|
||||
lossless_compression: true,
|
||||
new_runtime: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,7 +183,6 @@ impl<'a> Offered<'a> {
|
||||
announced,
|
||||
metal_validation,
|
||||
lossless_compression: true,
|
||||
new_runtime: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,14 +193,6 @@ impl<'a> Offered<'a> {
|
||||
..self
|
||||
}
|
||||
}
|
||||
|
||||
/// What it offers on `metal2vulkan-rt`'s run where `new_runtime`.
|
||||
pub fn on_new_runtime(self, new_runtime: bool) -> Self {
|
||||
Self {
|
||||
new_runtime,
|
||||
..self
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Why an allowance does not hold. Each of these fails the case: an allowance whose justification
|
||||
@@ -274,22 +216,16 @@ pub enum Unjustified {
|
||||
/// The venue presents a Mac that keeps textures compressed, as the recordings' Apple silicon
|
||||
/// Mac does, so the answer of a venue that keeps none justifies nothing here.
|
||||
VenueCompresses,
|
||||
/// The run is the old runtime's, where a notice or an accepted difference the case scopes to
|
||||
/// `metal2vulkan-rt` ([`Justification::NewRuntimeNotice`],
|
||||
/// [`Justification::NewRuntimeAccepted`]) loosens nothing.
|
||||
OldRuntime,
|
||||
}
|
||||
|
||||
impl Unjustified {
|
||||
/// Whether an allowance that does not hold for this reason faults the case. Every reason does
|
||||
/// but two: a venue's own answer ([`Justification::WithoutCompression`]) on a venue that
|
||||
/// presents Metal's compression holds nowhere, as on the Mac that recorded the case, and a
|
||||
/// notice or accepted difference scoped to `metal2vulkan-rt`
|
||||
/// ([`Justification::NewRuntimeNotice`], [`Justification::NewRuntimeAccepted`]) holds nowhere
|
||||
/// on the old runtime's run, so naming either is no fault there. The site then compares as if the
|
||||
/// case loosened nothing, and a difference there is the site's own and nothing more.
|
||||
/// but one: a venue's own answer ([`Justification::WithoutCompression`]) on a venue that
|
||||
/// presents Metal's compression holds nowhere, as on the Mac that recorded the case, so naming
|
||||
/// it is no fault there. The site then compares as if the case loosened nothing, and a
|
||||
/// difference there is the site's own and nothing more.
|
||||
pub fn faults_the_case(&self) -> bool {
|
||||
!matches!(self, Unjustified::VenueCompresses | Unjustified::OldRuntime)
|
||||
!matches!(self, Unjustified::VenueCompresses)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,10 +259,6 @@ impl std::fmt::Display for Unjustified {
|
||||
"the venue presents a Mac that keeps textures compressed, as the recordings' Mac \
|
||||
does, so the answer of a venue that keeps none justifies nothing here",
|
||||
),
|
||||
Unjustified::OldRuntime => out.write_str(
|
||||
"the run is the old runtime's, which a notice or an accepted difference scoped to \
|
||||
metal2vulkan-rt does not loosen",
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ pub fn ends_metals_process(request: &BufferTextureRequest) -> Option<String> {
|
||||
///
|
||||
/// The three getters metal2vulkan-rt keeps no counterpart of (`cpuCacheMode`,
|
||||
/// `hazardTrackingMode`, `allowGPUOptimizedContents`, which its consumer implements) are each the
|
||||
/// value a side recorded, so the new runtime's side records its refusal at those three sites alone.
|
||||
/// value a side recorded, so the runtime's side records its refusal at those three sites alone.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct BufferTextureFacts {
|
||||
/// `textureType`, by its raw `MTLTextureType`.
|
||||
|
||||
@@ -488,7 +488,7 @@ pub struct Failure {
|
||||
}
|
||||
|
||||
impl Failure {
|
||||
/// The failure a typed error of the new runtime (`metal2vulkan-rt`) is. A translator refusal
|
||||
/// The failure a typed error of the runtime (`metal2vulkan-rt`) is. A translator refusal
|
||||
/// that names a capability the device could enable is the venue's gap ([`device_gap_of`]).
|
||||
pub fn of_rt(error: &metal2vulkan_rt::Error) -> Self {
|
||||
let lacks = match error {
|
||||
@@ -511,7 +511,7 @@ impl Failure {
|
||||
}
|
||||
}
|
||||
|
||||
/// The failure a translator error is, where the new runtime's side calls the translator's
|
||||
/// The failure a translator error is, where the runtime's side calls the translator's
|
||||
/// library itself: recorded as the runtime's `Error::Translation` of it, the form the runtime
|
||||
/// gives it in.
|
||||
pub fn of_translation(error: &metal2vulkan::error::Error) -> Self {
|
||||
@@ -700,9 +700,6 @@ pub struct Venue {
|
||||
/// (`DeviceProperties::lossless_compression`), as the Apple silicon Mac every recording was
|
||||
/// taken on does: what a venue's own answer (`Justification::WithoutCompression`) holds by.
|
||||
pub lossless_compression: bool,
|
||||
/// Whether the side is `metal2vulkan-rt`'s: what a notice a case scopes to the new runtime
|
||||
/// (`Justification::NewRuntimeNotice`) holds by.
|
||||
pub new_runtime: bool,
|
||||
/// For a CPU implementation (`DeviceKind::Cpu`), the host's widest vector instruction set
|
||||
/// ([`host_vector_isa`]), which its shader compiler targets; `None` for a GPU. The device's
|
||||
/// name and driver do not carry it, and its answers follow it: one llvmpipe build (Mesa 26.2.6,
|
||||
@@ -2974,7 +2971,7 @@ pub struct SurfaceTexture {
|
||||
pub route: SurfaceRoute,
|
||||
}
|
||||
|
||||
/// How the new runtime's consumer makes a [`SurfaceTexture`]'s surface for one decoder
|
||||
/// How the runtime's consumer makes a [`SurfaceTexture`]'s surface for one decoder
|
||||
/// (`Device::new_exported_surface`): the handles it tries in turn and the layout's multiples.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum SurfaceRoute {
|
||||
|
||||
@@ -534,12 +534,12 @@ impl Case for AstcTextures {
|
||||
// `metal2vulkan-rt` keeps no twin: where the device holds the format's block, a
|
||||
// linear channel is the device's decode of it, the static note
|
||||
// `compressed-texel-decode`, whose catalogue entry bounds an ASTC LDR channel at
|
||||
// 1/2048. On the old runtime's run it holds nowhere and faults nothing.
|
||||
// 1/2048.
|
||||
for round in ROUNDS {
|
||||
all.push(Allowance::new(
|
||||
format!("case/{round}/texels"),
|
||||
Loosening::Absolute(DEVICE_DECODE_BOUND),
|
||||
Justification::new_runtime_notice(Degradation::CompressedTexelDecode),
|
||||
Justification::notice(Degradation::CompressedTexelDecode),
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -790,8 +790,8 @@ mod tests {
|
||||
.map(|allowance| allowance.loosening)
|
||||
.collect();
|
||||
// An sRGB form's twin holds Metal's own codes and an HDR format's Metal's halves, so
|
||||
// neither loosens a texel; only the fourteen linear ones do, each round by the old
|
||||
// runtime's compact twin's bound and by the device decode's (the new runtime's).
|
||||
// neither loosens a texel; only the fourteen linear ones do, each round by the compact
|
||||
// twin's bound and by the device decode's.
|
||||
if case.compact_bound().is_none() {
|
||||
assert!(bounds.is_empty(), "{}: {bounds:?}", format.name);
|
||||
continue;
|
||||
|
||||
@@ -312,11 +312,11 @@ impl Case for BorderSwizzles {
|
||||
// recording of this suite declares it.
|
||||
//
|
||||
// The fixture's float texture is sampled through the runtime sampler at `[[sampler(0)]]`,
|
||||
// which the new runtime's pipelines note as scaled
|
||||
// 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 all 8 rows.
|
||||
//
|
||||
// Every row sweeps samplers that read an opaque-black border, which the new runtime's
|
||||
// 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(),
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//! multiple of 4 but was set to 2", the `uint-2` bind of `probes/vector_access_placement.m`), and
|
||||
//! the recording keeps those words as its validated fact. Plain Metal runs the pass, and the
|
||||
//! recording keeps the pass's outcome: each step's answer, the command buffer's status and error.
|
||||
//! The new runtime refuses the dispatch (`Refusal::BufferOffsetAlignment`), so there this case
|
||||
//! The runtime refuses the dispatch (`Refusal::BufferOffsetAlignment`), so there this case
|
||||
//! is a refusal that Metal's own validation also makes.
|
||||
//!
|
||||
//! The case compares the outcome and reads no bytes back. Where plain Metal places each element of
|
||||
|
||||
@@ -289,14 +289,13 @@ impl Row {
|
||||
.flat_map(move |row| (0..ROW_BYTES).map(move |byte| OFFSET + row * self.pitch + byte))
|
||||
}
|
||||
|
||||
/// A `DontCare` row's declarations of its texels, one a byte of [`BUFFER_SITE`], unchecked on
|
||||
/// `metal2vulkan-rt`'s run alone ([`DONT_CARE_TEXELS`]); none for a `Store` row.
|
||||
/// A `DontCare` row's declarations of its texels, one a byte of [`BUFFER_SITE`], unchecked
|
||||
/// ([`DONT_CARE_TEXELS`]); none for a `Store` row.
|
||||
///
|
||||
/// Apple's page for `MTLStoreAction.dontCare` lets the GPU replace the attachment's contents
|
||||
/// with arbitrary data, and Metal's own answer on the M3 Max (the texels keep the buffer's
|
||||
/// bytes) is one outcome of that, the new runtime's (the clear) another. The old runtime gives
|
||||
/// Metal's, so there the texels still compare exactly, and the bytes outside them compare on
|
||||
/// both runtimes.
|
||||
/// bytes) is one outcome of that, the runtime's (the clear) another. The bytes outside the
|
||||
/// texels compare.
|
||||
fn dont_care_texels(&self) -> Vec<crate::allowance::Allowance> {
|
||||
if self.store != StoreAction::DontCare {
|
||||
return Vec::new();
|
||||
@@ -306,7 +305,7 @@ impl Row {
|
||||
crate::allowance::Allowance::new(
|
||||
format!("case/{BUFFER_SITE}/{at}"),
|
||||
crate::allowance::Loosening::Unchecked,
|
||||
crate::allowance::Justification::new_runtime_accepted(DONT_CARE_TEXELS),
|
||||
crate::allowance::Justification::accepted(DONT_CARE_TEXELS),
|
||||
)
|
||||
})
|
||||
.collect()
|
||||
@@ -363,10 +362,9 @@ impl Case for BufferTargetClear {
|
||||
}
|
||||
|
||||
fn allowances(&self) -> Vec<crate::allowance::Allowance> {
|
||||
// One set of bytes is loosened, on one runtime: a `DontCare` row's texels on
|
||||
// `metal2vulkan-rt`'s run, which Apple's page lets the GPU replace with arbitrary data
|
||||
// (`DONT_CARE_TEXELS`, `dont_care_texels`). The padding, the bytes before and after the
|
||||
// target, and every texel on the old runtime's run compare exactly, Metal's against ours.
|
||||
// One set of bytes is loosened: a `DontCare` row's texels, which Apple's page lets the GPU
|
||||
// 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.
|
||||
// The rest is the **announcing**. Our runtime keeps a target
|
||||
// whose rows the device's own linear image does not lay out as Metal does as a shadow
|
||||
// image the pass renders into and the encoders copy back, and it announces that once per
|
||||
@@ -475,12 +473,11 @@ mod tests {
|
||||
]
|
||||
}
|
||||
|
||||
/// **A `DontCare` row's texels are unchecked on the new runtime's run alone, and nothing else
|
||||
/// is.** Against Metal's kept bytes, ours with the clear in every texel is no divergence on
|
||||
/// `metal2vulkan-rt`'s run and 64 on the old runtime's; a padding byte or a byte before the
|
||||
/// target that moved is a divergence on both. A `Store` row declares no byte at all.
|
||||
/// **A `DontCare` row's texels are unchecked, and nothing else is.** Against Metal's kept
|
||||
/// bytes, ours with the clear in every texel is no divergence; a padding byte or a byte before
|
||||
/// the target that moved is a divergence. A `Store` row declares no byte at all.
|
||||
#[test]
|
||||
fn a_dont_care_row_leaves_its_texels_unchecked_on_the_new_runtime_alone() {
|
||||
fn a_dont_care_row_leaves_its_texels_unchecked_and_nothing_else() {
|
||||
use crate::allowance::Offered;
|
||||
use crate::compare::compare;
|
||||
use crate::transcript::Transcript;
|
||||
@@ -501,8 +498,7 @@ mod tests {
|
||||
}
|
||||
let allowances = row.dont_care_texels();
|
||||
assert_eq!(allowances.len(), 64, "{}", row.case);
|
||||
let old = Offered::notices(&[]);
|
||||
let rt = old.on_new_runtime(true);
|
||||
let rt = Offered::notices(&[]);
|
||||
let found = compare(
|
||||
&site(row, kept.clone()),
|
||||
&site(row, stored.clone()),
|
||||
@@ -511,18 +507,6 @@ mod tests {
|
||||
);
|
||||
assert!(found.divergences.is_empty(), "{}: {found:?}", row.case);
|
||||
assert!(found.bad_allowances.is_empty(), "{}: {found:?}", row.case);
|
||||
let found = compare(
|
||||
&site(row, kept.clone()),
|
||||
&site(row, stored.clone()),
|
||||
&allowances,
|
||||
old,
|
||||
);
|
||||
assert_eq!(
|
||||
paths(&found),
|
||||
[format!("case/{BUFFER_SITE}")],
|
||||
"{}: {found:?}",
|
||||
row.case
|
||||
);
|
||||
for at in [0, OFFSET - 1, OFFSET + ROW_BYTES, LEN - 1] {
|
||||
if row.texel_offsets().any(|texel| texel == at) {
|
||||
continue;
|
||||
|
||||
@@ -25,15 +25,11 @@
|
||||
//! lane uses, kept.
|
||||
//!
|
||||
//! **The device's decode is the answer.** A BC texture keeps no decoded twin: every device samples
|
||||
//! its own BC image through its own decode, announced `compressed-texel-decode` where the runtime
|
||||
//! makes it (the old runtime on a driver not measured to decode the format as Metal does;
|
||||
//! `metal2vulkan-rt` for every block-compressed texture, its static note). On `metal2vulkan-rt`'s
|
||||
//! run each round's texels are loosened by the largest difference that notice's catalogue entry
|
||||
//! (docs/API.md) states for the format's family on any driver, justified by the notice alone
|
||||
//! (`CompressedDecode::decode_bound`): a texel past it is the note's claim failing, a
|
||||
//! divergence. The bound is scoped to the new runtime (`Justification::NewRuntimeNotice`): on the
|
||||
//! old runtime's run it loosens nothing, every texel compares exactly, and the device's decode is
|
||||
//! a `known-gaps.tsv` row where it differs, as it was before the note.
|
||||
//! its own BC image through its own decode, announced `compressed-texel-decode`: the runtime's
|
||||
//! static note for every block-compressed texture. Each round's texels are loosened by the largest
|
||||
//! difference that notice's catalogue entry (docs/API.md) states for the format's family on any
|
||||
//! driver, justified by the notice alone (`CompressedDecode::decode_bound`): a texel past it is the
|
||||
//! note's claim failing, a divergence.
|
||||
//!
|
||||
//! Nothing here can fault a GPU: one compute pass a round, one read-only texture, one buffer, one
|
||||
//! thread a texel inside the texture, no loop and no sampling.
|
||||
@@ -326,7 +322,7 @@ impl Case for CompressedDecode {
|
||||
all.push(Allowance::new(
|
||||
format!("case/round/{round}/texels"),
|
||||
Loosening::Absolute(self.decode_bound()),
|
||||
Justification::new_runtime_notice(Degradation::CompressedTexelDecode),
|
||||
Justification::notice(Degradation::CompressedTexelDecode),
|
||||
));
|
||||
}
|
||||
all
|
||||
|
||||
@@ -846,10 +846,9 @@ pub fn out_tight(
|
||||
/// 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` where it makes it (the old runtime where the driver is not measured
|
||||
/// to decode a format as Metal does, `metal2vulkan-rt` for every such texture). Every block still
|
||||
/// compares exactly: the only site these loosen is the set of notices, which Metal holds empty.
|
||||
/// 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
|
||||
|
||||
@@ -317,7 +317,7 @@ impl Case for ComputeEncoderCommands {
|
||||
// recording of this suite declares it.
|
||||
//
|
||||
// A sampling row's kernel samples its texture through the runtime sampler at slot 0,
|
||||
// which the new runtime's pipelines note as scaled
|
||||
// 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()];
|
||||
|
||||
@@ -311,7 +311,7 @@ impl Case for ComputeRenderChain {
|
||||
// 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 new runtime's pipelines note as scaled
|
||||
// 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 {
|
||||
|
||||
@@ -576,7 +576,6 @@ mod tests {
|
||||
driver: "none".to_owned(),
|
||||
api: "none".to_owned(),
|
||||
lossless_compression: true,
|
||||
new_runtime: false,
|
||||
host: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ impl Case for DepthTexelReads {
|
||||
// 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 new runtime's pipelines note
|
||||
// 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![
|
||||
|
||||
@@ -264,7 +264,7 @@ impl Case for DrawStateChanges {
|
||||
// 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 new runtime's pipelines note
|
||||
// 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![
|
||||
|
||||
@@ -39,8 +39,7 @@
|
||||
//! On `metal2vulkan-rt` the `MTLEvent` row's waiting command buffer may still read `Committed`,
|
||||
//! with no handler run, though its wait is met: the runtime schedules a command buffer once
|
||||
//! its device's one submit thread is free, and Metal promises no time between a command buffer's
|
||||
//! dependencies resolving and its scheduling. The case declares that on the new runtime's run
|
||||
//! alone, in its allowances.
|
||||
//! dependencies resolving and its scheduling. The case declares that in its allowances.
|
||||
//!
|
||||
//! # What this pulls forward
|
||||
//!
|
||||
@@ -306,25 +305,22 @@ impl Case for EventOrder {
|
||||
const SCHEDULED_ONCE_THE_SUBMIT_THREAD_IS_FREE: &str =
|
||||
"the-runtime-schedules-a-command-buffer-once-its-submit-thread-is-free";
|
||||
|
||||
/// The declaration [`WAIT_BEHIND_A_RUNNING_SIGNAL`]'s `MTLEvent` row needs on `metal2vulkan-rt`'s
|
||||
/// run: the waiting command buffer's status while the signaller runs may be `Committed` or
|
||||
/// The declaration [`WAIT_BEHIND_A_RUNNING_SIGNAL`]'s `MTLEvent` row needs on `metal2vulkan-rt`:
|
||||
/// the waiting command buffer's status while the signaller runs may be `Committed` or
|
||||
/// `Scheduled`, and its handlers then none or the scheduled one.
|
||||
///
|
||||
/// **What it rests on**, the accepted difference [`SCHEDULED_ONCE_THE_SUBMIT_THREAD_IS_FREE`]
|
||||
/// names: Apple's `Scheduled` is "All dependencies have been resolved and the command buffer has
|
||||
/// been scheduled for execution", with no time promised between the two, and the new runtime
|
||||
/// been scheduled for execution", with no time promised between the two, and the runtime
|
||||
/// schedules a command buffer on its device's one submit thread, once that thread's earlier
|
||||
/// `vkQueueSubmit2` calls have returned, whichever queue they were for. Where the signaller's call
|
||||
/// outlasts the reading, the waiting one, its wait already met by that signal, is still
|
||||
/// `Committed` with no handler run.
|
||||
///
|
||||
/// **It loosens those two sites alone, and only on the new runtime**
|
||||
/// ([`Justification::NewRuntimeAccepted`]), so the old runtime's answers still compare exactly.
|
||||
/// The shared event's row is not loosened: both runtimes hold its waiting command buffer until
|
||||
/// the value is reached, as Metal does.
|
||||
/// **It loosens those two sites alone.** The shared event's row is not loosened: the runtime holds
|
||||
/// its waiting command buffer until the value is reached, as Metal does.
|
||||
fn scheduled_once_the_submit_thread_is_free() -> Vec<Allowance> {
|
||||
let justified =
|
||||
|| Justification::new_runtime_accepted(SCHEDULED_ONCE_THE_SUBMIT_THREAD_IS_FREE);
|
||||
let justified = || Justification::accepted(SCHEDULED_ONCE_THE_SUBMIT_THREAD_IS_FREE);
|
||||
vec![
|
||||
Allowance::new(
|
||||
"case/order/event/waiting/status-while-the-signaller-runs",
|
||||
|
||||
@@ -396,7 +396,7 @@ impl Case for ExtendedSwizzles {
|
||||
// of the four extended-range formats); its values move by it (`known-gaps.tsv`).
|
||||
//
|
||||
// Every kernel samples or gathers through the runtime sampler at `[[sampler(0)]]`, which
|
||||
// the new runtime's pipelines note as scaled (`crate::replay::pixel_sampler_scaling_notice`
|
||||
// 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![
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
//! the updater committed behind none, one or three busy command buffers of its queue: what
|
||||
//! Metal's hazard tracking orders between two queues by itself. Behind one or three, the M3 Max
|
||||
//! ran the waiter without the updater's words: its tracking orders only against work already
|
||||
//! submitted, as measured there, not documented. Behind one, the new runtime submits the updater
|
||||
//! submitted, as measured there, not documented. Behind one, the runtime submits the updater
|
||||
//! at once, as its queue has fewer than three submissions in flight, and the waiter copies every
|
||||
//! word; [`TRACKED_BEHIND_ONE`] declares that count on its run (docs/API.md section 10).
|
||||
//!
|
||||
@@ -96,18 +96,18 @@ impl Case for FenceOrderCase {
|
||||
// (`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()];
|
||||
// Behind one busy command buffer, the new runtime's 1024 is its structure: a writer whose
|
||||
// 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
|
||||
// for a tracked write. Metal's 0 is measured, not documented: on the M3 Max (macOS
|
||||
// 27.0.1) the copy ran first in 5 runs of 5 (job m3-max-52432), its tracking ordering only
|
||||
// against work already submitted (docs/API.md section 10). Either count holds on the new
|
||||
// runtime's run; the statuses still compare exactly.
|
||||
// against work already submitted (docs/API.md section 10). Either count holds; the
|
||||
// statuses still compare exactly.
|
||||
if self.name == TRACKED_BEHIND_ONE {
|
||||
allowances.push(Allowance::new(
|
||||
"case/order/y/words-written",
|
||||
Loosening::AnyOf(vec![Value::Uint(0), Value::Uint(WORDS)]),
|
||||
Justification::NewRuntimeAccepted(SEEN_ACROSS_QUEUES.to_owned()),
|
||||
Justification::AcceptedDifference(SEEN_ACROSS_QUEUES.to_owned()),
|
||||
));
|
||||
}
|
||||
allowances
|
||||
|
||||
@@ -598,13 +598,13 @@ impl Case for FootprintCase {
|
||||
if self.shared_texture_buffers {
|
||||
named.push(crate::replay::shared_memory_notice());
|
||||
}
|
||||
// The new runtime's answers are the device's own, held by their property and not by
|
||||
// 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::new_runtime_accepted(crate::texture_query::DEVICE_OWN_SIZES),
|
||||
Justification::accepted(crate::texture_query::DEVICE_OWN_SIZES),
|
||||
)
|
||||
}));
|
||||
named
|
||||
|
||||
@@ -226,7 +226,7 @@ impl Case for FrameChain {
|
||||
// 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 new runtime's pipelines note
|
||||
// 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![
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//! The owned fixture `fc_ushort3_half3` (our MSL) reads each constant through `as_type<half3>`,
|
||||
//! which its compiler folds into a `<3 x half>` load of the constant's `<3 x i16>` global: a read
|
||||
//! of the global through another type than its own, which the translator holds in the constant
|
||||
//! blob. Under the new runtime's identity domains the blob is the module's own words, with no
|
||||
//! descriptor; under the old runtime's it is bound. The pipeline is made with both constants'
|
||||
//! blob. Under the runtime's identity domains the blob is the module's own words, with no
|
||||
//! descriptor. The pipeline is made with both constants'
|
||||
//! values (`newFunctionWithName:constantValues:error:`), and one dispatch of `THREADS` threads
|
||||
//! stores, for thread `t`, lane `t % 3` of each constant as a float, their `half` sum, and `t`.
|
||||
//! The values ([`A`], [`B`]) are halves whose sums are exact, so the answer is the program's.
|
||||
|
||||
@@ -281,7 +281,7 @@ impl Case for HalfReadNans {
|
||||
// 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 new runtime's pipelines note
|
||||
// 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![
|
||||
|
||||
@@ -379,13 +379,13 @@ impl Case for HeapSizeCase {
|
||||
)],
|
||||
false => Vec::new(),
|
||||
};
|
||||
// The new runtime's answers are the device's own, held by their property and not by
|
||||
// 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::new_runtime_accepted(crate::texture_query::DEVICE_OWN_SIZES),
|
||||
Justification::accepted(crate::texture_query::DEVICE_OWN_SIZES),
|
||||
)
|
||||
}));
|
||||
named
|
||||
|
||||
@@ -293,7 +293,7 @@ impl Case for NearestPositions {
|
||||
// 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 new runtime's pipelines note as scaled
|
||||
// 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(),
|
||||
|
||||
@@ -858,14 +858,13 @@ impl Case for SequenceActions {
|
||||
}
|
||||
|
||||
fn allowances(&self) -> Vec<Allowance> {
|
||||
// One set of values is loosened, on one runtime: in a colour cell whose pass A stores
|
||||
// `DontCare`, the texels that hold what that store left (`ColorCell::dont_care_texels`),
|
||||
// unchecked on `metal2vulkan-rt`'s run alone (`DONT_CARE_TEXELS`). Apple's page for
|
||||
// `MTLStoreAction.dontCare` lets the GPU replace the 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 new runtime's (what pass A rendered) another. Every other texel, and every
|
||||
// texel on the old runtime's run, compares exactly. Two notices are declared and neither is
|
||||
// a difference.
|
||||
// One set of values is loosened: in a colour cell whose pass A stores `DontCare`, the
|
||||
// texels that hold what that store left (`ColorCell::dont_care_texels`), unchecked
|
||||
// (`DONT_CARE_TEXELS`). Apple's page for `MTLStoreAction.dontCare` lets the GPU replace the
|
||||
// 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. Two notices are declared and neither is a
|
||||
// difference.
|
||||
//
|
||||
// `DontCareStore`: every cell of both cases stores an attachment `DontCare` somewhere. Under
|
||||
// the suite's exact policy (`DontCareColorPolicy::Kept`) a colour stored `DontCare` keeps
|
||||
@@ -906,7 +905,7 @@ impl Case for SequenceActions {
|
||||
Allowance::new(
|
||||
format!("case/planes/{site}/{at}"),
|
||||
crate::allowance::Loosening::Unchecked,
|
||||
crate::allowance::Justification::new_runtime_accepted(DONT_CARE_TEXELS),
|
||||
crate::allowance::Justification::accepted(DONT_CARE_TEXELS),
|
||||
)
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -405,7 +405,7 @@ impl Case for RenderChain {
|
||||
// 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 new runtime's pipelines note as scaled
|
||||
// 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(),
|
||||
|
||||
@@ -154,10 +154,9 @@ const RUNS: u32 = 8;
|
||||
/// `uint4` the fragment function returned, so every channel of every case still compares exactly.
|
||||
///
|
||||
/// - `device-point-size` in every case: the vertex function writes `[[point_size]]`, which a
|
||||
/// device whose largest point is below Metal's notes. The old runtime announces it at a draw of
|
||||
/// points, the one primitive it sizes; metal2vulkan-rt's render state carries it as a static
|
||||
/// note of the state, whatever primitive a draw of it takes, so the triangles and lines cases
|
||||
/// announce it there too.
|
||||
/// device whose largest point is below Metal's notes. The runtime's render state carries it as a
|
||||
/// static note of the state, whatever primitive a draw of it takes, so the triangles and lines
|
||||
/// cases announce it too.
|
||||
///
|
||||
/// The vertex stage's own 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
|
||||
|
||||
@@ -975,7 +975,7 @@ impl Case for SamplerCrossings {
|
||||
crate::replay::shared_memory_notice(),
|
||||
crate::replay::pixel_sampler_scaling_notice(),
|
||||
];
|
||||
// The opaque-black axis-border rows read that border, which the new runtime's sampler
|
||||
// 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!(
|
||||
self.family,
|
||||
|
||||
@@ -879,7 +879,7 @@ impl Case for SamplerFiltering {
|
||||
crate::replay::shared_memory_notice(),
|
||||
crate::replay::pixel_sampler_scaling_notice(),
|
||||
];
|
||||
// The border family's opaque-black rows read that border, which the new runtime's sampler
|
||||
// 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) {
|
||||
named.push(crate::replay::swizzled_border_notice());
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
//! and an Apple M4. Record mode now runs the kernels on the oracle, so the recording holds Metal's
|
||||
//! own words and the simulation is checked against them.
|
||||
//!
|
||||
//! The new runtime gives the threads of a SIMD-group no order between barriers: the Metal Shading
|
||||
//! The runtime gives the threads of a SIMD-group no order between barriers: the Metal Shading
|
||||
//! Language calls these kernels' accesses a data race, and docs/API.md's accepted differences say
|
||||
//! so (`the-threads-of-a-simd-group-run-in-no-order-between-barriers`). So the output words go
|
||||
//! unchecked, named and counted, with that entry as the justification; the counts half the
|
||||
@@ -153,7 +153,7 @@ impl Case for Lockstep {
|
||||
}
|
||||
|
||||
fn allowances(&self) -> Vec<Allowance> {
|
||||
// The output words are lockstep's alone, which the new runtime does not give (the module
|
||||
// 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
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
//! | `surface-textures-420v-chroma-rg8` | the same | `RG8Unorm` over plane 1 |
|
||||
//! | `surface-textures-x420-luma-r16` | `'x420'`, 64x32: a 64x32 plane of 16-bit words at 0, then a 32x16 plane of word pairs at 4,096, each 128 bytes a row | `R16Unorm` over plane 0 |
|
||||
//! | `surface-textures-x420-chroma-rg16` | the same | `RG16Unorm` over plane 1 |
|
||||
//! | `surface-textures-420v-luma-r8-nvidia`, `-420v-chroma-rg8-nvidia`, `-x420-luma-r16-nvidia`, `-x420-chroma-rg16-nvidia` | the four two-plane cases' surfaces | the same, the new runtime's surface made by NVIDIA's route |
|
||||
//! | `surface-textures-420v-luma-r8-nvidia`, `-420v-chroma-rg8-nvidia`, `-x420-luma-r16-nvidia`, `-x420-chroma-rg16-nvidia` | the four two-plane cases' surfaces | the same, the runtime's surface made by NVIDIA's route |
|
||||
//!
|
||||
//! Each case makes the texture with `newTextureWithDescriptor:iosurface:plane:` (2D, `Shared`,
|
||||
//! shader-read usage), writes every texel with `replaceRegion:mipmapLevel:withBytes:bytesPerRow:`,
|
||||
@@ -74,7 +74,7 @@ fn one_plane(
|
||||
|
||||
/// A 4:2:0 surface of two planes, made with a plane dictionary: the luma plane of `code`-byte
|
||||
/// texels at 0, then the chroma plane of pairs of them, both `bytes_per_row` apart, and the
|
||||
/// texture over `plane`, made by the new runtime's side by `route`.
|
||||
/// texture over `plane`, made by the runtime's side by `route`.
|
||||
fn two_plane(
|
||||
ostype: [u8; 4],
|
||||
[luma, chroma]: [PixelFormat; 2],
|
||||
|
||||
@@ -630,13 +630,13 @@ impl Case for DescriptorPairs {
|
||||
crate::degradation::Degradation::MemorylessTextureBuffer.code(),
|
||||
));
|
||||
}
|
||||
// The new runtime's answers are the device's own, held by their property and not by
|
||||
// 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::new_runtime_accepted(crate::texture_query::DEVICE_OWN_SIZES),
|
||||
Justification::accepted(crate::texture_query::DEVICE_OWN_SIZES),
|
||||
)
|
||||
}));
|
||||
named
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
//! dispatch, run where earlier threadgroups stored their patterns. The dispatches and the answer
|
||||
//! where threadgroup memory reads zero until the program writes it are
|
||||
//! `metal2vulkan_devtools::threadgroup_start`'s; this module's test holds Metal's recorded answer
|
||||
//! equal to it, and the new runtime's device test holds its own equal to it.
|
||||
//! equal to it, and the runtime's device test holds its own equal to it.
|
||||
//!
|
||||
//! Every output word is an atomic OR or a wrapping sum, the same in any order, so every byte
|
||||
//! compares exactly. Nothing here can fault a GPU: one pass of six dispatches, every access inside
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
//! the bind offset and past the kernels' regions included, so an access placed anywhere but its
|
||||
//! own address shows as words that moved. The inputs and the bind offsets are
|
||||
//! `metal2vulkan_devtools::vector_word_phases`'s, whose `answer` is every access at its own
|
||||
//! address; this module's tests hold Metal's recorded answer equal to it, and the new runtime's
|
||||
//! address; this module's tests hold Metal's recorded answer equal to it, and the runtime's
|
||||
//! device test holds its own equal to it.
|
||||
//!
|
||||
//! Every input word is a normal `float`, so the kernels' negations and moves are exact on every
|
||||
@@ -229,7 +229,7 @@ mod tests {
|
||||
|
||||
/// Metal's recorded answer at each word phase is every access at its own address: the
|
||||
/// buffers `metal2vulkan_devtools::vector_word_phases::answer` gives, byte for byte, which the
|
||||
/// product's interpreter test and the new runtime's device test hold their own answers to.
|
||||
/// product's interpreter test and the runtime's device test hold their own answers to.
|
||||
#[test]
|
||||
fn metal_places_each_vector_at_its_own_address() {
|
||||
for case in all() {
|
||||
|
||||
@@ -138,14 +138,14 @@ impl Case for FormatDescriptors {
|
||||
}
|
||||
|
||||
fn allowances(&self) -> Vec<Allowance> {
|
||||
// The new runtime's answers are the device's own, held by their property and not by
|
||||
// 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().into_iter())
|
||||
.map(|(query, _)| {
|
||||
Allowance::new(
|
||||
format!("case/{}/{}/Ok/*", query.site(), site::QUERY),
|
||||
Loosening::Unchecked,
|
||||
Justification::new_runtime_accepted(crate::texture_query::DEVICE_OWN_SIZES),
|
||||
Justification::accepted(crate::texture_query::DEVICE_OWN_SIZES),
|
||||
)
|
||||
})
|
||||
.collect()
|
||||
|
||||
@@ -248,10 +248,9 @@ pub fn compare_run(
|
||||
// validation check that has since gone fails here rather than comparing under it.
|
||||
for allowance in allowances {
|
||||
let missing = match &allowance.justified_by {
|
||||
justification @ (crate::allowance::Justification::Degradation(code)
|
||||
| crate::allowance::Justification::NewRuntimeNotice(code)) => {
|
||||
justification @ crate::allowance::Justification::Degradation(code) => {
|
||||
let announced = std::slice::from_ref(code);
|
||||
let exists = Offered::new(announced, offered.metal_validation).on_new_runtime(true);
|
||||
let exists = Offered::new(announced, offered.metal_validation);
|
||||
match justification.unjustified(&exists) {
|
||||
// The run's own notices are checked where the allowance fires, not here.
|
||||
Some(Unjustified::NoticeNotAnnounced(_)) | None => None,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//! and the kind each of the runtime's precision notes announces as.
|
||||
//!
|
||||
//! 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 new runtime's side announces the codes of
|
||||
//! 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.
|
||||
|
||||
|
||||
@@ -2244,7 +2244,6 @@ impl Side for MetalSide {
|
||||
// An Apple GPU keeps textures losslessly compressed; a Mac's Intel or AMD GPU, which
|
||||
// supports no Apple family, keeps none (the consumer's AMD 5300M and Intel 630).
|
||||
lossless_compression: self.device.supportsFamily(MTLGPUFamily::Apple1),
|
||||
new_runtime: false,
|
||||
host: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ pub fn replay_against(
|
||||
case,
|
||||
answer,
|
||||
&ours,
|
||||
(&announced, venue.lossless_compression, venue.new_runtime),
|
||||
(&announced, venue.lossless_compression),
|
||||
abort.is_some(),
|
||||
);
|
||||
Ok(Replayed {
|
||||
@@ -202,8 +202,8 @@ pub fn replay_against(
|
||||
|
||||
/// The verdict of `ours` against `answer`'s outcomes: the most favourable of them, because Metal
|
||||
/// produced any of the set and matching one of them is matching Metal. With it, what the case's
|
||||
/// allowances did against that outcome. `offered` is what the run announced, whether its venue
|
||||
/// presents Metal's lossless compression, and whether the run is `metal2vulkan-rt`'s.
|
||||
/// allowances did against that outcome. `offered` is what the run announced, and whether its venue
|
||||
/// presents Metal's lossless compression.
|
||||
///
|
||||
/// The allowances follow the verdict rather than being gathered over every outcome, because they
|
||||
/// are a fact about the comparison the verdict came from: a racy case whose run matched the
|
||||
@@ -212,7 +212,7 @@ fn verdict_over(
|
||||
case: &dyn Case,
|
||||
answer: &Answer,
|
||||
ours: &Transcript,
|
||||
(announced, compression, new_runtime): (&[String], bool, bool),
|
||||
(announced, compression): (&[String], bool),
|
||||
stopped: bool,
|
||||
) -> (Verdict, Allowances) {
|
||||
let allowances = case.allowances();
|
||||
@@ -238,9 +238,7 @@ fn verdict_over(
|
||||
));
|
||||
continue;
|
||||
}
|
||||
let offered = Offered::new(announced, &answer.validated)
|
||||
.on_venue(compression)
|
||||
.on_new_runtime(new_runtime);
|
||||
let offered = Offered::new(announced, &answer.validated).on_venue(compression);
|
||||
let found = compare_run(&outcome.transcript, ours, &allowances, offered, stopped);
|
||||
let used = Allowances {
|
||||
named: found.named,
|
||||
@@ -366,7 +364,7 @@ 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 new runtime:
|
||||
/// 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
|
||||
/// divides by the texture's size for the device's normalized sampler. The function does not know
|
||||
|
||||
@@ -72,7 +72,7 @@ const THE_CONSUMERS: &str = "a queue's label and a command buffer's device and c
|
||||
/// The command buffers a queue of this side's holds at once: `newCommandQueue`'s.
|
||||
const QUEUE_COMMAND_BUFFERS: u32 = 64;
|
||||
|
||||
/// The new runtime's device a replay runs on, with the venue it reports and the indices it hands
|
||||
/// The runtime's device a replay runs on, with the venue it reports and the indices it hands
|
||||
/// out.
|
||||
pub struct RtDevice {
|
||||
device: rt::Device,
|
||||
@@ -304,7 +304,6 @@ fn venue(instance: &rt::Instance, physical: &rt::PhysicalDevice) -> Venue {
|
||||
vk::api_version_minor(properties.api_version)
|
||||
),
|
||||
lossless_compression: false,
|
||||
new_runtime: true,
|
||||
host: (properties.device_type == vk::PhysicalDeviceType::CPU)
|
||||
.then(crate::case::host_vector_isa),
|
||||
}
|
||||
@@ -346,7 +345,7 @@ pub(crate) fn reflection_is_the_consumers() -> Failure {
|
||||
)
|
||||
}
|
||||
|
||||
/// The new runtime's side of one case.
|
||||
/// The runtime's side of one case.
|
||||
pub struct RtSide<'a> {
|
||||
on: &'a RtDevice,
|
||||
queue: Option<rt::CommandQueue>,
|
||||
|
||||
@@ -16,7 +16,6 @@ fn venue() -> Venue {
|
||||
driver: "stub".to_owned(),
|
||||
api: "1.2".to_owned(),
|
||||
lossless_compression: true,
|
||||
new_runtime: false,
|
||||
host: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1302,8 +1302,7 @@ fn a_failing_row_names_the_native_notes_its_run_announced() {
|
||||
}
|
||||
|
||||
/// Every accepted difference a case names is an entry of `docs/API.md` section 10, a venue's
|
||||
/// answer (`Justification::WithoutCompression`) and the new runtime's
|
||||
/// (`Justification::NewRuntimeAccepted`) included. A slug that names no entry justifies
|
||||
/// answer (`Justification::WithoutCompression`) included. A slug that names no entry justifies
|
||||
/// nothing on any venue, and a replay says so only where the site it loosens differs: the
|
||||
/// presented-Mac entry's lead-in was reworded while the compression slug kept the old words, so
|
||||
/// every site that slug loosens read divergent on the RTX 5080 and on lavapipe, and the M3 Max,
|
||||
@@ -1314,11 +1313,10 @@ fn every_accepted_difference_a_case_names_is_an_entry() {
|
||||
let mut missing = Vec::new();
|
||||
for case in crate::cases::all() {
|
||||
for allowance in case.allowances() {
|
||||
let (Justification::AcceptedDifference(slug)
|
||||
| Justification::WithoutCompression(slug)
|
||||
| Justification::NewRuntimeAccepted(slug)) = &allowance.justified_by
|
||||
else {
|
||||
continue;
|
||||
let slug = match &allowance.justified_by {
|
||||
Justification::AcceptedDifference(slug)
|
||||
| Justification::WithoutCompression(slug) => slug,
|
||||
_ => continue,
|
||||
};
|
||||
if !entries.contains(slug) {
|
||||
missing.push(format!(
|
||||
@@ -1338,13 +1336,13 @@ fn every_accepted_difference_a_case_names_is_an_entry() {
|
||||
);
|
||||
}
|
||||
|
||||
/// Every answer Metal recorded to `heapTextureSizeAndAlignWithDescriptor:` is loosened on the new
|
||||
/// runtime's run, both of its numbers, by the entry saying they are the device's own
|
||||
/// (`texture_query::DEVICE_OWN_SIZES`); the new runtime's side holds them to their property
|
||||
/// Every answer Metal recorded to `heapTextureSizeAndAlignWithDescriptor:` is loosened, both of
|
||||
/// its numbers, by the entry saying they are the device's own
|
||||
/// (`texture_query::DEVICE_OWN_SIZES`); the runtime's side holds them to their property
|
||||
/// instead. An answer the allowances missed would compare the device's numbers with Metal's, which
|
||||
/// the entry says they are not; one they reach past would excuse a site that is no answer.
|
||||
#[test]
|
||||
fn every_recorded_heap_texture_answer_is_held_by_its_property_on_the_new_runtime() {
|
||||
fn every_recorded_heap_texture_answer_is_held_by_its_property() {
|
||||
/// The paths of the `size-and-align` sites under `node` that recorded an answer.
|
||||
fn answered(node: &Node, path: &str, out: &mut Vec<String>) {
|
||||
let path = match path.is_empty() {
|
||||
@@ -1359,7 +1357,7 @@ fn every_recorded_heap_texture_answer_is_held_by_its_property_on_the_new_runtime
|
||||
answered(child, &path, out);
|
||||
}
|
||||
}
|
||||
let own = Justification::new_runtime_accepted(crate::texture_query::DEVICE_OWN_SIZES);
|
||||
let own = Justification::accepted(crate::texture_query::DEVICE_OWN_SIZES);
|
||||
let (mut held, mut missed, mut cases) = (0, Vec::new(), 0);
|
||||
for case in crate::cases::all() {
|
||||
let Ok(recording) = crate::recording::read(case.name()) else {
|
||||
@@ -1392,7 +1390,7 @@ fn every_recorded_heap_texture_answer_is_held_by_its_property_on_the_new_runtime
|
||||
}
|
||||
assert!(
|
||||
missed.is_empty(),
|
||||
"{} recorded answer field(s) compared with Metal's on the new runtime:\n{}",
|
||||
"{} recorded answer field(s) compared with Metal's on the runtime:\n{}",
|
||||
missed.len(),
|
||||
missed.join("\n")
|
||||
);
|
||||
@@ -3003,58 +3001,6 @@ fn a_refusal_reads_by_what_metals_validation_did() {
|
||||
assert!(!Verdict::of(&found, &Validated::NotRun).is_compliant());
|
||||
}
|
||||
|
||||
/// **A notice scoped to `metal2vulkan-rt` loosens the new runtime's run alone.**
|
||||
/// [`Justification::NewRuntimeNotice`] holds on `metal2vulkan-rt`'s run where the run announced
|
||||
/// the notice, and faults the case there where it did not. On the old runtime's run it holds
|
||||
/// nowhere and faults nothing, even where the old runtime announces the same notice: the site
|
||||
/// compares as if the case loosened nothing, so a difference there is the site's own one row, and
|
||||
/// the report says why the bound never fired.
|
||||
#[test]
|
||||
fn a_notice_scoped_to_the_new_runtime_leaves_the_old_runtimes_site_its_one_row() {
|
||||
let leaf = |bits: u32| {
|
||||
Transcript::new(vec![Node::leaf(
|
||||
"texels",
|
||||
Observed::value(Value::Float {
|
||||
bits: u64::from(bits),
|
||||
width: crate::transcript::FloatWidth::Single,
|
||||
}),
|
||||
)])
|
||||
};
|
||||
let code = Degradation::CompressedTexelDecode.code().to_owned();
|
||||
let allowances = vec![Allowance::new(
|
||||
"case/texels",
|
||||
Loosening::Absolute(0.01),
|
||||
Justification::new_runtime_notice(Degradation::CompressedTexelDecode),
|
||||
)];
|
||||
let metal = leaf(0.5f32.to_bits());
|
||||
let ours = leaf(0.505f32.to_bits());
|
||||
let announced = [code];
|
||||
let old = Offered::new(&announced, &Validated::NotRun);
|
||||
let found = compare(&metal, &ours, &allowances, old);
|
||||
assert!(found.bad_allowances.is_empty(), "{found:?}");
|
||||
let paths: Vec<&str> = found
|
||||
.divergences
|
||||
.iter()
|
||||
.map(|at| at.path.as_str())
|
||||
.collect();
|
||||
assert_eq!(paths, ["case/texels"], "{found:?}");
|
||||
assert_eq!(found.unfired.len(), 1, "{found:?}");
|
||||
assert_eq!(
|
||||
found.unfired[0].why,
|
||||
Some(Unjustified::OldRuntime.to_string())
|
||||
);
|
||||
|
||||
let found = compare(&metal, &ours, &allowances, old.on_new_runtime(true));
|
||||
assert!(found.divergences.is_empty(), "{found:?}");
|
||||
assert!(found.bad_allowances.is_empty(), "{found:?}");
|
||||
assert_eq!(found.announced.len(), 1, "{found:?}");
|
||||
|
||||
let silent = Offered::new(&[], &Validated::NotRun).on_new_runtime(true);
|
||||
let found = compare(&metal, &ours, &allowances, silent);
|
||||
assert_eq!(found.bad_allowances.len(), 1, "{found:?}");
|
||||
assert!(!Verdict::of(&found, &Validated::NotRun).is_compliant());
|
||||
}
|
||||
|
||||
/// **A site only Metal reached after a refusal beside it is folded under that refusal.** A row
|
||||
/// whose rate map we refused never reaches its labels or its later sites, so those are the
|
||||
/// refusal's and no divergence of their own; a site before the refusal, and a site of another row
|
||||
@@ -3144,15 +3090,13 @@ fn a_site_only_metal_reached_after_a_refusal_is_that_refusal_s() {
|
||||
);
|
||||
}
|
||||
|
||||
/// **The running-signal case's `MTLEvent` reading may be `Committed` on the new runtime's run
|
||||
/// alone.** The case names the accepted difference that the runtime schedules a command
|
||||
/// buffer once its submit thread is free ([`Justification::NewRuntimeAccepted`]): on
|
||||
/// `metal2vulkan-rt`'s run a waiting command buffer still `Committed` with no handler run, where
|
||||
/// Metal had scheduled it, is no divergence; on the old runtime's the same answers are the sites'
|
||||
/// rows. The shared event's reading is not loosened, and a status other than the two is a row on
|
||||
/// either run.
|
||||
/// **The running-signal case's `MTLEvent` reading may be `Committed`.** The case names the
|
||||
/// accepted difference that the runtime schedules a command buffer once its submit thread is free
|
||||
/// ([`Justification::AcceptedDifference`]): a waiting command buffer still `Committed` with no
|
||||
/// handler run, where Metal had scheduled it, is no divergence. The shared event's reading is not
|
||||
/// loosened, and a status other than the two is a row.
|
||||
#[test]
|
||||
fn a_wait_met_by_a_running_signal_may_read_committed_on_the_new_runtime_alone() {
|
||||
fn a_wait_met_by_a_running_signal_may_read_committed() {
|
||||
let case = (crate::cases::event_orders::all().into_iter())
|
||||
.find(|case| case.name() == crate::cases::event_orders::WAIT_BEHIND_A_RUNNING_SIGNAL)
|
||||
.expect("the running-signal case");
|
||||
@@ -3192,11 +3136,7 @@ fn a_wait_met_by_a_running_signal_may_read_committed_on_the_new_runtime_alone()
|
||||
"case/order/event/waiting/handlers-while-the-signaller-runs",
|
||||
"case/order/event/waiting/status-while-the-signaller-runs",
|
||||
];
|
||||
let old = Offered::notices(&[]);
|
||||
let found = compare(&metal, &ours, &allowances, old);
|
||||
assert_eq!(paths(&found), event_sites, "{found:?}");
|
||||
|
||||
let rt = old.on_new_runtime(true);
|
||||
let rt = Offered::notices(&[]);
|
||||
let found = compare(&metal, &ours, &allowances, rt);
|
||||
assert!(found.divergences.is_empty(), "{found:?}");
|
||||
assert!(found.bad_allowances.is_empty(), "{found:?}");
|
||||
@@ -3222,7 +3162,7 @@ fn a_wait_met_by_a_running_signal_may_read_committed_on_the_new_runtime_alone()
|
||||
let unknown = vec![Allowance::new(
|
||||
"case/order/event/*",
|
||||
Loosening::Unchecked,
|
||||
Justification::new_runtime_accepted("no-such-entry"),
|
||||
Justification::accepted("no-such-entry"),
|
||||
)];
|
||||
let found = compare(&metal, &ours, &unknown, rt);
|
||||
assert_eq!(found.bad_allowances.len(), 1, "{found:?}");
|
||||
@@ -3773,7 +3713,6 @@ fn venue_named(device: &str) -> Venue {
|
||||
driver: "stub".to_owned(),
|
||||
api: "none".to_owned(),
|
||||
lossless_compression: true,
|
||||
new_runtime: false,
|
||||
host: None,
|
||||
}
|
||||
}
|
||||
@@ -3790,7 +3729,6 @@ fn a_cpu_venue_is_told_apart_by_its_hosts_vector_set() {
|
||||
driver: "vendor 0x10005 device 0x0000".to_owned(),
|
||||
api: "1.4".to_owned(),
|
||||
lossless_compression: false,
|
||||
new_runtime: false,
|
||||
host: host.map(str::to_owned),
|
||||
};
|
||||
let avx2 = venue(Some("x86-64 AVX2"));
|
||||
|
||||
@@ -331,15 +331,15 @@ impl SizeAndAlign {
|
||||
}
|
||||
}
|
||||
|
||||
/// `docs/API.md` section 10's entry for the new runtime's answer to
|
||||
/// `docs/API.md` section 10's entry for the runtime's answer to
|
||||
/// `heapTextureSizeAndAlignWithDescriptor:`: the device's own size and alignment, not Metal's.
|
||||
///
|
||||
/// Each case that records the answer of a query at `case/<query>/size-and-align` names it at
|
||||
/// `case/<query>/size-and-align/Ok/*`, `Unchecked`: on the new runtime's run the two numbers are
|
||||
/// not compared with Metal's, and the runtime's side holds each to a property instead, answering
|
||||
/// the failure where it does not hold (the alignment a power of two; a Private query's texture
|
||||
/// placed at `align` in a heap of `align + size` bytes, and its first slice read back where the
|
||||
/// runtime moves the format's bytes). A refusal is
|
||||
/// not an answer, so a site where one side answers and the other refuses still diverges.
|
||||
/// `case/<query>/size-and-align/Ok/*`, `Unchecked`: the two numbers are not compared with Metal's,
|
||||
/// and the runtime's side holds each to a property instead, answering the failure where it does not
|
||||
/// hold (the alignment a power of two; a Private query's texture placed at `align` in a heap of
|
||||
/// `align + size` bytes, and its first slice read back where the runtime moves the format's bytes).
|
||||
/// A refusal is not an answer, so a site where one side answers and the other refuses still
|
||||
/// diverges.
|
||||
pub const DEVICE_OWN_SIZES: &str =
|
||||
"the-runtime-s-heap-texture-size-and-alignment-are-the-device-s-own";
|
||||
@@ -1095,7 +1095,6 @@ mod tests {
|
||||
driver: "stub".to_owned(),
|
||||
api: "stub".to_owned(),
|
||||
lossless_compression: true,
|
||||
new_runtime: false,
|
||||
host: None,
|
||||
}
|
||||
}
|
||||
@@ -1249,7 +1248,6 @@ mod tests {
|
||||
driver: "slow".to_owned(),
|
||||
api: "slow".to_owned(),
|
||||
lossless_compression: true,
|
||||
new_runtime: false,
|
||||
host: None,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user