Skip to content

test(agc): enable VK_KHR_portability_subset in the tests that create their own device - #10920

Open
maximilianfv wants to merge 1 commit into
boykopovar:mainfrom
maximilianfv:test/agc-portability-subset-test-devices
Open

maximilianfv wants to merge 1 commit into
boykopovar:mainfrom
maximilianfv:test/agc-portability-subset-test-devices

Conversation

@maximilianfv

Copy link
Copy Markdown
Contributor

What

Thirteen AGC tests create their own Vulkan device with vkCreateDevice: BdaDevice.cpp, PerformanceOverlay.cpp, PresentationPass.cpp, Recorder.cpp and, under tests/execution/, DepthPlaneGuestLayers.cpp, DepthStorage.cpp, DepthSurfaceLastWriter.cpp, NativeMultisampleDepth.cpp, OversizedDescriptorSets.cpp, PartiallyResidentSnapshot.cpp, PooledBufferRange.cpp, SampledCacheBudget.cpp and SparseBufferHoles.cpp. None of them enables VK_KHR_portability_subset, which the spec requires whenever the physical device advertises it, so on MoltenVK each of these devices logs VUID-VkDeviceCreateInfo-pProperties-04451. Four of them (BdaDevice.cpp, Recorder.cpp, OversizedDescriptorSets.cpp, SampledCacheBudget.cpp) do not yet request portability enumeration at instance creation on main, so there the loader does not show them MoltenVK and the helper does nothing until they do; mugurc's macOS series adds that instance flag.

Enabling the extension alone is not enough: every subset feature then counts as off, so VkPhysicalDevicePortabilitySubsetFeaturesKHR with the values the device reports must be chained into VkDeviceCreateInfo as well.

A new test header, tests/PortabilitySubset.hpp, enumerates the device extensions. When the subset is advertised, it adds the extension, queries the subset features with vkGetPhysicalDeviceFeatures2 (all thirteen instances are Vulkan 1.1) and chains them into VkDeviceCreateInfo. In every case it sets the extension count and names from the test's extension vector. On a device without the subset it only does that. The subset struct and its sType are guarded by VK_ENABLE_BETA_EXTENSIONS in the Vulkan headers, so the CMake change defines it for these thirteen sources only. In DepthPlaneGuestLayers.cpp and PartiallyResidentSnapshot.cpp, the const std::array extension list became a std::vector so the helper can append to it. In PerformanceOverlay.cpp the optional memory-budget extension is now pushed into a vector instead of being passed through a pointer. The tests that enabled no extensions now pass an empty vector.

VulkanDevice.cpp is not touched. On main it does not enable the subset. mugurc's macOS series enables it there without chaining the features (20ee39d, "feat(agc): create the Vulkan device on MoltenVK"), and that part is left to the series.

Prior work and credit:

No code was ported from any of these.

Tested

Apple M1 Pro, macOS 27.0.1, x86_64 build under Rosetta 2, Vulkan through MoltenVK from the LunarG Vulkan SDK 1.4.363. main alone does not build on macOS, so the tree is mugurc's macOS series (ci/macos-series-2, 27e9689) merged with main at 2742004, plus other open macOS fixes. Only this change was toggled. Both runs used ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and ctest -V on the 103 tests that these thirteen binaries run.

passed skipped failed Validation Error lines pProperties-04451 imageViewFormatSwizzle-04465
without this change 99 1 3 99 95 4
with this change 99 1 3 4 0 4

The skipped test is agc_driver_oversized_descriptor_sets (the device binds fewer than 4097 storage buffers per stage or set). It still creates the changed device before it skips, and its 04451 is gone with the change.

  • The same three tests fail in both runs, for reasons unrelated to this change:
  • The four 04465 errors come from the same four tests in both runs: agc_driver_native_multisample_depth, agc_driver_native_depth_retirement, agc_driver_native_depth_clears and agc_driver_native_depth_clear_refusals. Without this change no test device enables the subset, so these errors come from the driver's own device in the macOS series, not from the devices this PR changes.
  • No was not found but was requested by env var VK_INSTANCE_LAYERS line appears in either log, and the change adds no new VUID-.

I could not run the same tests on main because main does not build on macOS. Linux and Windows were not tested. Native drivers there don't advertise the portability subset, so the change only rebuilds the extension list; a device that does advertise it gets the same handling as MoltenVK.

uv run tools/check_conventions.py --base origin/main passes.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: Apple M1 Pro, MoltenVK (LunarG Vulkan SDK 1.4.363), macOS 27.0.1
  • AI-assisted: yes

🤖 Generated with Claude Code

…their own device

