Skip to content

test(agc): honor GPU selection in recorder fixtures - #6225

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Amoenus:codex/test-recorder-gpu-selection
Oct 17, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Amoenus:codex/test-recorder-gpu-selection

Conversation

@Amoenus

@Amoenus Amoenus commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What

Closes #6219. Honor the existing ANYPS5_GPU selector in the recorder's private test device, using case-insensitive name-substring matching as introduced for the production device in #876.

Keep default adapter ranking for unset/empty requests and reject an unmatched explicit request. Extract selection over device properties so a CPU test covers ranking, case/substring matching, missing names, Vulkan-version eligibility and enumeration-order ties.

Checked the selection code in43 open PRs touching the recorder, including #6222; none implements this filtering. #4847 concerns production-device eligibility. Depends on none.

Tested

Head 82b4a665fa5b6449af6a396259dfbe4ef96bd46f, base main d92a8dad390af1807cc91622b924252141816a5a; Windows11 Enterprise26200, WinLibs GCC15.2.0 Release, bundled dependencies, SPIRV-Tools enabled.

  • Unchanged main: five agc_tiled_resolve runs requesting AMD selected NVIDIA; the numeric test passes but the physical-device assertion fails. Unset/empty controls select NVIDIA.
  • Full Windows application/libraries build, conventions and test registration pass.
  • All40 registered recorder groups pass once on each physical GPU, with0 CTest failures/skips.38 fixtures per vendor record the requested device; two are CPU tests. Slowest selected test0.428s.
  • Mixed-case NVIDIA/AMD requests each pass five tiled-resolve runs with the correct device. Unset/empty preserve the default. An unknown name is refused with ANYPS5_REQUIRE_VULKAN=1.
  • New CPU selection test passes20 repetitions. Restoring main's rank-only logic produces the intended integrated-versus-discrete assertion in5/5 runs. The exact fix is restored; a full rebuild, five CPU runs and five tiled-resolve runs per actual GPU pass afterward.

Three existing internal cases print “not tested” under compared imports: agc_storage_kept_unit_settle, agc_unit_shadow and agc_draw_inputs_in_place. Their other cases pass; those guarded paths are excluded from the coverage claim.

Our validation scope: Windows fixtures. We did not run Linux, the complete repository CTest suite or a title replay for this independent head. Full upstream CI requires maintainer dispatch.

Independent Linux helper coverage

simonbbby reports five fresh-process passes at the exact PR head on Ubuntu24.04/GCC13.3: the unchanged CPU fixture and selector helper, plus real enumeration of two RTX3090 adapters, RADV1002:13c0 and llvmpipe. Mixed-case requests select the intended vendor/CPU device; rank-only negative control fails. This is external standalone-helper evidence: it does not exercise the recorder executable, environment-variable integration, logical devices/queues, GPU commands or a title. Their full configure is blocked by SDL XRandR development support.

Independent Linux recorder coverage

jotitadev tested the actual recorder executable, head 82b4a665f merged onto main 44df21632: Ubuntu 26.04, GCC 15.2, NVIDIA RTX 3070 driver 595.99.02 and llvmpipe LLVM 21.1.8. Tiled resolve passes 3/3 on each requested device, an unmatched selector skips, and pending-key stores pass 3/3 on NVIDIA. With llvmpipe selected while both ICDs are installed, pending-key stores fail 23/23; restricting enumeration to lavapipe passes 10/10. The selector works and exposed a separate pending-store fixture defect tracked in #6500. MarcZX100 subsequently identified the partial block initialization; #6560, merged as 4eb91eacd, zeroes the entire block. The Linux results above were collected on 44df21632, before that correction; no fresh Linux rerun on the corrected main or claim that every recorder group passes on Linux. External reports, not rerun here.

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; no silent stubs added
  • No notes, investigation files or images added to the repository
  • New third-party code is a submodule built from source: n/a
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none (recorder validation correctness)
  • GPUs tested: NVIDIA GeForce RTX5080,610.62/32.0.16.1062; AMD Radeon(TM) Graphics (Ryzen9950X3D integrated),32.0.21036.18; both Windows11 Enterprise26200
  • AI-assisted: yes (Codex); author responsible for the contribution

@simonbbby

Copy link
Copy Markdown
Contributor

Independent Linux selection-helper coverage at exact head 82b4a665fa5b6449af6a396259dfbe4ef96bd46f: Ubuntu 24.04, kernel 7.0.0-38, Ryzen 9 9950X, GCC 13.3.

I compiled this head's unchanged selectDevice and deviceSelectionTests function bodies in a small standalone harness. After the CPU fixture, it creates a real Vulkan 1.1 instance and supplies the actual vkEnumeratePhysicalDevices / vkGetPhysicalDeviceProperties results to the same selector. It uses the installed Vulkan loader and existing bundled Vulkan headers; no fabricated device properties are used for the real-enumeration part.

All four devices are visible together, without pinning an ICD:

