queue_share: the quiet unshared queue's test makes again a run whose first long one's completion let the second go

Pin 91's lavapipe suite (0c3c24ec0e, under the whole suite's load) failed
a_quiet_unshared_queue_s_first_command_buffer_waits_behind_the_idle_budget_and_one_batch at
'a head let go under the idle budget': the first long one ran 63.5 ms against its queue's
expected 81.1 ms, so it completed before the 16 ms budget's point (about 65.1 ms) and its
completion let the second go at 64.0 ms, which neither budget holds and none counts as let go
under the idle one. Such a run shows nothing of the bound, as a run whose unshared command buffer
was committed after the third was let go shows nothing: it is now made again too, up to
HELD_RUNS runs (the second let go before the first's GPU end). A product that ignored the idle
budget still fails: a run that lets the second go while the first runs is still required, and
the counts and the early let-go are asserted on it.

Not a product change, and not RUNTIME 2303's: alone on msi lavapipe (m3-max-29668) the test
passed 3 of 3 at 2216540a68 (before 2303, binary md5 8963d218) and 3 of 3 at 6b6c9a002f (2303,
md5 21cdc46a), each run letting the second go at about 20 to 24 ms, under the idle budget, with
one head counted. 2303 changes only passes of committing and waiting threads with an unshared
head in the order; this test's unshared queue has none there while the long ones go.

Verified (msi lavapipe): the test alone 3/3 at 2216540a68 and 3/3 at 6b6c9a002f (m3-max-29668);
pin 91's failure was the suite's load (the first long one completed at 63.5 ms, before the
idle budget's let-go point). At the tip (m3-max-29677): clippy plain and cpuicd 0, 29/29 of
queue_share_device and unshared_hold.
This commit is contained in:
Anees Iqbal committed 2026-11-14 09:38:07 -08:00
1 parent 0c3c24ec0e
commit 7f01a06014
1 file changed
+10 -3
@@ -1392,7 +1392,11 @@ fn an_unshared_queue_s_command_buffer_goes_ahead_of_other_queues_held_work() {
/// stretch, committed once the second went, runs behind the first and second and before the third:
/// behind at most the idle budget's work and one batch, not all three. A run whose unshared command
/// buffer was committed only after the third was let go (the test's thread late on a loaded host)
/// shows nothing of the bound, and is made again, up to [`HELD_RUNS`] runs.
/// shows nothing of the bound, and is made again, up to [`HELD_RUNS`] runs. So does a run whose
/// second was let go only once the first had ended on the GPU: the first's completion let it go,
/// as it would under either budget, where the first ended more than 16 ms before its queue's
/// expected run (inside a whole suite's run on lavapipe, a first of 63.5 ms against an expected
/// 81.1 ms, the second let go at 64.0 ms and none counted under the idle budget).
#[test]
fn a_quiet_unshared_queue_s_first_command_buffer_waits_behind_the_idle_budget_and_one_batch() {
let scratch = Scratch::new("unshared-hold-quiet");
@@ -1400,8 +1404,11 @@ fn a_quiet_unshared_queue_s_first_command_buffer_waits_behind_the_idle_budget_an
let run = (0..HELD_RUNS)
.map(|_| work.run(false, Compositor::Quiet))
.inspect(|run| run.print("Bounded, quiet"))
.find(|run| run.committed < run.let_go[2])
.expect("a run committed the unshared one before the third was let go");
.find(|run| run.committed < run.let_go[2] && run.let_go[1] < run.longs[0].1)
.expect(
"a run committed the unshared one before the third was let go, and let the second go \
while the first ran",
);
let early = run.let_go[0] + run.expected / 1e3 - run.let_go[1];
assert!(
early > 0.007,