Thirteen AGC tests create their own Vulkan device and never enable
VK_KHR_portability_subset, which the spec requires when the physical
device advertises it, so on MoltenVK every one of them logs
VUID-VkDeviceCreateInfo-pProperties-04451. Enabling the extension alone
turns every subset feature off, so the features the device reports must
also be chained into VkDeviceCreateInfo. A shared test helper enumerates
the device extensions, and when the subset is advertised enables it and
chains the reported VkPhysicalDevicePortabilitySubsetFeaturesKHR; on
other devices it only sets the extension list. The beta header is
enabled for these thirteen sources only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MarcZX10

Copy link
Copy Markdown
Contributor

One device-selection path appears to miss the macOS portability-enumeration setup. In NativeMultisampleDepth.cpp, the instance is created with VK_API_VERSION_1_1, but unlike the other changed fixtures it does not enable VK_KHR_portability_enumeration / VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR under __APPLE__ (see the VkInstanceCreateInfo setup near the top of Device). The Vulkan loader omits portability-subset physical devices unless that instance extension and flag are enabled, so on MoltenVK this test may never select the device and PortabilitySubset::Enable cannot run. Could you confirm whether this test is already covered by a shared instance helper or add the same opt-in here? I also noticed the helper treats VK_INCOMPLETE from its second vkEnumerateDeviceExtensionProperties call as failure; that is a valid return if the extension list grows between calls, though it may be less likely in this test environment.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the changed device-creation paths and ran the repository convention check and diff whitespace validation. One macOS device-enumeration gap is described in the review comment below; I am holding approval until it is addressed or explained.

@maximilianfv

Copy link
Copy Markdown
Contributor Author

@MarcZX10 That fixture already enables portability enumeration on macOS. It just isn't in this diff, because main has had it all along. At this head, NativeMultisampleDepth.cpp#L72-L77 has:

#ifdef __APPLE__
            const char* portability = VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME;
            info.flags = VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR;
            info.enabledExtensionCount = 1;
            info.ppEnabledExtensionNames = &portability;
#endif

This PR only adds the device-side PortabilitySubset::Enable call before vkCreateDevice (L110-L113), as it does in the other fixtures.

@MarcZX10

Copy link
Copy Markdown
Contributor

Thanks for pointing me to the unchanged setup in main; I checked the exact head and confirmed the fixture already enables both the extension and flag. My first point was incorrect, so please disregard it. The VK_INCOMPLETE observation is only a defensive edge case in extension enumeration and does not block this change. I have no remaining review concern from that comment.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the exact head e04a7ecf48b09d18278073319e67770c64486f58 and the portability-subset feature-chain change. The changed fixtures add VkPhysicalDevicePortabilitySubsetFeaturesKHR to the device-create pNext chain before vkCreateDevice; PortabilitySubset::Enable checks the extension and supported feature bits before adding the extension to the create info. I initially flagged NativeMultisampleDepth.cpp, then verified its macOS instance portability-enumeration extension and flag already exist on main and withdrew that point. git diff --check and python3 tools/check_conventions.py --base upstream/main --head upstream/pr-10920 pass. The available hosted eligibility, conventions, intake, labels, and report checks pass; product test jobs are skipped by path filters, so I am not claiming a runtime test from CI. I found no remaining blocking issue in this focused review.

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 862 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1896 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4448 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/BdaDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/OversizedDescriptorSets.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6146 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6187 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6209 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 6970 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6987 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 6989 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 6995 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 7002 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 7085 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7275 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7457 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7508 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7514 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/PresentationPass.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
PR 7689 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8089 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8246 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8484 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 8592 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8707 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9012 core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
PR 9289 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9508 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/PresentationPass.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
PR 9712 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9852 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9875 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9884 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
PR 9950 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 9999 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10043 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/PerformanceOverlay.cpp
core/libs/prx/libSceAgcDriver/tests/PresentationPass.cpp
PR 10049 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10064 core/libs/prx/libSceAgcDriver/tests/execution/PartiallyResidentSnapshot.cpp
PR 10193 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/PresentationPass.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
PR 10233 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10359 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10442 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10443 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10469 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 10492 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 10497 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 10757 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11444 core/libs/prx/libSceAgcDriver/tests/execution/PartiallyResidentSnapshot.cpp
PR 11485 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 12324 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12575 core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
PR 12745 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
PR 12746 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12828 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12840 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 12855 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12994 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 13023 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 13148 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 13251 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 13263 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 13486 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/BdaDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/OversizedDescriptorSets.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
PR 13707 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 13793 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 13809 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 13863 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 13920 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 13928 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/PresentationPass.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
PR 13929 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/PresentationPass.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
PR 13963 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 14051 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 14084 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 14262 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 14330 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 15015 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 15136 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 15169 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 15398 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 15423 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 15443 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 15446 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 15456 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 15529 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 15570 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 15572 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 15574 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 15688 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 15690 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 15707 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 15719 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 15750 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 15792 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 15941 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 15986 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 16021 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 16086 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 16168 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 16251 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 16286 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 16301 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 16363 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 16364 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 16365 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rechecked exact head e04a7ecf48b09d18278073319e67770c64486f58 after your reply. The existing NativeMultisampleDepth.cpp setup already enables the instance portability-enumeration flag and extension; your correction is accurate, and my earlier comment on that file was mistaken.

