Repository navigation
feat(libScePlayReady): implement the version, init-params and buffer-init calls - #13624
adriadam10 merged 2 commits into
Conversation
…init calls Follow firmware 13.42's libScePlayReady.sprx for sceBufferInit, scePlayReadyBufferInit, scePlayReadyApiInitializeInitParams, scePlayReadyInitializeInitParams, scePlayReadyApiVersion and scePlayReadyApiVersionString, and give them their prototypes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…000 characters Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Progress report (5a75b4a → 3b0bccc)📈 System libraries: 26.51% (+0.02%, +6 implemented functions) ✅ 6 implemented
Changed libraries (implemented exports)
|
|
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.
|
|
Windows run of this head (
AI-assisted: yes (Claude Code). |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
I approve head 3b0bccc20699338ffd461c12d021490fa4583b1f: the six accessor-free initialization/version calls are implemented consistently with their declared signatures, and I found no blocking source issue.
What I ran
Reviewed exact head 3b0bccc20699338ffd461c12d021490fa4583b1f against PR base 5a75b4a119e2c92f8e0881944bd006c0b2bf9751; its merge preview against current main 73ffb45110da8a9960267124941316bc006998ea was clean. The implementation and test files are identical to tested commit 579ed87e0db7277b8fa3c5e37dc2792853fa21eb; the only later change is the debt-file split. The relevant PlayReady source and test files have no changes on current main since the reported test base 16345cad6a692bc37e682150f11c7ab635788941. Environment: Linux x86-64, Python 3.11.2. No local build or CTest was run.
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13624
git diff --stat 579ed87e0db7277b8fa3c5e37dc2792853fa21eb...3b0bccc20699338ffd461c12d021490fa4583b1f
git diff --name-only 16345cad6a692bc37e682150f11c7ab635788941...73ffb45110da8a9960267124941316bc006998ea -- core/libs/prx/libScePlayReady core/libs/tests/GuestPlayReady.cpp core/libs/CMakeLists.txt
gh pr checks 13624 --repo boykopovar/AnyPS5Results
| Check | Result |
|---|---|
| Diff, conventions, dependency/merge preview | Passed. |
| Export declaration/definition audit | Passed; no findings. |
| Hosted Windows build | Passed on the reviewed head. |
| Hosted Linux and specialized jobs | Skipped. |
| PlayReady CTest and seven negative controls | Author reports 3/3 relevant tests passed and each mutation failed the new test on commit 579ed87e0db7277b8fa3c5e37dc2792853fa21eb; I did not independently run them. |
| Firmware behavior | Author reports native calls against firmware 13.42; no console measurement is claimed, and I did not independently verify the disassembly or run. |
Relevant unedited output
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13624:
Head unchanged at completion: True
Base unchanged at completion: True
diff_check: passed
conventions_and_pr_template: passed
live_dependency_and_mergeability_check: passed
gh pr checks 13624 --repo boykopovar/AnyPS5:
windows pass 7m44s
conventions pass 22s
intake pass 21s
labels pass 5s
eligibility pass 7s
library-portability pass 1m51s
report pass 59s
linux skipping 0
register-context skipping 0
relinker skipping 0
relinker-asan skipping 0
write-watch skipping 0
Sources
- PlayReady implementations at the reviewed head
- PlayReady test coverage at the tested source commit
- PlayReady implementation debt and unverified console behavior
Not verified
I did not run the C++ tests, negative controls, firmware calls, or console behavior locally. Linux full-build and specialized hosted jobs were skipped.
blawesom
left a comment
There was a problem hiding this comment.
Verified 3b0bccc on Linux x86-64 (GCC 16.2.1, CachyOS kernel 6.2.10, Release, BUILD_TESTING=ON)
- Built in an isolated worktree at the PR head (fresh build dir, Ninja):
guest_playready_testsandguest_firmware_constant_returns_testsbuild clean. ctest -R '^guest_playready$|^guest_firmware_constant_returns$' -V: 2/2 passed.guest_playreadyrepeated 5x: 5/5 passed.ctest -R 'public_headers' --parallel 8: 65/65 passed.ctest -R 'playready': onlyguest_playreadyexists in the family; passed.nid_verneedpassed after buildingnid_patcher(initial failure was only the unbuilt dependency in my fresh dir, not a PR regression).tools/check_conventions.py --base origin/mainat the head: all checks passed.- Diff vs base
16345cad6ais exactly the 5 files shown; no code comments (only// namespaceends); Conventional Commit subjects; remaining 43 unimplemented exports still go throughNotImplemented_nid_no_patch. - Test coverage of all six exports is thorough: exact cleared ranges (0x18, 0x138) with two fill bytes and untouched tails, magic/version words, null arguments, both version indices plus rejected 2/3/0x80000000/0xFFFFFFFF with nothing written, shared 32-byte string buffer, leftover tail and cleared buffer for unknown indices.
- Version values ({2,5,0,1788} and {1,3,3,2021111201}) come from firmware 13.42's libScePlayReady.sprx read from disassembly and run natively — the PR body and the debt entry both state this and explicitly note it was not measured on a console, and the debt doc correctly documents the shared mutable string buffer and its consequences.
- PR checklist complete and consistent with what I ran (AI-assisted: yes; GPUs: n/a; no title run — none needed for these stateless calls).
Not run: firmware SPRX comparison or a console run (no title/console here); Windows build (author covered WinLibs GCC 15.2).
|
Checked the six implementations against the diff (cleared sizes 0x18/0x138, init-params words, index and null rejection, static version buffer), the debt entries and the new |
What
On
main, 49 of the 50 libScePlayReady exports throw (scePlayReadyMemGetStatsreturns0x80004001), and the debt file lists those 49 as having no known prototype. This implements six that need no PlayReady state, following firmware 13.42's libScePlayReady.sprx (read from disassembly and run natively, not measured on a console; see Tested), and gives them their prototypes:void sceBufferInit(void* buffer)int scePlayReadyBufferInit(void* buffer)0x80070057for nullvoid scePlayReadyApiInitializeInitParams(void* params),void scePlayReadyInitializeInitParams(void* params)0x50524459and1as the first two 32-bit words; do nothing for nullint scePlayReadyApiVersion(uint32_t index, uint64_t* version){2, 5, 0, 1788}, index 1 writes{1, 3, 3, 2021111201}(32 bytes), returns 0;0x80070057for any other index or a nullversion, with nothing writtenconst char* scePlayReadyApiVersionString(uint32_t index)"%lu.%lu.%lu.%lu"(2.5.0.1788,1.3.3.2021111201); for any other index the whole buffer is cleared and returnedBoth calls that take an index read only its low 32 bits (
cmp $0x1,%edi). The version string keeps the firmware's buffer: the firmware does not clear it before a valid index and writes the text through libcsnprintf, so withsnprintfbehaving as standard C (it was modelled, not run, in the firmware run below) the text and its terminator are the only bytes written, and after1.3.3.2021111201a call for index 0 leaves11201after the new terminator. Here the text is built withstd::to_charsrather than the hostsnprintf, becauseunsigned long(%lu) is 32 bits on Windows and the values are 64-bit.scePlayReadyApiIsStartedandscePlayReadyResetare left throwing: their answers depend on the state thatscePlayReadyApiStartandscePlayReadyInitializeset, and those are not implemented. In the debt file the six names leave the "no credible prototypes" entry, which is split into three entries to stay under 1000 characters (its text is unchanged), and a new entry records where they come from, that the meaning of the cleared fields is unknown (so they takevoid*), and that the version string is a single static buffer, as in the firmware.Tested
Windows 11, WinLibs GCC 15.2, Release. No title was run.
guest_playreadycovers all six: the cleared byte ranges with two fill bytes (0xA5 and 0x5A) and the bytes after them left untouched, the init-params words, null arguments, both version indices, the rejected indices 2, 3, 0x80000000 and 0xFFFFFFFF with nothing written, the shared string buffer, the leftover tail after a shorter string and the cleared buffer for an unknown index.579ed87e0d(basemain16345cad6a; the head commit after it only splits the debt entry),guest_playready,guest_firmware_constant_returns(the other test that links this library) and the 65public_headerstests pass 3/3. Seven single mutations of the new code (clearing 0x20 instead of 0x18 bytes, 0x130 instead of 0x138, writing 0 instead of 1, accepting a nullversion, not clearing the buffer for an unknown index, clearing the whole buffer before a valid string, and returning 0 for a null buffer) each makeguest_playreadyfail on its first run at the matching check.0x100000000and0x100000001for both index calls,0xDEADBEEF00000000forscePlayReadyApiVersion), which behaved as their low 32 bits. The only import these calls use,snprintf, was modelled as standard C for%lu. Three runs gave the same output, and the values above are from it. Nothing from the firmware is attached or added.check_conventions.py --base upstream/mainpasses at the head.pr_overlap.py(on579ed87e0d) found no overlap with the PRs it could compare and failed closed on 13 that conflict withmain(feat(aot): consolidate native ARM64 compiler, runtime and consumers #5021, feat(agc): add opt-in render-state overrides #7275, fix(runtime): isolate host worker MXCSR #7622, feat(libSceVrTracker): answer before initialization in sceVrTrackerGetTime, sceVrTrackerGpuSubmit and sceVrTrackerGpuWait #8650, feat(libkernel): implement four pthread_attr forms #9156, feat(libkernel): implement the named ksem semaphores #9293, feat(libkernel_sys): implement POSIX message queues #9297, feat(libkernel_sys): implement kmq_notify registration #9302, feat(libkernel): implement rtld_printf #9383, feat(libSceFreeType): query Type 1 private dictionaries #9933, feat(libkernel_sys): implement pthread_suspend_np #12130, feat(libkernel_sys): implement pthread_suspend_all_np and pthread_single_np #12642, feat(libSceLibreSsl): implement file and socket BIO adapters #12928); I compared those by hand and none touches libScePlayReady.progress.py --compare(on579ed87e0d): +6 implemented functions in libScePlayReady (1/50 to 7/50), none flagged empty. Nothing else in the repo calls these exports.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)🤖 Generated with Claude Code