State what every lane claim of the layer's silence holds, at all 355 of them

Content: the tree of `development` at cdc23c17c1, unchanged.
This commit is contained in:
Anees Iqbal committed 2026-10-26 13:19:16 +02:00
1 parent 5c74da4e82
commit 14fb1be63e
159 files changed
+1301 -1666

No files matched your search

@@ -0,0 +1,258 @@
//! What a device test's claim that the validation layer reported nothing holds, from what the
//! device's instance enabled of the layers it asked for.
//!
//! A device opens although a layer its caller asked for is one the loader cannot provide
//! (`device/create.rs`, `tests/missing_layer.rs`): the creation drops the whole layer list, creates
//! the instance with none, and the device says as it is made which layers it was made without
//! ([`LAYERS_DROPPED`]). That is right for a caller that asked for a device and wrong for a claim:
//! a test that requires the validation layer to have reported nothing passes by reporting nothing
//! at all, on every host the loader can give it no layer.
//!
//! So a test states the claim against the instance's own answer ([`Watched::layer_reported_nothing`]):
//! where the layer was enabled the claim holds over everything the layer checks, and where it was
//! not the test says so in its own output (`LAYER-ABSENT <claim>`) rather than passing on an empty
//! list. The decision is the instance's alone -- never the loader's listing, which a layer it lists
//! and cannot load passes alike, and never the host or the driver's name.
//!
//! A device test: compiled only under the validation crate's GPU safety cfgs.
use crate::device::create::LAYERS_DROPPED;
use crate::{DebugMessage, MessageSeverity, MessageSink};
use std::ffi::{CStr, CString};
use std::sync::{Arc, Mutex};
/// The validation layer, which this host may or may not provide.
pub(super) const VALIDATION: &CStr = c"VK_LAYER_KHRONOS_validation";
/// The id name the Vulkan loader gives the messages it reports itself.
const LOADER_MESSAGE: &str = "Loader Message";
/// What the loader's message about a layer it cannot provide names: the check it failed, and what
/// it found (`loader_validate_layers`, Vulkan-Loader `loader/loader.c`).
const VALIDATE_LAYERS: &str = "loader_validate_layers";
/// The rest of that message: the layer is none the loader lists.
const NOT_AVAILABLE: &str = "does not exist in the list of available layers";
/// Whether a message with this id name and text is the loader's own complaint about an instance
/// layer it cannot provide, and nothing wider. The loader reports it through the messenger chained
/// at `vkCreateInstance`, before the call answers `VK_ERROR_LAYER_NOT_PRESENT`.
fn loader_layer_message(id_name: &str, text: &str) -> bool {
id_name == LOADER_MESSAGE && text.contains(VALIDATE_LAYERS) && text.contains(NOT_AVAILABLE)
}
/// What one message list holds.
#[derive(Default)]
struct Seen {
/// The messages that fail a run, bounded so a flood cannot grow without limit.
failing: Vec<DebugMessage>,
/// Whether a device reporting here announced it was made without the layers it asked for.
dropped: bool,
/// Whether a device reporting here asked for the validation layer.
asked: bool,
}
/// The most messages kept of one list.
const MAX: usize = 64;
/// The messages the devices of one test report, and what their instance enabled of the validation
/// layer they asked for.
#[derive(Clone, Default)]
pub(super) struct Watched(Arc<Mutex<Seen>>);
impl Watched {
/// The instance layers a device reporting here asks for: the validation layer alone. The
/// loader may be unable to provide it, which the device itself says
/// ([`Watched::layer_reported_nothing`] reads that answer, not this list).
pub(super) fn layers(&self) -> Vec<CString> {
self.0.lock().unwrap_or_else(|p| p.into_inner()).asked = true;
vec![VALIDATION.to_owned()]
}
/// A sink reporting here, which calls `also` with each message first: a test's own work on the
/// messages it watches for (a sentinel the sink owns, a line it prints).
pub(super) fn sink(&self, also: impl Fn(&DebugMessage) + Send + Sync + 'static) -> MessageSink {
let seen = Arc::clone(&self.0);
MessageSink::new(move |message: &DebugMessage| {
also(message);
let mut seen = seen.lock().unwrap_or_else(|p| p.into_inner());
// What the instance enabled of the layers the device asked for: informational, so it
// fails nothing, and kept rather than dropped with the rest, since a claim of what the
// validation layer reported holds nothing without it.
if message.id_name == LAYERS_DROPPED {
seen.dropped = true;
return;
}
let fails = message.severity == MessageSeverity::Error
|| (message.severity == MessageSeverity::Warning && message.kind.validation);
if fails && message.degradation.is_none() && seen.failing.len() < MAX {
seen.failing.push(message.clone());
}
})
}
/// Require that the validation layer reported nothing of `claim` on the devices reporting
/// here, and say what that holds.
///
/// Every message the layer reported fails here, as `assert!(failures.is_empty())` did. What
/// the claim then stands on is the instance's answer alone: where a device announced it was
/// made without the layer it asked for, there was nothing to report, so the claim was not
/// exercised and the test says so; the loader's own complaint about that same layer passes
/// with it, and nothing else does.
///
/// # Panics
///
/// Where the layer reported anything that fails a run.
pub(super) fn layer_reported_nothing(&self, claim: &str) {
let mut seen = self.0.lock().unwrap_or_else(|p| p.into_inner());
let dropped = seen.dropped;
let asked = seen.asked;
let failing: Vec<DebugMessage> = seen
.failing
.split_off(0)
.into_iter()
// The device said it was made without the layer, which is what the loader complained
// about first and all it complained about.
.filter(|message| !(dropped && loader_layer_message(&message.id_name, &message.text)))
.collect();
drop(seen);
assert!(
failing.is_empty(),
"{claim}: the validation layer reported\n{failing:#?}"
);
if dropped || !asked {
eprintln!(
"LAYER-ABSENT {claim}: the device's instance enabled no validation layer, so it \
reported nothing at all; the claim was not exercised here"
);
}
}
}
#[cfg(test)]
mod tests {
use super::{loader_layer_message, Watched, VALIDATION};
use crate::device::create::LAYERS_DROPPED;
use crate::{DebugMessage, MessageKind, MessageSeverity};
/// A message of the layer's or the loader's, as the sink hears it.
fn message(severity: MessageSeverity, id_name: &str, text: &str) -> DebugMessage {
DebugMessage {
severity,
kind: MessageKind {
general: severity == MessageSeverity::Error,
validation: false,
performance: false,
},
id_name: id_name.to_owned(),
id: 0,
text: text.to_owned(),
degradation: None,
}
}
/// The loader's own complaint about the layer it cannot provide, and nothing wider.
#[test]
fn the_loader_s_message_about_a_layer_it_cannot_provide_is_matched_and_nothing_wider() {
assert!(loader_layer_message(
"Loader Message",
"loader_validate_layers: Layer 0 does not exist in the list of available layers"
));
for (id_name, text) in [
(
"Loader Message",
"terminator_CreateInstance: Failed to CreateInstance in ICD 0",
),
(
"VUID-vkCreateInstance-ppEnabledLayerNames-01727",
"loader_validate_layers: Layer 0 does not exist in the list of available layers",
),
("Loader Message", "loader_validate_layers: Layer 0 is fine"),
] {
assert!(!loader_layer_message(id_name, text), "{id_name}: {text}");
}
}
/// The message the loader sends about the layer it cannot provide.
fn loader_complaint() -> DebugMessage {
message(
MessageSeverity::Error,
"Loader Message",
"loader_validate_layers: Layer 0 does not exist in the list of available layers",
)
}
/// The message a device sends as it is made without the layers it asked for.
fn made_without() -> DebugMessage {
message(
MessageSeverity::Info,
LAYERS_DROPPED,
"metal2vulkan: the device was made without the instance layer(s) \
VK_LAYER_KHRONOS_validation",
)
}
/// A list whose device asked for the validation layer and was made without it states no claim
/// of the layer's: the loader's own complaint about that layer passes, and the claim prints
/// that it was not exercised rather than passing on an empty list. Its own input: no device,
/// no loader, no host.
#[test]
fn a_claim_on_a_device_made_without_the_layer_is_not_exercised() {
let watched = Watched::default();
assert_eq!(watched.layers(), [VALIDATION.to_owned()]);
let sink = watched.sink(|_| {});
sink.deliver(&loader_complaint());
sink.deliver(&made_without());
watched.layer_reported_nothing("nothing of the layer's");
}
/// The loader's complaint fails where no device says it was made without the layer: a loader
/// that refused a layer nothing accounts for is not a clean run.
#[test]
#[should_panic(expected = "the validation layer reported")]
fn the_loader_s_complaint_fails_where_no_device_explains_it() {
let watched = Watched::default();
let sink = watched.sink(|_| {});
sink.deliver(&loader_complaint());
watched.layer_reported_nothing("nothing of the layer's");
}
/// A list whose device enabled the layer it asked for and had it report nothing holds the
/// claim, and anything the layer did report fails it: the check is not vacuous either way.
#[test]
fn a_claim_holds_where_the_layer_was_enabled_and_fails_on_what_it_reported() {
let watched = Watched::default();
assert_eq!(watched.layers(), [VALIDATION.to_owned()]);
let sink = watched.sink(|_| {});
watched.layer_reported_nothing("every command was valid");
sink.deliver(&message(
MessageSeverity::Error,
"VUID-vkCmdDraw-None-08600",
"a bound descriptor set was not valid",
));
let failed = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
watched.layer_reported_nothing("every command was valid")
}));
assert!(
failed.is_err(),
"the claim held over a message the layer reported"
);
}
/// The test's own work on each message runs too, beside the list's.
#[test]
fn a_test_s_own_receiver_hears_every_message() {
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
let heard = Arc::new(AtomicUsize::new(0));
let counted = Arc::clone(&heard);
let watched = Watched::default();
let sink = watched.sink(move |_| {
counted.fetch_add(1, Ordering::Relaxed);
});
sink.deliver(&made_without());
sink.deliver(&loader_complaint());
assert_eq!(heard.load(Ordering::Relaxed), 2);
watched.layer_reported_nothing("nothing of the layer's");
}
}
@@ -127,6 +127,8 @@ mod keeper;
mod kept_barriers;
#[cfg(any(m2v_gpu, m2v_cpu_icd))]
mod kept_images;
#[cfg(any(m2v_gpu, m2v_cpu_icd))]
mod layer_claim;
mod left;
mod linear_attachment;
mod linear_plan;
@@ -13,12 +13,14 @@
//! which the fetching draws' storage view of them takes.
//!
//! A device test: compiled only under the validation crate's GPU safety cfgs (`m2v_gpu`,
//! `m2v_cpu_icd`), on the kind of device the cfg selects, under the validation layer where the
//! loader lists it: a view the image does not take, or a view whose usage its format lacks, is a
//! failing message.
//! `m2v_cpu_icd`), on the kind of device the cfg selects, asking for the validation layer: a view
//! the image does not take, or a view whose usage its format lacks, is a failing message. What the
//! claim of the layer's silence holds is what the device's instance enabled of the layer it asked
//! for (`tests/layer_claim.rs`), so a host the loader can give it no layer says so rather than
//! passing on an empty message list.
use super::layer_claim::Watched;
use crate::attachment_stand_in::stand_in;
use crate::device::lock;
use crate::framebuffer_fetch::{
storage_view_format, stores_samples, through_multisampled_storage, through_planes, views_in,
};
@@ -27,15 +29,13 @@ use crate::render_pass::Target;
use crate::render_target::{color_view, storage_view_in};
use crate::sample_planes::Planes;
use crate::{
DebugMessage, Device, DeviceKind, DeviceOptions, MessageSeverity, MessageSink, ResourceOptions,
ShaderCacheOptions, Texture, TextureDescriptor,
Device, DeviceKind, DeviceOptions, ResourceOptions, ShaderCacheOptions, Texture,
TextureDescriptor,
};
use metal2vulkan::device::FormatUsage;
use metal2vulkan::metal::{PixelFormat, TextureType, TextureUsage};
use metal2vulkan::vk::{Format, ImageCreateFlags, ImageUsageFlags};
use std::ffi::CString;
use std::path::{Path, PathBuf};
use std::sync::{Arc, Mutex};
/// The attachments' side, and the multisampled one's samples.
const SIDE: u32 = 16;
@@ -65,30 +65,12 @@ impl Drop for Scratch {
}
}
/// The validation layer's name, where the loader lists it.
fn validation_layer() -> Option<CString> {
let name = c"VK_LAYER_KHRONOS_validation";
let entry = crate::device::create::open_loader(None).ok()?;
// SAFETY: the loader is open; listing its layers needs nothing else.
let layers = unsafe { entry.enumerate_instance_layer_properties() }.ok()?;
layers
.iter()
.any(|layer| layer.layer_name_as_c_str().is_ok_and(|n| n == name))
.then(|| name.to_owned())
}
/// The device the cfg selects, its shader cache in `cache`, under the validation layer where the
/// loader lists it, and the failing messages it reports.
fn watched(cache: &Path) -> (Device, Arc<Mutex<Vec<String>>>) {
let failures = Arc::new(Mutex::new(Vec::new()));
let reported = Arc::clone(&failures);
let sink = MessageSink::new(move |message: &DebugMessage| {
let fails = message.severity == MessageSeverity::Error
|| (message.severity == MessageSeverity::Warning && message.kind.validation);
if fails && message.degradation.is_none() {
lock(&reported).push(format!("{}: {}", message.id_name, message.text));
}
});
/// The device the cfg selects, its shader cache in `cache`, asking for the validation layer, and
/// what its instance had the layer report ([`Watched::layer_reported_nothing`] says what a claim
/// of its silence holds; the instance's own answer, never the loader's listing).
fn watched(cache: &Path) -> (Device, Watched) {
let watched = Watched::default();
let sink = watched.sink(|_| {});
let options = DeviceOptions {
kinds: match cfg!(m2v_cpu_icd) {
true => vec![DeviceKind::Cpu],
@@ -102,12 +84,12 @@ fn watched(cache: &Path) -> (Device, Arc<Mutex<Vec<String>>>) {
directory: Some(cache.to_owned()),
..ShaderCacheOptions::default()
},
layers: validation_layer().into_iter().collect(),
layers: watched.layers(),
messages: Some(sink),
..DeviceOptions::default()
};
let device = Device::system_default_with(&options).unwrap();
(device, failures)
(device, watched)
}
/// A private 2D texture of `pf`, `SIDE` square, of `samples` and `usage`.
@@ -155,7 +137,7 @@ fn mutable_to(plan: &ImagePlan, format: Format, view: Format) -> bool {
#[test]
fn an_srgb_attachment_is_fetched_through_its_unsigned_integer_view() {
let cache = Scratch::new();
let (device, failures) = watched(&cache.0);
let (device, watched) = watched(&cache.0);
// The command buffer whose encoder would make the scratch images.
let queue = device.new_command_queue().unwrap();
let maker = queue.command_buffer().unwrap();
@@ -236,6 +218,5 @@ fn an_srgb_attachment_is_fetched_through_its_unsigned_integer_view() {
{planes} sample planes"
);
drop((maker, queue, device));
let failures = lock(&failures);
assert!(failures.is_empty(), "failing messages: {:#?}", *failures);
watched.layer_reported_nothing("every fetch image's commands were valid and nothing leaked");
}
@@ -5,8 +5,9 @@
//! gates the test opens, never a timing: the program drops every handle while the runtime holds the
//! device through one path, the device is checked to be still alive, the gate opens, and the
//! teardown must end, on the thread the path lets go on, with no message (the validation layer,
//! where the loader lists it, reports a destroyed object used, an object destroyed twice, or one
//! the teardown left).
//! which the device asks for, reports a destroyed object used, an object destroyed twice, or one
//! the teardown left; what the claim of its silence holds is what the instance enabled of it,
//! `tests/layer_claim.rs`).
//!
//! - **Not a pool thread**: a draw's making held waiting in the pool (`pool::held`) holds nothing
//! of the device, whose last handle goes on the program's thread; one held while it runs
@@ -52,6 +53,7 @@
use super::dispatch_pending as pending;
use super::freed_memory::{unused, Host, Runs};
use super::layer_claim::Watched;
use crate::device::lock;
use crate::device::prime::SHADER;
use crate::exit_guard;
@@ -59,14 +61,12 @@ use crate::pipeline::objects::{shader_module, words_digest};
use crate::pipeline::pool::held;
use crate::trails::blocked;
use crate::{
Buffer, ClearColor, CommandBufferStatus, DebugMessage, Device, DeviceKind, DeviceOptions,
LoadAction, MessageSeverity, MessageSink, PipelineOptions, RenderPassDescriptor,
RenderPipelineState, ResourceOptions, ShaderCacheOptions, Size, StoreAction, Submission,
TextureDescriptor,
Buffer, ClearColor, CommandBufferStatus, Device, DeviceKind, DeviceOptions, LoadAction,
PipelineOptions, RenderPassDescriptor, RenderPipelineState, ResourceOptions,
ShaderCacheOptions, Size, StoreAction, Submission, TextureDescriptor,
};
use metal2vulkan::metal::{PixelFormat, PrimitiveType, TextureUsage};
use metal2vulkan::pipeline::{ColorAttachmentDescriptor, RenderPipelineDescriptor, StageSource};
use std::ffi::CString;
use std::path::{Path, PathBuf};
use std::sync::atomic::Ordering;
use std::sync::mpsc::{self, TryRecvError};
@@ -119,10 +119,11 @@ impl Drop for Ended {
}
}
/// A watched device's teardown: the thread it ends on, and the failing messages it reported.
/// A watched device's teardown: the thread it ends on, and what its instance had the validation
/// layer report ([`Watched`], which says what a claim of its silence holds).
struct Ending {
thread: mpsc::Receiver<String>,
failures: Arc<Mutex<Vec<String>>>,
watched: Watched,
}
impl Ending {
@@ -143,8 +144,8 @@ impl Ending {
Ok(program_thread()),
"the device was not torn down on this thread before its last drop returned"
);
let failures = lock(&self.failures);
assert!(failures.is_empty(), "failing messages: {:#?}", *failures);
self.watched
.layer_reported_nothing("the teardown that ended here left no object and used none");
}
/// The teardown ends, on one of `threads`, and nothing failed meanwhile.
@@ -157,38 +158,22 @@ impl Ending {
threads.contains(&thread.as_str()),
"the device's teardown ended on {thread}, not on one of {threads:?}"
);
let failures = lock(&self.failures);
assert!(failures.is_empty(), "failing messages: {:#?}", *failures);
self.watched.layer_reported_nothing(&format!(
"the teardown that ended on {thread} left no object and used none"
));
}
}
/// The validation layer's name, where the loader lists it.
fn validation_layer() -> Option<CString> {
let name = c"VK_LAYER_KHRONOS_validation";
let entry = crate::device::create::open_loader(None).ok()?;
// SAFETY: the loader is open; listing its layers needs nothing else.
let layers = unsafe { entry.enumerate_instance_layer_properties() }.ok()?;
layers
.iter()
.any(|layer| layer.layer_name_as_c_str().is_ok_and(|n| n == name))
.then(|| name.to_owned())
}
/// The device the cfg selects, its shader cache in `cache`, under the validation layer where the
/// loader lists it, reporting to a sink that sees its teardown end.
/// The device the cfg selects, its shader cache in `cache`, asking for the validation layer, and
/// reporting to a sink that sees its teardown end. What a claim of the layer's silence holds is
/// the instance's own answer ([`Watched::layer_reported_nothing`]), never the loader's listing.
fn watched(cache: &Path) -> (Device, Ending) {
let (sender, thread) = mpsc::channel();
let ended = Ended(sender);
let failures = Arc::new(Mutex::new(Vec::new()));
let reported = Arc::clone(&failures);
let sink = MessageSink::new(move |message: &DebugMessage| {
let watched = Watched::default();
let sink = watched.sink(move |_| {
// The sink owns the sentinel, which goes with its last share, the instance's.
let _ = &ended;
let fails = message.severity == MessageSeverity::Error
|| (message.severity == MessageSeverity::Warning && message.kind.validation);
if fails && message.degradation.is_none() {
lock(&reported).push(format!("{}: {}", message.id_name, message.text));
}
});
let options = DeviceOptions {
kinds: match cfg!(m2v_cpu_icd) {
@@ -203,13 +188,13 @@ fn watched(cache: &Path) -> (Device, Ending) {
directory: Some(cache.to_owned()),
..ShaderCacheOptions::default()
},
layers: validation_layer().into_iter().collect(),
layers: watched.layers(),
messages: Some(sink),
..DeviceOptions::default()
};
// The options' share of the sink goes as this returns: the instance's is the last.
let device = Device::system_default_with(&options).unwrap();
(device, Ending { thread, failures })
(device, Ending { thread, watched })
}
/// The fixture's render pipeline state: `colored_vertex` and `colored_fragment`, one
@@ -513,8 +498,9 @@ fn the_watch_of_the_program_s_marks_leaves_the_device_to_the_program_s_thread()
Ok(program_thread()),
"the device was not torn down on this thread before its last drop returned"
);
let failures = lock(&ending.failures);
assert!(failures.is_empty(), "failing messages: {:#?}", *failures);
ending
.watched
.layer_reported_nothing("the teardown that ended here left no object and used none");
}
/// A released host import's block waits for the program's mark, which only the held watch sees;
@@ -564,7 +550,8 @@ fn a_release_of_freed_memory_leaves_the_device_to_the_program_s_thread() {
1,
"the teardown freed the block and ran its deallocator"
);
let failures = lock(&ending.failures);
assert!(failures.is_empty(), "failing messages: {:#?}", *failures);
ending
.watched
.layer_reported_nothing("the teardown that freed the block left no object and used none");
drop(host);
}
@@ -1,6 +1,8 @@
//! The runtime path's routing, device-free, over the committed public cases.
use super::*;
#[cfg(any(m2v_gpu, m2v_cpu_icd))]
use crate::candidate::runtime_case::layer_reported_nothing_at_all;
use crate::check::admission::{admit, ExecutionRequest};
use crate::gpu::DeviceType;
use crate::store::CorpusStore;
@@ -966,11 +968,7 @@ fn the_runtime_path_calls_the_functions_its_tables_hold() {
};
assert!(matches!(unlinked, CaseError::Case(_)), "{unlinked}");
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The engine's candidate draws each owned object and mesh case through the runtime's mesh path
@@ -95,7 +95,10 @@ pub use commands::{encoded_execution, pipeline_states, CaseCommands, TemplateSta
/// (`runtime_lane::creation_heard_checked`).
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
pub(crate) use layer_claim::loader_layer_message;
pub use layer_claim::{layer_reported_nothing, EnabledLayers, LayerClaim, LAYERS_DROPPED};
pub use layer_claim::{
layer_reported_nothing, layer_reported_nothing_at_all, nothing_reported_without_the_layer,
EnabledLayers, LayerClaim, LAYERS_DROPPED,
};
pub use render::{
commit_render, encoded_mesh, encoded_render, mesh_pipeline_state, render_pipeline_descriptor,
render_pipeline_state, CommittedRender, EncodedRender, MeshInputs, RenderInputs,
@@ -126,15 +126,70 @@ impl LayerClaim {
/// alone ([`EnabledLayers`]): [`LayerClaim::Held`] where the layer was enabled, else a claim that
/// was not exercised, printed on stderr with the test's name.
///
/// For a claim no narrower than the layer's own silence, [`layer_reported_nothing_at_all`].
///
/// # Panics
///
/// Where the layer reported anything that fails a run.
pub fn layer_reported_nothing(messages: &Messages, claim: &str) -> LayerClaim {
stated(messages, claim, &format!("{claim}: "), LAYER)
}
/// What a lane states where it names no claim narrower than the layer's own silence: that the
/// validation layer reported nothing at all of the work the test did up to here. Named in the line
/// a layerless device prints, where the test's own name says the rest ([`LayerFacts::claim`]).
const NOTHING_AT_ALL: &str = "the validation layer reported nothing of the work so far";
/// Require that the validation layer reported nothing at all of the work the devices reporting to
/// `messages` did, and say what that holds ([`layer_reported_nothing`] of the lane's widest
/// claim).
///
/// The claim the lane states oftenest, and exactly what `assert!(messages.take().is_empty())`
/// stated: whatever the layer checked of the work so far, it reported nothing of it. A test that
/// holds something narrower names it ([`layer_reported_nothing`]); the claim's words change
/// nothing of what fails, every message failing either way, and say which claim a layerless
/// device could not exercise.
///
/// # Panics
///
/// Where the layer reported anything that fails a run.
pub fn layer_reported_nothing_at_all(messages: &Messages) -> LayerClaim {
stated(messages, NOTHING_AT_ALL, "", LAYER)
}
/// Require that the devices reporting to `messages` reported nothing of `claim` that fails, where
/// they asked for no validation layer: a device a test makes without it, so that what reaches the
/// list is the driver's own and the runtime's. The layer's absence takes nothing from such a
/// claim, and the claim is [`LayerClaim::NoLayerAsked`].
///
/// # Panics
///
/// Where anything reported fails a run, and where such a device did ask for the validation layer:
/// then the claim is the layer's after all, and [`layer_reported_nothing`] is how it is stated.
pub fn nothing_reported_without_the_layer(messages: &Messages, claim: &str) -> LayerClaim {
let asked = messages.enabled_layers();
assert!(
!asked
.asked()
.iter()
.any(|name| name.as_c_str() == super::VALIDATION_LAYER),
"{claim}: the device asked for the validation layer, so the claim is the layer's"
);
stated(messages, claim, &format!("{claim}: "), "the device")
}
/// What a claim names as having reported nothing, where the validation layer is what would have.
const LAYER: &str = "the validation layer";
/// Take what the devices reporting to `messages` reported, state `claim` against what their
/// instance enabled, and fail on anything reported, the failure led by `lead` and naming
/// `reporter` as what reported.
fn stated(messages: &Messages, claim: &str, lead: &str, reporter: &str) -> LayerClaim {
let reported = messages.take();
let stated = messages.state_layer_claim(claim);
assert!(
reported.is_empty(),
"{claim}: the validation layer reported\n{reported:#?}"
"{lead}{reporter} reported\n{reported:#?}"
);
stated
}
@@ -291,7 +346,10 @@ impl LayerFacts {
#[cfg(test)]
mod tests {
use super::{layer_reported_nothing, LayerClaim, LAYERS_DROPPED};
use super::{
layer_reported_nothing, layer_reported_nothing_at_all, nothing_reported_without_the_layer,
LayerClaim, LAYERS_DROPPED,
};
use crate::candidate::runtime_case::{Messages, VALIDATION_LAYER};
use std::ffi::CString;
@@ -364,6 +422,63 @@ mod tests {
assert!(claim.exercised());
}
/// The widest claim, which no test names ([`layer_reported_nothing_at_all`], the one the lane
/// states oftenest), is not exercised either where the layer was dropped: so the 300-odd lane
/// sites that asserted `messages.take()` was empty and said no more now say so instead of
/// passing on a list that could report nothing at all.
#[test]
fn the_widest_claim_is_not_exercised_where_the_layer_was_dropped() {
let messages = layerless();
assert_eq!(
messages.take(),
Vec::new(),
"the layerless list reports nothing at all"
);
assert_eq!(
layer_reported_nothing_at_all(&messages),
LayerClaim::NotExercised {
dropped: vec![VALIDATION_LAYER.to_string_lossy().into_owned()],
},
"the widest claim with no layer present must say it was not exercised"
);
assert!(!layer_reported_nothing_at_all(&messages).exercised());
}
/// The same claim on a list whose device enabled the layer holds.
#[test]
fn the_widest_claim_holds_where_the_layer_was_enabled() {
let messages = Messages::default();
messages.device_asked_layers(&[VALIDATION_LAYER.to_owned()]);
let claim = layer_reported_nothing_at_all(&messages);
assert_eq!(claim, LayerClaim::Held);
assert!(claim.exercised());
}
/// A claim a test states of a device it made without the validation layer
/// ([`nothing_reported_without_the_layer`]: the driver's own messages and the runtime's) is
/// none of the layer's, and the layer's absence takes nothing from it.
#[test]
fn a_claim_of_what_a_layerless_device_reported_is_none_of_the_layer_s() {
let messages = Messages::default();
messages.device_asked_layers(&[]);
assert_eq!(
nothing_reported_without_the_layer(&messages, "nothing the driver said fails"),
LayerClaim::NoLayerAsked
);
}
/// The same claim on a device that did ask for the validation layer fails: then what reaches
/// the list is the layer's, and the claim is the layer's to state
/// ([`layer_reported_nothing`]), so a test that stops clearing its device's layers cannot
/// keep the weaker statement.
#[test]
#[should_panic(expected = "the device asked for the validation layer")]
fn a_layerless_claim_on_a_device_that_asked_for_the_layer_fails() {
let messages = Messages::default();
messages.device_asked_layers(&[VALIDATION_LAYER.to_owned()]);
nothing_reported_without_the_layer(&messages, "nothing the driver said fails");
}
/// A device a test makes with no layer at all, to time it, states no claim of the layer's.
#[test]
fn a_device_that_asked_for_no_layer_states_no_claim_of_the_layer_s() {
@@ -8,6 +8,7 @@ use super::api::Observation;
use super::record::{compare, read_lines, Value};
use super::runtime::RuntimeApi;
use super::{fingerprint, records_path, scenarios, Scenario, SCENARIOS};
use crate::candidate::runtime_case::layer_reported_nothing;
use crate::runtime_lane::METAL_ENVIRONMENT;
/// Run every case of `scenario` on the runtime, each on a device of its own, and compare the
@@ -34,7 +35,9 @@ fn matches_metal(name: &str) {
);
}
/// One case's records on a runtime device, which reported no validation message.
/// One case's records on a runtime device, which reported no validation message
/// ([`layer_reported_nothing`], so a device the loader could not give the layer to says in the
/// test's output that the claim was not exercised there).
fn run_on_runtime(scenario: &Scenario, case: &'static str) -> Result<Vec<(String, Value)>, String> {
let api = RuntimeApi::open()?;
let mut observation = Observation::new(case, false);
@@ -42,15 +45,8 @@ fn run_on_runtime(scenario: &Scenario, case: &'static str) -> Result<Vec<(String
let records = observation.finish(scenario.name);
let messages = api.messages.clone();
drop(api);
let messages = messages.take();
if messages.is_empty() {
Ok(records)
} else {
Err(format!(
"{}/{case}: the validation layer reported: {messages:#?}",
scenario.name
))
}
layer_reported_nothing(&messages, &format!("{}/{case}", scenario.name));
Ok(records)
}
#[test]
@@ -19,9 +19,10 @@ use crate::air_library::AirLibrary;
use crate::candidate::engine::{compute_case, ComputeCase};
pub use crate::candidate::runtime_case::{
argument_texture_usage, bound_buffers, buffer_with, buffer_with_options, commit_case,
compute_descriptor, encode_case, layer_reported_nothing, loader, open_device, open_devices,
read_buffer, read_texture, texture_descriptor, texture_usage, texture_with, CaseResources,
EnabledLayers, LayerClaim, Messages, ScratchCache, LAYERS_DROPPED, VALIDATION_LAYER,
compute_descriptor, encode_case, layer_reported_nothing, layer_reported_nothing_at_all, loader,
nothing_reported_without_the_layer, open_device, open_devices, read_buffer, read_texture,
texture_descriptor, texture_usage, texture_with, CaseResources, EnabledLayers, LayerClaim,
Messages, ScratchCache, LAYERS_DROPPED, VALIDATION_LAYER,
};
use crate::candidate::runtime_case::{
encoded_tile, report_each_message, tile_descriptor, Committed,
@@ -29,7 +29,10 @@
//! Metal's does (the same probe's texture buffers, swizzled ones among them, and argument buffers).
use super::degrade_notices::resolve_kind;
use super::{buffer_with, read_buffer, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device_with, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::bind::SamplerDescriptor;
@@ -802,7 +805,7 @@ fn a8_without_a8_unorm_writes_and_reads_alpha_as_metal() {
assert!(got.iter().all(|&v| v == alpha), "a8r_read_write: {got:?}");
every("a8r_read_write", &lane.bytes(&t), 178);
drop(lane);
assert!(messages.take().is_empty(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// An `A8Unorm` storage texture's reads on the device made without
@@ -823,7 +826,7 @@ fn a8_storage_reads_without_the_feature_go_by_the_format_s_bit() {
if lane.in_red() {
println!("A8-FORMATLESS {name}: no A8_UNORM, its own format not checked");
drop(lane);
assert!(messages.take().is_empty(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
return;
}
let profile = lane.device.compile_device().profile();
@@ -852,7 +855,7 @@ fn a8_storage_reads_without_the_feature_go_by_the_format_s_bit() {
);
}
drop(lane);
assert!(messages.take().is_empty(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
return;
}
let usage = TextureUsage::SHADER_READ | TextureUsage::SHADER_WRITE;
@@ -868,7 +871,7 @@ fn a8_storage_reads_without_the_feature_go_by_the_format_s_bit() {
}
println!("A8-FORMATLESS {name}: read by A8_UNORM's own bit, as Metal's");
drop(lane);
assert!(messages.take().is_empty(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// A render stores the fragment's alpha, a clear the color's, only the alpha bit of a write mask
@@ -928,7 +931,7 @@ fn a8_without_a8_unorm_renders_masks_clears_and_blends_as_metal() {
}
}
drop(lane);
assert!(messages.take().is_empty(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
// The same blends into the device's own `A8_UNORM` texture, where it has the format.
let own = Lane::new(&messages, &cache, false);
let mut unlike = Vec::new();
@@ -945,7 +948,7 @@ fn a8_without_a8_unorm_renders_masks_clears_and_blends_as_metal() {
}
}
drop(own);
assert!(messages.take().is_empty(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
for line in wrong.iter().chain(&unlike) {
println!("A8-IN-RED-DIFFERS {name}: {line}");
}
@@ -982,7 +985,7 @@ fn a8_resolves_as_r8_unorm() {
let form = if withheld { "R8_UNORM" } else { "A8_UNORM" };
a8_resolve_leg(&lane, &format!("{name} {form}"));
drop(lane);
assert!(messages.take().is_empty(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
}
@@ -1122,7 +1125,7 @@ fn a8_color_input_reads_alpha_as_metal() {
);
println!("A8-FETCH {name} {form}: as Metal's, at four samples {planes}");
drop(lane);
assert!(messages.take().is_empty(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
}
@@ -1151,7 +1154,7 @@ fn a8_color_input_through_sample_planes_reads_alpha_as_metal() {
lane.reads_planes()
);
drop(lane);
assert!(messages.take().is_empty(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
return;
}
let pipeline = lane
@@ -1176,7 +1179,7 @@ fn a8_color_input_through_sample_planes_reads_alpha_as_metal() {
every(&format!("{name}: the resolve"), &lane.bytes(&one), STORED);
println!("A8-PLANES {name}: as Metal's, through A8_UNORM sample planes");
drop(lane);
assert!(messages.take().is_empty(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// Alpha-to-coverage through an `A8Unorm` attachment 0 at four samples covers by the output's
@@ -1253,7 +1256,7 @@ fn a8_alpha_to_coverage_covers_as_rgba8() {
}
println!("A8-COVERAGE {name} {form}: as RGBA8Unorm's at 33 alphas, within {codes} codes");
drop(lane);
assert!(messages.take().is_empty(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
}
@@ -1360,7 +1363,7 @@ fn a8_texture_buffer_reads_and_writes_alpha_as_metal() {
);
println!("A8-BUFFER {name} {form}: as Metal's");
drop(lane);
assert!(messages.take().is_empty(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
}
@@ -1409,7 +1412,7 @@ fn a8_argument_buffer_storage_reads_and_writes_alpha_as_metal() {
);
println!("A8-HELD {name} {form}: refused without {feature:?}: {refused}");
drop(lane);
assert!(messages.take().is_empty(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
continue;
}
let usage = TextureUsage::SHADER_READ | TextureUsage::SHADER_WRITE;
@@ -1444,6 +1447,6 @@ fn a8_argument_buffer_storage_reads_and_writes_alpha_as_metal() {
);
println!("A8-HELD {name} {form}: as Metal's");
drop(lane);
assert!(messages.take().is_empty(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
}
@@ -14,7 +14,10 @@
//! draw's texels and count as the same draw's without the test, a failing draw's as the clear's
//! and 0.
use super::{buffer_with, read_buffer, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device_with, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::metal::{PixelFormat, PrimitiveType, TextureUsage};
@@ -229,9 +232,5 @@ fn the_alpha_test_keeps_the_fragments_metal_keeps() {
);
eprintln!("{name}: {checked} alpha-tested draws keep Metal's fragments");
drop(lane);
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -32,7 +32,8 @@ use super::degrade_notices::{
assert_made_once, assert_once, forced, made_render_kinds, shared_in_system_memory,
};
use super::{
buffer_with, read_buffer, validated_device, validated_device_with, Messages, ScratchCache, WAIT,
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device,
validated_device_with, Messages, ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
@@ -647,11 +648,7 @@ impl Drawn {
}
}
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
}
@@ -1287,11 +1284,7 @@ fn a_visibility_result_counts_every_amplification() {
.unwrap_or_else(|e| panic!("{} on {name}: {e}", after.name));
assert_eq!(stored.color, colors([0x100, 0x101, E, E]).color, "{name}");
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// What Metal's validation stops and plain Metal's answer does not settle is `Invalid` (a Metal
@@ -1393,11 +1386,7 @@ fn an_amplified_draw_is_refused_as_typed() {
.unwrap_or_else(|e| panic!("amp0 on {name}: {e}"));
assert_eq!(stored, colors([C, C, E, E]), "amp0 on {name}");
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// On a device without `multiViewport` (withheld here, with `shaderOutputViewportIndex`) a draw has
@@ -1453,11 +1442,7 @@ fn with_one_viewport_an_amplification_s_viewport_offset_draws_through_it() {
first.extend(lane.made(&PLAIN));
assert_made_once(&messages, &AMPLIFICATION, &first);
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// A device without `shaderOutputLayer` (withheld here: no committed real GPU lacks it) draws an
@@ -1560,9 +1545,5 @@ fn a_device_without_shader_output_layer_draws_or_refuses_typed() {
first.extend(lane.made(&PLAIN));
assert_made_once(&messages, &AMPLIFICATION, &first);
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -26,7 +26,10 @@
//! and mean difference in codes and the share of channels a code or more off.
use super::degrade_notices::counts;
use super::{buffer_with, read_buffer, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device_with, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::bind::SamplerDescriptor;
@@ -505,11 +508,7 @@ fn within_bounds(
.collect();
(name, metal_sampler, outcomes)
};
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
let announced: BTreeSet<Degradation> = counts(&messages.take_notices()).into_keys().collect();
println!("ANISOTROPIC {name}: announced {announced:?}");
let mut wrong = Vec::new();
@@ -15,8 +15,9 @@
use super::kernel_textures::{absent_read_only, fresh_candidate, refusal};
use super::{
bound_buffers, buffer_with, encode_case, pipeline_state, public_case, public_cases,
read_buffer, run_case, validated_device, CaseResources, Messages, ScratchCache,
bound_buffers, buffer_with, encode_case, layer_reported_nothing, layer_reported_nothing_at_all,
pipeline_state, public_case, public_cases, read_buffer, run_case, validated_device,
CaseResources, Messages, ScratchCache,
};
use crate::candidate::engine::ComputeOutput;
use crate::case::{AuthoredCase, Stage};
@@ -49,11 +50,7 @@ fn on_device(test: impl FnOnce(&Device)) {
let device = validated_device(TEST_DEVICE, &messages, cache.path()).unwrap();
test(&device);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Every committed public kernel case whose argument buffers hold buffers runs through the
@@ -160,6 +157,10 @@ fn census(what: &str, select: impl Fn(&AuthoredCase) -> bool) -> Census {
"failed:\n{}\nat device destruction: {leaked:#?}",
failed.join("\n")
);
layer_reported_nothing(
&messages,
"every case's commands were valid and left nothing behind",
);
Census {
matched: matched.len(),
}
@@ -24,7 +24,7 @@
//! by its class and a heap texture's not.
use super::depth_compares::{pipeline_of, run_held, Held, Through};
use super::{validated_device, Messages, ScratchCache};
use super::{layer_reported_nothing_at_all, validated_device, Messages, ScratchCache};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::bind::SamplerDescriptor;
use metal2vulkan::error::DriverDeviation;
@@ -510,5 +510,5 @@ fn heap_linear_samples_answer_as_slot_samples() {
groups.join("\n")
);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
@@ -7,7 +7,10 @@
//! device keeps for its sample count (`runtime/attachmentless.rs`); MoltenVK rasterized one sample
//! in a pass made per encoder.
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::metal::PrimitiveType;
@@ -121,11 +124,7 @@ fn a_pass_without_attachments_rasterizes_its_default_sample_count() {
}
eprintln!("attachmentless passes on {name}: {}", answers.join("; "));
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// What one command buffer on `queue` leaves: a blit filling mark 0 with `0x11`, a signal of
@@ -270,11 +269,7 @@ fn a_pass_without_attachments_past_16384_fails_its_command_buffer() {
assert_eq!(events, [1, 0], "{size:?}: the signal before the pass alone");
}
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// A pass without attachments at a default raster sample count other than 1, 2 and 4 is Metal's
@@ -352,9 +347,5 @@ fn a_pass_without_attachments_takes_metal_s_default_sample_counts() {
device.name()
);
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -25,7 +25,9 @@
//! with neither way, such as the `vk12-floor` profile's, refuses the functions as needing either
//! `fragmentShaderBarycentric` or `geometryShader`.
use super::{buffer_with, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, validated_device_with, Messages, ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::candidate::LaneRestriction;
use crate::gpu::TEST_DEVICE;
@@ -377,11 +379,7 @@ fn on_lane(adjust: impl FnOnce(&mut DeviceOptions), check: impl FnOnce(&Lane)) {
let lane = Lane::with(&messages, &cache, adjust);
check(&lane);
drop(lane);
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// `check` on the lane device of `path`.
@@ -667,11 +665,7 @@ fn a_pipeline_with_a_geometry_stage_announces_it_and_one_without_does_not() {
}
);
drop(lane);
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
}
@@ -17,7 +17,8 @@
use super::degrade_notices::assert_once;
use super::render_state::{library, Probe, PASS};
use super::{
compute_descriptor, pipeline_state, public_case, validated_device, Messages, ScratchCache,
compute_descriptor, layer_reported_nothing_at_all, pipeline_state, public_case,
validated_device, Messages, ScratchCache,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
@@ -257,9 +258,5 @@ fn an_archive_serves_a_fresh_device_and_fails_where_metal_misses() {
)))
);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -7,8 +7,9 @@
use super::degrade_notices::{assert_once, counts};
use super::{
buffer_with, buffer_with_options, encode_case, pipeline_state, public_case, read_buffer,
validated_device, CaseResources, Messages, ScratchCache,
buffer_with, buffer_with_options, encode_case, layer_reported_nothing,
layer_reported_nothing_at_all, pipeline_state, public_case, read_buffer, validated_device,
CaseResources, Messages, ScratchCache,
};
use crate::gpu::TEST_DEVICE;
use metal2vulkan_runtime::{
@@ -102,11 +103,7 @@ fn on_device_with(test: impl FnOnce(&Device, &Messages)) {
let device = validated_device(TEST_DEVICE, &messages, cache.path()).unwrap();
test(&device, &messages);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Copies and fills of any offsets and sizes land exactly where Metal puts them, within one
@@ -743,11 +740,7 @@ fn compute_blit_compute_chains_read_what_was_written() {
command_buffer.wait_until_completed_for(WAIT).unwrap();
assert_eq!(command_buffer.error(), None, "{leg}");
}
let reported = messages.take();
assert!(
reported.is_empty(),
"{leg}: the validation layer reported: {reported:#?}"
);
layer_reported_nothing(messages, &leg);
for (chain, (first, second)) in chains.iter().enumerate() {
let written = read_buffer(&first[&1], 0, output).unwrap();
assert_eq!(written, case.metal_output, "{leg}, chain {chain}: first");
@@ -41,7 +41,10 @@
use super::degrade_notices::{assert_made_once, forced, loses_depth_denormals, signs_depth_tests};
use super::degrade_notices::{made_compute_kinds, shared_in_system_memory};
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::candidate::runtime_samples::{encode, read_function};
use crate::executor_contract::multisample::SampleRead;
use crate::gpu::TEST_DEVICE;
@@ -542,9 +545,5 @@ fn a_buffer_copies_every_sample_of_a_multisampled_depth_or_stencil_both_ways() {
{announced:?}"
);
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -11,7 +11,10 @@
use super::degrade_notices::{assert_made_once, forced, shared_in_system_memory};
use super::host_memory::{no_copy, not_importable, Mapping};
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::gpu::TEST_DEVICE;
use ash::vk;
use metal2vulkan::metal::{PixelFormat, TextureType, TextureUsage};
@@ -376,11 +379,7 @@ fn on_device(test: impl FnOnce(&Device)) {
let device = validated_device(TEST_DEVICE, &messages, cache.path()).unwrap();
test(&device);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The rows a Metal probe recorded (M4 and M3 Max alike) for its overlapping copies at 32-byte
@@ -909,11 +908,7 @@ fn an_overlapping_texel_copy_is_announced_once() {
]);
assert_made_once(&messages, &OVERLAPS, &first);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The kind [`iosurface_planes_lie_where_metal_puts_them`] takes: a texture of an IOSurface plane
@@ -1002,11 +997,7 @@ fn iosurface_planes_lie_where_metal_puts_them() {
]);
assert_made_once(&messages, &NARROW_ROWS, &first);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// A depth or stencil texture over a plane of a surface with planes, which Metal makes and
@@ -1143,11 +1134,7 @@ fn a_planar_surface_s_depth_or_stencil_texture_reads_and_stores_the_plane() {
}
}
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Where Metal's pass puts element `(x, y)` of a `w`x`h` depth or stencil texture of `unit`-byte
@@ -1402,11 +1389,7 @@ fn a_planar_surface_s_depth_or_stencil_texture_s_passes_write_metal_s_elements_a
}
}
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The rows of a `w`x`h` plane `row` bytes wide, from `offset`, `pitch` bytes apart.
@@ -1621,11 +1604,7 @@ fn four_two_two_iosurface_planes_move_the_surface_s_rows() {
}
}
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The consumer's '420v' backing over a new buffer of `kind` ([`iosurface_planes_lie_where_metal_puts_them`]):
@@ -11,8 +11,9 @@
use super::degrade_notices::counts;
use super::{
buffer_with, encode_case, pipeline_state, public_case, read_buffer, run_case,
texture_descriptor, validated_device, CaseResources, Messages, PublicCase, ScratchCache, WAIT,
buffer_with, encode_case, layer_reported_nothing_at_all, pipeline_state, public_case,
read_buffer, run_case, texture_descriptor, validated_device, CaseResources, Messages,
PublicCase, ScratchCache, WAIT,
};
use crate::candidate::engine::ComputeOutput;
use crate::case::TextureType;
@@ -51,11 +52,7 @@ fn on_device(test: impl FnOnce(&Device)) {
let device = validated_device(TEST_DEVICE, &messages, cache.path()).unwrap();
test(&device);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// A binding of a case: its texture or buffer at a slot.
@@ -462,11 +459,7 @@ fn textures_over_buffers_alias_where_the_device_lays_them_as_metal_does() {
}
let shadowed = counts(&messages.take_notices()).contains_key(&Degradation::ShadowedTexture);
forms.push((width, row, if shadowed { "shadowed" } else { "aliased" }));
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
eprintln!("textures over buffers on {name}: {forms:?}");
assert_eq!(
@@ -547,11 +540,7 @@ fn with_undeclared_usage(name: &str, usage: TextureUsage, width: u64, pad: u64)
let notices = counts(&messages.take_notices());
let shadowed = notices.contains_key(&Degradation::ShadowedTexture)
|| notices.contains_key(&Degradation::UndeclaredUsageShadow);
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
shadowed
}
@@ -682,11 +671,7 @@ fn beyond_usage(name: &str, usage: TextureUsage) -> (Vec<u8>, Vec<u8>, bool) {
};
let shadowed =
counts(&messages.take_notices()).contains_key(&Degradation::UndeclaredUsageShadow);
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
(ran.0, ran.1, shadowed)
}
@@ -29,7 +29,10 @@
use super::buffer_texture_blits::{hex_rows, texel, texels, Held, Kind, OFF};
use super::degrade_notices::counts;
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::bind::SamplerDescriptor;
@@ -341,11 +344,7 @@ fn on_device(test: impl FnOnce(&Device)) {
let device = validated_device(TEST_DEVICE, &messages, cache.path()).unwrap();
test(&device);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Run `cases` over each kind of buffer the device makes.
@@ -940,11 +939,7 @@ fn a_command_writing_a_buffers_bytes_two_ways_keeps_both_writes() {
device.name()
);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
fn two_ways(lane: &Lane, kind: Kind) {
@@ -6,8 +6,9 @@
//! ordering against other uses of the bytes is `buffer_texture_order.rs`'s.
use super::{
bound_buffers, buffer_with, encode_case, pipeline_state, public_case, read_buffer, run_case,
texture_descriptor, validated_device, CaseResources, Messages, ScratchCache, WAIT,
bound_buffers, buffer_with, encode_case, layer_reported_nothing_at_all, pipeline_state,
public_case, read_buffer, run_case, texture_descriptor, validated_device, CaseResources,
Messages, ScratchCache, WAIT,
};
use crate::candidate::engine::ComputeOutput;
use crate::gpu::TEST_DEVICE;
@@ -34,11 +35,7 @@ fn on_device(test: impl FnOnce(&Device)) {
let device = validated_device(TEST_DEVICE, &messages, cache.path()).unwrap();
test(&device);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
fn invalid(call: &'static str, problem: BufferTextureProblem) -> Error {
@@ -22,8 +22,9 @@
//! cache data"): every making's data is read, nothing fails, and nothing is reported.
use super::{
needs_later_steps, pipeline_state, public_case, public_case_names, public_cases, run_case,
run_with, validated_device, validated_device_with, Messages, PublicCase, ScratchCache,
layer_reported_nothing_at_all, needs_later_steps, pipeline_state, public_case,
public_case_names, public_cases, run_case, run_with, validated_device, validated_device_with,
Messages, PublicCase, ScratchCache,
};
use crate::air_library::AirLibrary;
use crate::case::ExecutionSafety;
@@ -112,11 +113,7 @@ fn cache_run(cache: &Path, case: &str) -> CacheRun {
run,
}
};
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
run
}
@@ -405,11 +402,7 @@ fn a_state_made_again_takes_the_memos_translations() {
);
assert_eq!(run_with(&device, &case, &again).unwrap().output, output);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
}
@@ -468,11 +461,7 @@ fn a_cancelled_or_late_creation_refuses_until_its_translation_is_cached() {
"nothing compiled again"
);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The makings a device's statistics count by what became of the driver's pipeline cache data:
@@ -540,11 +529,7 @@ fn makings_on_several_threads_each_read_their_own_cache() {
});
(device.shader_cache_statistics(), failed)
};
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
let made = cases.len() - failed.len();
assert_eq!(
(statistics.write_failures, statistics.read_failures),
@@ -3,7 +3,7 @@
//! and the Apple-only calls answered typed on a live command buffer and its compute and blit
//! encoders.
use super::{validated_device, Messages, ScratchCache};
use super::{layer_reported_nothing_at_all, validated_device, Messages, ScratchCache};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::device::{VkFeature, VkProperty};
use metal2vulkan::error::{Capability, Feature, Unsupported};
@@ -212,11 +212,7 @@ fn a_runtime_device_answers_its_queries_and_the_apple_only_calls() {
assert_eq!(command_buffer.status(), CommandBufferStatus::Completed);
assert_eq!(command_buffer.error(), None);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// A private 4² texture of `pf` with `samples` samples, a render target read by shaders: 2D for
@@ -429,11 +425,7 @@ fn textures_are_made_as_the_texture_queries_answer() {
assert_eq!(command_buffer.status(), CommandBufferStatus::Completed);
assert_eq!(command_buffer.error(), None);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The device's own numbers, printed per venue (`GPU-CORES`): `gpuCoreCount` is the count its
@@ -19,7 +19,10 @@
use super::degrade_notices::{assert_made_once, forced, made_render_kinds};
use super::degrade_notices::{shared_in_system_memory, twins_depth};
use super::hidden_depth::replayed_but_unrun;
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::metal::state::{DepthStencilDescriptor, StencilDescriptor};
@@ -380,11 +383,7 @@ pub(super) fn lane() -> (Messages, ScratchCache, Lane) {
pub(super) fn quiet(lane: Lane, messages: &Messages) {
drop(lane);
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(messages);
}
/// A case of `a_clear_reaches_past_the_render_area_as_metal_s`: its name, the render area, the
@@ -33,7 +33,7 @@
//! color of another group. A pipeline of four colors in the five-color pass, which the device
//! draws in groups, is refused `NotImplemented(ColorAttachmentGroups)`.
use super::{validated_device_with, Messages, ScratchCache, WAIT};
use super::{layer_reported_nothing_at_all, validated_device_with, Messages, ScratchCache, WAIT};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use crate::observation::PROFILES_LAYER;
@@ -487,11 +487,7 @@ fn scenes(width: Width) {
}
assert_eq!(announced, expected, "on {}", lane.device.name());
drop(lane);
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The depth scene (the module docs).
@@ -12,7 +12,7 @@
//! [`WAIT`].
use super::host_memory::Mapping;
use super::{validated_device, Messages, ScratchCache};
use super::{layer_reported_nothing_at_all, validated_device, Messages, ScratchCache};
use crate::gpu::TEST_DEVICE;
use metal2vulkan_runtime::{
BufferContents, BufferDescriptor, CommandBuffer, CommandQueue, DeadlockCause, Deallocator,
@@ -47,11 +47,7 @@ fn on_device(test: impl FnOnce(&Device)) {
let device = validated_device(TEST_DEVICE, &messages, cache.path()).unwrap();
test(&device);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// A make of `queue`'s next command buffer on a thread of its own; its answer comes on the
@@ -437,9 +433,5 @@ fn a_presenting_queue_s_lock_holds_no_other_queue_where_the_device_reserved_one(
release.send(()).unwrap();
holder.join().unwrap();
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -15,7 +15,7 @@
//! the image of a texture a CPU copy reaches is uncompressed, in the space of Metal's compressed
//! size).
use super::{validated_device_with, Messages, ScratchCache};
use super::{layer_reported_nothing_at_all, validated_device_with, Messages, ScratchCache};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::bind::CompressedBlit;
use metal2vulkan::metal::{PixelFormat, TextureUsage};
@@ -389,5 +389,5 @@ fn blits_through_a_compressed_texture_write_metal_s_texels() {
}
}
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
@@ -33,7 +33,7 @@
//! through the view; and an interior `replaceRegion` to the edges. Plain Metal answered the same
//! 336 steps as the model ([`METAL_TRANSCRIPT_2`]).
use super::{validated_device_with, Messages, ScratchCache};
use super::{layer_reported_nothing, validated_device_with, Messages, ScratchCache};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::metal::{PixelFormat, TextureType, TextureUsage};
use metal2vulkan_runtime::{
@@ -686,11 +686,7 @@ fn compressed_blocks_move_as_metal_moves_them() {
transcript, METAL_TRANSCRIPT,
"the model no longer moves blocks as plain Metal on an Apple M4 moved them"
);
assert_eq!(
messages.take(),
Vec::new(),
"the validation layer reported on {name}"
);
layer_reported_nothing(&messages, &format!("on {name}"));
}
// ---- The second lane: views, interior regions and a large texture ----
@@ -938,9 +934,5 @@ fn views_regions_and_large_levels_move_as_metal_s() {
transcript, METAL_TRANSCRIPT_2,
"the model no longer moves blocks as plain Metal on an Apple M4 moved them"
);
assert_eq!(
messages.take(),
Vec::new(),
"the validation layer reported on {name}"
);
layer_reported_nothing(&messages, &format!("on {name}"));
}
@@ -17,7 +17,7 @@
use super::degrade_notices::counts;
use super::extended_range_targets::half_value;
use super::{validated_device_with, Messages, ScratchCache, WAIT};
use super::{layer_reported_nothing_at_all, validated_device_with, Messages, ScratchCache, WAIT};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::metal::{
@@ -209,11 +209,7 @@ fn coverage_alpha_stores_the_nearest_even_half_under_mode_two() {
"{name}: {noted:?}"
);
drop(lane);
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Alphas whose rounding to the nearest-even half crosses a coverage level's edge: for each edge
@@ -295,9 +291,5 @@ fn an_unstored_coverage_alpha_keeps_metal_s_coverage_under_mode_two() {
"{name}: {noted:?}"
);
drop(lane);
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -23,7 +23,10 @@
//! Metal's error on every device.
use super::raster_sample_counts::refusal;
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::device::DriverWorkaround;
@@ -196,11 +199,7 @@ fn the_loop_runs_what_fits_and_refuses_the_rest_by_its_reason() {
}
eprintln!("coverage loop on {name}: {}", answers.join("; "));
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The standard sample positions at 2 and 4 samples (Vulkan's "Standard sample locations",
@@ -320,9 +319,5 @@ fn the_loop_reads_each_sample_qualified_varying_at_its_sample() {
}
eprintln!("sample-qualified varying on {name}: {}", answers.join("; "));
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -18,7 +18,10 @@
//! triangle's fragments (lavapipe), says so and draws nothing.
use super::degrade_notices::counts;
use super::{buffer_with, read_buffer, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device_with, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::error::Feature;
@@ -258,9 +261,5 @@ fn coverage_reading_color_writers_write_the_samples_metal_writes() {
assert!(whole > 0 && partial > 0, "{whole} whole, {partial} partial");
}
drop(lane);
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -223,8 +223,9 @@ use super::wide_points::POINT_GUARD_BAND;
use super::ycbcr_passes::YCBCR_PASSES;
use super::ycbcr_textures::YCBCR_FILTERS;
use super::{
case_making_kinds, creation_heard_checked, made_lane_device, pipeline_state, public_case,
run_case, run_with, shared_kinds, validated_device_with, Messages, PublicCase, ScratchCache,
case_making_kinds, creation_heard_checked, layer_reported_nothing_at_all, made_lane_device,
pipeline_state, public_case, run_case, run_with, shared_kinds, validated_device_with, Messages,
PublicCase, ScratchCache,
};
use crate::air_library::AirLibrary;
use crate::candidate::engine::compute_shape;
@@ -452,7 +453,7 @@ pub(super) fn on_device_with(
let device = validated_device_with(TEST_DEVICE, &messages, cache.path(), adjust).unwrap();
test(&device, &messages);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// Every kind is taken by a lane test's site: listed above, or a stage's precision note or
@@ -639,7 +640,7 @@ fn moltenvk_argument_buffers_are_announced_where_unread_and_refused_off() {
}
moltenvk
};
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
if !moltenvk {
return;
}
@@ -819,7 +820,7 @@ fn a_metal_level_below_the_host_release_is_announced_once() {
}
assert!(made.is_empty(), "announced past the creation: {made:?}");
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// The kind an anisotropy past the device's largest takes
@@ -15,7 +15,7 @@
use super::argument_linear_samples::kernel;
use super::depth_compares::{pipeline_of, run_held, Held, Through};
use super::{validated_device, Messages, ScratchCache};
use super::{layer_reported_nothing_at_all, validated_device, Messages, ScratchCache};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::bind::SamplerDescriptor;
use metal2vulkan::metal::PixelFormat;
@@ -187,5 +187,5 @@ fn denormal_texels_read_through_words_and_heaps_keep_their_bits() {
wrong.join("\n")
);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
@@ -14,7 +14,10 @@
//! `RGBA32Float` target, where the linear filter weighs one texel).
use super::depth_compares::pipeline_of;
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::bind::SamplerDescriptor;
@@ -398,9 +401,5 @@ fn a_depth_texture_read_as_a_color_reads_metals_texel() {
);
assert!(wrong.is_empty(), "{name}: {wrong:#?}");
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -15,7 +15,9 @@
//! `[0, 1]` (`degrade_notices::clamps_depth_uploads`).
use super::degrade_notices::{clamps_depth_uploads, counts};
use super::{buffer_with, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, validated_device_with, Messages, ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::bind::SamplerDescriptor;
@@ -252,9 +254,5 @@ fn the_depth_compare_clamp_mask_clamps_metal_s_references() {
"{name}: restricted-depth-range announced"
);
drop(lane);
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -20,7 +20,7 @@
//! filter's two levels' comparisons (`compared::blended`).
use super::depth_compares::{argument_kernel, pipeline_of, run_held, Held, Through};
use super::{validated_device, Messages, ScratchCache};
use super::{layer_reported_nothing_at_all, validated_device, Messages, ScratchCache};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::bind::SamplerDescriptor;
use metal2vulkan::metal::{CompareFunction, PixelFormat, SamplerMipFilter};
@@ -375,5 +375,5 @@ fn comparisons_read_the_level_metal_reads() {
.join("\n")
);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
@@ -31,7 +31,10 @@
//! the eight functions. (A sampler that filters leaves a heap texture's comparison to the device,
//! which the module records, so it is not asked here.)
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::bind::SamplerDescriptor;
@@ -809,5 +812,5 @@ fn depth_comparisons_compare_as_metal_does() {
wrong.join("\n")
);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
@@ -79,7 +79,10 @@ use super::degrade_notices::{counts, signs_depth_tests};
use super::degrade_notices::{made_compute_kinds, made_render_kinds, shared_in_system_memory};
use super::depth_compares::run;
use super::render_state::library;
use super::{buffer_with, read_buffer, validated_device, validated_device_with};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device,
validated_device_with,
};
use super::{Messages, ScratchCache, WAIT};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
@@ -696,11 +699,7 @@ fn depth_images_hold_denormals_as_their_drivers_claim() {
tests {tests})"
);
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Whether Metal's depth test passes a fragment at depth `z` under `compare` against the stored
@@ -1145,11 +1144,7 @@ fn a_stored_depth_tests_reads_samples_and_compares_as_metal_s() {
"{name}: signed-depth-test for the merge where the target takes the stand-in"
);
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// A target that takes no magnitude stand-in, or whose pass renders it through another image,
@@ -1254,11 +1249,7 @@ fn a_target_without_a_stand_in_stores_its_words_without_their_signs() {
"{name}: signed-depth-test for the tests of the targets without a stand-in"
);
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// A NaN clear depth stores and tests as Metal's (our probe `nanclear`, the M3 Max under macOS
@@ -1352,11 +1343,7 @@ fn a_nan_clear_depth_stores_and_tests_as_metal_s() {
}
messages.take_notices();
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The side of [`fresh_target`]'s textures, which Metal compresses: each texel reads its pattern.
@@ -1628,11 +1615,7 @@ fn a_new_target_s_pattern_loaded_unwritten_tests_and_stores_as_metal_s() {
"{name}: a cleared target announces nothing: {announced:?}"
);
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The depth of an ordinary pass, which never stores a value whose stand-in is not itself, loads
@@ -1679,9 +1662,5 @@ fn an_ordinary_depth_loads_in_place() {
assert_eq!(strips, 0, "{name}: sign strips");
messages.take_notices();
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -27,7 +27,10 @@
//! `NotImplemented(DepthNeverWithoutAttachment)` (printed).
use super::render_state::{texels, texture};
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::error::Feature;
@@ -249,11 +252,7 @@ impl Lane {
/// The lane dropped, nothing the validation layer reported.
fn quiet(lane: Lane, messages: &Messages) {
drop(lane);
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(messages);
}
/// `color` 16 times.
@@ -11,7 +11,10 @@
//! texture at a slot, and the module converts a heap depth texture's texel by the class its
//! handle carries.
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use crate::hash::sha256_bytes;
@@ -255,9 +258,5 @@ fn a_depth16_texel_reads_and_samples_as_metal_s_code_over_65535() {
assert_eq!(sha256_bytes(got), METAL, "{what}: Metal's digest");
}
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -9,7 +9,10 @@
//! itself, as MoltenVK would. A swapchain needs a headless surface that the device's primary
//! queue family presents to; a venue without one prints its gap and only loads.
use super::{validated_device, validated_device_with, Messages, ScratchCache};
use super::{
layer_reported_nothing_at_all, nothing_reported_without_the_layer, validated_device,
validated_device_with, Messages, ScratchCache,
};
use crate::gpu::wait::{self, SubmissionBackend};
use crate::gpu::TEST_DEVICE;
use ash::vk::{self, Handle};
@@ -206,8 +209,7 @@ fn a_device_is_made_and_used_while_moltenvk_names_it_in_each_message() {
overwrite(&device, true);
overwrite(&device, true);
}
let messages = messages.take();
assert!(messages.is_empty(), "the device reported: {messages:#?}");
nothing_reported_without_the_layer(&messages, "nothing MoltenVK said fails");
}
/// The caller's swapchain commands load through `Device::device_proc_addr` after the device's
@@ -234,11 +236,7 @@ fn the_caller_s_commands_load_and_make_a_swapchain_after_moltenvk_overwrote_the_
);
caller_s_commands(&device, moltenvk, headless, layered);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
}
@@ -44,7 +44,7 @@ use super::indirect_host_steps::{self, HOST_STEPS};
use super::rebind_reach::{buffer_len, buffer_over, pages};
use super::rebinds::rebind;
use super::shared_kinds;
use super::{validated_device_with, Messages, ScratchCache, WAIT};
use super::{layer_reported_nothing_at_all, validated_device_with, Messages, ScratchCache, WAIT};
use crate::air_library::AirLibrary;
use crate::candidate::runtime_case::{buffer_with, read_buffer};
use crate::gpu::TEST_DEVICE;
@@ -343,7 +343,7 @@ fn on_device(test: impl FnOnce(&Device, &Messages)) {
assert!(device.compile_device().generated_commands().is_none());
test(&device, &messages);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// The indirect dispatches `device` replayed so far.
@@ -1791,11 +1791,7 @@ fn a_heap_texture_over_dma_buf_pages_takes_its_shadow_where_the_source_fails() {
);
drop((texture, heap));
}
let failing = messages.take();
assert!(
failing.is_empty(),
"{TEST}: the validation layer reported: {failing:#?}"
);
layer_reported_nothing(&messages, TEST);
}
/// A placement heap of `view`'s length over its pages of `ram`, with `ram`'s source noting in
@@ -104,8 +104,9 @@
use super::degrade_notices::{counts as notice_counts, on_device};
use super::{
buffer_with, public_case, read_buffer, run_case, validated_device, validated_device_with,
CaseResources, Messages, PublicCase, ScratchCache, METAL_ENVIRONMENT, WAIT,
buffer_with, layer_reported_nothing_at_all, public_case, read_buffer, run_case,
validated_device, validated_device_with, CaseResources, Messages, PublicCase, ScratchCache,
METAL_ENVIRONMENT, WAIT,
};
use crate::air_library::AirLibrary;
use crate::case::{AuthoredCase, OutputSelection, Primitive};
@@ -314,11 +315,7 @@ fn threadgroup_words_only_lockstep_orders_answer_as_metal() {
);
}
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
// ---------------------------------------------------------------------------------------------
@@ -422,11 +419,7 @@ fn float_functions_the_device_answers_are_metals() {
}
}
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
// ---------------------------------------------------------------------------------------------
@@ -616,11 +609,7 @@ fn cube_gradients_through_an_anisotropic_sampler_answer_as_metal() {
}
}
assert!(failures.is_empty(), "{failures:#?}");
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
// ---------------------------------------------------------------------------------------------
@@ -702,11 +691,7 @@ fn half_fused_multiply_adds_the_device_answers_are_metals() {
}
}
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
// ---------------------------------------------------------------------------------------------
@@ -836,11 +821,7 @@ fn float_denormals_read_as_metal_reads_them() {
}
assert!(failures.is_empty(), "{failures:#?}");
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// a probe cases ([`HALF_FMA_CASES`]): every word, `fma(a, b, c)`, `a * b + c`, the two `half`
@@ -875,11 +856,7 @@ fn fused_pairs_answer_metals_nans_and_denormals() {
}
assert!(failures.is_empty(), "{failures:#?}");
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The NaN model's cases whose words round a `float` near 65520 to `half`: the narrowing, the
@@ -968,11 +945,7 @@ fn half_quantize_rounds_as_metal_at_the_edge() {
}
assert!(failures.is_empty(), "{failures:#?}");
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The owned denormal fixtures (`dfl_float_denormals`, `dfl_float_denormals_fast`): 256 threads of
@@ -1141,11 +1114,7 @@ fn owned_float_fixtures_answer_metal() {
}
assert!(failures.is_empty(), "{failures:#?}");
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
// ---------------------------------------------------------------------------------------------
@@ -1202,11 +1171,7 @@ fn owned_dot_fixtures_answer_metal() {
}
assert!(failures.is_empty(), "{failures:#?}");
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
// ---------------------------------------------------------------------------------------------
@@ -1268,11 +1233,7 @@ fn minimums_and_maximums_answer_as_metal() {
}
assert!(failures.is_empty(), "{failures:#?}");
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
// ---------------------------------------------------------------------------------------------
@@ -1333,11 +1294,7 @@ fn half_arithmetic_answers_as_metal() {
}
assert!(failures.is_empty(), "{failures:#?}");
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
// ---------------------------------------------------------------------------------------------
@@ -1531,11 +1488,7 @@ fn half_loads_the_device_widens_answer_as_metal() {
}
assert!(failures.is_empty(), "{failures:#?}");
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
// ---------------------------------------------------------------------------------------------
@@ -1926,11 +1879,7 @@ fn fragment_simdgroup_lanes_are_metal_s() {
}
}
assert!(failures.is_empty(), "{failures:#?}");
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
// ---------------------------------------------------------------------------------------------
@@ -24,7 +24,10 @@
//! event it waits for there or of another head's (no head waits for the GPU's signal once the
//! host met its wait).
use super::{loader, open_device, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
layer_reported_nothing_at_all, loader, open_device, validated_device_with, Messages,
ScratchCache, WAIT,
};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::device::CompletionPolicy;
use metal2vulkan::vk::DriverId;
@@ -290,11 +293,7 @@ fn a_checked_head_waits_for_another_queue_s_signal_on_the_gpu() {
);
}
}
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Where the scheduler's thread waits on the GPU for a signal a long command buffer gives at its
@@ -430,9 +429,5 @@ fn a_host_signal_wakes_the_scheduler_from_its_wait_on_the_gpu() {
}
}
}
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -10,8 +10,8 @@
//! last handle returns.
use super::{
open_device, open_devices, pipeline_state, public_case, run_with, validated_device,
validated_options, Messages, ScratchCache,
layer_reported_nothing_at_all, open_device, open_devices, pipeline_state, public_case,
run_with, validated_device, validated_options, Messages, ScratchCache,
};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::metal::{PixelFormat, TextureUsage};
@@ -55,11 +55,7 @@ fn on_device(test: impl FnOnce(&Device)) {
let device = validated_device(TEST_DEVICE, &messages, cache.path()).unwrap();
test(&device);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Wait for `command_buffer` and check it completed without error.
@@ -669,7 +665,7 @@ fn shared_event_handles_open_the_same_event() {
Err(invalid("encode_signal_event", Problem::ForeignObject))
);
}
assert!(messages.take().is_empty());
layer_reported_nothing_at_all(&messages);
});
}
@@ -728,11 +724,7 @@ fn equal_options_make_one_device() {
completed(&command_buffer);
assert_eq!(event.signaled_value(), 2);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Event waits and signals are refused where Metal stops them: with an encoder open (Metal
@@ -1028,11 +1020,7 @@ fn a_device_dropped_after_a_wait_is_gone_when_the_drop_returns() {
}
let next = validated_device(TEST_DEVICE, &messages, cache.path()).unwrap();
drop(next);
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
after_handler.sort_by(f64::total_cmp);
eprintln!(
@@ -4,8 +4,8 @@
use super::renders::{is_public_render, render_cases_where, run_render};
use super::{
bound_buffers, encode_case, in_shard, pipeline_state, public_case, run_case,
validated_device_with, CaseResources, Messages, ScratchCache, WAIT,
bound_buffers, encode_case, in_shard, layer_reported_nothing_at_all, pipeline_state,
public_case, run_case, validated_device_with, CaseResources, Messages, ScratchCache, WAIT,
};
use crate::budgets::creation_within_ceiling;
use crate::candidate::engine::compute_shape;
@@ -30,11 +30,7 @@ pub(super) fn on_device_with(adjust: impl FnOnce(&mut DeviceOptions), test: impl
let device = validated_device_with(TEST_DEVICE, &messages, cache.path(), adjust).unwrap();
test(&device);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The kernel case's run records one execution: the compiled compute pipeline its dispatch ran,
@@ -33,7 +33,9 @@
//! waited.
use super::indirect_host_steps::Setup;
use super::{run_queue_waits, validated_device, Messages, ScratchCache};
use super::{
layer_reported_nothing_at_all, run_queue_waits, validated_device, Messages, ScratchCache,
};
use crate::gpu::{DeviceType, TEST_DEVICE};
use metal2vulkan_runtime::{
Buffer, CommandBuffer, CommandBufferStatus, CommandQueue, Deallocator, Device, DeviceKind,
@@ -1155,11 +1157,7 @@ fn a_dropped_command_buffer_completes_once_its_event_is_signalled() {
std::thread::sleep(Duration::from_millis(10));
}
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Devices made again in a long-lived process register the exit hook no more while what they
@@ -1197,9 +1195,5 @@ fn devices_made_again_register_the_exit_hook_no_more() {
);
drop(held);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -16,7 +16,10 @@
//! `Feature::RasterSampleCount`, is skipped with a printed line, and the other counts are checked.
use super::degrade_notices::{assert_once, forced, shared_in_system_memory};
use super::{buffer_with, read_buffer, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device_with, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::error::Feature;
@@ -422,9 +425,5 @@ fn extended_range_resolves_are_metals_or_within_a_code() {
)]));
assert_once(&messages.take_notices(), &kinds);
drop(lane);
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -1,7 +1,7 @@
//! Device test of the GPU-family audit on the device the cfg selects: every family's
//! `supportsFamily:` answer and the rows that block it, printed as the venue's burn-down.
use super::{validated_device, Messages, ScratchCache};
use super::{layer_reported_nothing_at_all, validated_device, Messages, ScratchCache};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::metal::TextureUsage;
use metal2vulkan_runtime::{
@@ -88,9 +88,5 @@ fn every_family_answers_with_its_blocking_rows() {
.and_then(|heap| heap.new_texture(&texture));
assert_eq!(sparse, made.is_ok(), "{made:?}");
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -16,7 +16,10 @@
//! one of the two. The validation layer is off there: the vertex function's read races the fill
//! by Metal's rule, which synchronization validation reports as a hazard.
use super::{buffer_with, read_buffer, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing, read_buffer, validated_device_with, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::metal::state::DepthStencilDescriptor;
@@ -166,11 +169,7 @@ fn a_wait_before_the_vertex_stage_orders_the_vertex_function() {
"texels after the fill and before it on {name}"
);
drop(device);
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported on {name}: {reported:#?}"
);
layer_reported_nothing(&messages, &format!("on {name}"));
}
/// The module docs' wait before the fragment stage: either answer, counted.
@@ -20,7 +20,7 @@
use super::host_memory::{counting, no_copy, not_importable, Mapping, GUEST_PAGE};
use super::no_copy_textures::{floats, staged};
use super::pitched_surfaces::reading;
use super::{validated_device, Messages, ScratchCache, WAIT};
use super::{layer_reported_nothing_at_all, validated_device, Messages, ScratchCache, WAIT};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::metal::{PixelFormat, PrimitiveType, TextureUsage};
use metal2vulkan_runtime::{
@@ -239,11 +239,7 @@ fn a_cpu_write_to_bytes_a_first_use_does_not_read_stays() {
}
}
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
assert!(
lapses.is_empty(),
"a first use undid a CPU write, or changed or misread bytes:\n{}",
@@ -27,7 +27,7 @@
//! (`texture_blits` measures that).
use super::degrade_notices::assert_once;
use super::{validated_device, Messages, ScratchCache};
use super::{layer_reported_nothing_at_all, validated_device, Messages, ScratchCache};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::metal::{PixelFormat, TextureUsage};
use metal2vulkan_runtime::{
@@ -260,7 +260,7 @@ fn depth_and_stencil_copy_their_bytes_with_colour_formats_of_their_unit() {
);
}
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// Probes 8, 8b and 8c: the stencil view `X32Stencil8` of a `Depth32FloatStencil8` texture copies
@@ -396,7 +396,7 @@ fn the_stencil_view_of_a_combined_texture_copies_its_stencil() {
"a combined texture into another on {name}"
);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// The CPU's copies through the stencil view `X32Stencil8` of a `Shared` `Depth32FloatStencil8`
@@ -470,7 +470,7 @@ fn the_cpu_copies_through_the_stencil_view_move_the_stencil() {
texture.get_bytes(&mut held, 16, 32, region, 0, 0).unwrap();
assert_eq!(held.to_vec(), depth, "the depth kept again on {name}");
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// Probes 7, 7b and 8b: a region copied onto itself keeps its texels, the whole texture or a
@@ -613,7 +613,7 @@ fn a_copy_onto_its_own_texels_keeps_them_and_another_overlap_moves_as_memmove()
let notices = assert_once(&messages.take_notices(), &MEMMOVES);
assert_eq!(notices.len(), 1, "{notices:?} on {name}");
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// A unit's bytes: `tag`, its index `i`, then bytes that count up, `n` in all.
@@ -741,5 +741,5 @@ fn compressed_blocks_copy_into_texels_of_their_bytes_and_back() {
);
}
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
@@ -24,7 +24,9 @@
use super::degrade_notices::assert_once;
use super::shared_kinds;
use super::tile_states::descriptor as tile_descriptor;
use super::{buffer_with, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, validated_device, Messages, ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::metal::{PixelFormat, PrimitiveType, TextureUsage};
@@ -260,7 +262,7 @@ fn a_pass_keeps_its_imageblock_across_draws_and_a_split() {
}
}
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
assert_once(&messages.take_notices(), &kinds);
}
@@ -333,7 +335,7 @@ fn imageblock_draws_are_refused_where_metal_or_the_runtime_refuses_them() {
);
});
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// What a step of [`commands_reach_the_pass_s_imageblock`] draws: the encoder's own draw of a
@@ -450,7 +452,7 @@ fn commands_reach_the_pass_s_imageblock() {
}
drop(held);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
let notices = messages.take_notices();
let storage = notices
.iter()
@@ -24,7 +24,10 @@ use super::degrade_notices::{assert_made_once, assert_once, clamps_depth_uploads
use super::degrade_notices::{
draws_depth_copies, forced, loses_depth_denormals, signs_depth_tests,
};
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::metal::{PixelFormat, TextureType, TextureUsage};
use metal2vulkan_runtime::{
@@ -267,11 +270,7 @@ fn a_new_texture_a_blit_wrote_whole_reads_its_texels_unannounced() {
let control = assert_once(&messages.take_notices(), &[Degradation::FreshPatternZeroed]);
println!("FRESH-WRITE {name} control, read unwritten: announced {control:?}");
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Writes of parts, a resolve, separate attachments and a view's write, each of a new texture
@@ -445,11 +444,7 @@ fn a_new_texture_written_in_parts_or_by_a_pass_reads_its_texels_unannounced() {
let noted = counts.contains_key(&Degradation::FreshPatternZeroed);
println!("FRESH-WRITE {name} a new single-sample Depth32Float is noted: {noted}");
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// A clear the pass renders through a scratch and does not store writes nothing of the texture:
@@ -503,9 +498,5 @@ fn a_clear_through_a_scratch_the_pass_does_not_store_writes_nothing() {
);
}
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -28,7 +28,7 @@ use super::indirect_host_steps::{
complete, param, state, wait, Setup, COMMANDS, HOST_STEPS, THREADS,
};
use super::shared_kinds;
use super::{validated_device_with, Messages, ScratchCache};
use super::{layer_reported_nothing_at_all, validated_device_with, Messages, ScratchCache};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::bind::ReplayFaults;
@@ -89,7 +89,7 @@ fn on_device(withheld: bool, test: impl FnOnce(&Device, &Messages, bool)) {
}
test(&device, &messages, generated);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// Whether `command_buffer` ran the flat kernel's flat variant: the GPU-alone path's execution
@@ -62,7 +62,9 @@
use super::commit_work::orders_by_ends;
use super::degrade_notices::{assert_once, counts, FROM_HOST, GPU_TIMES, UNTIMED};
use super::presenting::Adopted;
use super::{validated_device, validated_device_with, Messages, ScratchCache};
use super::{
layer_reported_nothing_at_all, validated_device, validated_device_with, Messages, ScratchCache,
};
use crate::gpu::TEST_DEVICE;
use ash::vk;
use metal2vulkan::device::{BatchOrderPolicy, DriverFact};
@@ -390,11 +392,7 @@ fn command_buffers_are_timed_in_the_hosts_time_base() {
assert_once(&notices, &GPU_TIMES);
}
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// On a `device` that calibrates: the calibration pairs that placed its command buffers' times,
@@ -513,11 +511,7 @@ fn command_buffers_one_after_another_are_each_timed_on_their_own() {
assert!(reused > 0, "no kept stamped command buffer taken again");
}
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// [`BEHIND_ROUNDS`] pairs of fills of the same [`BEHIND_LENGTH`] bytes on one queue, the first
@@ -648,11 +642,7 @@ fn start_behind_work(batch_order: BatchOrderPolicy) {
),
}
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// On a device the test made and the runtime adopts without calibrated timestamps: the three
@@ -720,11 +710,7 @@ fn more_command_buffers_in_flight_than_metal_keeps_sample_buffers_are_timed() {
);
}
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Command buffers each waiting for one shared event are committed before it is signaled, so all
@@ -856,11 +842,7 @@ fn command_buffers_past_a_pool_s_slots_are_timed_by_pools_made_as_needed() {
);
}
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Command buffers with no encoder answer where their queue reached them as both GPU times and
@@ -944,11 +926,7 @@ fn a_command_buffer_with_no_encoder_answers_where_its_queue_reached_it() {
);
}
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// On a device made with `gpu_times_from_host`: the three command buffers' times hold the module
@@ -1025,11 +1003,7 @@ fn a_device_answering_gpu_times_from_the_host_writes_no_timestamps() {
"runtime gpu times: {IN_FLIGHT} command buffers on one queue, answered from the host"
);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The command buffers each queue of [`host_clock_gpu_times_keep_metal_s_rules`] commits, in a
@@ -1357,9 +1331,5 @@ fn host_clock_gpu_times_keep_metal_s_rules() {
}
);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -42,7 +42,10 @@
//! handler's start on the host's clock, over [`DELAY_ROUNDS`] rounds after [`DELAY_WARM`].
use super::degrade_notices::counts;
use super::{loader, open_device, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
layer_reported_nothing_at_all, loader, open_device, validated_device_with, Messages,
ScratchCache, WAIT,
};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::device::{CompletionPolicy, DeviceDescription, DriverFact};
use metal2vulkan_runtime::{
@@ -184,11 +187,7 @@ fn run(completion: CompletionPolicy, checked: bool) -> (u64, u64, u64, usize, bo
};
let notices = counts(&messages.take_notices());
let [heard] = GROUPED.map(|kind| notices.get(&kind).copied().unwrap_or(0));
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
eprintln!(
"GROUPED {completion:?}, checked {checked}: {grouped} vkQueueSubmit calls held {batches} batches together, \
of {submissions} calls in all; groups by what sent them {ends:?}; {heard} \
@@ -322,11 +321,7 @@ fn completions_wake_the_scheduler_only_once_a_head_may_go() {
after.scheduler_wakes_completion - before.scheduler_wakes_completion,
)
};
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
eprintln!("GROUPED-COMPLETION-WAKES: the check saw {seen:?}; {wakes} wakings by completions");
assert_eq!(seen, Some(1), "the event's value the check saw");
assert!(wakes <= 1, "{wakes} wakings by completions");
@@ -474,11 +469,7 @@ fn event_scenario(completion: CompletionPolicy, steps: &[Step], last: u64) -> Sc
met: after.event_waits_met - before.event_waits_met,
}
};
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
eprintln!(
"GROUPED-EVENTS {completion:?}: {} vkQueueSubmit calls held {} batches together; groups \
by what sent them {:?}; event waits met as taken {}; the driver merges: {}",
@@ -981,11 +972,7 @@ fn behind_running_work(completion: CompletionPolicy, stretch: usize, carried: Ca
checks: checks.load(std::sync::atomic::Ordering::SeqCst),
}
};
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
eprintln!("GROUPED-BEHIND {completion:?} {carried:?}: {seen:#?}");
seen
}
@@ -29,7 +29,7 @@
//! alpha 1.
use super::degrade_notices::{counts, on_device_with};
use super::{buffer_with_options, read_buffer, WAIT};
use super::{buffer_with_options, layer_reported_nothing, read_buffer, WAIT};
use crate::air_library::AirLibrary;
use metal2vulkan::metal::{PixelFormat, TextureUsage};
use metal2vulkan::pipeline::{ComputePipelineDescriptor, StageSource};
@@ -534,11 +534,7 @@ fn half_nans_written_through_the_blur_keep_their_bits() {
if read_announced { " (announced)" } else { "" }
));
}
assert_eq!(
messages.take(),
Vec::new(),
"{what}: the validation layer reported"
);
layer_reported_nothing(messages, &what);
}
}
}
@@ -29,7 +29,7 @@ use super::color_writes::{
half, half_toward_zero, specials, unsigned_float, unsigned_float_toward_zero,
};
use super::degrade_notices::{on_device, on_device_with};
use super::{buffer_with, read_buffer, Messages, WAIT};
use super::{buffer_with, layer_reported_nothing, read_buffer, Messages, WAIT};
use crate::air_library::AirLibrary;
use metal2vulkan::metal::{PixelFormat, ResourceUsage, TextureUsage};
use metal2vulkan::pipeline::{ComputePipelineDescriptor, StageSource};
@@ -260,12 +260,7 @@ fn kernel_writes_store_metals_halves() {
if let Some(d) = judge(device, messages, (form, pf, channels), &values) {
differ.push(d);
}
assert_eq!(
messages.take(),
Vec::new(),
"{pf:?} by {}: the validation layer reported",
form.kernel()
);
layer_reported_nothing(messages, &format!("{pf:?} by {}", form.kernel()));
}
}
},
@@ -19,7 +19,7 @@
//! `device-nan-encoding`.
use super::degrade_notices::{counts, on_device_with};
use super::{buffer_with, read_buffer, WAIT};
use super::{buffer_with, layer_reported_nothing, read_buffer, WAIT};
use crate::air_library::AirLibrary;
use metal2vulkan::device::VkProperty;
use metal2vulkan::metal::{PixelFormat, ResourceUsage, TextureUsage};
@@ -397,12 +397,7 @@ fn half_writes_store_their_nans_as_metal_or_announce() {
if noted { "announced" } else { "not announced" }
));
}
assert_eq!(
messages.take(),
Vec::new(),
"{access} {}: the validation layer reported",
f.name
);
layer_reported_nothing(messages, &format!("{access} {}", f.name));
}
}
},
@@ -11,7 +11,7 @@
//! one that would leave the device's handler threads with none free (`HandlerThreadCap`). No wait here can hang: every wait in a handler is answered at once or
//! is for work that other threads do, and every wait of the test's own thread is bounded.
use super::{validated_device, Messages, ScratchCache};
use super::{layer_reported_nothing_at_all, validated_device, Messages, ScratchCache};
use crate::gpu::TEST_DEVICE;
use metal2vulkan_runtime::{
Buffer, CommandBuffer, CommandBufferStatus, CommandQueue, DeadlockCause, Device, Error,
@@ -51,11 +51,7 @@ fn on_device(test: impl FnOnce(&Device)) {
let device = validated_device(TEST_DEVICE, &messages, cache.path()).unwrap();
test(&device);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// A command buffer of `queue` filling the first 64 bytes of `buffer` with `value`, not
@@ -1,7 +1,7 @@
//! Device tests of the raw-handle accessors on the device the cfg selects: each handle the runtime
//! lends names the object it says, read back through Vulkan itself.
use super::{validated_device, Messages, ScratchCache};
use super::{layer_reported_nothing_at_all, validated_device, Messages, ScratchCache};
use crate::gpu::wait::{self, SubmissionBackend};
use crate::gpu::TEST_DEVICE;
use ash::vk;
@@ -133,9 +133,5 @@ fn the_raw_handles_name_the_runtimes_objects() {
// SAFETY: the test's fence; its submission completed.
unsafe { vk_device.destroy_fence(fence, None) };
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -4,7 +4,7 @@
use super::heap_textures::{sample_round_trip, SampleAspect};
use super::host_memory::{gpu_fill, gpu_read, run};
use super::{buffer_with, validated_device, Messages, ScratchCache};
use super::{buffer_with, layer_reported_nothing_at_all, validated_device, Messages, ScratchCache};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::device::DriverFact;
use metal2vulkan::error::Feature;
@@ -159,9 +159,5 @@ fn device_heap_multisample_colour_textures_lie_where_announced() {
reasons[0]
);
drop((texture, heap));
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -4,7 +4,7 @@
//! holds, and the consumer's surface, whose it may not.
use super::host_memory::run;
use super::{validated_device, Messages, ScratchCache};
use super::{layer_reported_nothing_at_all, validated_device, Messages, ScratchCache};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::error::Feature;
use metal2vulkan::metal::{PixelFormat, TextureType, TextureUsage};
@@ -179,9 +179,5 @@ fn a_large_heap_multisample_texture_s_moves() {
drop(kept);
print(&format!("{shape}: both gone"));
}
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -31,9 +31,9 @@ use super::host_memory::{gpu_fill, gpu_read, on_device, run};
use super::presenting::Adopted;
use super::textures::{no_texture_alone, pattern, texel_bytes};
use super::{
bound_buffers, buffer_with, encode_case, pipeline_state, public_case, read_buffer, run_case,
texture_descriptor, validated_device, validated_device_with, CaseResources, Messages,
PublicCase, ScratchCache,
bound_buffers, buffer_with, encode_case, layer_reported_nothing_at_all, pipeline_state,
public_case, read_buffer, run_case, texture_descriptor, validated_device,
validated_device_with, CaseResources, Messages, PublicCase, ScratchCache,
};
use crate::air_library::AirLibrary;
use crate::candidate::engine::ComputeOutput;
@@ -445,7 +445,7 @@ fn heap_textures_answer_and_place_as_metal_s_do() {
placement_rules(device);
automatic_rules(device);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// A placement heap's textures: at every multiple of the alignment, refused off it and past the
@@ -790,11 +790,7 @@ fn a_buffer_write_shows_in_an_overlapping_texture() {
);
assert_eq!(hidden, 0);
assert_eq!(transfer + linear, usize::from(hides && made));
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Under the default `HeapCompressionPolicy::Compressed`, where the device's driver may keep a
@@ -872,11 +868,7 @@ fn a_heap_texture_metal_compresses_keeps_the_driver_s_compression_by_default() {
assert_eq!(compressed, usize::from(hides && compressed_made));
assert_eq!(hidden, 0);
assert_eq!(transfer + linear, usize::from(hides && uncompressed_made));
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// What a 2048x2048 `RGBA8Unorm` render target in a `Private` placement heap costs the GPU under
@@ -1112,11 +1104,7 @@ fn a_multisample_depth_texture_without_optimized_contents_is_announced_where_it_
let notices = counts(&messages.take_notices());
let announced = notices.get(&OPTIMIZED[0]).copied().unwrap_or(0);
assert_eq!(announced, usize::from(optimized));
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The kinds a heap's colour texture announces on a driver whose compressed images hide writes
@@ -1716,11 +1704,7 @@ fn heap_depth_textures_keep_their_bytes_with_their_twins() {
eprintln!("HEAPTEX depth: the Shared heap's texture is a shadow of the heap's bytes");
}
assert_eq!(shadowed, usize::from((apart && made) || shared_shadow));
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// A heap's single-sample depth and stencil textures keep their texels where Metal's tiles place
@@ -1982,11 +1966,7 @@ fn heap_depth_textures_keep_their_texels_in_metal_s_tiles() {
assert_eq!(count(OPTIMIZED[0]), 0);
assert_eq!(count(APART[0]), 0);
}
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// One aspect of one slice of a multisample texture a lane moves ([`sample_round_trip`]): its
@@ -2299,11 +2279,7 @@ fn heap_multisample_textures_keep_their_samples_in_metal_s_tiles() {
assert_eq!(count(Degradation::HeapTextureLosslessLayout), 1);
assert_eq!(count(APART[0]), 0);
}
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// A heap's colour textures that Metal keeps uncompressed, in a `Private` placement heap over the
@@ -2417,11 +2393,7 @@ fn device_heap_textures_lie_in_metal_s_tiles() {
true => assert_eq!((layouts.len(), counted), (0, 0)),
false => assert_eq!((layouts, counted), (vec![(&untiled, &1)], 7)),
}
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// One aspect of a `side`-square depth or stencil texture, read back through a blit with
@@ -12,8 +12,9 @@ use super::host_memory::{
};
use super::no_copy_heaps::{no_copy_heap, HEAP};
use super::{
bound_buffers, encode_case, pipeline_state, public_case, read_buffer, run_case,
validated_device, CaseResources, Messages, PublicCase, ScratchCache, WAIT,
bound_buffers, encode_case, layer_reported_nothing_at_all, pipeline_state, public_case,
read_buffer, run_case, validated_device, CaseResources, Messages, PublicCase, ScratchCache,
WAIT,
};
use crate::candidate::device_facts::DeviceFacts;
use crate::candidate::engine::guards::{GuardCount, GuardReach};
@@ -1187,7 +1188,7 @@ fn a_kernel_reaches_buffers_placed_in_heaps_it_uses() {
);
encoder.end_encoding().unwrap();
}
assert!(messages.take().is_empty());
layer_reported_nothing_at_all(&messages);
});
}
@@ -1657,7 +1658,7 @@ fn a_resident_set_past_the_old_search_reaches_every_live_buffer() {
);
drop(live);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// The counts of buffers of their own [`the_resident_set_s_cost`] adds, in turn.
@@ -10,8 +10,8 @@
//! are Metal's, as measured on an Apple M3 Max and an M4.
use super::{
buffer_with, encode_case, pipeline_state, public_case, read_buffer, validated_device,
validated_device_with, CaseResources, Messages, ScratchCache,
buffer_with, encode_case, layer_reported_nothing, pipeline_state, public_case, read_buffer,
validated_device, validated_device_with, CaseResources, Messages, ScratchCache,
};
use crate::candidate::engine::ComputeOutput;
use crate::gpu::TEST_DEVICE;
@@ -1709,8 +1709,7 @@ fn a_lost_device_s_command_buffers_let_go_of_their_pools_after_the_driver_s_comp
);
drop((read_only, texture, filled, queue, device));
drop(memory);
let left = messages.take();
assert!(left.is_empty(), "round {round}: {left:#?}");
layer_reported_nothing(&messages, &format!("round {round}, after the teardown"));
}
}
@@ -1893,8 +1892,7 @@ fn a_gpu_fault_fails_its_command_buffer_and_the_queue_runs_on() {
faulting, victim, read_only, texture, after, beside, queue, device,
));
drop(memory);
let left = messages.take();
assert!(left.is_empty(), "{resume:?}: {left:#?}");
layer_reported_nothing(&messages, &format!("{resume:?}, after the teardown"));
}
}
@@ -47,7 +47,10 @@
use super::degrade_notices::{assert_made_once, assert_once};
use super::shared_kinds;
use super::{buffer_with, read_buffer, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device_with, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::candidate::engine::guards::GuardReach;
use crate::candidate::runtime_case::guarded_buffer;
@@ -336,7 +339,7 @@ fn index_positions_past_the_buffer_draw_index_zero_plus_the_base_vertex() {
);
}
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
}
@@ -440,7 +443,7 @@ fn a_run_of_bounded_indirect_draws_draws_each_draws_metal_vertices() {
RUN.len()
);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// The positions of [`an_indirect_draw_past_the_old_index_pool_draws_metals_vertices`]'s draw:
@@ -493,5 +496,5 @@ fn an_indirect_draw_past_the_old_index_pool_draws_metals_vertices() {
u64::from(PAST_OLD_POOL) * 4
);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
@@ -19,7 +19,9 @@
//! `vkDestroyBuffer` waited for the lock that making holds, so the handler ran as the making
//! ended, 20 to 27 ms after the command buffer completed.
use super::{buffer_with, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, validated_device_with, Messages, ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::coverage::ROBUSTNESS_FEATURES;
use crate::gpu::TEST_DEVICE;
@@ -167,7 +169,7 @@ fn command_buffers_of_one_queue_share_one_pool_block() {
"two command buffers held the block at once at most"
);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// A second queue's command buffer makes a block of its own, which goes as the queue goes; the
@@ -199,7 +201,7 @@ fn a_second_queue_takes_its_own_pool_block() {
"the second queue's block went with it"
);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// A queue's block that no command buffer held for the quiet period goes as another queue's
@@ -223,7 +225,7 @@ fn a_pool_block_no_command_buffer_held_goes_after_the_quiet_period() {
lane.drawn(&idle);
assert_eq!(lane.blocks(), (3, 1), "the idle queue makes one again");
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// A command buffer's completed handler runs while another queue's first command buffer makes
@@ -281,5 +283,5 @@ fn a_completed_handler_waits_for_no_pool_block_made_meanwhile() {
);
}
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
@@ -40,7 +40,7 @@ use super::degrade_notices::{
assert_made_once, counts, forced, on_device, shared_in_system_memory,
};
use super::indirect_host_steps::state;
use super::{buffer_with, read_buffer, WAIT};
use super::{buffer_with, layer_reported_nothing_at_all, read_buffer, WAIT};
use crate::air_library::AirLibrary;
use metal2vulkan::bind::StatusReport;
use metal2vulkan::pipeline::{ComputePipelineDescriptor, RuntimeFact, StageSource};
@@ -348,7 +348,7 @@ fn indirect_dispatches_are_refused_where_metal_refuses_them() {
complete(&command_buffer, "refused dispatches");
assert_eq!(fixture.out(), vec![0; SLOTS as usize]);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// An offset that is not a multiple of 4 reads the arguments at the multiple below, as plain
@@ -21,9 +21,10 @@
use super::degrade_notices::counts;
use super::host_memory::{host_page, no_copy, not_importable, Mapping};
use super::{
bound_buffers, compute_descriptor, encode_case, in_shard, public_case, public_cases,
read_buffer, validated_device, validated_device_with, wait_for_device, CaseResources,
DeviceWait, Messages, PublicCase, ScratchCache, WAIT,
bound_buffers, compute_descriptor, encode_case, in_shard, layer_reported_nothing,
layer_reported_nothing_at_all, public_case, public_cases, read_buffer, validated_device,
validated_device_with, wait_for_device, CaseResources, DeviceWait, Messages, PublicCase,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::candidate::engine::{ComputeCase, ComputeOutput};
@@ -79,11 +80,7 @@ fn on_device_with(adjust: impl FnOnce(&mut DeviceOptions), test: impl FnOnce(&De
let device = validated_device_with(TEST_DEVICE, &messages, cache.path(), adjust).unwrap();
test(&device, &messages);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// `case`'s pipeline state, made with `supportIndirectCommandBuffers` (as the oracle's
@@ -634,6 +631,10 @@ fn every_case_of_buffers_alone_runs_from_a_command_as_its_dispatch(shard: usize)
failed.join("\n"),
timed_out.join("\n")
);
layer_reported_nothing(
&messages,
"every case's commands were valid and left nothing behind",
);
assert!(!alike.is_empty(), "no case ran alike");
}
@@ -1709,11 +1710,7 @@ fn a_segment_runs_between_the_encoder_s_commands() {
encoder.end_encoding().unwrap();
assert_eq!(command_buffer.executions().len(), 2);
complete(&command_buffer);
let reported = messages.take();
assert!(
reported.is_empty(),
"{dispatch_type:?}: the validation layer reported: {reported:#?}"
);
layer_reported_nothing(messages, &format!("{dispatch_type:?}"));
for (step, expected) in expected.iter().enumerate() {
let written = read_buffer(&chain[step + 1], 0, length).unwrap();
assert_eq!(&written, expected, "{dispatch_type:?} step {step}");
@@ -20,7 +20,10 @@
//! The object stage's form runs `mesh_draws`' object cases (`mesh_draws.rs`).
use super::vertex_strides::{drawn, pipeline, read_at};
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::error::BindError;
@@ -173,7 +176,7 @@ fn kernels_read_each_calls_inline_bytes() {
}
}
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// A vertex attribute reads inline bytes as its vertex buffer: at the layout's stride, and under
@@ -222,7 +225,7 @@ fn vertex_attributes_read_inline_bytes() {
"MTLAttributeStrideStatic"
);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// A fragment function reads inline bytes through a `const device` pointer and a `constant`
@@ -283,5 +286,5 @@ fn fragments_read_inline_bytes() {
.collect();
assert_eq!(read_buffer(&o, 0, 64).unwrap(), want);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
@@ -20,7 +20,10 @@
//! - A 32-bit integer format read into a float attribute refuses the pipeline,
//! `InvalidDescriptor(VertexAttribute)`, where Metal refuses it too.
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::bind::SamplerDescriptor;
@@ -297,7 +300,7 @@ fn integer_formats_read_into_float_attributes_take_metal_s_values() {
);
assert!(wrong.is_empty(), "{} rows differ", wrong.len());
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// A 32-bit integer format read into a float attribute refuses the pipeline, as on Metal.
@@ -333,7 +336,7 @@ fn a_32_bit_integer_format_into_a_float_attribute_is_refused() {
}
}
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// The label pipeline, its `UShort2` attribute read as `float2`, draws Metal's pixels.
@@ -508,5 +511,5 @@ fn the_label_pipeline_draws_metal_s_pixels() {
"the label's pixels"
);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
@@ -24,7 +24,10 @@
//! hold its band's composition; the wrong ones are counted and printed per pass, with the GPU time
//! of each pass and whether the device records the barrier.
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::device::DriverFact;
@@ -270,9 +273,5 @@ fn consecutive_fetching_draws_read_each_others_writes() {
device.name()
);
drop(device);
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -19,7 +19,10 @@
//! and the bytes are the same.
use super::no_copy_textures::{blending, floats, staged};
use super::{validated_device, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
layer_reported_nothing_at_all, validated_device, validated_device_with, Messages, ScratchCache,
WAIT,
};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::device::{CompletionPolicy, DriverFact};
use metal2vulkan::metal::{PixelFormat, PrimitiveType, TextureUsage};
@@ -278,11 +281,7 @@ fn on_device(completion: Option<CompletionPolicy>, test: impl FnOnce(&Device)) {
.unwrap();
test(&device);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The module docs' first case: [`COMMAND_BUFFERS`] passes into one texture a round, each in a
@@ -12,8 +12,8 @@
use super::kernel_textures::census;
use super::{
bound_buffers, encode_case, pipeline_state, public_case, public_cases, validated_device,
CaseResources, Messages, PublicCase, ScratchCache, WAIT,
bound_buffers, encode_case, layer_reported_nothing_at_all, pipeline_state, public_case,
public_cases, validated_device, CaseResources, Messages, PublicCase, ScratchCache, WAIT,
};
use crate::candidate::runtime_case::Committed;
use crate::case::Stage;
@@ -39,11 +39,7 @@ fn on_device(test: impl FnOnce(&Device)) {
let device = validated_device(TEST_DEVICE, &messages, cache.path()).unwrap();
test(&device);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Every committed public kernel case with an explicit imageblock, and no tile pass, passes the
@@ -18,7 +18,10 @@
//! 64 coordinates per query.
use super::mip_levels::{half, texture, LEVELS, SIDE};
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::bind::SamplerDescriptor;
@@ -279,7 +282,7 @@ fn kernel_lod_queries_answer_metals_level() {
}
assert!(wrong.is_empty(), "{name}: {} queries differ", wrong.len());
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// The rule's own arithmetic at the measured points: a nearest mip filter's half-way point, the
@@ -18,8 +18,9 @@
//! of their cases' own formats.
use super::{
buffer_with, encode_case, in_shard, pipeline_state, public_case, public_cases, read_buffer,
run_case, validated_device, CaseResources, Messages, NamedCase, PublicCase, ScratchCache, WAIT,
buffer_with, encode_case, in_shard, layer_reported_nothing, layer_reported_nothing_at_all,
pipeline_state, public_case, public_cases, read_buffer, run_case, validated_device,
CaseResources, Messages, NamedCase, PublicCase, ScratchCache, WAIT,
};
use crate::candidate::engine::variants::compile_compute_for_shape;
use crate::candidate::engine::{compute_shape, ENGINE_EXECUTOR_ABI};
@@ -231,6 +232,10 @@ pub(super) fn census(label: &str, cases: &[NamedCase]) {
"failed:\n{}\nat device destruction: {leaked:#?}",
failed.join("\n")
);
layer_reported_nothing(
&messages,
"every case's commands were valid and left nothing behind",
);
assert!(matched > 0, "no case ran");
}
@@ -341,11 +346,7 @@ fn on_device(test: impl FnOnce(&Device, &Messages)) {
let device = validated_device(TEST_DEVICE, &messages, cache.path()).unwrap();
test(&device, &messages);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// A state the device can make is made, those Metal's validation stops among them, as plain
@@ -27,7 +27,8 @@
//! 27.0.1 for its texels).
use super::{
buffer_with, read_buffer, validated_device, validated_device_with, Messages, ScratchCache, WAIT,
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device,
validated_device_with, Messages, ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
@@ -607,11 +608,7 @@ fn layered_passes(withheld: &[VkFeature]) {
lane.geometry_stages(2)
);
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// An index at or past the pass's length renders the pass's first layer, and the fragment function
@@ -829,11 +826,7 @@ fn index_past_the_length(withheld: &[VkFeature]) {
lane.geometry_stages(2)
);
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// `rt6_layered_weights` reads the slice and the tag, the primitive ID and the barycentric weights
@@ -976,11 +969,7 @@ fn weights_passes(withheld: &[VkFeature]) {
lane.geometry_stages(1)
);
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// What Metal's validation stops in a layered pass is refused typed before anything runs (Metal
@@ -1050,11 +1039,7 @@ fn a_layered_pass_is_refused_as_metal_refuses_it() {
);
}
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// A resolve lane texel (RGBA8): white where a draw covered the pixel, the clear (zero) where none
@@ -1909,11 +1894,7 @@ fn a_layered_pass_resolves_each_layer_as_metal() {
}
}
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// One separate depth and stencil case: its name, the arrays' slices, the attachments' slice,
@@ -1992,11 +1973,7 @@ fn separate_depth_and_stencil_render_each_layer_as_metal() {
assert_eq!(stencils, stencil, "{case} on {name}");
}
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// A layered pass over separate multisampled depth and stencil textures tests and stores each
@@ -2146,11 +2123,7 @@ fn separate_multisampled_depth_and_stencil_render_each_layer_as_metal() {
}
differ
};
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
assert!(differ.is_empty(), "{differ:#?}");
}
@@ -2209,11 +2182,7 @@ fn a_depth_and_stencil_resolve_reads_and_writes_their_own_slices() {
}
}
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// A layered pass resolves its depth and stencil from its first layer alone, into slice
@@ -2270,9 +2239,5 @@ fn a_layered_pass_resolves_its_depth_and_stencil_from_its_first_layer() {
}
}
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -3,7 +3,10 @@
//! (`lower::texture::emit::level_extent`).
use super::host_memory::run;
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::metal::{PixelFormat, TextureUsage};
@@ -130,9 +133,5 @@ fn size_queries_at_a_level_answer_metal_s_extent() {
eprintln!("LEVELSIZES storage 100x40/3 level {l}: {got:?}, Metal's {want:?}");
assert_eq!(got, want, "storage, level {l}");
}
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -21,7 +21,7 @@
//! their `0x11` bytes.
use super::degrade_notices::{counts, on_device_with};
use super::{buffer_with, read_buffer, WAIT};
use super::{buffer_with, layer_reported_nothing, read_buffer, WAIT};
use crate::air_library::AirLibrary;
use metal2vulkan::metal::{PixelFormat, TextureUsage};
use metal2vulkan::pipeline::{ComputePipelineDescriptor, StageSource};
@@ -269,11 +269,7 @@ fn writes_at_every_level_store_whatever_the_usage() {
if shadowed { "shadowed" } else { "own image" },
));
}
assert_eq!(
messages.take(),
Vec::new(),
"{what}: the validation layer reported"
);
layer_reported_nothing(messages, &what);
}
}
},
@@ -13,7 +13,9 @@
//! operation. Copy and no-op draw on every device; the others where the device has `logicOp`,
//! and are refused naming it elsewhere (MoltenVK).
use super::{buffer_with, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, validated_device_with, Messages, ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::device::VkFeature;
@@ -305,9 +307,5 @@ fn the_logic_operation_stores_metal_s_codes() {
);
eprintln!("{name}: {checked} logic-operated draws store Metal's texels, {refused} refused");
drop(lane);
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -9,7 +9,10 @@
//! vertices through a vertex descriptor (`LAYOUT_FUNCTIONS`).
use super::degrade_notices::{counts, on_device};
use super::{dynamic_input_assembly, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
dynamic_input_assembly, layer_reported_nothing_at_all, validated_device_with, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::bind::SamplerDescriptor;
@@ -320,7 +323,7 @@ fn a_pipeline_made_at_creation_announces_at_its_first_draw() {
"a second draw announced again"
);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
/// A state's creation predicts the draw that binds no texture: nothing it sees names a texture a
@@ -10,7 +10,10 @@
//! and `INT_MIN`; an infinity `(x, 0)` and `INT_MAX`; a NaN `(x, 0)` and `INT_MIN`; anything else
//! `((u & 0x807fffff) | 0x3f000000, E - 126)` and `E - 127`.
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::pipeline::{ComputePipelineDescriptor, StageSource};
@@ -194,9 +197,5 @@ fn frexp_and_ilogb_answer_as_metals_routines() {
);
}
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -30,7 +30,10 @@
//! and each is compared with Metal's lines.
use super::render_state::{texels, texture};
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::metal::{BarrierScope, PixelFormat, RenderStages};
@@ -342,9 +345,5 @@ fn readers_behind_a_barrier_read_the_writers_words() {
}
}
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -50,7 +50,10 @@ use super::degrade_notices::{assert_made_once, made_mesh_kinds};
use super::gpu_times::read_kinds;
use super::render_state::{texels, texture};
use super::shared_kinds;
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::device::{VkExtension, VkFeature};
@@ -486,11 +489,7 @@ fn mesh_draws_store_metals_words() {
}
}
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Each object case draws the words Metal drew (the module docs), but those that leave a partial
@@ -564,11 +563,7 @@ fn object_draws_store_metals_words() {
};
assert_made_once(&messages, emulated, &made);
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// One case of Metal probe 5 over the owned fixture `mesh_object_grid`: the draw's object
@@ -928,11 +923,7 @@ fn object_grids_run_as_metal_runs_them() {
assert_eq!(tail, !direct, "{what}: the encoder after the draw's");
}
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The pixels Metal draws for `cases` drawn in order in one pass, as case `name`: each case's
@@ -1003,11 +994,7 @@ fn draws_of_both_pipelines_in_one_pass_store_metals_words() {
);
assert_eq!(lines, metals, "on {name}");
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// What Metal's validation stops draws as plain Metal does (a probe): more than 1024 threads in a
@@ -1062,9 +1049,5 @@ fn mesh_draws_answer_as_plain_metal_and_refuse_the_rest() {
.unwrap();
assert_eq!(lines, ["RESULT refused drawn=0"], "on {name}");
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -26,7 +26,10 @@
//! `L + 1/2` in steps of `1/4096`, every `1/1024` from 1 to 2, the `half` ties around `L + k/64`
//! with their `f32` neighbours, and past the last level, the infinities and a NaN.
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::metal::{PixelFormat, TextureType};
@@ -380,5 +383,5 @@ fn explicit_levels_read_metals_levels() {
wrong.join("\n")
);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
@@ -20,7 +20,10 @@
//! compared with its bytes.
use super::degrade_notices::assert_once;
use super::{validated_device, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
layer_reported_nothing_at_all, validated_device, validated_device_with, Messages, ScratchCache,
WAIT,
};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::bind::{MipmapFilterChain, MipmapRule};
use metal2vulkan::metal::{PixelFormat, TextureType, TextureUsage};
@@ -303,11 +306,7 @@ fn mipmaps_of_the_16_bit_fixed_formats_on_halving_chains_are_metal_s() {
"the M3 Max's passes, no blit chain: {announced:?}"
);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The boxes an Apple M4 measured (probe 10), each the first level of a texture of the box: exact
@@ -375,11 +374,7 @@ fn the_boxes_metal_measured_mipmap_as_it_measured_them() {
"{announced:?}"
);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// At macOS 26.7 (`MetalLevel::MacOS26_7`, the M3 Max's passes), `mipmaps-as-apple-m4` is
@@ -471,11 +466,7 @@ fn the_m3_note_is_announced_exactly_where_an_m3_differs() {
generate(&queue, &t);
assert_once(&messages.take_notices(), &M3_MIPMAPS);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Every format the filter computes, from random bytes (every bit pattern: NaNs, infinities,
@@ -577,11 +568,7 @@ fn every_format_the_filter_computes_is_its_filter_level_by_level() {
"no blit chain: {announced:?}"
);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// At macOS 26.7 (`MetalLevel::MacOS26_7`), the Apple M3 Max's passes past its tail's extent, from
@@ -656,11 +643,7 @@ fn mipmaps_past_65_texels_take_the_m3_max_s_passes() {
assert!(unknown, "a compressed pass past PASS_ASPECT");
assert_once(&messages.take_notices(), &M3_MIPMAPS);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The kind a chain takes where a level may take a rounding the chain does not fit, every venue,
@@ -736,11 +719,7 @@ fn mipmaps_near_ties_are_announced_where_the_rounding_is_not_fit() {
&[(PixelFormat::RGBA16Float, [16, 16, 1], 3)],
Some("RGBA16Float"),
);
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// At macOS 27.0.1 (`MetalLevel::MacOS27_0_1`), where the Apple M3 Max makes every level by its
@@ -808,11 +787,7 @@ fn mipmaps_at_macos_27_0_1_are_the_m3_max_s_filter() {
assert_eq!(ties, (false, true), "an 8-bit sRGB chain");
assert_once(&messages.take_notices(), &TIE_MIPMAPS);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// Plain Metal's integer mipmap of a level from the level above (`above`, of `above_extent`),
@@ -1017,11 +992,7 @@ fn integer_mipmaps_pick_the_texels_plain_metal_picks() {
let announced = assert_once(&messages.take_notices(), &[]);
assert!(announced.is_empty(), "{announced:?}");
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The first level read in place recovers every code: for every format the filter computes, a 2D
@@ -1122,9 +1093,5 @@ fn a_first_level_read_in_place_recovers_every_code() {
"the extended-range formats' integer carriers are read in place on every device"
);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
@@ -17,7 +17,10 @@
//! argument buffer the encoder makes resident with `use_resource` ([`READ_DMS`]), or through a
//! blit's copy into a buffer.
use super::{buffer_with, read_buffer, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing, read_buffer, validated_device_with, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::candidate::runtime_samples::encode;
use crate::executor_contract::multisample::SampleRead;
@@ -355,11 +358,7 @@ fn run(name: &str, expected: Expect, case: impl FnOnce(&Device, &Kit)) {
}
drop(kit);
drop(device);
let reported = messages.take();
assert!(
reported.is_empty(),
"{name}: the validation layer reported on {device_name}: {reported:#?}"
);
layer_reported_nothing(&messages, &format!("{name} on {device_name}"));
}
/// Three passes, each its own command buffer and each read back by a compute function after it:
@@ -14,7 +14,10 @@
//! difference clamped by `air.clamp.s.i32`, each truncated to its width and zero-extended. Every
//! device answers each word zero-extended.
use super::{buffer_with, read_buffer, validated_device, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::pipeline::{ComputePipelineDescriptor, StageSource};
@@ -196,5 +199,5 @@ fn a_narrow_sum_clamped_signed_and_truncated_is_zero_extended() {
wrong.join("\n")
);
}
assert_eq!(messages.take(), Vec::new(), "the validation layer reported");
layer_reported_nothing_at_all(&messages);
}
@@ -26,7 +26,7 @@
use super::heap_layouts::tiled_offset;
use super::host_memory::{gpu_fill, gpu_read, host_page, not_importable, run, Mapping};
use super::{read_buffer, validated_device, Messages, ScratchCache};
use super::{layer_reported_nothing_at_all, read_buffer, validated_device, Messages, ScratchCache};
use crate::gpu::TEST_DEVICE;
use metal2vulkan::metal::format::is_depth_stencil;
use metal2vulkan::metal::{PixelFormat, TextureUsage};
@@ -156,11 +156,7 @@ fn on_device(kind: Degradation, test: impl FnOnce(&Device)) -> usize {
.is_some_and(|notice| notice.degradation == kind)
})
.count();
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
notices
}
@@ -40,7 +40,10 @@
use super::degrade_notices::counts;
use super::host_memory::{counting, no_copy, not_importable, Mapping, GUEST_PAGE};
use super::{validated_device, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
layer_reported_nothing_at_all, validated_device, validated_device_with, Messages, ScratchCache,
WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::metal::{
@@ -423,11 +426,7 @@ fn read_and_write_the_caller_s_pages(pf: PixelFormat, texel: u64, pad: u64) {
drop(mapping);
}
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
per_format! {
@@ -600,11 +599,7 @@ fn two_slice_arrays_over_no_copy_buffers_read_and_write_the_caller_s_pages() {
drop((texture, buffer, queue, device));
drop(mapping);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// The `shadowed-texture` notice's reason among the notices delivered so far (removed), as
@@ -1031,11 +1026,7 @@ fn passes_blend_load_and_store_as_private_textures(pf: PixelFormat, texel: u64,
drop((texture, private, buffer));
drop(mapping);
}
let messages = messages.take();
assert!(
messages.is_empty(),
"the validation layer reported: {messages:#?}"
);
layer_reported_nothing_at_all(&messages);
}
per_format! {
@@ -25,6 +25,7 @@
use super::color_writes::{field, metal, round_product, Channel, Output, CASES};
use super::degrade_notices::on_device;
use super::half_storage_writes::{written, written_texels, Form};
use super::layer_reported_nothing;
use metal2vulkan::metal::PixelFormat;
/// Metal's stored code of `x` in `channel` (the module docs); `None` for a channel of another
@@ -63,11 +64,7 @@ fn kernel_writes_store_metals_normalized_codes() {
for form in Form::ALL {
let label = format!("{:?} by {}", case.pf, form.kernel());
let stored = written(device, form, case.pf, case.bytes, &values);
assert_eq!(
messages.take(),
Vec::new(),
"{label}: the validation layer reported"
);
layer_reported_nothing(messages, &label);
let Some(stored) = stored else {
eprintln!("NORM-STORAGE-WRITE {label} on {name}: refused");
continue;
@@ -141,11 +138,7 @@ fn kernel_writes_store_each_channel_in_its_field() {
for form in Form::ALL {
let label = format!("{pf:?} by {}", form.kernel());
let stored = written_texels(device, form, pf, 4, &texels);
assert_eq!(
messages.take(),
Vec::new(),
"{label}: the validation layer reported"
);
layer_reported_nothing(messages, &label);
let Some(stored) = stored else {
eprintln!("NORM-STORAGE-FIELDS {label} on {name}: refused");
continue;
@@ -6,7 +6,7 @@
//! `label=ID` between steps that make and drop the objects, each state kept to the test's end
//! (plain allocation hands each the lowest free ID).
use super::{validated_device, Messages, ScratchCache};
use super::{layer_reported_nothing_at_all, validated_device, Messages, ScratchCache};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::bind::SamplerDescriptor;
@@ -185,11 +185,7 @@ fn on_device(row: impl FnOnce(&mut Row)) -> String {
row(&mut r);
r.answers()
};
let failing = messages.take();
assert!(
failing.is_empty(),
"the validation layer reported: {failing:#?}"
);
layer_reported_nothing_at_all(&messages);
answers
}
@@ -15,7 +15,10 @@
//! (`render/tessellation_scan.rs`): the same marks, and the emulation announced once
//! ([`EMULATED_TESSELLATION`]).
use super::{buffer_with, read_buffer, validated_device_with, Messages, ScratchCache, WAIT};
use super::{
buffer_with, layer_reported_nothing_at_all, read_buffer, validated_device_with, Messages,
ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
use metal2vulkan::device::VkFeature;
@@ -103,11 +106,7 @@ pub(super) fn on_path(path: Path, check: impl FnOnce(Device, &str)) {
} else {
assert!(order <= 1, "the triangle order announced {order} times");
}
let reported = messages.take();
assert!(
reported.is_empty(),
"the validation layer reported: {reported:#?}"
);
layer_reported_nothing_at_all(&messages);
}
/// `error`, a refusal of the fixture's pipeline, which only the native path may answer (on a
@@ -46,8 +46,8 @@
use super::executions::KERNEL;
use super::{
buffer_with, pipeline_state, public_case, read_buffer, validated_device, validated_device_with,
Messages, ScratchCache, WAIT,
buffer_with, layer_reported_nothing_at_all, pipeline_state, public_case, read_buffer,
validated_device, validated_device_with, Messages, ScratchCache, WAIT,
};
use crate::air_library::AirLibrary;
use crate::gpu::TEST_DEVICE;
@@ -965,8 +965,7 @@ fn draws_made_on_the_pool_draw_as_made_ones() {
assert!(pooled.1 > 0, "the draws counted samples");
assert_eq!(pooled.1, made.1, "the same samples counted");
assert!(pooled.0 == made.0, "the same bytes rendered");
let reported = messages.take();
assert!(reported.is_empty(), "{reported:#?}");
layer_reported_nothing_at_all(&messages);
}
/// Pipeline states compare by identity, as Metal's objects do, so a program finds the state a
@@ -996,6 +995,5 @@ fn pipeline_states_equal_only_their_own_clones() {
);
assert!(first == first.clone());
assert!(first != second, "two states of one kernel are two states");
let reported = messages.take();
assert!(reported.is_empty(), "{reported:#?}");
layer_reported_nothing_at_all(&messages);
}
Loaded 100 of 159 files, more files were not shown because too many files have changed in this diff. Show more