Skip to content

fix(agc): give the device-lost hook lambda an empty parameter list - #21773

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
dantdmdarealguy:agent/winwarn3
Nov 26, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
dantdmdarealguy:agent/winwarn3

Conversation

@dantdmdarealguy

Copy link
Copy Markdown
Contributor

What

The VulkanDevice constructor installs the device-lost hook as a lambda written [captures...] noexcept { ... }. Leaving out the parameter list before noexcept is only allowed from C++23 (P1102). The project builds as C++20, so every GCC we build with warns:

core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp:2585:289: warning: parameter declaration before lambda exception specification only optional with '-std=c++23' or '-std=gnu++23' [-Wc++23-extensions]

This change writes the empty parameter list, [captures...]() noexcept { ... }, which is valid C++20 and means the same thing. The object file is byte-identical before and after on all three compilers below. The form came in with 0fbe561 (device-lost fault reports via a token ring).

Tested

Windows 11 Pro, Intel Core i9-14900K, 128 GB RAM, NVIDIA GeForce RTX 5080 (driver 621.14, 32.0.16.2101), WinLibs GCC 15.2.0, Release, -DBUILD_TESTING=ON. Arch Linux (WSL2) on the same machine, GCC 16.2.1 and GCC 15.3.0 (gcc15 package), Release.

Build main This PR
Windows, WinLibs GCC 15.2.0 -Wc++23-extensions at VulkanDevice.cpp:2585:289 no warning
Arch, GCC 16.2.1 -Wc++23-extensions at VulkanDevice.cpp:2585:289 no warning
Arch, GCC 15.3.0 -Wc++23-extensions at VulkanDevice.cpp:2585:289 no warning
  • I compiled VulkanDevice.cpp with the build's own compile command and the same generated headers, once with main's line and once with this change. On all three compilers the two .obj/.o files are byte-identical, and so is their objdump -d.
  • Focused GPU tests on the RTX 5080, main and this PR, using ctest --test-dir build -R "^(agc_driver_calibrated_clock|agc_driver_buffer_load_store|agc_driver_buffer_load_store_draw_pipeline|agc_driver_buffer_load_store_plan_verify|agc_device_fault|agc_device_memory_fallback|agc_vendor_dump)$" -V.
    • Environment: VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (layer 1.4.363), VK_LOADER_DEBUG=layer, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1.
    • Result: 7/7 passed on both. Both logs show Insert instance layer "VK_LAYER_KHRONOS_validation" (4 times), neither contains was not found but was requested by env var VK_INSTANCE_LAYERS, and neither has a VUID- line.
    • The driver reports deviceFault = true, so every VulkanDevice these tests create installs this hook.
  • ctest -R "<the 7 tests above>|patched_libraries": 8/8 passed.
  • cmake --build --target libs succeeds. The full build fails on the same 35 targets on main and with this change, all unrelated:
    • Windows Defender blocks 34 newly linked shader test executables and agc_shader_replay.exe on this PC ("the file contains a virus or potentially unwanted software", so objcopy reports Invalid argument).
    • UploadCacheReadOnlyFlush.cpp:177 uses setenv, which MinGW doesn't have.
  • tools/check_conventions.py --base origin/main and tools/check_test_registration.py pass.

No test fails on main, because this change removes a warning and doesn't change behaviour.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: NVIDIA GeForce RTX 5080, driver 621.14 (32.0.16.2101), Windows 11 Pro
  • AI-assisted: yes, some AI assistance was used

The device-lost hook installed by the VulkanDevice constructor was
written as `[captures] noexcept { ... }`. Omitting the parameter list
before a noexcept specifier is a C++23 feature, so GCC 15 and 16 warn
with -Wc++23-extensions under the project's C++20 mode. Writing `()`
makes the lambda valid C++20; the generated code is unchanged.
@github-actions github-actions Bot added the agc libSceAgc* label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 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/Execution/src/VulkanDevice.cpp
PR 4040 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4472 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4847 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7643 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9289 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9356 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9387 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10442 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10652 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11435 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11436 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11483 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12828 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12944 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13148 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13863 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13920 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13928 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13929 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 15548 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 16571 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 16831 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 17056 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 18173 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20030 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20111 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20172 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20186 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20248 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20315 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 21059 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 21238 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22071 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22190 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22424 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22531 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22647 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 23058 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 24327 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 24661 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 25010 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 26165 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp

@Colewiz7

