feat(libSceHmd2): answer 62 pointer-checking exports before initialization as the console does #7805
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7805"
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 T3cm0 on 2026-10-19T08:15:16Z.
What
Follow-up to #7798. That sweep left 81
libSceHmd2exports that answer0x8a720008(ParameterNull) to all-null arguments but something else to zeroed buffers, so they validate pointers. A second probe (hmd2n) called each of them six times beforesceHmd2Initialize, every argument pointing at its own zeroed 16 KiB buffer except one, to find which arguments are the checked pointers. 62 exports answer0x8a720008exactly when one of a fixed set of arguments is null and their all-present code otherwise; they are bound here by NID, as in #7798, to 18 handlers with that many pointer parameters:0x8a7200040x8a7210020x8a7200090x8a72002c0x8a7200090x8a7200090x800d0203,0x8a721003,0x8a721010; arguments 0 and 1 with0x8a721002,0x8a721003; arguments 0 and 2 with 0,0x8a721003; argument 1 with0x8a720003,0x8a721002Each handler returns
ParameterNullfor a null checked pointer and otherwise the measured code while the library is not initialized, through theBeforeInitializehelper from #7798, which throws ifsceHmd2Initializeever succeeds (it fails withUnsupportedFeatureonmainsinceb378541e79). What the present arguments mean is not measured and is said so in the debt entries, which list every NID with its aerolib name where one exists (34 of the 62).Error1010andError800d0203are placeholder names.Left as they were: 7 exports that write output (their field widths are not known) and 12 whose answer to a single null argument is neither
ParameterNullnor their all-present code, which take a handle or slot number rather than a pointer first.Measurement: probe
hmd2n(81 NIDs, 486 calls, resumable across crashes), run from Payload Manager with no headset connected; log attached as a comment, together with the earlierhmd2ssweep it starts from.Tested
maineaae7e069dplus #7798:libs,guest_hmd2_testsandpatched_libraries_testsbuilt;ctest -R "guest_hmd2|patched_libraries"2/2 passed. The test calls every handler with all pointers present and with each checked pointer null, beforesceHmd2Initializeand after its failed call.maindb7763d836plus #7798: same targets built, same two tests passed.tools/check_conventions.pyclean against bothmainand #7798's branch;tools/pr_overlap.py: #6844 declares throwing stubs by name for 7 of these exports (sceHmd2GazeGetDeviceStatus,sceHmd2SetFieldOfViewand others), answered from measurement here, so whichever lands second rebases; #7658 and #7690 shareHmd2.hppand the debt file only. No title was run: no known title calls these exports before initialization.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
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T08:15:53Z.
Progress report (
b95ca1b→dd86478)📉 System libraries: 84.19% (-0.55%, +30 declared functions)
🆕 30 declared as stubs
Hmd2BeforeInitializeError0004Hmd2BeforeInitializeError002CHmd2BeforeInitializeError1002Hmd2BeforeInitializeError1003Hmd2BeforeInitializeMinusOneHmd2BeforeInitializeNotInitializedHmd2BeforeInitializeParameterInvalidHmd2BeforeInitializeParameterNullHmd2BeforeInitializeReprojectionNotInitializedHmd2BeforeInitializeValue0400Hmd2BeforeInitializeValue20000Hmd2BeforeInitializeZeroHmd2CheckAllSixThenZeroHmd2CheckFirstAndThirdThenError1003Hmd2CheckFirstAndThirdThenZeroHmd2CheckFirstThenError0004Hmd2CheckFirstThenError1002Hmd2CheckFirstThenError1003Hmd2CheckFirstThenError1010Hmd2CheckFirstThenError800d0203Hmd2CheckFirstThenMinusOneHmd2CheckFirstThenParameterInvalidHmd2CheckFirstThenZeroHmd2CheckFirstTwoThenError1002Hmd2CheckFirstTwoThenError1003Hmd2CheckFirstTwoThenParameterInvalidHmd2CheckSecondThenError002CHmd2CheckSecondThenError1002Hmd2CheckSecondThenInvalidHandleHmd2CheckSecondThenParameterInvalidImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T08:28:23Z.
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.
core/libs/tests/GuestHmd2.cppcore/libs/prx/libSceHmd2/Export.cppcore/libs/prx/libSceHmd2/Hmd2.hppcore/libs/tests/GuestHmd2.cppdocs/dev/debt/libSceHmd2.mdImported from boykopovar/AnyPS5. Originally posted by T3cm0 on 2026-10-19T08:36:47Z.
Console log behind the table in the description: probe hmd2n, the 81 pointer-checking libSceHmd2 NIDs from the hmd2s sweep, each called six times before sceHmd2Initialize with every argument pointing at a zeroed 16 KiB buffer except one; payload process, firmware 13.60, no headset connected.
18-hmd2n-console.txt
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-19T19:01:18Z.
This PR looks strictly contained in #7826: its two commits (
68ef4ca43125 exports,dd86478bc62 pointer-checking exports) are exactly the first two commits of #7826's branch, which carries one more on top (6eeb2233918 slot/output-writing exports). All three PRs are from the same series opened within ~1h12m this morning.If the intent was one review thread, closing this in favour of #7826 would keep a single place for the maintainers to look — #7826 also has a verified rebase handoff onto current
main(including the resolution againstmain's05bdd6aebstubs, 22 of which these commits supersede, 7 of them silent NID double-registrations with no merge conflict). If the split was deliberate, it may be worth saying so on each so they don't read as accidental.Imported from boykopovar/AnyPS5. Originally posted by T3cm0 on 2026-10-20T12:36:35Z.
Closing in favour of #7826, which carries this commit plus the follow-ups and has @blawesom's verified rebase onto current
main(thank you for the NID audit against05bdd6aeb). The split was meant as a review stack, but one thread is easier to review. AI-assisted: yes.Pull request closed