Skip to content

fix(agc): ignore failed fence creation outputs - #7169

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
Ondra97:codex/fix-command-batch-fence-failure
Oct 19, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
Ondra97:codex/fix-command-batch-fence-failure

Conversation

@Ondra97

@Ondra97 Ondra97 commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

What

CommandBatch passes its owned fence member directly to vkCreateFence. If creation fails and leaves a non-null output, constructor cleanup passes that undefined handle to vkDestroyFence. Vulkan leaves outputs undefined on runtime errors unless an API specifies otherwise (error behavior).

Receive the fence in a local variable and publish it to the batch only after creation succeeds. Cleanup still frees the successfully allocated command buffer and the original Vulkan error propagates.

The regression covers host/device memory errors with null and non-null fence outputs, command-buffer allocation and begin failures, and successful recovery. A test-only adapter delegates successful operations to the existing graphics mocks. The command-buffer allocation control follows Vulkan's explicit null-output guarantee.

Relevant shared changes, including #7065 and #7057, were compared; they do not modify this constructor. pr_overlap.py reports only pre-existing unmergeable branches, with no confirmed overlap. Targeted Git compositions with #6614 and #7145 are clean, and the registration was also checked against 114 shared CMake changes without adding a conflict.

Tested

Final source: 19655eaba5c878bfc0bb7c3dc464ee300acaf740, based on 47a266cf975f00f7fba94013467d03bfa5e355e9. Release, BUILD_TESTING=ON.

  • Windows (native host): Windows 11 Pro 10.0.26300, WinLibs MinGW-w64 GCC 15.2.0; AMD Ryzen 9 7900X, 32 GB RAM, NVIDIA GeForce RTX 4070 Ti SUPER, driver 32.0.16.1742. Full default build passed. Nine selected CPU tests and three hardware Vulkan tests passed, with no failures or skips. The GPU tests were agc_storage_integer_clear, agc_storage_cpu_snapshot and agc_driver_pooled_buffer_range; device logs confirmed the NVIDIA GPU, with Vulkan required and the application shader cache disabled.
  • Linux (VirtualBox): Ubuntu 24.04.5 LTS, kernel 7.0.0-38-generic, GCC 13.3.0, VirtualBox 7.2.20 r175154 on the Windows host above; 4 vCPUs, 8 GiB RAM. Graphics: not exercised. The relevant AGC/runtime and CPU test targets built; eight CPU tests passed with no failures or skips. All 2,761 source blobs matched the final commit.
  • Conventions, whitespace and test-registration checks passed: 941 Windows test executables, all registered.

Before / after

agc_command_batch_fence_failure, one run per revision and OS, using the same regression source and Release configuration. The negative controls used the production file from base 47a266cf975f00f7fba94013467d03bfa5e355e9, retaining the regression fixture. Each run covers six constructor failure paths and four successful recoveries; four of those failures are fence creation errors.

Environment Metric Before (base) After (fix)
Windows (native host) Invalid fence destroys across 4 creation failures 2 0
Linux (VirtualBox) Invalid fence destroys across 4 creation failures 2 0

Error paths use Vulkan mocks. The hardware tests exercise successful recording, submission and readback; no real memory exhaustion was induced.

cmake --build build --target agc_driver_graphics_tests
ctest --test-dir build -R '^agc_command_batch_fence_failure$' --output-on-failure

Linux graphics/Vulkan tests: NOT RUN — intentionally excluded from VirtualBox validation. Native/bare-metal Linux was not tested. Native Linux GPU validation: not tested. No retail title or homebrew was run. Full hosted platform CI requires collaborator dispatch; local results above are separate from hosted checks.

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 in technical debt
  • No notes, investigation .md files or images added to the repository
  • 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 4070 Ti SUPER; NVIDIA driver 32.0.16.1742; Windows 11 Pro 10.0.26300
  • AI-assisted: yes (Codex)

@github-actions

github-actions Bot commented Oct 17, 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 1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5441 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5500 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5656 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6177 core/libs/prx/libSceAgcDriver/Graphics/src/Resources.cpp
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6194 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6235 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6360 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6457 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6479 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6503 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6523 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6529 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6535 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6563 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6606 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6646 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6647 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6701 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6718 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6730 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6759 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6762 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6763 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6820 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6937 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6941 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6946 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Resources.cpp
PR 6963 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6970 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6972 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7048 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7085 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7254 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7256 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7427 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7505 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7514 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Resources.cpp

@github-actions github-actions Bot added build agc libSceAgc* labels Oct 17, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 18, 2026
@oneandonlydean
oneandonlydean merged commit 3fda339 into boykopovar:main Oct 19, 2026
9 checks passed
@Ondra97
Ondra97 deleted the codex/fix-command-batch-fence-failure branch October 19, 2026 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants