From 9081edca8e1b333cdcb6ceae2e6c004f86fde177 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 12 Nov 2026 04:00:12 -0800 Subject: [PATCH] Keep the plugin list a refusal; compare the typed fixture's module words The empty !gld.plugin_info list is what this Mac's (macOS 27) OpenGL front end writes, and its modules then stop at other module-level shapes (an `OpenGL GLSL` language version beside Metal's, repeated versions, contradictory compile options); the guests' modules, from macOS 26, reached the entries. So the module-level shapes stay refusals, and only the two entry shapes the guests met change. The engine test compares FunctionArtifact::module.words. --- crates/metal2vulkan-air/src/abi/module.rs | 9 --------- crates/metal2vulkan-air/src/abi/tests.rs | 17 ----------------- .../src/tests/engine_read_through_constant.rs | 2 +- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/crates/metal2vulkan-air/src/abi/module.rs b/crates/metal2vulkan-air/src/abi/module.rs index 84aa7dcc9..fb46d7083 100644 --- a/crates/metal2vulkan-air/src/abi/module.rs +++ b/crates/metal2vulkan-air/src/abi/module.rs @@ -39,7 +39,6 @@ enum Named { WorkingDirectory, RecordedSources, DebugCompileUnits, - GlPluginInfo, } const NAMED: &[(&str, Named)] = &[ @@ -67,7 +66,6 @@ const NAMED: &[(&str, Named)] = &[ ("llvm_utils.workingdir", Named::WorkingDirectory), ("llvm_utils.sources", Named::RecordedSources), ("llvm.dbg.cu", Named::DebugCompileUnits), - ("gld.plugin_info", Named::GlPluginInfo), ]; /// Apple's named list of a module's program-scope buffer bindings (MSL 3.2): each entry @@ -193,13 +191,6 @@ pub(super) fn decode( } } } - // Apple's OpenGL front end names an empty list here in every module it writes. What - // an entry of it would say is unknown, so one is refused as a key outside the contract. - Named::GlPluginInfo => { - if !ops.is_empty() { - return Err(site.err(AbiError::UnknownKey, Some("gld.plugin_info"))); - } - } Named::Kernel | Named::Vertex | Named::Fragment | Named::Object | Named::Mesh => {} Named::FunctionConstants => { cx.meter.reserve(&mut abi.function_constants, ops.len())?; diff --git a/crates/metal2vulkan-air/src/abi/tests.rs b/crates/metal2vulkan-air/src/abi/tests.rs index c49808e13..40cea65df 100644 --- a/crates/metal2vulkan-air/src/abi/tests.rs +++ b/crates/metal2vulkan-air/src/abi/tests.rs @@ -2926,23 +2926,6 @@ fn debug_info_and_recorded_sources_leave_the_abi_unchanged() { assert_eq!(debug, plain); } -/// Apple's OpenGL front end adds an empty `!gld.plugin_info` list to every module it writes: the -/// module decodes to the ABI it has without it. An entry in the list says something unknown, and -/// is refused as a key outside the contract. -#[test] -fn an_empty_opengl_plugin_list_leaves_the_abi_unchanged() { - let plain = module_with(|_| {}).unwrap(); - let listed = module_with(|b| b.named_md("gld.plugin_info", &[])).unwrap(); - assert_eq!(listed, plain); - expect_abi( - module_with(|b| { - let n = node(b, &[S("plugin")]); - b.named_md("gld.plugin_info", &[n]); - }), - AbiError::UnknownKey, - ); -} - /// The debug-info and recorded-source lists are read by their shapes: a compile unit that is not a /// debug-info record, a recorded source without its text, or a file that is not a node is refused. #[test] diff --git a/crates/metal2vulkan/src/tests/engine_read_through_constant.rs b/crates/metal2vulkan/src/tests/engine_read_through_constant.rs index 7b043cb3e..512497612 100644 --- a/crates/metal2vulkan/src/tests/engine_read_through_constant.rs +++ b/crates/metal2vulkan/src/tests/engine_read_through_constant.rs @@ -129,6 +129,6 @@ fn the_typed_fixture_compiles_as_its_opaque_form_does() { let [typed, opaque] = [&typed, &opaque].map(|bc| { compile(bc, "read_through_constant", &p).unwrap_or_else(|e| panic!("{stem}: {e}")) }); - assert_eq!(typed.spirv, opaque.spirv, "{stem}"); + assert_eq!(typed.module.words, opaque.module.words, "{stem}"); } }