Tests: the two room-hold tests show their window by the head's status and its pieces sent
What: both tests (pieces.rs, present.rs) show the window open by the cut head's status, Scheduled, and two of its four pieces submitted 50 ms after the second went, asserted and printed before the command buffer under test is committed. They no longer wait for Metrics::held_for_room to rise. Why: a cut command buffer whose later pieces wait only for room is scheduled with its first piece and marked held there (WorkState::step, the cut-and-leads arm), with no held_for_room counted; hold() never takes it. So the count never rose, and both tests timed out in their window wait, 60 s, before committing anything (m3-max-68752 at 31a1f91891, m3-max-68755 at acfac8f4d2): the window was not shown, and nothing was tested. Verified: see the job named where it is handed over.
This commit is contained in:
1 parent
02923fb2ae
commit
40a9982a94
2 files changed
+26
-20
No files matched your search
@@ -457,8 +457,8 @@ mod on_device {
|
||||
/// Behind a cut command buffer whose later pieces wait for room, a command buffer of its
|
||||
/// queue that holds nothing for the GPU, or one ended before it went (enqueued, its queue
|
||||
/// abandoned, then committed), is not held for room (`WorkState::hold`): it retires behind
|
||||
/// the pieces, after them, as the room comes. The window is shown open first: two of the
|
||||
/// four pieces submitted, the head held for room (`Metrics::held_for_room`). Its commit and
|
||||
/// the pieces, after them, as the room comes. The window is shown open first: the head
|
||||
/// scheduled with its first piece, two of its four pieces submitted 50 ms on. Its commit and
|
||||
/// both completions are waited for on another thread, within `BOUND` each; past it the test
|
||||
/// ends its process, as a submit thread that spins holding the work lock lets no handle drop.
|
||||
#[test]
|
||||
@@ -480,16 +480,13 @@ mod on_device {
|
||||
}))
|
||||
.expect("a completed handler");
|
||||
};
|
||||
let (from, before) = (sent(&device, &queue), device.counters().metrics());
|
||||
let from = sent(&device, &queue);
|
||||
state.inner.compiled.rate.set_for_test(RATE);
|
||||
let pieces = queue.command_buffer().expect("a command buffer");
|
||||
steps(&pieces, &state, &x, 4).end_encoding();
|
||||
log(&pieces, "pieces");
|
||||
pieces.commit().expect("a commit");
|
||||
within(name, || order(&device, &pieces).len() == from + 2);
|
||||
within(name, || {
|
||||
device.counters().metrics().held_for_room > before.held_for_room
|
||||
});
|
||||
let behind = queue.command_buffer().expect("a command buffer");
|
||||
log(&behind, form);
|
||||
if form == "ended" {
|
||||
@@ -497,10 +494,16 @@ mod on_device {
|
||||
behind.enqueue().expect("an enqueue");
|
||||
queue.abandon();
|
||||
}
|
||||
println!(
|
||||
"{name}: {form}: committed behind {} of 4 pieces submitted, held for room {}",
|
||||
order(&device, &pieces).len() - from,
|
||||
device.counters().metrics().held_for_room - before.held_for_room
|
||||
// The window: the head scheduled with its first piece (held, `WorkState::step`),
|
||||
// two of its four pieces on the device and, nothing completing behind the gate,
|
||||
// the third waiting for room a while on.
|
||||
thread::sleep(Duration::from_millis(50));
|
||||
let window = (pieces.status(), order(&device, &pieces).len() - from);
|
||||
println!("{name}: {form}: committed behind the head at {window:?} of 4 pieces");
|
||||
assert_eq!(
|
||||
window,
|
||||
(CommandBufferStatus::Scheduled, 2),
|
||||
"{name}: {form}: the head scheduled, its third piece waiting for room"
|
||||
);
|
||||
let (tell, told) = mpsc::channel();
|
||||
let watcher = {
|
||||
|
||||
@@ -980,8 +980,8 @@ mod on_device {
|
||||
/// later pieces wait for room, one that only presents the drawable retires after the pieces
|
||||
/// ("behind"); and a cut command buffer that presents, its first piece waiting for the room
|
||||
/// another queue's pieces hold, goes as the room comes ("cut"). Behind the busy gate the
|
||||
/// window is shown open first: two of the four pieces holding the room submitted, their head
|
||||
/// held for room (`Metrics::held_for_room`). The presenting command buffer's commit and both
|
||||
/// window is shown open first: the head of the pieces holding the room scheduled with its
|
||||
/// first, two of its four submitted 50 ms on. The presenting command buffer's commit and both
|
||||
/// completions are waited for on another thread within `BOUND` each; past it the test ends
|
||||
/// its process, as a submit thread that spins holding the work lock lets no handle drop. The
|
||||
/// presents name no semaphore.
|
||||
@@ -997,7 +997,6 @@ mod on_device {
|
||||
const RATE: u64 = 3_000_000_000;
|
||||
each_device("present_hold", |name, _, device| {
|
||||
(device.grant_indices(IndexClass::Texture, 4096, 2)).expect("a grant");
|
||||
let counters = device.counters();
|
||||
let state = step(&device);
|
||||
let mut arena = Arena::new(&device);
|
||||
let info = swapchain(USAGE);
|
||||
@@ -1044,14 +1043,10 @@ mod on_device {
|
||||
}))
|
||||
.expect("a completed handler");
|
||||
};
|
||||
let before = counters.metrics();
|
||||
let room = pieces(if form == "behind" { &queue } else { &other }, &x);
|
||||
log(&room, "pieces");
|
||||
room.commit().expect("a commit");
|
||||
within(name, || own(&room) == 2);
|
||||
within(name, || {
|
||||
counters.metrics().held_for_room > before.held_for_room
|
||||
});
|
||||
let presenting = match form {
|
||||
"behind" => queue.command_buffer().expect("a command buffer"),
|
||||
_ => pieces(&queue, &y),
|
||||
@@ -1060,10 +1055,18 @@ mod on_device {
|
||||
// SAFETY: no semaphore is named, and the drawable is acquired.
|
||||
unsafe { presenting.present_drawable(&drawable, vk::Semaphore::null()) }
|
||||
.unwrap_or_else(|error| panic!("{name}: {form}: a present: {error}"));
|
||||
// The window: the room's head scheduled with its first piece (held,
|
||||
// `WorkState::step`), two of its four pieces on the device and, nothing
|
||||
// completing behind the gate, the third waiting for room a while on.
|
||||
thread::sleep(Duration::from_millis(50));
|
||||
let window = (room.status(), own(&room));
|
||||
println!(
|
||||
"{name}: {form}: committed with {} of 4 pieces submitted, held for room {}",
|
||||
own(&room),
|
||||
counters.metrics().held_for_room - before.held_for_room
|
||||
"{name}: {form}: committed with the room's head at {window:?} of 4 pieces"
|
||||
);
|
||||
assert_eq!(
|
||||
window,
|
||||
(CommandBufferStatus::Scheduled, 2),
|
||||
"{name}: {form}: the room's head scheduled, its third piece waiting for room"
|
||||
);
|
||||
let (tell, told) = mpsc::channel();
|
||||
let watcher = {
|
||||
|
||||
Reference in new issue
Block a user