rt tests: the upload bound test reads the upload's own count at the bound, not the device's submissions

The block-maker thread's zero fills of the blocks it makes and is given back
are submissions too, and come when they come: on llvmpipe one came inside the
fill-at-the-bound step (check m3-max-44699: 15 submissions against 14). The
upload's pending bytes say what the step asks: the released block still counts
at the bound, and past it the send starts the count again.
This commit is contained in:
Anees Iqbal committed 2026-11-17 23:37:22 -08:00
1 parent 5b52afb17b
commit eb46c7fa2c
1 file changed
+16 -4
+16 -4
View File
@@ -230,8 +230,11 @@ mod on_device {
MemoryClass::Private.block_len(),
"{name}: the released block is counted"
);
// At the bound and not past it, a fill keeps the upload pending.
let before = submissions();
// At the bound and not past it, a fill keeps the upload pending: the released block
// still counts, where a send would have started the count again. The upload's own
// count, not the device's submissions: the block-maker thread's zero fills of the
// blocks it makes and is given back submit beside it, when they come (on llvmpipe,
// one came inside this step).
let fills = device
.take_block(MemoryClass::Private, MemoryClass::Private.block_len())
.unwrap_or_else(|error| panic!("{name}: {error}"));
@@ -239,7 +242,12 @@ mod on_device {
.new_buffer(fills.id, 0, 256, true)
.unwrap_or_else(|error| panic!("{name}: {error}"));
drop(buffer);
assert_eq!(submissions(), before, "{name}: a fill at the bound");
let (_, bytes, _) = core.work.pending();
assert_eq!(
bytes,
MemoryClass::Private.block_len(),
"{name}: a fill at the bound"
);
assert!(!core.pool.holds(released_id), "{name}: the block held");
// A texture released after a copy takes it past the bound: the next fill sends the
// upload, and the block comes back to the pool.
@@ -254,7 +262,11 @@ mod on_device {
.new_buffer(fills.id, 256, 256, true)
.unwrap_or_else(|error| panic!("{name}: {error}"));
drop(buffer);
assert!(submissions() > before, "{name}: a fill past the bound");
let (_, bytes, _) = core.work.pending();
assert!(
bytes < MemoryClass::Private.block_len(),
"{name}: a fill past the bound keeps {bytes} bytes pending"
);
wait_until("the released block back in the pool", || {
core.pool.holds(released_id)
});