Reclaim bench: each pool's blocks kept ahead at a phase's end, and whether it grows

The phase report names the pools that keep blocks made ahead at its
end, with their bytes and whether each grows or is near its next block
(Memory::growing): which pool's reserve the sweep frees unused in the
next phase. On the Radeon 780M's small-blocks arms (job 12627, 16 MiB
blocks): at each quiet phase's end the textures' pool (Images, 2) keeps
48 MiB ahead and grows, and the host copies' pool (Images, 5) 64 MiB and
does not; the three blocks (48 MiB) freed unused in each pressed phase
are (Images, 2)'s.

(cherry picked from commit a0f47d9827798373e2f8bb2a213a9a3dc19ee340)
This commit is contained in:
Anees Iqbal committed 2026-11-09 17:52:06 -08:00
1 parent 52b4685ffc
commit 7675ea39fc
1 file changed
+17 -7
@@ -632,11 +632,19 @@ fn phase(
memory.turnover_bytes(),
)
};
let placements: Vec<String> = (crate::device::lock(&device.shared().memory)
.image_placements
.iter())
.map(|(&(bytes, align), count)| format!("{count} of {bytes} bytes at {align}"))
.collect();
let (placements, ahead) = {
let mut memory = crate::device::lock(&device.shared().memory);
let placements: Vec<String> = (memory.image_placements.iter())
.map(|(&(bytes, align), count)| format!("{count} of {bytes} bytes at {align}"))
.collect();
let ahead: Vec<String> = (memory.ahead_by_pool().into_iter())
.map(|(pool, bytes)| {
let grows = memory.grows(pool);
format!("{pool:?} {} MiB, grows {grows}", bytes >> 20)
})
.collect();
(placements, ahead)
};
let over = |times: &[(Duration, f64)], bound: f64| {
(times.iter())
.filter(|&&(took, _)| took.as_secs_f64() * 1e3 >= bound)
@@ -709,8 +717,10 @@ fn phase(
frees.kept_for_room - earlier_frees.kept_for_room,
);
eprintln!(
"RECLAIM-SUBMIT {arm}, {name}: images placed by bytes and alignment [{}]",
placements.join(", ")
"RECLAIM-SUBMIT {arm}, {name}: images placed by bytes and alignment [{}]; kept ahead at \
the phase's end by pool [{}]",
placements.join(", "),
ahead.join(", ")
);
eprintln!("RECLAIM-SUBMIT {arm}, {name}: slowest submissions {slow}");
eprintln!("RECLAIM-SUBMIT {arm}, {name}: slowest turnarounds {slow_turns}");