refactor(libs): share the remaining compiled SDK version reads #26370
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/26370"
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 Buraddomoon on 2026-11-23T20:58:00Z.
What
Route the six remaining read sites enumerated in #26276 through the helper introduced by #26296. AppContent, GnmDriverForNeoMode, Hmd2, Http and Http2 now use
ApplicationCompiledSdkVersion()for the 32-bit process-parameter field at offset0x10. Http2 uses the host helper instead of a guest export, removing its0x99900000fallback and unused kernel API include.Keep the existing local helper names as forwarding functions: in-flight changes such as #24528 call them too. This centralizes the read without renaming their call sites or requiring those PRs first. The SDK field and normal SDK-dependent results are preserved.
Http2 previously substituted
0x99900000whensceKernelGetCompiledSdkVersion(&version)returned an error, although its destination was a local host-stack variable. The direct helper returns the actual field without that guest-output fallback policy. Parameter discovery can throw for missing or invalid process metadata in both implementations; the helper is not a fabricated-success fallback.Together with #26296, this completes the 16 readers listed in #26276. The additional readers identified in review in Json2, Ngs2.native, Rtc, Ssl, UsbStorageDialog and kernel Coredump are follow-up scope.
Tested
Linux x86-64, Debian 13 container on Fedora 44, GCC 14.2.0, CMake 3.31.6, Ninja, Release with
-O1 -DNDEBUG. Full runtime configuration (BUILD_TESTING=ON), all five affected libraries and the selected test executables built successfully.3aec109413b7a30a3db672cc09e90dd71dfb74f0: 74/74 CTests passed, zero skips, in 23.58 s. Selection:guest_appcontent|guest_hmd2|guest_gnm_neo|^guest_http|application_?heap|process_?param.sceHmd2Initializealways returnsUnsupportedFeature, andinitializedis never set to true. The passing Hmd2 tests validate the available error paths, not those SDK branches.-O3, including the Http2 transport archive, while leaving unchanged dependency builds at-O1. The same 74/74 CTests passed with zero skips on the unchanged head.-O3and compared them with a variant removing the local forwarding functions and callingApplicationCompiledSdkVersion()directly.objdump -drCinstruction and relocation listings match for all six, after normalizing only the temporary object filename and the generated initializer filename. The forwarding functions disappear at this optimization level; retaining their names adds no extra call in this compiler/configuration.python3 tools/check_conventions.py --base origin/mainandgit diff --check origin/main...HEADpassed.mainf784587f30and on three runs of merge5952756a06. The reviewer also checked SDK changes between calls and used negative-control/mutation cases for the reachable readers. These are the reviewer's runs, separate from the author's Linux results.The pre-submission branch overlap check examined 2,541 open PRs and 13 shared-file candidates. It returned exit 2 for #17711, #19525 and the then-current #24528 because they already conflicted with the checked base. After the bot listed 13 unverified comparisons, I manually compared the current heads of all 13 reported PRs against base
2b09db6f11and this head3aec109413: #11630, #12056, #16231, #17711, #18954, #19525, #20805, #24528, #24634, #25677, #25731, #25756 and #26229. Eleven merge cleanly with this head. #17711 and #19525 have exactly the same conflict paths and conflict blocks on the base and on this branch. The updated #24528 (81b4bc374f) merges cleanly; retaining the local helper names preserves its added calls. This records manual comparison of the bot warnings, not a clean checker exit or combined runtime qualification of the other PRs.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)Imported from boykopovar/AnyPS5. Originally posted by catminou4 on 2026-11-23T22:08:29Z.
Review: COMMENTED
Verified locally (Linux x86-64, GCC 11):
libSceAppContentandlibSceHttpbuild cleanly from this branch.The change replaces six local copies of "read the compiled SDK version from the process parameters at +0x10" with the existing shared helper
ApplicationCompiledSdkVersion()fromprx/libc/include/ApplicationHeap.hpp, which does exactly the same read. Five of the six sites are behavior-neutral.One note on
libSceHttp2/Transport.cpp: the old code went throughsceKernelGetCompiledSdkVersionand fell back to0x99900000on error; the new code reads the process parameters directly and has no fallback. SinceApplicationCompiledSdkVersion()is the same source of truth and cannot fail, this is arguably more consistent, but it is a small behavioral difference worth being aware of (the0x99900000sentinel path is gone). Not a blocker.Deduplicating onto the shared helper is the right direction. LGTM from my side.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T08:05:55Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; its six reader paths now delegate to the shared SDK-version helper while preserving the existing helper names and SDK-dependent call sites.
What I ran
Reviewed head
3aec109413b7a30a3db672cc09e90dd71dfb74f0using the prepared diff and pinned repository reader. No build or test commands were run by me; the test results below are author-reported.Files read:
description.md,commits.md,manifest.json,diff.patch,ApplicationHeap.hpp, and the changed source ranges inExport.cpp,Options.cpp,Uri.cpp, andTransport.cppfor all six changed files. All six changed files are listed as included in the manifest. No files were excluded by the manifest.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not run the reported tests or builds, verify native Windows/macOS behavior, or measure behavior on a console, GPU, or title. The description reports Hmd2 SDK branches are currently unreachable; I did not independently verify that coverage claim. The description also reports the other reviewers' test runs; those were not run by me.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T12:18:39Z.
Review: COMMENTED
Compiled the exact shared SDK helper into a Linux fixture. It read the compiled SDK field while ignoring the adjacent Prospero field, and a second call saw a value change without redoing the process-parameter lookup. I checked the call sites against the previously used offset. This run covered the shared helper.
AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.