feat(libSceAgc): implement the marker span builders #971
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/971"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-06T20:48:52Z.
What
sceAgcDcbPushMarkerSpan,sceAgcDcbSetMarkerSpan,sceAgcAcbPushMarkerSpanandsceAgcAcbSetMarkerSpanthrew. They now write the same packets as the existing push and set markers, but take the text as(text, length)instead of a NUL-terminated string:lengthbytes, NUL-terminated and zero-padded to a dword.sceAgcDcbSetMarkerdoes.Agc::Marker::Pushnow calls a newAgc::Marker::PushSpanwithstrlen, so its packets are unchanged.Invalid input throws and leaves the buffer untouched: a null buffer, null text with a non-zero length, or a span over 0xfffc bytes (the existing 0x4000-dword payload limit).
The signature
(buffer, text, length, color)comes from the clean-room OpenAGC, the only reference that has these functions. OpenAGC's packet layout differs from the one AnyPS5 uses for markers: it writes the color as the first payload dword and no terminator. I kept AnyPS5's layout so all markers stay consistent. Both points are under "Unknown function info" in TechnicalDebt.Tested
Linux (Arch, GCC), Release with
BUILD_TESTING=ON, on currentmain.agc_command_testsonly runs itsdefaultsmode under ctest, and its full mode already fails onmain("expected an exception"). The new cases therefore go in a separateagc_marker_span_tests, built from sources likeagc_cond_exec_patch_tests. For the DCB and ACB variants it checks:sceAgcDcbPushMarkerwith the same text;Six mutations each make the test fail: the whole string copied instead of the span, the null check removed, the length limit removed, the pop dropped from DCB Set, the pop dropped from ACB Set, and ACB Push ignoring the length.
Full
ctest: 360/360 passed. A simulated merge with every open PR shows no conflict caused by this branch. Not tested with a title.tools/progress.py --compareagainstmain: System libraries 87.14% (+0.14%, +4 implemented functions).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-06T21:41:45Z.
Usage by titles: PS5PCEM
agc_table.zig, "generated from the identifiers a shipped title imports", binds all four (sceAgcDcbPushMarkerSpan,sceAgcDcbSetMarkerSpan,sceAgcAcbPushMarkerSpan,sceAgcAcbSetMarkerSpan), but it does not name the title. I have no title ID beyond that.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T22:02:56Z.
Thanks for the clear write-up, and for recording the OpenAGC layout difference in TechnicalDebt.
Which title calls the marker span builders? The description says it wasn't tested with a title, and none of the four is imported by the titles we test with. If you know of a caller (an executable or engine module that imports one of these NIDs), please name it, since that's the main reason to replace a throw with a guessed packet layout.
Separately, the description says
agc_command_testsin its full mode already fails on main ("expected an exception"). Could you open an issue with the failing case? That deserves a look of its own.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T22:40:36Z.
Thanks, and sorry: I asked before I'd seen your note. The PS5PCEM table doesn't name the title, so this one is weaker than #975: today a title that calls a marker span builder stops with a clear message. If you come across the title (or an engine module that imports one of the four NIDs), please add it here.
The
agc_command_testsfull-mode failure on main is still worth an issue of its own, whatever happens to this PR.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-06T22:40:55Z.
Progress report (
e323c1f→3e9f71c)📈 System libraries: 86.89% (+0.14%, +4 implemented functions)
✅ 4 implemented
sceAgcAcbPushMarkerSpansceAgcAcbSetMarkerSpansceAgcDcbPushMarkerSpansceAgcDcbSetMarkerSpanImported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-06T23:06:56Z.
More on callers. I found two observations of real executables importing them, but neither names the title:
reloc_summary.txtis the GOT of a PS5 main executable as its loader resolved it. It has all four:BYcSvEsINWU(sceAgcDcbSetMarkerSpan),8Kly1JrJUlw(sceAgcAcbPushMarkerSpan),N7M3+N-sBCw(sceAgcDcbPushMarkerSpan) andpxx-GoOSdw4(sceAgcAcbSetMarkerSpan).REmu also builds them, and keeps its payload compatible with the markers that take a NUL-terminated string, as this PR does.
So at least one shipped executable imports each of the four NIDs, but I still can't give a title ID. I'll leave it here unless I find one.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T06:52:08Z.
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.
main)core/libs/prx/libSceAgc/Unimplemented.cppL33-47docs/dev/TechnicalDebt.mdL83-84Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-07T21:06:40Z.
I checked a dump of Propagation: Paradise Hotel (PPSA15878), the title the PS5PCEM table seemed to point to. It doesn't support this PR:
eboot.binimports all four marker span NIDs, and its bundledlibSceJobManager.prximports the two ACB ones.jmpthunk, and none of the four thunks is called or referenced anywhere: nocall/jmp, no RIP-relative reference, no pointer. The same check finds 5 call sites for thesceAgcDcbPushMarkerthunk in the executable and 3 forsceAgcAcbPushMarkerinlibSceJobManager.prx. The span variants are linked in from the SDK but unused.main. It fails before running:error while loading shared libraries: libSceHmd2.prx.So this title would never stop at a marker span function, and the PS5PCEM table only shows imports. I have no title that calls them. Feel free to close this. I'll reopen it with the title ID and the log line if I find one that stops here.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T02:44:05Z.
Closing as agreed: PPSA15878 imports the four span builders but never calls them, and no other title is known to. If you find one that stops at one of them on main, comment here with the title ID and the log line.
Pull request closed