From c19efa540d2ef29638fe5687b86d90cf6ba5aa45 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Wed, 11 Nov 2026 19:10:53 -0800 Subject: [PATCH] RUNTIME_VERSION 2075: records carry a compute state's dispatches, and the warm pass makes their pipelines The two commits before this one. A compute state whose descriptor requires no threadgroup size predicts no VkPipeline at its creation: the local size and the threadgroup memory lengths come from the dispatch. So its creation's record warmed none of its dispatches' pipelines, and each was a cold driver compile at the program's first dispatch of that shape. On the Iris Xe these are the compute kernels FAST-PATHS names. Now a compute state's direct dispatch (dispatchThreadgroups: or dispatchThreads:) whose regions' pipelines weren't all made hands the record hook one more record. It holds the creation's descriptor and the dispatch: the threadgroup size, a dispatchThreads: grid cut down to one whole threadgroup plus its ragged edge per axis, and the encoder's threadgroup memory lengths. Each dispatch shape is recorded once per state, at most 16 per state (pipeline/dispatch_record.rs). The warm pass creates the state, plans each recorded dispatch with nothing bound and the recorded lengths, settles its variant through compute::settle_direct as the program's direct dispatch does, and makes each region's VkPipeline on the pass thread. The program's making is then handed the driver cache the pass filled. WarmStatistics::dispatch_pipelines_warmed counts them. Indirect dispatches, threadgroup-range dispatches and tile dispatches record nothing. The record format goes from 6 to 7; a format-6 record reads as none. The codec caps a record at 16 dispatches and 31 lengths each, on write and on read. The warm budget is unchanged. Not covered: the program's dispatch still calls vkCreateComputePipelines (warm states share no live variant with the program), and a dispatch whose bindings specialize its regions still makes its own pipelines at first dispatch. Verified (potluck jobs, on the branch at 42d9d77e54): - lavapipe (m3-max-18386): 50/50, the warm, warm_record, dispatch_pending, dispatch_making, deferred_calls, driver_pipeline_compile and creation_log tests. The new device test: on a device warmed with both records, records_warmed 2 and dispatch_pipelines_warmed 1, and the program's first dispatch gave [makings handed a cache the device held, pipelines made, functions translated] = [1, 1, 0]; on a control warmed with the creation's record alone, [0, 1, 0] and 0. lavapipe reported 0 driver hits and 1 miss on both devices; the cache sharing is the only structural check there. - An earlier run (18374) caught the pass making 2 pipelines the program never asks for (settled through ComputePipelineState::settle alone); 42d9d77e54 fixes it. - Lint (18388): fmt check, clippy in all three configurations, rustdoc, api_signatures and api_surface 15/15, fast_paths 27/27, warm_record 5/5. Not yet run: a driver hit on a real GPU (the Iris run is queued). --- crates/metal2vulkan/src/cache/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/metal2vulkan/src/cache/mod.rs b/crates/metal2vulkan/src/cache/mod.rs index aac7785b9..d8ef0b5a2 100644 --- a/crates/metal2vulkan/src/cache/mod.rs +++ b/crates/metal2vulkan/src/cache/mod.rs @@ -93,7 +93,7 @@ pub const ARTIFACT_FORMAT_VERSION: u32 = 502; /// changes no behaviour, and then updates that hash alone with the commit saying why, or changes /// behaviour and also bumps this version. The commit that bumps it says what changed; this comment /// keeps no history. -pub const RUNTIME_VERSION: u32 = 2074; +pub const RUNTIME_VERSION: u32 = 2075; /// The digest of the sources this build of the crate was compiled from: SHA-256, as lowercase hex, /// of the manifest, the build script, and exactly the files the crate roots' module tree compiles