From 523d32a10a29b4f850bc5a587c186ea8b152cc71 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Fri, 13 Nov 2026 11:19:29 -0800 Subject: [PATCH] A failed submission's and a failed recording's warning end in their id name reims's sink writes a runtime message's text alone, without its id, so a metal2vulkan-submit-failed or metal2vulkan-recording-failed line could not be found by id in qemu.log. submit_failure::warn now appends " []" to the text, as degrade notices end in theirs, for both warnings. The device test asserts the submit-failed line ends in " [metal2vulkan-submit-failed]". docs/API.md says so. Log text only: no version bump. Verified: expected, by the check job dispatched at this commit (clippy plain and m2v_cpu_icd on the runtime, the submit_failure unit tests, the lavapipe device test). --- crates/metal2vulkan-runtime/src/submit_failure.rs | 4 +++- .../metal2vulkan-runtime/src/tests/submit_failure_device.rs | 1 + docs/API.md | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/metal2vulkan-runtime/src/submit_failure.rs b/crates/metal2vulkan-runtime/src/submit_failure.rs index f34f4a6a3..176c7edb6 100644 --- a/crates/metal2vulkan-runtime/src/submit_failure.rs +++ b/crates/metal2vulkan-runtime/src/submit_failure.rs @@ -346,7 +346,9 @@ pub(crate) fn warn(device: &Device, id_name: &str, text: String) { }, id_name: id_name.to_owned(), id: 0, - text, + // The text ends in its id name, as a degrade notice's does, so a consumer that writes the + // text alone still lets a reader find the line by id. + text: format!("{text} [{id_name}]"), degradation: None, }; match device.shared().instance.sink() { diff --git a/crates/metal2vulkan-runtime/src/tests/submit_failure_device.rs b/crates/metal2vulkan-runtime/src/tests/submit_failure_device.rs index 2b4da9679..5117f717e 100644 --- a/crates/metal2vulkan-runtime/src/tests/submit_failure_device.rs +++ b/crates/metal2vulkan-runtime/src/tests/submit_failure_device.rs @@ -106,4 +106,5 @@ fn a_failed_submission_logs_one_line_naming_what_it_held() { assert!(line.contains(expected), "{expected:?} missing from {line}"); } assert!(!line.contains("submit-failure-next"), "{line}"); + assert!(line.ends_with(" [metal2vulkan-submit-failed]"), "{line}"); } diff --git a/docs/API.md b/docs/API.md index 8737cfb16..b87387c61 100644 --- a/docs/API.md +++ b/docs/API.md @@ -2055,8 +2055,9 @@ detached now. It names at most 8 infos, 8 waits and 8 signals of each, 32 `VkCom command buffers and 32 resources, and counts the rest; state another thread holds at that moment reads as busy, and a submission that succeeds does none of it. A command buffer whose recording fails with a Vulkan result or the runtime's own error (`CommandBufferError::Internal` for both) logs -that error (id name `metal2vulkan-recording-failed`, `Warning` severity). That text is for people, -not a contract. +that error (id name `metal2vulkan-recording-failed`, `Warning` severity). Each of the two lines ends +in its id name in brackets, as a degrade notice does, so a consumer that writes the text alone still +leaves it findable by id. That text is for people, not a contract. Each entry below gives the code, its category, the `Degradation` kind (or the `PrecisionNote`) and what triggers it; a runtime kind's cost follows. The kind's rustdoc states the trigger, cost and