From be19769dcd882ad1ae7bbfe575ac1d08d20cfd27 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Mon, 16 Nov 2026 00:10:54 -0800 Subject: [PATCH] rate-mapped tests: a boxed host step's first frame makes no pipeline; the first frame's multi-draw batch a_host_step_s_first_boxed_frame_makes_no_pipeline draws the boxed-draws workload's executed frame first on a fresh FanOut device and checks that its host step boxes the four patches and makes no VkPipeline itself (WorkCounts::host_step_pipelines_made). The fan-out test's first-frame line now prints the regions a multi-draw takes, the evidence that the regions variant drew several regions a command (region_batch). --- .../src/tests/rate_mapped_boxed_draws.rs | 21 +++++++++++++++++++ .../src/tests/rate_mapped_fan_out.rs | 6 +++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/crates/metal2vulkan-runtime/src/tests/rate_mapped_boxed_draws.rs b/crates/metal2vulkan-runtime/src/tests/rate_mapped_boxed_draws.rs index a63f16c67..5595d42fb 100644 --- a/crates/metal2vulkan-runtime/src/tests/rate_mapped_boxed_draws.rs +++ b/crates/metal2vulkan-runtime/src/tests/rate_mapped_boxed_draws.rs @@ -435,3 +435,24 @@ fn a_host_step_boxes_the_draws_whose_triangles_lie_in_few_regions() { let (_, before, after) = exact.frame(true); assert_eq!(counts(&before, &after), [0; 6], "under Exact"); } + +/// The first frame of a device that drew none of the commands' states before: its host step boxes +/// the four patches through their region-copy variant and fans the others out, with the pipelines +/// `commit`'s settle began, keyed as the step keys them, and makes none itself +/// (`WorkCounts::host_step_pipelines_made`). +#[test] +fn a_host_step_s_first_boxed_frame_makes_no_pipeline() { + let scratch = Scratch::new("rate-mapped-boxed-first-frame"); + let workload = Workload::new(device_under(&scratch.0, RateMapRegionPolicy::FanOut)); + let (_, before, after) = workload.frame(true); + let seen = counts(&before, &after); + let made = after.host_step_pipelines_made - before.host_step_pipelines_made; + eprintln!( + "RATE-MAP-BOXED-FIRST-FRAME probes, flagged, fanned, boxed, region-copy draws, boxed \ + vertex work {seen:?}; {made} made at the step" + ); + if boxes(&workload.device) { + assert_eq!(seen[3], BOXED, "draws boxed {seen:?}"); + } + assert_eq!(made, 0, "pipelines the host step made"); +} diff --git a/crates/metal2vulkan-runtime/src/tests/rate_mapped_fan_out.rs b/crates/metal2vulkan-runtime/src/tests/rate_mapped_fan_out.rs index cbaff8bcc..c41713b27 100644 --- a/crates/metal2vulkan-runtime/src/tests/rate_mapped_fan_out.rs +++ b/crates/metal2vulkan-runtime/src/tests/rate_mapped_fan_out.rs @@ -706,10 +706,14 @@ fn a_host_steps_first_frame_makes_no_pipeline() { let boxed = after.rate_map_boxed_draws - before.rate_map_boxed_draws; let copies = copy_counts(&before, &after); let ranges = after.rate_map_index_ranges - before.rate_map_index_ranges; + // The regions a command of the regions variant draws at a time, where it draws several + // (`region_batch`). + let batch = (workload.device.shared().multi_draws.as_ref()).map(|multi| multi.batch()); eprintln!( "RATE-MAP-FIRST-FRAME {name}: {at_step} made at the step; counts {counts:?}; \ fan-out pipelines {ready} ready, {waited} waited for; {boxed} boxed draws; \ - region-copy draws and recordings {copies:?}; {ranges} index ranges" + region-copy draws and recordings {copies:?}; {ranges} index ranges; regions a \ + multi-draw takes {batch:?}" ); let (drawn, _, _) = workload.frame(false); let (differ, first) = differing(&drawn, &executed);