Repository navigation
fix(libSceAgc): preserve versioned register defaults layout - #7681
oneandonlydean merged 1 commit into
Conversation
|
Full build and title run of this PR's head Tests. Require(defaults == sceAgcGetRegisterDefaults2(13));One way to keep that test's intent: compare the table contents instead of the pointer, i.e. the four bank register counts at - Require(defaults == sceAgcGetRegisterDefaults2(13));
+ Require(std::memcmp(defaults + 0x20, static_cast<unsigned char*>(sceAgcGetRegisterDefaults2(13)) + 0x20, 16) == 0);With that line applied locally on top of Title. Sword of the Sea (PPSA25344, 01.510.000, imports AI-assisted: yes (Claude Code). The build, the tests, the run and this comment were done and written by Claude Code on my machine. |
|
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.
|
cf386a1 to
4fbec1e
Compare
4fbec1e to
0c2260e
Compare
|
Additional Linux title confirmation: ASTRO BOT (PPSA21567, v01.019.000) reaches in-game with this fix. Thanks for addressing this regression. Host: CachyOS/Arch Linux, Ryzen 7 5700G, Radeon RX 6750 XT, RADV/Mesa 26.2.4, GCC 16.2.1. Controlled comparison Base:
The actual loaded Original failure Repeated launches stopped in the title's bundled This is the first write of a memset-like operation over 1,016 MiB. The destination belonged to the reserved A separate temporary GDB experiment restoring the original compact type tables for the public and internal version-13 calls also passed that failure point. Applying the real production change to the library then reproduced the improvement without GDB. We have not traced every instruction between reading the defaults table and the allocator's invalid write, so this does not claim a complete corruption trace. Manual follow-up After installing the corrected library for my normal Astro Bot launch, I confirmed that the game reaches in-game, beyond the automated startup test. I have not yet measured the duration of that manual session or established long-term stability, performance gains or complete visual correctness. AI-assisted: Codex performed the controlled builds/debugging/tests and helped draft this report; I manually confirmed the in-game result and authorized posting it. |
|
Another retail title with the same regression: EA SPORTS UFC 6 (PPSA23566, SDK 9.04 per its process parameters). On current I tested a change equivalent to this PR (legacy Windows 11 Pro, Ryzen 7 5700X, RTX 4060 8 GB (driver 32.0.16.1664), 32 GB RAM, WinLibs GCC 15.2.0, Release. |
Nice catch. This lines up very well with the Astro Bot regression I reported above. |
|
Tested this PR's head (0c2260e) on a retail SDK title, and the title's own code agrees with the layout it restores. EA SPORTS FC 25 (PPSA20049) imports A key it can't find becomes Runs on Linux, RX 9070 XT, RADV (Mesa 26.2.5),
|
|
@WhiteAssassins Thanks! That difference makes sense with the mechanism: when the 12-byte walk misses a key, UFC 6 stores -1 and the range check stops it right away, but if a misaligned read happens to match a key, the title gets a wrong block index instead and computes a plausible but wrong register or memory location, so it can fail much later and somewhere else, like your libc.prx write. That would explain why each title breaks differently with the same root cause. I can also run UFC 6 on this PR's exact head if that helps the merge |
Yes, testing UFC 6 on the exact PR head would definitely help. Your current trace already gives strong evidence for the mechanism, but confirming the actual head would remove the only remaining difference from your current test. |
|
Thanks for the Windows test report and the suggested assertion update. The pointer-identity check has already been replaced on the current PR head ( |
…aults The versioned tables hand out compact 12-byte type entries since boykopovar#7681, and the MRT0 checks on them were dropped with the pairs. The walk now takes the entry size: MRT0 is block 78 of the legacy pairs and of the compact version 13 table, block 73 of version 10, and every versioned table from 4 holds it. The debt entry names the layout of each entry point. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Stray (PPSA02100, Unreal Engine 4, retail) is another title #6270 stopped, and this PR fixes it there too. Stray imports the versioned getters
Before this PR, a first-parent bisect from e1338ff to 0bc3003 ended at #6270's merge 2da2284. On 0bc3003, restoring only the compact type entries in Setup: Linux (CachyOS, kernel 7.2.10), Ryzen 9 9950X, RTX 3090 (NVIDIA 615.78.08), GCC 16.2.1, Release, stock AI-assisted: yes (bisect, tests and text with Claude Code; the runs are from my machine). |
What
Fixes #7678 by keeping the legacy no-argument
sceAgcGetRegisterDefaults()key/bank pair table while restoring the original three-word compact entries forsceAgcGetRegisterDefaults2(version)and its internal counterpart. This preserves the homebrew layout measured for the legacy path without changing the versioned SDK tables used by retail titles. Adds regression coverage for public versions 0 and 10 and internal version 0.Tested
Linux, GCC 12.2: syntax-checked the changed command source, export source, AGC command test source and
guest_shader_linktest source. A focused standalone runtime smoke test confirmed legacy public pairs, versioned public compact entries for versions 0 and 10, and the internal version 0 compact entry.git diff --check, conventions against currentupstream/main, and the open-PR overlap check passed. Full CMake/CTest was not run locally because configuration is blocked by the uninitialized SDL2 submodule and missing XRandR development files.Windows contributor report on the prior code-identical head: Sword of the Sea (PPSA25344) reached the title screen in one 180-second run with no indirect-register sentinel abort. The full build passed
agc_initializationandagc_commands;guest_shader_linkinitially failed on its pointer-equality assertion. Replacing that assertion with a comparison of the four bank register counts (the test-only correction now in this PR) made all three tests pass in the contributor's local build. The retail-title run preceded that test-only correction. No local retail-title or GPU runtime test is claimed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)sceAgcDcbSetCxRegisterDirect: invalid register range20 s into boot since #6270 (register-defaults type table changed forsceAgcGetRegisterDefaults2too) #7678