Skip to content

test(agc): cover the jump target patches with and without a cache policy - #11686

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
milescoviello:test/agc-jump-target-patch
Oct 28, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
milescoviello:test/agc-jump-target-patch

Conversation

@milescoviello

@milescoviello milescoviello commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What

tests/Commands.cpp gets a testJumpTargetPatch case after testMarkers, on a chained jump packet built with sceAgcDcbJump. sceAgcJumpPatchSetTarget_0300 replaces the target address, the dword count and the cache policy (bits 28-29) and keeps the chain bit. sceAgcJumpPatchSetTarget replaces the address and count and keeps the cache policy. A cache policy above 3, a misaligned target, a count of 0x100000 and a packet of another size are refused without changing the packet.

It is called by PPSA18194, PPSA30839, PPSA31162, PPSA34502 and PPSA36591 (sceAgcJumpPatchSetTarget_0300) (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 (maskym's run, i7-12700K, WinLibs GCC 15.2, Release, Ninja): agc_commands and agc_register_command_tests pass at head efb3edd0ce merged into main f759e165d9, in a joint tree with other open PRs.

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

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

Copy link
Copy Markdown
Contributor Author

Windows 11 VM (GT 1030, NVIDIA 582.66, WinLibs GCC 15.2.0, Release, Ninja): this head efb3edd0ce 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 27, 2026

Copy link
Copy Markdown
Contributor

Windows result for head efb3edd0ce, merged into main f759e165d9 (the PR's Tested section names no Windows run).

Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, BUILD_TESTING=ON, Ninja. Build clean.

The tree also carried the open PRs #11724, #11644, #11639, #11636, #11635, #11630, #11353, #11347, #11221, #10925, #11706, #11693, #11682, all merged cleanly, so the run is a joint one; the tests of this PR are agc_commands and agc_register_command_tests (0.05-0.06 s), all passed (the batch's mapped tests: 16/16, plus 43/43 for the Ngs2 and host-import suites). 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 run. I've added it to Tested.

AI-assisted: yes (Claude Code)

@adriadam10
adriadam10 merged commit 7103b34 into boykopovar:main Oct 28, 2026
13 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the expected words against PatchJump/WriteJump (address split, cache policy in bits 28-29, chain bit kept, policy kept by the plain variant) and the refusal paths (policy > 3, misaligned target, size 0x100000, wrong packet size), which all throw before writing; Windows run by @maskym noted; 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.

3 participants