I also reran git diff --check upstream/main...upstream/pr-10920 and python3 tools/check_conventions.py --base upstream/main --head upstream/pr-10920; both pass. The focused test change is still awaiting a runnable Vulkan-host validation on a portability-subset device. The added helper appends the reported extension and queries/enables its feature struct; most call sites chain that struct ahead of the previous feature chain. In Recorder.cpp, however, the preexisting feature chain includes BDA/8-bit-storage and optionally dynamic-rendering, GPL, descriptor-indexing and robustness2 structs. Please confirm on an advertised-subset device that the final chain retains all of those entries and the selected feature values, since Enable() inserts the portability struct by rewriting its own pNext and device.pNext.

No product suite was run locally here. Hosted build/product paths are skipped for this test-only change, so I am leaving this as a comment pending that portability-device validation rather than approving from the policy checks alone.

@maximilianfv

Copy link
Copy Markdown
Contributor Author

@MarcZX10 thanks for rechecking. The validation on a portability-subset device is the Tested section: Apple M1 Pro, MoltenVK from the Vulkan SDK 1.4.363, with the Khronos validation layer loaded, ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1, ctest -V on all 103 tests these thirteen binaries run, with and without the change.

For Recorder.cpp specifically, since its chain is the longest: agc_driver_recorder_tests runs 69 of those tests. All 69 pass with and without the change. Without it they log 64 VUID-VkDeviceCreateInfo-pProperties-04451 errors; with it they log 0, and no other validation error appears in either run. The subset struct goes in front of the existing chain (features.pNext = device.pNext; device.pNext = &features;), so the BDA, 8-bit storage, dynamic rendering, GPL, descriptor indexing and robustness2 structs behind it reach vkCreateDevice unchanged.

@github-actions github-actions Bot added build agc libSceAgc* labels Oct 25, 2026
@MarcZX10

Copy link
Copy Markdown
Contributor

Thanks for the detailed exact-device report. I verified the helper links features.pNext to the original device.pNext before replacing the head, so the BDA, 8-bit storage and optional feature structs remain in the chain. The M1 Pro/MoltenVK validation results (69 recorder tests, 64 portability VUIDs without the change and zero with it) resolve my remaining concern. I have no blocking review findings on this head.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head e04a7ecf48b09d18278073319e67770c64486f58. The portability-subset helper preserves the existing pNext chain and enables the extension only when advertised. The author's M1 Pro/MoltenVK validation compares all 103 tests run by the affected binaries with and without the change; the recorder's 69 tests drop from 64 portability VUIDs to zero, with no new VUIDs. My earlier NativeMultisampleDepth setup concern was incorrect because the unchanged base already enables instance portability enumeration. git diff --check and check_conventions.py pass. Product CI jobs are skipped by path filters; the GPU validation above is author-reported, not independently rerun here.

@Gonic0

Gonic0 commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Repeated your run on an M5 Pro, macOS 27.2 (26B5086k), x86_64 Release under Rosetta 2, MoltenVK and the validation layer from the LunarG SDK 1.4.363, same env (ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ctest -V).

Base is ci/macos-series-2 (27e9689743) alone, not merged with main, so these thirteen binaries run 89 tests here instead of 103. On that base the fixtures still load libvulkan.so.1 and don't request portability enumeration, so for both runs I put a libvulkan.so.1 symlink to the SDK's libvulkan.1.dylib on DYLD_LIBRARY_PATH and used a copy of the MoltenVK ICD JSON with is_portability_driver: false. The device still advertises VK_KHR_portability_subset. Only e04a7ecf48 was toggled; on this base PresentationPass.cpp and Recorder.cpp needed just the PortabilitySubset.hpp include, and the rest applied as is.

passed skipped failed Validation Error lines pProperties-04451 imageViewFormatSwizzle-04465
without this change 86 1 2 85 81 4
with this change 86 1 2 4 0 4
  • Every test has the same result in both runs.
  • The skip is agc_driver_oversized_descriptor_sets, for the same reason as yours (fewer than 4097 storage buffers per stage or set).
  • The failures are the same two as yours: agc_performance_overlay (the process's private memory can't be read) and agc_driver_pooled_buffer_range (a robust read returns 0xabababab). agc_driver_recover_srgb_allocation isn't among the tests on this base.
  • The four 04465 come from the same four tests as yours: agc_driver_native_multisample_depth, agc_driver_native_depth_retirement, agc_driver_native_depth_clears and agc_driver_native_depth_clear_refusals.
  • No other VUID- appears in either run, and the layer always loaded.

