Skip to content

test(agc): gate queued count-indirect case on device support - #20528

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
kali113:test/queued-indirect-count-capability
Nov 28, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
kali113:test/queued-indirect-count-capability

Conversation

@kali113

@kali113 kali113 commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

What

agc_driver_queued_indirect_read_order expects its indirect argument and count reads to stay queued while a preceding image write is pending. Without VK_KHR_draw_indirect_count, the count case takes the driver's CPU feature-gap path, so its queued-read assertion is not applicable. On MoltenVK it reports that the queued draw holds no argument read and aborts during shutdown.

Read DrawIndirectSupport().count from the test device and run that case only when supported. The ordinary indirect case still runs, and an omitted count case prints an explicit message. The packet requests at most one draw, so it does not require multi-draw support. Neighbouring indirect tests also inspect DrawIndirectSupport() for their capability-dependent checks.

This is a test correction. The CPU fallback's ordering and count-clamping gaps remain; no driver behaviour changes. The supported count-indirect path is unchanged and was not exercised on this GPU.

Tested

  • Apple M5 Pro, macOS 27.3 (26C5035r), MoltenVK 1.4.2, LunarG Vulkan SDK 1.4.363.1; Apple clang 21.0.0, x86_64 Release under Rosetta, BUILD_TESTING=ON.
  • Clean build of the focused target from main 324dc5aae5, then rebuild with this change. No other PRs applied.
  • ctest -R '^agc_driver_queued_indirect_read_order$' -V -j 1: baseline fails in 3/3 runs; change passes in 3/3 runs, with the ordinary case executed and the count case explicitly omitted.
  • Both sides use ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, and VK_LOADER_DEBUG=layer. Every log confirms insertion of validation layer 1.4.363; none reports a missing requested layer or any VUID- error.
  • An additional baseline trace selects the GPU path for DRAW_INDIRECT and cpu (feature gap) for the count-indirect packet. The patched trace retains the ordinary GPU path.
  • python3 tools/check_conventions.py --base origin/main and git diff --check pass.
  • No Linux, Windows or title 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 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: Apple M5 Pro, MoltenVK 1.4.2 (SDK 1.4.363.1), macOS 27.3 (26C5035r)
  • AI-assisted: yes (Claude Code; verified and continued with Codex)

The queued-read assertion requires the GPU count-indirect path. Keep the ordinary indirect case active when drawIndirectCount is unavailable and report the omitted count case explicitly.

Co-Authored-By: Claude Code <noreply@anthropic.com>

Co-Authored-By: Codex <noreply@openai.com>
Copilot AI balanced review requested due to automatic review settings November 15, 2026 08:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@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

The change gates the count-indirect test on device support while retaining the ordinary indirect case; I found no blocking defect in the changed code.

What I ran

Reviewed head 1df7763ed5010688897aebae03cbfe7d06849bb8. I read the prepared description, commit list, manifest, diff, and the complete changed file. I did not run commands or tests; repo_read.py was unavailable as a command tool.

Results

Check Result Note
Changed-code review passed Guard follows reported device capability
Tests not run Results in description are author-reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

Did not independently verify the author-reported build, CTest runs, convention check, or git diff --check. No other files were changed according to the manifest; the only changed file was read in full. No excluded changed files were listed.

To get this to a good state

Nothing is required.

@github-actions

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 21059 core/libs/prx/libSceAgcDriver/tests/execution/QueuedIndirectReadOrder.cpp

@kali113

kali113 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review.

AI-assisted: yes

@kurexw kurexw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on an Apple M4 (macOS 27.2, MoltenVK 1.4.2 from the LunarG SDK 1.4.363.1, x86-64 build under Rosetta).

This PR merges cleanly. I tested main at 939d363 against this PR's commit merged onto it. I tested commit 8cdf291c9f; the current head 1df7763 has the identical patch, rebased. Both sides built apart from libcurl.prx (#17425) and TimeGetFields.cpp, which fails identically on both sides.

The test set is the 29 agc_driver_* tests that fail on main on this Mac. Environment: ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer, three runs per side. Every test process logged Insert instance layer "VK_LAYER_KHRONOS_validation" (layer 1.4.363), and none logged the missing-layer message.

