mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:00:52 +01:00
[PR #2178] macOS: through the Vulkan loader, the test tools opt in to portability enumeration; validation runs on MoltenVK (TEST-MAC-LOADER-PORTABILITY) #2181
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2181
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2178
Author: @Tauwni
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/mac-loader-portability-enumeration📝 Commits (4)
dfad849macOS: through the Vulkan loader, the test tools opt in to portability enumeration, so MoltenVK is foundde37175docs/testing.md: the three validation messages MoltenVK 1.4.2 reports that are not failures, and the filter000258edocs/testing.md: link the MoltenVK issue for its vkGetDescriptorSetLayoutSupport count5b835b6Merge main into fix/mac-loader-portability-enumeration📊 Changes
4 files changed (+190 additions, -2 deletions)
View changed files
📝
docs/testing.md(+16 -1)📝
runtime/test/vulkan_loader.h(+100 -1)📝
tests/test_vk_subgroup_info.py(+38 -0)📝
tools/vk_subgroup_info.py(+36 -0)📄 Description
Claimed in the coordination issue as: TEST-MAC-LOADER-PORTABILITY (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7180966128)
What and why
On a Mac, the test tools open MoltenVK directly, which can't load layers. The way to run with
LEONIDA_VK_VALIDATION=1isLEONIDA_VULKAN_LOADER, the standard loader. But behind the loader, MoltenVK is a portability driver:VK_KHR_portability_enumerationandVK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR;VK_KHR_portability_subset.None of the tools asked for either, so through the loader they found no device:
tools/vk_subgroup_info.pyreturnedvkCreateInstance failed (-9)instead, sorun_gpu_tests.pylost the probes it reads (per_vertex_inputs, among others). In practice, validation couldn't run on MoltenVK.runtime/test/vulkan_loader.h: whenLEONIDA_VULKAN_LOADERis set on macOS,load_vulkan()returns avkGetInstanceProcAddrwrapper. It wrapsvkCreateInstance, adding the extension and its flag where the loader offers them, andvkCreateDevice, addingVK_KHR_portability_subsetwhere the device offers it. Everything else goes to the loader unchanged. Every tool gets this fromload_vulkan(), so no tool changes.tools/vk_subgroup_info.py: the same instance opt-in, plus 2 unit tests.docs/testing.md: how to run with validation on a Mac.Tested
Apple M3, macOS 26.5.1,
mainad41fd517+ this commit, Vulkan loader 1.4.363 and validation layers from Homebrew:run_gpu_tests.py193/268. That's the same failures as direct MoltenVK onmain(cs_fma_fused,cs_imgatomic_ext,ps_ssharp,ps_array_resinfo,ps_get_lod_array), with open fixes in #1724, #1518, #1774 and #2169. ctest 106/106 both ways.main).tests/test_vk_subgroup_info.py(57 tests),test_make_game_translator_flags.py,test_make_game_wave64.pyand the docs tests: OK.What validation reports on MoltenVK, now that it can run (the runtime is unchanged;
docs/testing.mdnow lists these and the filter, see the update below):VUID-RuntimeSpirv-shaderDenormPreserveFloat16-06296. That is the documentedDenormPreserve 16trade-off (design.md, "Float controls (f16 denormals)"): MoltenVK reportsshaderDenormPreserveFloat16false.vk_bindless_grow,vk_null_descriptor,vk_bindless_test:VUID-vkCreateDescriptorSetLayout-support-09582. The bindless set layout has 11777 descriptors, against MoltenVK'smaxPerSetDescriptorsof 1212, andvkGetDescriptorSetLayoutSupportanswers false for it.size_bindingskeeps the default counts above that limit on purpose ("it never shrinks step 1"). The draws pass, but the layout is outside the spec on MoltenVK.Update (
de37175f5,000258e00, thenmainmerged):docs/testing.mdlists the three validation messages MoltenVK 1.4.2 reports that are not test failures, plus theVK_LAYER_MESSAGE_ID_FILTERthat hides them:06296andVUID-VkShaderModuleCreateInfo-pCode-08740: theDenormPreserve 16trade-off;09582: MoltenVK's own count,4 × (31 + 256 + 16) = 1212, which ignores argument buffers (KhronosGroup/MoltenVK#2573).With the filter,
vk_bindless_test,vk_bindless_grow_testandvk_null_descriptor_testpass under validation. So does the wholerun_gpu_tests.pysuite atmaina73a57e13(195/268, the same three failures as without validation).GPUs tested: Apple M3 (10-core GPU), MoltenVK 1.4.2 and KosmicKrisp (Mesa 26.3.1), macOS 26.5.1 (25F80); llvmpipe (Mesa 26.3.1)
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.