Repository navigation
feat(libSceNpMatching2): model contexts offline - #9902
Conversation
The context calls, the callback registrations and SetDefaultRequestOptParam threw. They now follow shadPS4's checks and context ids, ContextStart returns SCE_NET_ERROR_RESOLVER_ETIMEDOUT, the answer shadPS4 records for a console without internet access, and Terminate releases the contexts.
Progress report (aeeaefa → aff9389)📈 System libraries: 48.79% (+0.08%, +9 implemented functions) ✅ 9 implemented
|
|
I checked the context lifecycle and offline behavior against the added test: the context set is serialized under a mutex, ids wrap across 1–10 while skipping live ids, termination clears state and resets allocation, and |
|
I also independently built and ran the exact A scope/checklist question before I can complete approval: the current three-commit diff includes offline Matching2 contexts, |
|
Correction to my scope question in #6354074656: I compared the complete commit ancestry with #9896 and confirmed that the PS4 NP imports and Trophy changes are the exact declared prerequisite history, not separate contributions newly bundled into this PR. The |
|
@MarcZX10 thanks for the independent context test and for clarifying the prerequisite scope. Updated in d90537b, merging main while preserving the reviewed hashes: both CMake test registrations and both Signaling debt sections are retained. The full Release build and all six focused NP tests pass, including guest_np_matching2_offline and the prerequisite guest_np_ps4_imports. Depends on #9896 remains; Windows was not compiled here. |
…texts # Conflicts: # core/libs/CMakeLists.txt # docs/dev/debt/libSceNpSignaling.md
…CMakeLists.txt docs/dev/debt/libSceNpSignaling.md)
…oykopovar#9466 in core/libs/CMakeLists.txt and libc/CMakeLists.txt: the kept-both-sides merge dropped the closing PATH line and endif() of the test block each PR's block was inserted after
What
Builds on #9896, which implements
sceNpMatching2InitializeandsceNpMatching2Terminate. #9896 is merged and this branch is merged with currentmain, so the diff now holds only this PR's change.The context calls of libSceNpMatching2 threw. They now follow shadPS4's np_matching2.cpp and its context manager, offline:
sceNpMatching2CreateContextreturnsNOT_INITIALIZEDbefore any argument check, then refuses a null parameter, a parameter whosesizeis not0x28and a null output withINVALID_ARGUMENT. Ids 1 to 10 are handed out round-robin; an eleventh context isCONTEXT_MAX.sceNpMatching2DestroyContextand the room event, room message and signaling callback registrations answerINVALID_CONTEXT_IDfor an unknown context;sceNpMatching2SetDefaultRequestOptParamchecks the null option first.sceNpMatching2Terminatenow also releases the contexts and restarts the ids.sceNpMatching2ContextStartreturns0x804101E2(SCE_NET_ERROR_RESOLVER_ETIMEDOUT) after the initialization check. shadPS4 returns it when there is no network and notes that the "error [was] confirmed with a real console disconnected from the internet". No context starts, sosceNpMatching2ContextStopanswersCONTEXT_NOT_STARTEDfor a known context.Callbacks and the default request option are checked but never used, as no event is generated offline. The room, user, world, server-id and signaling-info calls still throw:
sceNpMatching2GetServerIdin shadPS4 writes server id 1 from its own server, which is not an answer to copy. Nothing here is measured on a PS5 beyond shadPS4's note; the debt entry says so.#9874 declares other libSceNpMatching2 exports and creates the same debt file as #9896;
pr_overlap.pyfinds no conflict inExport.cpp.Tested
Ubuntu 26.04.1, kernel 7.0.0-38, GCC 15.2.0, Release, full build with
BUILD_TESTING=ON. Windows was not compiled. No title was run.New
guest_np_matching2_offline(core/libs/tests/GuestNpMatching2Offline.cpp):NOT_INITIALIZEDfrom every context call before initialization (ahead of the argument checks), the create parameter checks, ids 1 to 10 with a freed id skipped until the allocation wraps,CONTEXT_MAX, the offline start for known and unknown contexts,CONTEXT_NOT_STARTED, the callback and option checks, and termination releasing the contexts and restarting the ids.On feat(np): answer and declare the PS4 NP and trophy imports of CUSA03312 #9896's branch the test aborts (
sceNpMatching2CreateContext not implemented); with this change it passes, and feat(np): answer and declare the PS4 NP and trophy imports of CUSA03312 #9896'sguest_np_ps4_importsstill passes. 11 mutations of the new code (parameter size, check order, round-robin, the limit, the offline start before the context check, the stop and option checks, both parts of the termination reset, the context callback's initialization check, destroying) each fail it.tools/check_conventions.py --base upstream/mainpasses, and the branch merges cleanly into currentmain.Updated onto
main15e71dbe11with merge commitd90537bf06, preserving hashes referenced in the review. Resolved the CMake conflict by keeping bothguest_np_commonandguest_np_ps4_imports, and retained both Signaling debt sections. Full Release build succeeds;guest_np_matching2_offline,guest_np_ps4_imports, all threeguest_np_commoncases andguest_np_signaling_offlinepass (6/6). Conventions and whitespace checks pass. Windows was not compiled.After merging current
main(feat(np): answer and declare the PS4 NP and trophy imports of CUSA03312 #9896 included), the full build succeeds, the 34guest_nptests pass and conventions pass.Refreshed overlap check: feat(np): answer and declare the PS4 NP and trophy imports of CUSA03312 #9896 is the declared prerequisite; feat(prx): declare exports for 3 inventory-covered NP libraries #9874 adds different exports but shares Matching2/Trophy debt sections, which must retain both entries on merge. The checker could not compare CMake changes in feat(aot): consolidate native ARM64 compiler, runtime and consumers #5021, test: organize library tests and label CTest suites #6044, Macos port #7201, feat(agc): add opt-in render-state overrides #7275, fix(runtime): isolate host worker MXCSR #7622, fix(savedata): build libSceSaveData and libSceSaveDataDialog from the native sources #7780, feat(savedata): add sceSaveDataMount2 #8285, feat(libSceVrTracker): answer before initialization in sceVrTrackerGetTime, sceVrTrackerGpuSubmit and sceVrTrackerGpuWait #8650, feat(libSceGnmDriverForNeoMode): write the shader register packets and answer the workload and clock queries #9212, feat(libSceGnmDriverForNeoMode): set the embedded fullscreen VS and PS shaders #9221, feat(libkernel): implement the unnamed ksem semaphores #9284, feat(libkernel): implement the named ksem semaphores #9293, feat(libkernel_sys): implement POSIX message queues #9297, feat(libkernel_sys): implement kmq_notify registration #9302 and feat(libSceLibreSsl): implement CMAC with AES-CBC methods #9571. I inspected those CMake diffs; none edits the
guest_np_ps4_importsregistration.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)