test(agc): keep the import-probe hook one-shot on libc++ #10857
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10857"
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?
Imported from boykopovar/AnyPS5. Originally posted by maximilianfv on 2026-10-25T05:51:17Z.
What
agc_driver_graphicshangs until the test timeout on macOS. The cause is in the test helper, not in the driver.ImportAllocationProbe::Allocateincore/libs/prx/libSceAgcDriver/tests/BdaResources.cpptakes theonImporthook withstd::moveand then calls it. The standard leaves the state of a moved-fromstd::functionunspecified. libstdc++ and MSVC leave it empty. libc++ leaves a small stored functor in place, so the hook is still callable:importMappedFailureGenerationTestsregisters an unrelated range from the hook.HostImportForholds the guest buffer memory mutex (state.mutex, not recursive).GuestAllocationsRequireUnpinned,WaitForLeasesAndImportsandreleaseParkedImports, which locksstate.mutexagain on the same thread, and the thread deadlocks.This change takes the hook with
std::exchange(active->onImport, nullptr), which leaves it empty on every standard library, and includes<utility>. It changes only test code. On Linux and Windows the behaviour does not change, because their moved-fromstd::functionwas already empty.Ported from Himansh Raj's commit
c932f1072b"test(agc): keep the import-probe hook one-shot on macOS" (2026-10-21) in #8658, the closed whole macOS port; the commit carries aCo-authored-by:trailer for him. That commit found the same deadlock and cleared the hook after the move, under#ifdef __APPLE__and with a code comment. This version is unconditional and has no comment. None of the PRs #8658 was split into (#10362, #10419) carries this change. No other open or closed PR touchesonImport, apart from #8802, which added the hook.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.
mainalone does not build on macOS. I tested in a tree made of mugurc's macOS series (ci/macos-series-2, 27e968974) merged withmainat522e32e3b6. The tree also has the other open macOS fixes of this series: #10540, #10562, #10641, #10642, #10650, #10651, #10652 and the build parts of #10419. Only this change was toggled between the runs.Both runs used
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandctest -R '^agc_driver_graphics$' -E 'audio_in|voice' --timeout 420 -V.agc_driver_graphicstimes out after 420.05 s.Validation Errorline or awas not found but was requested by env var VK_INSTANCE_LAYERSline.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T05:53:38Z.
Review: APPROVED
Reviewed exact head
f0fee97510a202d780930f8aca146a5d4484f596against current main. The test hook is now removed fromactive->onImportwithstd::exchangebefore invocation, so callback behavior no longer depends on the unspecified state of a moved-fromstd::function. The returned callable is invoked exactly once, and<utility>supplies the exchange utility. Scope is limited to test support code; production code is unchanged.The PR reports a macOS/MoltenVK control where
agc_driver_graphicstimes out without the fix and passes 3/3 with it, with the validation layer present. I did not independently run the macOS test. Hosted eligibility, conventions, intake, labels and report checks pass; product jobs are skipped under repository policy. I found no blocker in this focused test portability fix.AI-assisted review: yes.
Imported from boykopovar/AnyPS5. Originally posted by imellag on 2026-10-25T07:16:07Z.
Review: APPROVED
Tested head
f0fee97510on Apple M4 Pro, macOS 27.0.1, Apple clang 21, x86-64 under Rosetta 2, MoltenVK from the Vulkan SDK 1.4.363.0.The tree is
main61fc572ceeplus the open macOS build PRs and the parts of mugurc's series that #7201 also carries; only this change was toggled. WithANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandctest -R '^agc_driver_graphics$' --timeout 420 -V:agc_driver_graphicstimes out after 420.04 s. I saw the same timeout yesterday on the previousmain.VUID-line orwas not found but was requested by env var VK_INSTANCE_LAYERS. WithVK_LOADER_DEBUG=allthe test prints no loader output, so it runs on the mocked device and the validation layer is not loaded here.AI-assisted: yes