Request passed to the helper Selected real device
empty NVIDIA GeForce RTX 3090, 10de:2204 (first of two)
nViDiA NVIDIA GeForce RTX 3090, 10de:2204
rAdV AMD Ryzen 9 9950X 16-Core Processor (RADV RAPHAEL_MENDOCINO), 1002:13c0
lLvMpIpE llvmpipe (LLVM 20.1.2, 256 bits), CPU device, 10005:0000
deliberately missing name no match

5/5 fresh-process runs pass, including the PR's complete CPU fixture and the real-enumeration checks. The RADV result is checked by vendor ID, rather than trusting the CPU-model-like name this Mesa build reports.

Negative control in a separate scratch copy: remove name filtering and restore rank-only selection. The extracted CPU fixture exits 1 with a requested integrated GPU lost to an unrelated discrete GPU. The five passing runs use the unchanged PR helper; the checkout is clean.

Scope: request strings are passed directly to the helper. No full recorder fixture, environment-variable-to-recorder integration, logical-device/queue creation, GPU command execution, or title result is claimed. HAL's ordinary full configure remains blocked by SDL XRandR development support, so these are standalone helper results rather than agc_recorder_device_selection CTest results.

This was referenced Oct 15, 2026
@github-actions

github-actions Bot commented Oct 15, 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
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt L1057

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
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1896 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4339 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4650 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
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 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6215 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6222 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6259 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6373 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6503 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6535 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6718 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6763 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6937 core/libs/prx/libSceAgcDriver/CMakeLists.txt

@jotitadev jotitadev 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.

Linux run of the recorder executable itself, which the description lists as not covered (the Linux data so far is a standalone harness).

Machine: NVIDIA GeForce RTX 3070, driver 595.99.02, Vulkan 1.4.329, plus llvmpipe (LLVM 21.1.8). Ubuntu 26.04 (kernel 7.0.0-38), i7-8700. GCC 15.2, Release, BUILD_TESTING=ON. Head 82b4a665f merged onto main 44df21632, no conflicts.

GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02), llvmpipe (Mesa, LLVM 21.1.8), Linux

Test ANYPS5_GPU Result Vulkan device: lines
agc_tiled_resolve llvmpipe 3/3 pass llvmpipe
agc_tiled_resolve NVIDIA GeForce RTX 3070 3/3 pass NVIDIA
agc_pending_key_stores NVIDIA GeForce RTX 3070 3/3 pass NVIDIA
agc_tiled_resolve nomatch-xyz skipped: no Vulkan 1.1 device matching ANYPS5_GPU="nomatch-xyz" none
agc_pending_key_stores llvmpipe fails 23/23: a range wider than the pending fill was known, or waited for llvmpipe

main selects NVIDIA in every one of these cases.

The selection works. The new failure is in agc_pending_key_stores, which this PR makes reachable here: llvmpipe selected while the NVIDIA ICD is also installed. With VK_DRIVER_FILES set to the lavapipe ICD only, the same build passes 10/10, and the logs of the two cases are identical up to the assertion. /dev/udmabuf access makes no difference: 13 of the failing runs had it accessible, 10 denied through an LD_PRELOAD shim. It is the assertion of #6500, where the numbers on unchanged main are.

Written with AI assistance (Claude Code). I ran the tests above on my machine.

@MarcZX10

Copy link
Copy Markdown
Contributor

Thanks for testing the recorder itself on Linux and for separating device selection from the assertion failure. The lavapipe agc_pending_key_stores failure you surfaced is tracked in #6500 and was root-caused to the fixture clearing only part of its block; #6560 zeroes the full block. That makes the selection result here useful independently: this PR lets the test actually run on the requested device, exposing the separate fixture defect.

@Amoenus

Amoenus commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Additional current-integration validation: 5c23b59fe adds this exact head 82b4a66 to #6973's initializer/array/layout composition on main f6a2091.

Before this selection fix, the recorder's --multisample-only fixture logged NVIDIA RTX 5080 even with ANYPS5_GPU=AMD. With it, the same behavioral fixture passes three fresh processes each on verified NVIDIA RTX 5080, AMD Radeon Graphics and Linux llvmpipe; logs confirm the actual requested device. All production sources and the complete guest-access test function are byte-identical across the comparison; only the recorder selector and its CMake unit-test registration differ. agc_recorder_device_selection also passes on Windows and Linux.

Windows 11 Enterprise 26200, NVIDIA 610.62/32.0.16.1062 and AMD 32.0.21036.18; Ubuntu 24.04 WSL2, Mesa 25.2.8 llvmpipe LLVM 20.1.2. Vulkan required, project shader cache disabled, serial 30 s CTests. This is validation of the adapted composition, not a fresh test of the unchanged old-base PR head or a title run. The corrected coverage scope is recorded in #6973. AI-assisted: Codex; author responsible.

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.

AGC recorder fixtures ignore ANYPS5_GPU and prefer the discrete adapter

5 participants