Skip to content

test(agc): catch the descriptor pool reset terminate on macOS - #13126

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
iamthehimansh:split/macos-pool-reset-terminate
Oct 30, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
iamthehimansh:split/macos-pool-reset-terminate

Conversation

@iamthehimansh

Copy link
Copy Markdown
Contributor

What

Next part of splitting #8658: agc_descriptor_pool_reset_failure aborts on macOS. The test makes the mock vkResetDescriptorPool return VK_ERROR_DEVICE_LOST, expects DescriptorCache::Free to end in std::terminate, and catches that with an exit handler set through the guest _ZSt13set_terminatePFvvE_nid_postfix. On Linux, libc routes the driver's std::terminate to that guest handler, so the test exits cleanly. On macOS that routing does not happen: the driver's std::terminate reaches the host libc++abi handler, which aborts.

On macOS the test now also installs the same exit handler with std::set_terminate around the Free call, and restores the previous one afterwards. Only the test changes, by 8 added lines in #ifdef __APPLE__; the driver is unchanged. Linux and Windows compile the same test as before.

I compared the added lines with all 1,453 open PRs. None carries this change; the only shared lines are }); and #endif, from #11551, #8874 and #5925.

Tested

Apple M2 Pro, macOS 26.6.2, x86_64 Release under Rosetta 2. Same base and the same build, with only tests/Graphics.cpp changed. The test function is identical to main at 08a10d225.

tests/Graphics.cpp agc_descriptor_pool_reset_failure
main fail 3/3 (Subprocess aborted)
this PR (7e659e7ea) pass 3/3

agc_descriptor_cache, from the same test binary, passes 3/3 with this change.

The base is my local macOS test base: main at b27cc8416 plus the open macOS build PRs and local patches listed in #11303.

Outside the __APPLE__ blocks, the file's text equals main for both unifdef -U__APPLE__ -D__linux__ and -D_WIN32. python3 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: n/a (mock Vulkan)
  • AI-assisted: yes (Cana)

agc_descriptor_pool_reset_failure makes vkResetDescriptorPool return
VK_ERROR_DEVICE_LOST and expects DescriptorCache::Free to end in
std::terminate, caught by a handler set through the guest
_ZSt13set_terminatePFvvE_nid_postfix. On Linux libc routes the driver's
std::terminate to that guest handler; on macOS it reaches the host
libc++abi handler instead, so the test aborted. On macOS the test now
also installs the same exit handler with std::set_terminate around the
Free call and restores it afterwards. The driver is unchanged.
@github-actions

github-actions Bot commented Oct 30, 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 1395 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6194 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6235 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6481 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6804 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6970 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7256 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7642 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7844 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8246 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9356 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9387 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9489 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9712 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9748 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9915 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10193 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10472 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp

@JJenkx

JJenkx commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Windows run of this head (7e659e7eab), merged onto main 9624d8c6bb (clean merge, local only). Windows 11 Enterprise 10.0.22621, Ryzen 9 5950X, WinLibs GCC 15.2.0 UCRT r7, Ninja, Release, BUILD_TESTING=ON, no Vulkan driver visible.

  • agc_address_copy_cap, agc_address_copy_cap_mirror, agc_address_copy_cap_remembered, agc_address_space_unwatched_mirror_import, agc_command_batch_fence_failure, agc_compute_descriptor_layout_flags, agc_copy_input_kept_bytes, agc_depth_copy_kept_bytes, agc_descriptor_cache, agc_descriptor_pool_reset_failure, agc_driver_address_space_teardown, agc_driver_alpha_to_coverage_state, agc_driver_covered_centroid_state, agc_driver_depth_bounds_state, agc_driver_graphics, agc_driver_msaa_dcc_state, agc_driver_sample_location_grid_fallback, agc_driver_sample_order_planning, agc_driver_undithered_alpha_to_coverage_state, agc_driver_unobserved_provoking_vertex, agc_driver_unused_viewport_depth, agc_heap_mirror_run_unwatch, agc_heap_mirror_run_unwatch_no_space_cache, agc_heap_mirror_unwatch, agc_heap_mirror_unwatch_no_space_cache, agc_pipeline_journal, agc_pipeline_journal_extended_paths, agc_pipeline_journal_long_paths, agc_pipeline_library_clear_waits_for_build, agc_pipeline_store_fixed_bound, agc_pipeline_store_growth, agc_pipeline_store_lazy_buffer_pool, agc_pipeline_store_replay_growth, agc_pipeline_store_touch, agc_sparse_buffer_holes, agc_sparse_heap_mirror_budget, agc_sparse_heap_mirror_unwatch, agc_sparse_heap_mirror_unwatch_no_space_cache pass 3 of 3 (ctest --repeat until-fail:3), none skipped.
  • This PR changes tests only, so there is no source to revert for a negative control.

AI-assisted: yes (Claude Code).

@adriadam10 adriadam10 self-assigned this Oct 30, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 7e659e7 merged onto main 98ddd9c · tested 2026-10-30 13:52 UTC · 20 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 822 passed · 1 failed (0 new, 0 also fail on main, 1 unstable on main) · 8 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 831 of 2,987 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (389 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_bda_device 40.6 s
Intermittent validation messages (1, seen once in the parallel run, not reproduced when the test was re-run alone 2 times; not counted against this PR)
agc_driver_depth_clear_hle: VUID-vkCmdCopyBuffer-commonparent (6x)
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_depth_clear_hle: failed in 1 of the last 8 main runs
Validation IDs already present on main (3 IDs in 109 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (109 tests): agc_driver, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_conservative_rasterization, agc_driver_constant_dword_fill, agc_driver_copied_writer_copy, agc_driver_copied_writer_label_order, agc_driver_copy_surface_bytes, and 101 more
VUID-vkCmdCopyImage-srcImage-01548 (8 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_plane_sampling_evicting, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (8 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_plane_sampling_evicting, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
Skipped (8)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
Reproduce
git fetch origin 7e659e7eab0ca26d272e600b81af1371592d9e89 98ddd9c1792bbab016ceed5db267a93d1d61f00a
git checkout 98ddd9c1792bbab016ceed5db267a93d1d61f00a && git merge --no-ff 7e659e7eab0ca26d272e600b81af1371592d9e89
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@github-actions github-actions Bot added the agc libSceAgc* label Oct 30, 2026
@adriadam10
adriadam10 merged commit c21e5c8 into boykopovar:main Oct 30, 2026
11 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the diff (test-only, 8 lines under __APPLE__, the same exit handler installed through std::set_terminate around Free and restored afterwards; nothing changes on Linux/Windows), the macOS A/B table (fails 3/3 on main, passes 3/3 here) and JJenkx's Windows run; merged.

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

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants