From 894eb35c205f4fd846c1ff4deef83cb5bf5ffec4 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 12 Nov 2026 06:33:09 -0800 Subject: [PATCH] RUNTIME_VERSION 2116: a residency's copies share what it made resident, and its kept key is listed once The commit before this one. A host step copied the command buffer's Residency for each execution and listed every resident key into a fresh BTreeSet each time, so a step's cost grew with the resident heap textures times the executions (reims's forward-rendering sample on the Iris: host_step_nanos per step 4.3 -> 9.2 ms over the run). Now the copies share the resources through an Arc changed with Arc::make_mut; Residency::kept_key is listed once per residency content and again only when host cells move, the device's views_epoch changes or an ICB slot hold changes (debug builds check the kept listing against a fresh one); the attachment test looks up the sorted keys. New counter WorkCounts::resident_kept_keys_listed. Verified: lane test a_host_step_lists_its_residency_once_for_every_execution (4 executions a frame, 64 heap textures, 71 resident: frames 1-3 list at most 2x71) passes with 147/147 lanes on lavapipe (m3-max-21020) and fails with the listing forced (284 listed in frame 1, m3-max-21030); release probe, 2400 resident heap textures, median ms a step for 1/4/16 executions a pass: 0.57/1.67/6.07 and 0.56/1.71/5.72 before (m3-max-20992), 0.49/1.18/4.01 and 0.53/1.27/3.72 after (m3-max-21007); clippy all features, runtime alone, --cfg m2v_gpu, rustdoc, runtime suite 1488/1488 (m3-max-21037); api_signatures/api_surface 15/15, conformance cost 17/17 (m3-max-21058). The host-step lanes at the landing tip carry RV 2115's check_variant failure (m3-max-21056 on fbb1f7c6bb itself), fixed separately. --- 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 eb26605e6..2f8beaa2f 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 = 505; /// 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 = 2115; +pub const RUNTIME_VERSION: u32 = 2116; /// 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