Copy link
Copy Markdown
Contributor

Head 6be44f0dc1 merged onto main 7c836568c8 as d92ed9aa9a, no conflict. Linux 7.3.4, GCC 16.2.1 Release, Mesa 26.2.6 RADV, RX 7900 XT (gfx1100) and 7800X3D iGPU (gfx1036).

No new failures and no new validation messages on either GPU.

RX 7900 XT iGPU
tests run (6206 on the 7900 XT, the 2007 GPU ones on the iGPU), new failures vs main none none
-R '^agc' (1940 tests) with the layer, new failures vs main none none
VUID- / SYNC-HAZARD lines 0 / 0 0 / 0

Layer runs used VK_LAYER_KHRONOS_validation 1.4.363.1 with VK_LOADER_DEBUG=layer and ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1; the loader inserted the layer in every run, and the set of distinct validation messages matches main.

AI-assisted: yes

@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 — looks good

Nothing blocks this change; the added empty parameter list makes the lambda syntax valid in C++20 without changing its behavior.

What I ran

Reviewed head 6be44f0dc150b3fd91599ee63873a6a4f5eed404 using the prepared diff and repo_read.py to read the changed line and its immediate context. No builds or tests were run by me.

Results

Check Result Note
Diff and changed code passed One lambda declaration changed
Build and tests not run Results in the description are author-reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

The changed file was read at the changed line and nearby context. Other portions of the file were not read. The description's reported builds and tests were not independently verified.

To get this to a good state

Nothing is required.

@kiwe147

kiwe147 commented Nov 21, 2026

Copy link
Copy Markdown

Tested head 6be44f0dc1, applied with git apply on main fd4aeed483 together with the other 29 PRs of one batch (#17478, #21223, #24030, #24201, #14202, #18889, #19531, #21641, #22468, #22471, #23239, #23255, #23484, #23869, #23992, #24311, #18425, #21195, #21255, #22989, #23507, #23886, #14582, #17878, #19666, #19899, #20138, #21656, #21746). All applied without conflicts and the whole tree built.

Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. GPUs: NVIDIA GeForce RTX 3080 (driver 621.24) and the AMD Radeon iGPU of the CPU (gfx1036, driver 32.0.21036.18). No validation layer. iGPU run: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ANYPS5_GPU="AMD Radeon", agc_/video tests only.

tests RTX 3080 iGPU
none: no test of its own in this PR - -

Whole batch: the full ctest -j 12 (6522 tests) on the RTX 3080 has 4 failing tests; the 4 that also fail on main fd4aeed483 are agc_driver_stencil_plane_memory, agc_driver_msaa_dcc_unwatch, agc_storage_write_back_host_retile, and pr_overlap_names, which needs a newer Python than my 3.10. Intermittent in this run (pass when rerun alone, or known flaky): agc_driver_store_over_untracked. The 2125 agc_/video tests on the iGPU have 2 failing: agc_driver_stencil_plane_memory, agc_driver_store_over_untracked (agc_driver_stencil_plane_memory also fails on main).

This is one combined tree, not a run of this PR alone.

AI-assisted: yes (Claude Code)

This was referenced Nov 21, 2026
@vgpastor

Copy link
Copy Markdown
Contributor

Current-main reproduction while rebuilding the GTX 1060 game-test runtime: 42120ad25c2e7102edb22e2be5a8f42f08dcd2c1, Windows 11 Pro 26300, WinLibs GCC 15.2.0 UCRT r7, RelWithDebInfo. VulkanDevice.cpp:2645 still reports:

warning: parameter declaration before lambda exception specification only optional with '-std=c++23' or '-std=gnu++23' [-Wc++23-extensions]

The warning is the same device-lost hook capture line changed here. A separate minimal -std=c++20 -Werror=c++23-extensions -fsyntax-only control rejects auto hook = [] noexcept {}; (exit 1) and accepts auto hook = []() noexcept {}; (exit 0). I inspected this PR's one-line patch and it makes exactly that syntax correction without changing the capture list or callback body.

This is additional current-main/compiler evidence, not a full runtime test of this PR or a claim that it fixes device loss. I am keeping the correction separate from the #24931/Ping Pong and mesh/barycentric comparisons. No duplicate PR opened.

AI-assisted: yes.

@oneandonlydean
oneandonlydean merged commit 42ec806 into boykopovar:main Nov 26, 2026
14 checks passed
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.

6 participants