From b04d0a8a31c672602ba24bf636fba229c2031702 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Mon, 9 Nov 2026 00:57:57 -0800 Subject: [PATCH] RUNTIME_VERSION 1959 and the runtime-sources pin for the exit hook after a program's own instance The two commits before this are ownpixel's fix of the lavapipe runtime-lane exit SIGSEGV. - Cause: a VkInstance the program makes itself (Device::from_raw's adopted devices, the validation candidate engine) registers the validation layer's ApplicationAtExit after the runtime's exit hook. Exit handlers run LIFO, so the layer tore its per-device state down first, while runtime threads were still inside it. - Fix: the new public metal2vulkan_runtime::program_instance_made() registers the hook again after a program's own vkCreateInstance, and Device::from_raw calls it for an adopted device's instance. - The new test checks the order directly, without relying on a crash: the program's handler must see process_exiting() == true. - The NVIDIA exit known gap is a different mechanism (the driver's own worker against libEGL_nvidia's handler, no runtime section in progress) and stays. RUNTIME_VERSION goes 1958 -> 1959, and the runtime-sources pin is recomputed: a4bdf2ba5041a01ec31781e65adf27602dc005de13b85abb7cfd64559d64fed3. Verified at 6f24b49f16 (on bb8c60238b) by ownpixel, M3 MoltenVK 11283: - the negative control (adopt.rs at the base, an empty program_instance_made) fails with "the layer's handler ran before the hook: hook_ran=0"; - with the fix, both cases pass 3/3; - exits, presenting, heap_textures, view_reinterpretation and tests::exit_guard 87/87; - gpu clippy clean. Probe (M3, 20 child exits a case): no program instance 20/20 clean; a program instance with the layer aborted in GetDeviceFromKey 2/20 and 3/20. Still running: lavapipe 11284 and rustdoc for the new links. The cherry-picks onto 67650c36a5 were clean; this tree is not yet built. --- 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 a2aacab4d..f60868e0c 100644 --- a/crates/metal2vulkan-validation/runtime-sources.sha256 +++ b/crates/metal2vulkan-validation/runtime-sources.sha256 @@ -1 +1 @@ -1ef99693110ba5ecc473862e3a456b2906480a1ec5d8699a457184a5eacc8fba +a4bdf2ba5041a01ec31781e65adf27602dc005de13b85abb7cfd64559d64fed3 diff --git a/crates/metal2vulkan/src/cache/mod.rs b/crates/metal2vulkan/src/cache/mod.rs index a19ec97bb..28e7b51d6 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 = 497; /// 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 = 1958; +pub const RUNTIME_VERSION: u32 = 1959; /// 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