From 98efd4de504d2cd4dab5b0deac069ddf712a2f6e Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Wed, 18 Nov 2026 08:18:55 -0800 Subject: [PATCH] rt tests: the busy rounds go up to 4,096 fills behind_busy and the two tests with their own rounds commit busy command buffers of more fills each round until the work outlasts the check. With each busy one now committed after the one before it is submitted (3309532960), the first runs longer before the check, and under load the last round, 1,024 fills of 16 MiB (16 GiB, about 17 ms on the RX 7900 XTX), was outlived by the host once in about 530 runs of the three held-group tests beside two loops of the device suite (m3-max-46831: every_device_sends_the_held_group_a_command_buffer_without_a_submission_retires_behind, 'the busy work ended before every check'; no wait timed out). One round more, of 4,096 fills, runs only where the 1,024 one ended first. Verified: the compile job and the XTX load run, named in the hand-off. --- crates/metal2vulkan-rt/src/tests/command.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/metal2vulkan-rt/src/tests/command.rs b/crates/metal2vulkan-rt/src/tests/command.rs index 03dd25b5e..593523ea4 100644 --- a/crates/metal2vulkan-rt/src/tests/command.rs +++ b/crates/metal2vulkan-rt/src/tests/command.rs @@ -980,6 +980,11 @@ pub(crate) mod on_device { /// The submissions a queue keeps in flight before it holds a group ([`IN_FLIGHT`]). const AHEAD: u64 = IN_FLIGHT as u64; + /// The fills of 16 MiB each busy command buffer of a round takes, a round with more once the + /// work ended before the check: 1,024 (16 GiB, about 17 ms on an RX 7900 XTX) was outlived by + /// the host under a loaded run of the device suite beside it, so the last is 4,096. + const FILLS: [u32; 5] = [16, 64, 256, 1024, 4096]; + /// Runs `body` with as many command buffers of busy work committed on `queue` as a queue /// keeps in flight ([`IN_FLIGHT`]), each a submission of its own ([`busy_alone`]), so its next /// commit is held, each of more fills each time, until `body` answers that it checked what it @@ -994,7 +999,7 @@ pub(crate) mod on_device { mut body: impl FnMut(&[CommandBuffer], u64, u64) -> bool, ) { let buffer = private(device); - let checked = [16, 64, 256, 1024].into_iter().any(|fills| { + let checked = FILLS.into_iter().any(|fills| { let before = device.counters().metrics().submissions; let seen = device.core().done.completed(); let running: Vec = (0..IN_FLIGHT) @@ -1024,7 +1029,7 @@ pub(crate) mod on_device { let buffer = arena.buffer(); let work = private(&device); let (first, second) = (queue(&device), queue(&device)); - let checked = [16, 64, 256, 1024].into_iter().any(|fills| { + let checked = FILLS.into_iter().any(|fills| { let before = device.counters().metrics(); let running: Vec = [&first, &second] .into_iter() @@ -1149,7 +1154,7 @@ pub(crate) mod on_device { let work = private(&device); let queue = queue(&device); let submissions = || device.counters().metrics().submissions; - let checked = [16, 64, 256, 1024].into_iter().any(|fills| { + let checked = FILLS.into_iter().any(|fills| { let before = submissions(); let running = [ busy_alone(name, &device, &queue, &work, fills),