main (3 runs) this PR (3 runs)
agc_driver_queued_indirect_read_order Subprocess aborted Passed
the other 28 Failed, identical Failed, identical
VUID- lines per run 10 10
  • On main, the count-indirect case logs AGC graphics: queued indirect read: the queued draw holds no read of its indirect argument range. MoltenVK then loses the device (VK_ERROR_OUT_OF_DEVICE_MEMORY ... kIOGPUCommandBufferCallbackErrorInnocentVictim), and the test aborts with vkWaitForFences graphics: Vulkan result -4.
  • With this PR, the first case passes, and the second logs skipped, the count-indirect draw needs VK_KHR_draw_indirect_count, which this device lacks.
  • The 10 VUID- lines are the same on both sides: 4 VUID-VkDeviceCreateInfo-sType-unique (from Recorder.cpp, addressed by #21965) and 6 VUID-VkSamplerCreateInfo-samplerMipLodBias-04467.

Overlap: #21059 (which conflicts with main in Draw.cpp) also edits QueuedIndirectReadOrder.cpp. At its own merge-base on this M4, it runs the count-indirect case instead of skipping it: the driver reads the arguments on the CPU, and the test checks the result. That way the case keeps checking something on devices without drawIndirectCount. If #21059 lands, this skip may no longer be needed.

I didn't test this on Linux, Windows or another GPU vendor.

@rafaconvaitis

rafaconvaitis commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Windows + NVIDIA run (AMD run added below). It covers the supported count-indirect path, which the description says was not exercised on the Apple GPU. Head 1df7763ed5 merged alone onto main 6286d36449 with git merge --no-ff (clean merge).

Setup: Windows 11 25H2 (build 26200), NVIDIA GeForce RTX 3050 6 GB (10de:2584), driver 610.88, WinLibs GCC 15.2.0 r7 UCRT, Release, BUILD_TESTING=ON, Khronos validation layer 1.4.363 (LunarG SDK 1.4.363.1). Only the focused test targets were built; the other execution tests were left out with ANYPS5_AGC_EXECUTION_TESTS.

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, ctest -R '^agc_driver_queued_indirect_read_order$' -V -j 1, 3 runs per side.

agc_driver_queued_indirect_read_order VUID- lines
main passes 3/3 0
this PR passes 3/3 0
  • The new message skipped, the count-indirect draw needs VK_KHR_draw_indirect_count is in none of the three logs of this PR, so DrawIndirectSupport().count is true on this device and the count case ran and passed, as on main.
  • Every run logs Insert instance layer "VK_LAYER_KHRONOS_validation" and none logs was not found but was requested.

Update, same day: AMD run added. Same head, same main, same commands and 3 runs per side, on the second GPU of this machine, selected with ANYPS5_GPU=Radeon: AMD Radeon 760M integrated graphics (1002:15bf, Vulkan device name Radeon 5), AMD Software 26.11.2 (driver 32.0.32029.2010, Vulkan 1.4.359), Windows 11 25H2 (build 26200).

Radeon 760M agc_driver_queued_indirect_read_order VUID- lines
main passes 3/3 0
this PR passes 3/3 0
  • The skip message is in none of the three logs of this PR here either, so the count case ran and passed on the AMD driver too.
  • Every run logs Selected GPU name=Radeon 5 vendor=0x1002 device=0x15bf and Insert instance layer "VK_LAYER_KHRONOS_validation", and none logs was not found but was requested.

AI-assisted: yes (build and runs scripted with an AI assistant, on the hardware above).

@domx4q

domx4q commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Ran the focused tests with the Khronos validation layer on Linux and an NVIDIA GPU, since CI runs the GPU tests only on lavapipe and the Tested section is on MoltenVK; this covers the supported count-indirect path on Linux.

Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor 0x10de, device 0x2684, Ada), proprietary driver 620.70.06, Vulkan 1.4.357, Khronos validation layer 1.4.363.1. Head 1df7763ed5 merged onto main fbaae8a79d with --no-ff (clean, as 536df3e613). Main baseline is a Release build of fbaae8a79d on the same machine.

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer \
ctest --test-dir build -R '^agc_driver_queued_indirect_read_order$' -V
main fbaae8a79d this PR
Result 1 of 1 passed 1 of 1 passed
Insert instance layer "VK_LAYER_KHRONOS_validation" 2 2
was not found but was requested by env var VK_INSTANCE_LAYERS 0 0
VUID- none none

agc_driver_queued_indirect_read_order passes on both sides (queued indirect read vs. deferred storage write-back tests passed). The device supports VK_KHR_draw_indirect_count, so the new skip line does not appear and the count-indirect case still runs here; the RTX 4090 was selected in every device.

No new VUID- errors; the test passes on Ada with the count-indirect case still executed.

AI-assisted: yes (Claude Code)

@kiwe147

kiwe147 commented Nov 21, 2026

Copy link
Copy Markdown

Tested head 1df7763ed5, applied with git apply on main fd4aeed483 together with the other 28 PRs of one batch (#22366, #22943, #23994, #24150, #24483, #14625, #16796, #17425, #22589, #22887, #14505, #16792, #17900, #18484, #20048, #20099, #20517, #21636, #22886, #23659, #23880, #24047, #24100, #24248, #16353, #21683, #21714, #22276). 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
agc_driver_queued_index_read_order, agc_driver_queued_indirect_read_order (2 tests, matched by name to the test file this PR changes) all pass all pass

Whole batch: the full ctest -j 12 (6522 tests) on the RTX 3080 has 5 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. Failing tests I could not trace to a single PR (reverting the likely candidates did not clear them): public_headers. 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)

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.

8 participants