From bacd33bec5d42c812daf5736fa1661cd658cd602 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sun, 8 Nov 2026 21:30:31 -0800 Subject: [PATCH] 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) --- .../framebuffer_fetch/coverage_chain.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/crates/metal2vulkan-validation/src/runtime_lane/framebuffer_fetch/coverage_chain.rs b/crates/metal2vulkan-validation/src/runtime_lane/framebuffer_fetch/coverage_chain.rs index b9a1c0d34..91b00cc06 100644 --- a/crates/metal2vulkan-validation/src/runtime_lane/framebuffer_fetch/coverage_chain.rs +++ b/crates/metal2vulkan-validation/src/runtime_lane/framebuffer_fetch/coverage_chain.rs @@ -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);