coverage_chain: print each case's instances and splits beside its texels

What. a_coverage_chain_through_fetch_keeps_every_block's line for each case now also prints, from
the device's WorkCounts around the case's pass: the render pass instances begun, the splits for
interlocked writes, for a barrier and for a memoryless write, and the draws dropped (still
making or unmade).

Why. The test still loses 8x4 blocks under load on the M3 Max (MoltenVK) in the cases with a
discard, after the split for interlocked writes. Whether the split ran in a failing case, and
whether a draw went missing, decides where to look; the line said neither.

Verified: cargo fmt. The run on the M3 is a potluck job.
(cherry picked from commit 94061430214bfa257f0eb64bfb76bed5aaa752e7)
(cherry picked from commit b2db90a08beda968daec04b4fd548d65b85ec5e3)
This commit is contained in:
Anees Iqbal committed 2026-11-08 23:56:34 -08:00
1 parent 0fafc2a4b3
commit bacd33bec5
1 file changed
+12 -3
@@ -58,7 +58,7 @@ use metal2vulkan::pipeline::{ColorAttachmentDescriptor, RenderPipelineDescriptor
use metal2vulkan_runtime::{
BlitOption, Buffer, ClearColor, Deallocator, Error, IoSurfacePlane, Library, LoadAction,
PipelineOptions, Region, RenderCommandEncoder, RenderPassDescriptor, RenderPipelineState,
ResourceOptions, ScissorRect, StoreAction, Texture, TextureDescriptor,
ResourceOptions, ScissorRect, StoreAction, Texture, TextureDescriptor, WorkCounts,
};
/// The target's width and height.
@@ -763,13 +763,22 @@ fn a_coverage_chain_through_fetch_keeps_every_block() {
pipeline(&lane, &chain, ("chain_rects", "chain_coverage"), false),
pipeline(&lane, &chain, ("chain_rects", colour), false),
];
let before = lane.device.work_counts();
let texels = drawn(&lane, case, &pipelines);
let after = lane.device.work_counts();
let (count, blocks) = lost(case.coverage, color, &texels);
let ran = |count: fn(&WorkCounts) -> u64| count(&after) - count(&before);
eprintln!(
"coverage chain, {}, on {device} through {}: {count} texels from Metal's, 8x4 blocks \
(x, y) {blocks:?}",
(x, y) {blocks:?}; {} instances begun, split for interlocked writes {}, for a \
barrier {}, for a memoryless write {}; draws dropped {}",
case.name,
form(&lane)
form(&lane),
ran(|c| c.render_passes_begun_instances),
ran(|c| c.instance_splits_interlocked_writes),
ran(|c| c.instance_splits_barrier),
ran(|c| c.instance_splits_memoryless_write),
ran(|c| c.draws_dropped_still_making + c.draws_dropped_unmade),
);
if count != 0 {
failed.push(case.name);