Repository navigation
fix(agc): give the device-lost hook lambda an empty parameter list - #21773
Conversation
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.
|
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.
|
|
Head No new failures and no new validation messages on either GPU.
Layer runs used AI-assisted: yes |
MarcZX10
left a comment
There was a problem hiding this comment.
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.
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
|
Current-main reproduction while rebuilding the GTX 1060 game-test runtime: The warning is the same device-lost hook capture line changed here. A separate minimal 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. |
What
The
VulkanDeviceconstructor installs the device-lost hook as a lambda written[captures...] noexcept { ... }. Leaving out the parameter list beforenoexceptis only allowed from C++23 (P1102). The project builds as C++20, so every GCC we build with warns: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 (gcc15package), Release.main-Wc++23-extensionsatVulkanDevice.cpp:2585:289-Wc++23-extensionsatVulkanDevice.cpp:2585:289-Wc++23-extensionsatVulkanDevice.cpp:2585:289VulkanDevice.cppwith the build's own compile command and the same generated headers, once withmain's line and once with this change. On all three compilers the two.obj/.ofiles are byte-identical, and so is theirobjdump -d.mainand this PR, usingctest --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.VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(layer 1.4.363),VK_LOADER_DEBUG=layer,ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1.Insert instance layer "VK_LAYER_KHRONOS_validation"(4 times), neither containswas not found but was requested by env var VK_INSTANCE_LAYERS, and neither has aVUID-line.deviceFault = true, so everyVulkanDevicethese tests create installs this hook.ctest -R "<the 7 tests above>|patched_libraries": 8/8 passed.cmake --build --target libssucceeds. The full build fails on the same 35 targets onmainand with this change, all unrelated:agc_shader_replay.exeon this PC ("the file contains a virus or potentially unwanted software", so objcopy reportsInvalid argument).UploadCacheReadOnlyFlush.cpp:177usessetenv, which MinGW doesn't have.tools/check_conventions.py --base origin/mainandtools/check_test_registration.pypass.No test fails on
main, because this change removes a warning and doesn't change behaviour.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)