From b9da46258e5a178eba8d684e212ce3ef56c25ca6 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Wed, 25 Nov 2026 14:49:14 -0800 Subject: [PATCH] Tests: the poke guard and the early member's settle test print the attempt that asserted every_device_pokes_the_submit_thread_for_a_completion_that_leaves_room asserts X's hold only on an attempt where S was not seen complete first (1b4595dea9). An attempt where it was goes again, up to four. The fourth fails, so a pass always has one attempt that asserted the hold. The failure now says the hold was never observed. The pass line names the attempt that asserted it, so each run shows the hold was checked and on which attempt. every_device_settles_an_early_members_shared_writes_at_its_own_completion's line names its attempt as well. Test only. --- crates/metal2vulkan-runtime/src/tests/command.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/crates/metal2vulkan-runtime/src/tests/command.rs b/crates/metal2vulkan-runtime/src/tests/command.rs index 9c5841ff2..7f546ea6b 100644 --- a/crates/metal2vulkan-runtime/src/tests/command.rs +++ b/crates/metal2vulkan-runtime/src/tests/command.rs @@ -5168,7 +5168,8 @@ pub(crate) mod on_device { calls(&held, &at_l), ); println!( - "{name}: atom {atom:?}; flushes, flushed bytes, invalidates, invalidated bytes and \ + "{name}: attempt {attempt}, atom {atom:?}; flushes, flushed bytes, invalidates, \ + invalidated bytes and \ failures since the group was held: at A's handler {a_calls:?}, {} ns before L's \ GPU end; at A's status {status_calls:?}, {} ns before it; at L's handler \ {l_calls:?}", @@ -5288,9 +5289,18 @@ pub(crate) mod on_device { drop((s, a, l, y, x, queue)); continue; } - assert!(!early, "{name}: S seen complete before X was held"); + // Only an attempt that asserted X's hold comes past here: the fourth fails where + // S was seen complete first. + assert!( + !early, + "{name}: S seen complete before X was held in all {attempt} attempts: the \ + hold was never observed" + ); let poked = at_last.load(Ordering::SeqCst) - before; - println!("{name}: {poked} pokes of the submit thread from X's hold to L's handler"); + println!( + "{name}: attempt {attempt} asserted X's hold; {poked} pokes of the submit \ + thread from X's hold to L's handler" + ); assert_eq!( poked, 1, "{name}: the group's last completion alone poked it"