diff --git a/crates/metal2vulkan-runtime/src/tests/command.rs b/crates/metal2vulkan-runtime/src/tests/command.rs index 84efa0647..8cf997d80 100644 --- a/crates/metal2vulkan-runtime/src/tests/command.rs +++ b/crates/metal2vulkan-runtime/src/tests/command.rs @@ -5100,7 +5100,9 @@ pub(crate) mod on_device { /// feeds them as the last retires, where one signal for the group fed them, so what the /// submit thread joins and parts meanwhile reads what it read then. A's handler, after A's /// retirement, sees them as they stood; L's, after the last's, sees the count two higher and - /// the run fed twice, each run halving the way down from the long run the test set. + /// the run A's handler saw fed A's GPU run and then L's (`queue::next_run`), each the span of + /// its own timestamps: values the runtime recorded, so the check holds however long the runs + /// took on a loaded device. #[test] fn every_device_feeds_an_early_members_run_to_its_queue_as_the_last_retires() { each_device("command_group_apart_feeds_late", |name, _, device| { @@ -5150,11 +5152,18 @@ pub(crate) mod on_device { a_retired + 2, "{name}: A's run fed its queue as L retired" ); - // Each run halves the way down to a short command buffer's: fed twice after A's - // handler, the run comes to about a quarter of what A's handler saw; once, a half. - assert!( - l_run * 3 < a_run, - "{name}: the run fed twice after A's handler" + // After A's handler the queue took A's run, then L's, each its timestamps' own span + // (`QueueInner::ran`): from the run A's handler saw, exactly the run L's sees, + // whatever the GPU times came to. + let fed = |run: u64, command_buffer: &CommandBuffer| { + let span = + (command_buffer.gpu_end_time()).saturating_sub(command_buffer.gpu_start_time()); + super::next_run(Some(run), span) + }; + assert_eq!( + l_run, + fed(fed(a_run, &a), &l), + "{name}: A's run, then L's, fed after A's handler" ); drop((a, l, queue)); drop((first, second, arena, device));