From 187127bd04c331a2e0f9d0a7fa74bff2f79d5ca4 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sun, 15 Nov 2026 12:30:48 -0800 Subject: [PATCH] Runtime lane: a making made again leaves the loader's errors about its refused vkCreateDevice behind The 2080 lane leg 1/2 at c1747ff89 (job m3-max-33322, 1,040 tests, 830 s) waited 35 times for room, 12.0 s of pauses in all, and every device it waited for was then made with its plan. 16 of those tests then failed on the loader's errors, which the wait had left in the lane's message list: kernel_textures x10, layered_passes, made_at_creation x2, math_routines, mesh_commands and ycbcr_in_place. The loader reports each refused vkCreateDevice as two errors through the instance's messenger ("terminator_CreateDevice: Failed in ICD ... vkCreateDevice call", "vkCreateDevice: Failed to create device chain."), and those come from the making the lane drops and makes again, not from the device the test keeps. Messages::failing_kept and Messages::drop_failing_since: the lane marks the failing list before each making, and where it makes that one again it drops what was kept since the mark. The kept making's messages, the layer's included, stay. validated_device_with and made_lane_device both do it. Verified: cargo fmt; build, clippy and the 2080 lane leg in the lane's jobs. --- .../src/candidate/runtime_case.rs | 20 +++++++++++++++++++ .../src/runtime_lane.rs | 10 ++++++++++ 2 files changed, 30 insertions(+) diff --git a/crates/metal2vulkan-validation/src/candidate/runtime_case.rs b/crates/metal2vulkan-validation/src/candidate/runtime_case.rs index 4228c4e5a..1afd44036 100644 --- a/crates/metal2vulkan-validation/src/candidate/runtime_case.rs +++ b/crates/metal2vulkan-validation/src/candidate/runtime_case.rs @@ -463,6 +463,26 @@ impl Messages { true } + /// How many failing messages are kept so far: the mark [`Messages::drop_failing_since`] takes. + pub fn failing_kept(&self) -> usize { + self.0 + .lock() + .unwrap_or_else(|p| p.into_inner()) + .failing + .len() + } + + /// Drop the failing messages kept since `mark` ([`Messages::failing_kept`]): those a device + /// making delivered that the runtime lane makes again, the driver having refused the device, + /// or its queue plan, for want of what other processes' devices hold. The loader reports each + /// refused `vkCreateDevice` as two errors ("terminator_CreateDevice: Failed in ICD ... + /// vkCreateDevice call", "vkCreateDevice: Failed to create device chain."), which the making + /// the test keeps does not deliver (`runtime_lane/device_room.rs`). + pub fn drop_failing_since(&self, mark: usize) { + let mut reported = self.0.lock().unwrap_or_else(|p| p.into_inner()); + reported.failing.truncate(mark); + } + /// Put `notices`, taken earlier, back before those delivered since: the runtime lane's device /// constructor takes a new device's creation notices apart from those a test has not read. pub fn restore_notices(&self, mut notices: Vec) { diff --git a/crates/metal2vulkan-validation/src/runtime_lane.rs b/crates/metal2vulkan-validation/src/runtime_lane.rs index 9223d215c..5820cfc57 100644 --- a/crates/metal2vulkan-validation/src/runtime_lane.rs +++ b/crates/metal2vulkan-validation/src/runtime_lane.rs @@ -1084,6 +1084,7 @@ pub fn validated_device_with( let options = lane_device_options(messages, cache, adjust); let (device, made) = device_room::with_room(std::thread::sleep, || { let pending = messages.take_notices(); + let failing = messages.failing_kept(); let device = open_device(device_type, options.clone()); let made = messages.take_notices(); messages.restore_notices(pending); @@ -1091,6 +1092,10 @@ pub fn validated_device_with( Ok(_) => device_room::least_plan_taken(&made), Err(error) => device_room::refused_for_room(error), }; + // The loader's errors about the refused `vkCreateDevice` of a making made again. + if short.is_some() { + messages.drop_failing_since(failing); + } ((device, made), short) }); messages.device_made(&made); @@ -1113,11 +1118,16 @@ pub(crate) fn made_lane_device( ) -> Result { let options = lane_device_options(messages, cache, adjust); device_room::with_room(std::thread::sleep, || { + let failing = messages.failing_kept(); let device = open_device(device_type, options.clone()); let short = device .as_ref() .err() .and_then(device_room::refused_for_room); + // The loader's errors about the refused `vkCreateDevice` of a making made again. + if short.is_some() { + messages.drop_failing_since(failing); + } (device, short) }) .map_err(|error| no_lane_device(device_type, &error))