AI-assisted: yes

@ycbuzi

ycbuzi commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

A Windows run of this head on three GPUs: Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release. e04a7ecf48 merged onto main 5b85225ef3 with no conflicts.

The test set is the 124 tests whose executables compile the changed test sources. One GPU at a time with ANYPS5_GPU, plus ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1, run with ctest -V --repeat until-fail:2. Every log's Selected GPU / Vulkan device: lines name the device in its row.

device result
GeForce RTX 4070 SUPER (0x2783), NVIDIA 616.92 123 of 124 pass
GeForce GTX 1650 SUPER (0x2187), NVIDIA 616.92 123 of 124 pass
AMD Radeon(TM) Graphics (1002:164e, RDNA2 iGPU), AMD 32.0.21030.2001 123 of 124 pass

No negative control: this PR changes only tests.

AI-assisted: yes (Claude Code)

@jotitadev jotitadev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build report on Apple silicon at head e04a7ecf48: on current main the nine tests/execution/ sources this PR changes no longer compile, because of the shared precompiled header that #10164 added after this branch's last push.

Machine: Apple M2 Max, macOS 27.2, Apple clang 21 (Xcode 27), x86_64 Release under Rosetta 2, Ninja, BUILD_TESTING=ON.
Tree: main 27ad7244d2 with the open macOS build PRs merged on top (#10366, #7631, #10659, #10660, #11249, #11358, #11047, #11048, #10669, #9263, #8477, #10876, #10552, #7804, #10540, #10676, #11447, #11437, #11554, #11119, #11049), plus this PR, which merges cleanly. That isn't plain main, but main alone doesn't build libkernel on macOS, and none of those PRs touches the execution tests or the PCH.

All nine changed execution tests fail the same way (DepthPlaneGuestLayers, DepthStorage, DepthSurfaceLastWriter, NativeMultisampleDepth, OversizedDescriptorSets, PartiallyResidentSnapshot, PooledBufferRange, SampledCacheBudget, SparseBufferHoles):

tests/execution/../PortabilitySubset.hpp:14:5: error: unknown type name 'VkPhysicalDevicePortabilitySubsetFeaturesKHR'
tests/execution/../PortabilitySubset.hpp:14:59: error: use of undeclared identifier 'VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR'
tests/execution/../PortabilitySubset.hpp:23:92: error: use of undeclared identifier 'VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME'

The compile line does have -DVK_ENABLE_BETA_EXTENSIONS. Since 3fe7aaf3b4, though, every execution test reuses one PCH (REUSE_FROM the first execution target), and that PCH includes VulkanTestDevice.hpp, so <vulkan/vulkan.h>, without the define. By the time the source is compiled, the Vulkan headers have already been included without the beta part, and their include guards keep it out. Clang uses the PCH and doesn't warn that the macro differs. I haven't checked how GCC handles it.

Including <vulkan/vulkan_beta.h> in PortabilitySubset.hpp isn't enough: it supplies the struct and the extension name, but the VkStructureType value is in vulkan_core.h under the same define. What did work: defining it for every execution test, so the shared PCH is built with it too. I added it in the foreach loop that creates the execution tests (the per-source property can then drop the nine execution sources):

    target_compile_definitions(${agcExecutionTest} PRIVATE VK_ENABLE_BETA_EXTENSIONS)

With that, the nine sources and the whole tree build again; the only remaining failures are two core/libs/tests objects that this PR doesn't touch. The four non-execution sources (BdaDevice.cpp, PerformanceOverlay.cpp, PresentationPass.cpp, Recorder.cpp) don't use the shared PCH, so their per-source property still works.

I haven't run the changed tests on the GPU in this tree yet.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@maximilianfv this needs a merge of main now, and jotitadev's build report above points at a real problem with the merged tree. Since #10164, every tests/execution/ test reuses one precompiled header (target_precompile_headers(... REUSE_FROM ...) in libSceAgcDriver/CMakeLists.txt). That header includes <vulkan/vulkan.h> without VK_ENABLE_BETA_EXTENSIONS, so the per-source COMPILE_DEFINITIONS this PR adds never reaches the Vulkan headers for those nine files, and PortabilitySubset.hpp can't see the portability-subset types. Clang fails on all nine.

Could you merge main and move the define to the target in the execution-test loop, as jotitadev did: target_compile_definitions(${agcExecutionTest} PRIVATE VK_ENABLE_BETA_EXTENSIONS)? Then the nine execution sources can leave the per-source property; the four non-execution tests can keep it. We'll recheck once it's pushed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build needs rebase Conflicts with main, rebase needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants