From cbd4644463ef57f155afe2e698495e91ef755d0d Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Wed, 18 Nov 2026 00:59:22 -0800 Subject: [PATCH] rt tests: the hold test commits the held command buffer before the bytes are named What: every_device_takes_staging_of_its_own_behind_a_held_command_buffer commits the command buffer that waits on the event before it makes and names the Managed buffer. Why: on every discrete leg of edfa66f02e (jobs 45072-45074) the held command buffer's own commit captured the bytes named at the buffer's making, streaming them with nothing held ahead, so the later commit named nothing and took no staging of its own (0 overflows, 1 expected); the bytes checks passed. Tests: legs rerun. --- crates/metal2vulkan-rt/src/tests/managed.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/metal2vulkan-rt/src/tests/managed.rs b/crates/metal2vulkan-rt/src/tests/managed.rs index a34780af4..8fdbbbfd2 100644 --- a/crates/metal2vulkan-rt/src/tests/managed.rs +++ b/crates/metal2vulkan-rt/src/tests/managed.rs @@ -421,7 +421,8 @@ mod on_device { } /// A commit naming more than the ring behind a command buffer that waits on an event the host - /// has not signalled cannot send its ring-full ahead: the rest takes staging of its own, the + /// has not signalled, committed before the bytes were named, cannot send its ring-full ahead: + /// the rest takes staging of its own, the /// command buffer reads the bytes of its commit, not those written and named after it, and the /// staging goes back once it retires. #[test] @@ -434,12 +435,13 @@ mod on_device { let counters = device.counters(); let len = CAPTURE_LEN / 2 * 3; let first = vec![0xA1; len as usize]; - let (managed, into, blocks) = named_whole(&device, name, len, &first); let queue = device.new_command_queue(4).expect("a queue"); let event = device.new_shared_event().expect("an event"); let held = queue.command_buffer().expect("a command buffer"); (held.encode_wait_for_event(event.as_event(), 1)).expect("a wait"); + // Committed before the buffer's bytes are named, so its own capture takes none. held.commit().expect("a commit"); + let (managed, into, blocks) = named_whole(&device, name, len, &first); let before = counters.metrics(); let command_buffer = queue.command_buffer().expect("a command buffer"); copy_out(&command_buffer, &managed, &into, 0, len);