Skip to content

test(agc): cover the graphics and compute dispatch-indirect and direct dispatch packets - #11675

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
milescoviello:test/agc-dispatch-packets
Oct 28, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
milescoviello:test/agc-dispatch-packets

Conversation

@milescoviello

@milescoviello milescoviello commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What

tests/Commands.cpp gets a testDispatchPackets case after testNop. sceAgcDcbDispatchIndirect writes a three-word DISPATCH_INDIRECT with the argument offset and the flags ORed with 0x41. sceAgcAcbDispatchIndirect writes a four-word one with the argument address split into two words. sceAgcCbDispatch writes a five-word DISPATCH_DIRECT with the three thread-group counts. A flag bit outside 0xa079 (0x100 here), and a null or misaligned argument address, are refused with the whole buffer and cursor left unchanged. Bit 1 (PARTIAL_TG_EN) is valid hardware state that is not supported yet, so the test leaves it unpinned. The size getters report 12, 16 and 20 bytes.

It is called by all eight titles run here (PPSA01494, PPSA03984, PPSA18194, PPSA21564, PPSA30839, PPSA31162, PPSA34502, PPSA36591) for each of the three functions (call sites found through the import's PLT stub in each title's relinked eboot.bin), and until now no test called it.

Changed: core/libs/prx/libSceAgc/tests/Commands.cpp. Test only, no change to the library.

Tested

Linux (Ubuntu 26.04, GCC 15.2), Release: cmake --build build --target agc_command_tests and ctest -R '^agc_commands$' --repeat until-fail:3 pass on this branch, which is current main plus the test. tools/check_conventions.py --base upstream/main passes.

Windows 11 with an RTX 2070 SUPER (maskym's run, NVIDIA 621.01, Khronos validation layer, WinLibs GCC 15.2, Release): this PR's tests pass at head 0c02f0be96 merged into main f759e165d9, in a joint tree with other open PRs, and every other agc and video_out test gives the same result as on main.

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 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: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

…t dispatch packets

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

Copy link
Copy Markdown
Collaborator

Thanks for the coverage. One change: please remove the new expectFailure for sceAgcDcbDispatchIndirect with flags 0x2. Bit 1 is PARTIAL_TG_EN in COMPUTE_DISPATCH_INITIATOR, so this pins a valid but unsupported dispatch form to throwing. Please keep the packet checks and the invalid-flag, null and misaligned-address cases.

…fused packets leave the buffer unchanged

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

Copy link
Copy Markdown
Contributor Author

@oneandonlydean Removed in 0c02f0b: the 0x2 case is gone, so PARTIAL_TG_EN isn't pinned to throwing. The packet checks stay, and so do the invalid flag (0x100 on sceAgcCbDispatch), misaligned and null address cases. Each refusal now also checks that the whole sentinel-filled buffer and cursor_up are unchanged, which MarcZX10 asked for on #11674. agc_initialization and agc_commands pass on Linux. I updated the description to match.

AI-assisted: yes (Claude Code)

@milescoviello

Copy link
Copy Markdown
Contributor Author

Windows 11 VM (GT 1030, NVIDIA 582.66, WinLibs GCC 15.2.0, Release, Ninja): this head 0c02f0be96 and its base main abed035 each build agc_command_tests, and agc_initialization and agc_commands pass 3 of 3 on both.

AI-assisted: yes (Claude Code)

@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 1060 core/libs/prx/libSceAgc/tests/Commands.cpp

@maskym

maskym commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Windows + NVIDIA result for head 0c02f0be96, merged into main f759e165d9 (the PR's GPUs tested line names no NVIDIA run on Windows).

This PR's own tests: the libSceAgc packet tests agc_commands (0.15 s), agc_shader_helpers (0.08 s), agc_register_command_tests, agc_dma_data_tests and agc_initialization, which are CPU-side, all passed.

Host: Windows 11 26300, Intel i7-12700K, NVIDIA GeForce RTX 2070 SUPER (vendor 0x10de, device 0x1e84; Vulkan loader 1.4.357 from the NVIDIA driver 621.01), Khronos Validation Layers nightly 1.4.366 (b2b44c0d37) through VK_ADD_LAYER_PATH, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, BUILD_TESTING=ON, Ninja.

Same focused run on main f759e165d9 and on this tree, same machine and GPU: VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, VK_LOADER_DEBUG=error,warn,layer, ctest --test-dir build -R '^(agc|guest_video_out|video_out)' --parallel 4 -V.

The tree also carried the open PRs #11948, #12062, #12132, #12070, #11680, #11679, #11678, #11677, #11674, #11605, #11604, #11600, all merged cleanly, so the run is a joint one. Not run on a PS5.

AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine.

@milescoviello

Copy link
Copy Markdown
Contributor Author

@maskym thanks for the Windows NVIDIA run with the validation layer. I've added it to Tested.

AI-assisted: yes (Claude Code)

@adriadam10
adriadam10 merged commit 1a551c4 into boykopovar:main Oct 28, 2026
14 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the expected words against sceAgcDcbDispatchIndirect, sceAgcAcbDispatchIndirect and sceAgcCbDispatch (headers, flags | 0x41, 0xa079 mask, 4-byte address check, sizes 12/16/20); all match, and the PARTIAL_TG_EN case Dean asked to drop is gone; merged.

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.

4 participants