Tests: the heap barrier count takes its kernel's rate as the test's input

What: every_device_orders_a_heap_s_resources_as_one sets step's rate to 1 ps a threadgroup before
each counted command buffer, so its two dispatches share one piece and the barriers counted are
the hazards' and the one segment end's. No assertion changes.

Why: the same piece-end barrier 75773059e7 took out of three other counts. On a loaded lavapipe a
measured rate can cut the command buffer between the two dispatches, and the cut ends a segment
with its barrier. "One heap, the same bytes" and "one heap, apart" count 2 either way, the first
piece's end taking the hazard barrier's place; "two heaps", with no hazard, counts 2 against the
asserted 1 (compute.rs:479, development's lavapipe runs m3-max-68655 at 59481e60bd and
m3-max-68664 at f21db0934c; passed at 600b38fda7, m3-max-68546).

Verified: see the job lines below.
This commit is contained in:
Anees Iqbal committed 2026-11-22 13:23:00 -08:00
1 parent f21db0934c
commit e74f1480ed
1 file changed
+4 -1
@@ -445,8 +445,11 @@ pub(crate) mod on_device {
.unwrap_or_else(|error| panic!("{name}: {error}"))
};
// Two dispatches of `step`, each over one buffer: the barriers they take, the
// segment's end among them.
// segment's end among them. The kernel's rate 1 ps a threadgroup, the test's own
// input, so the two dispatches share one piece (`crate::piece`) and the barriers
// counted are the hazards' and the one segment end's alone.
let barriers = |buffers: [&Buffer; 2]| -> u64 {
state.inner.compiled.rate.set_for_test(1);
let before = device.counters().metrics();
let command_buffer = queue.command_buffer().expect("a command buffer");
let mut encoder = command_buffer