Skip to content

test(agc): run agc_driver_bda_device_tests under ctest - #1187

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
johnmaia:test/agc-bda-device-ctest
Oct 8, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
johnmaia:test/agc-bda-device-ctest

Conversation

@johnmaia

@johnmaia johnmaia commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

What

agc_driver_bda_device_tests was EXCLUDE_FROM_ALL and never registered, so it ran nowhere (#22, #23 left it out pending #14 and #20). It now runs under ctest with the other AGC driver tests.

  • The test picked devices.front(). It now ranks devices as VulkanDevice does (discrete, integrated, virtual, then the rest; Vulkan 1.1 or newer), so on a host with an iGPU it runs on the same GPU as the runtime.
  • Without a usable Vulkan device it exits 77 (skipped), as OpenVulkanTestDevice does, unless ANYPS5_REQUIRE_VULKAN is set. The Windows job has no Vulkan driver.
  • On a CPU device (lavapipe) the BDA execution tests are not run and the test says so. The contract, allocation and color transfer tests still run there.

The BDA execution tests segfault on lavapipe on main too: the third dispatch, a 32-bit read at guest + 1 that spans both ranges, faults in llvmpipe's JIT code on vpbroadcastd (%rcx) with rcx = 0. The probe returns 0 for that read, and the only load through the probe result sits behind OpBranchConditional mapped && aligned. llvmpipe executes it anyway. With APS5_BDA_BYTE_READS=1, which removes that branch, all 22 dispatches pass on lavapipe.

A 20-line GLSL shader reproduces it outside the project (if (address != 0) value = Word(address).value; with address = 0): it crashes lavapipe at every GALLIUM_OVERRIDE_CPU_CAPS level (sse2, sse4_2, avx, avx2, native on an Alder Lake CPU; Mesa 25.2.8, LLVM 20.1.2), and returns the right value on RADV and ANV. Reported upstream as Mesa #16515 (same AnyPS5 shader), same class as #16217.

agc_driver_recorder_tests has the same devices.front() and is also unregistered, but fails on main on every device (an unchanged draw input was copied again); that is a separate PR.

Tested

Linux, Ubuntu 24.04.5, GCC 13.3, Mesa 25.2.8; i3-12100 with RX 7600 (RADV) and UHD 730 (ANV).

  • ctest (Release, BUILD_TESTING=ON, ANYPS5_REQUIRE_VULKAN=1): 400/400 on the RX 7600; 400/400 on lavapipe alone with the CI settings (GALLIUM_OVERRIDE_CPU_CAPS=avx, --repeat until-fail:3), 21 skipped as before.
  • agc_driver_bda_device_tests alone:
Vulkan devices selected result
all, iGPU enumerated first RX 7600 passes
all, default order RX 7600 passes
UHD 730 + lavapipe UHD 730 passes
lavapipe only lavapipe passes, BDA execution not tested
none - exit 77 (skipped)
none, ANYPS5_REQUIRE_VULKAN=1 - exit 1
  • Windows: not tested locally; the change on that job is the skip above.
  • No title was run.

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 TechnicalDebt
  • 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
  • AI-assisted: yes

🤖 Generated with Claude Code

The BDA device test was built only on request and never registered, so
it ran nowhere. Register it with the other AGC driver tests.

Pick the Vulkan device the way VulkanDevice does, a discrete GPU over an
integrated one, instead of the first enumerated device, so the test runs
on the same GPU as the runtime on hosts with an iGPU. Without a usable
device it exits 77, as OpenVulkanTestDevice does, unless
ANYPS5_REQUIRE_VULKAN is set.

On a CPU device the BDA execution tests are not run: llvmpipe loads
through the null pointer of a branch that is not taken and the process
segfaults (Mesa #16515, #16217). The contract, allocation and color
transfer tests still run there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#1298 core/libs/prx/libSceAgcDriver/CMakeLists.txt L526
#1309 core/libs/prx/libSceAgcDriver/CMakeLists.txt L526
#1311 core/libs/prx/libSceAgcDriver/CMakeLists.txt L526
#1312 core/libs/prx/libSceAgcDriver/CMakeLists.txt L526
#1313 core/libs/prx/libSceAgcDriver/CMakeLists.txt L526
#1316 core/libs/prx/libSceAgcDriver/CMakeLists.txt L526
#1318 core/libs/prx/libSceAgcDriver/CMakeLists.txt L526
#1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt L526
#1343 core/libs/prx/libSceAgcDriver/CMakeLists.txt L526
#1372 core/libs/prx/libSceAgcDriver/CMakeLists.txt L526

popcoder565 added a commit to popcoder565/AnyPS5 that referenced this pull request Oct 7, 2026
The test is added to ctest in its own BUILD_TESTING block, as agc_vop1_sdwa_move_decode is, instead of in the shared test list that boykopovar#1187 also extends.
@github-actions github-actions Bot added build agc libSceAgc* labels Oct 7, 2026
@oneandonlydean
oneandonlydean merged commit 637fb3e into boykopovar:main Oct 8, 2026
4 checks passed
@johnmaia
johnmaia deleted the test/agc-bda-device-ctest branch October 8, 2026 06:40
adriadam10 pushed a commit to popcoder565/AnyPS5 that referenced this pull request Oct 8, 2026
The test is added to ctest in its own BUILD_TESTING block, as agc_vop1_sdwa_move_decode is, instead of in the shared test list that boykopovar#1187 also extends.
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