From e4107afbf0fadf589efdcdfd85055c83e21a8065 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sat, 7 Nov 2026 16:38:40 -0800 Subject: [PATCH] Bump RUNTIME_VERSION to 1841: a commit copies in only the copied host buffers its commands use, and a copy reads its pages before its memory is made Lands steelbrain/orch-stitched-copies (cherry-picked a779b1824a..c5192a2cae): - a commit's copy in asks only the copies its command buffer's used keys reach (every copy where a command may reach memory no use names); merge back was already by written keys; - a few changed pages find the bytes they meet in a copy stitched from thousands of runs through an index of the runs by offset, not a walk of every run; - a copied host buffer reads the caller's pages before it maps its own memory, so a mapping the runtime makes cannot fill an unmapped page of the caller's and make a buffer Metal refuses. Verified, release, gem10 (m3-max-5734), the stitched bench (512 copies x 640 runs, 1280 MiB), base 018900246e vs fix, medians of 15, 3 alternating rounds: 0 pages written: 0.224 ms -> 0.003 (8 copies used) / 0.031 (every copy reached) 16 pages written: 1.21 ms -> 0.005 / 0.266 256 pages written: 2.37 ms -> 0.039 / 2.23 4096 pages written: 6.19 ms -> 0.156 / 6.0 Lavapipe (ms01 m3-max-5735): copied, dirty, host_ram_copy, host_memory, degrade_notices 154/154. M3 (m3-max-5724): host_memory's half-mapped refusal 0 failures in 20 (it failed before the fix). --- crates/metal2vulkan-validation/runtime-sources.sha256 | 2 +- crates/metal2vulkan/src/cache/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/metal2vulkan-validation/runtime-sources.sha256 b/crates/metal2vulkan-validation/runtime-sources.sha256 index 8998bc51f..f449024f2 100644 --- a/crates/metal2vulkan-validation/runtime-sources.sha256 +++ b/crates/metal2vulkan-validation/runtime-sources.sha256 @@ -1 +1 @@ -f8b11d81425e34aedaf4e6a3ecf968e9e9d8d2b87a0b9d7679522a2d7a246002 +115896f3ef08cf12fc1be2f9035215c82cdc5b970bc61fcd4c1857242bede4ea diff --git a/crates/metal2vulkan/src/cache/mod.rs b/crates/metal2vulkan/src/cache/mod.rs index ab56ce2e6..16d6dd8e3 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 = 493; /// 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 = 1840; +pub const RUNTIME_VERSION: u32 = 1841; /// 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