Repository navigation
Conversation
…sole does A sweep of the 281 libSceHmd2 exports on a PS5 (firmware 13.60), each called from a payload before sceHmd2Initialize once with every argument null and once with every argument pointing at a zeroed 16 KiB buffer, found 127 that answer the same code both ways and write nothing. 125 of them are bound here, by NID, to one handler per answer: 45 return 0, 16 return 0x8a720008, 15 return 0x8a720004, 12 return -1, 10 reprojection exports return 0x8a72000b, 9 return 0x8a720002, 9 return 0x8a720009, 5 return 0x8a721002 and one each returns 0x8a72002c, 0x8a721003, 0x400 and 0x20000. Each handler returns its measured value while the library is not initialized and throws if sceHmd2Initialize ever succeeds, because the initialized behaviour is not measured; since b378541 it fails with UnsupportedFeature here, so these are the answers titles get. Left out: the export that returns a pointer-like value, the one answering 0x8a72000a (which sceHmd2Initialize also returns for some applications), the exports that answer differently to null and to zeroed arguments or write output, the 16 that crashed the probe, and the exports that main, boykopovar#7658 or boykopovar#7690 already implement. The debt entries list every NID with its aerolib name where one exists. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Console log behind the table in the description: probe hmd2s, 281 libSceHmd2 NIDs called from a payload before sceHmd2Initialize, first with every argument null and then with every argument pointing at a zeroed 16 KiB buffer, resumed across the crashes it hit; firmware 13.60, no headset connected. 17-hmd2s-console.txtAI-assisted: yes. |
Progress report (eaae7e0 → 68ef4ca)📉 System libraries: 84.51% (-0.22%, +12 declared functions) 🆕 12 declared as stubs
|
|
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.
|
adriadam10
left a comment
There was a problem hiding this comment.
Thanks for the sweep. Two things block this as it stands:
- The branch conflicts with
mainincore/libs/prx/libSceHmd2/Export.cppandcore/libs/tests/GuestHmd2.cpp. - 15 of the NIDs you bind with
APS5_EXPORTare already exported onmainby named throwing stubs:sceHmd2SetIpdOffset,sceHmd2GazeActivateGazeTracking,sceHmd2GazeGetCalibrationData,sceHmd2GazeObjectSelectionInitialize,sceHmd2GazeObjectSelectionTerminate,sceHmd2GazeSetEnabledEye,sceHmd2GazeSetUserCalibrationData,sceHmd2GazeSetUserCalibrationPoint,sceHmd2GazeStartUserCalibration,sceHmd2GazeStopUserCalibration,sceHmd2ReprojectionClearUserEventStart,sceHmd2ReprojectionClearUserEventEnd,sceHmd2ReprojectionSetUserEventStart,sceHmd2ReprojectionSetUserEventEnd,sceHmd2ReprojectionGetCurrentOutput. The name already hashes to the NID, so the alias exports the same symbol twice. The Linux patcher accepts that and the Windows PE patcher rejects it (duplicate patched export name).
To fix: rebase on main, and for those 15 replace the body of the existing stub (return the measured value through BeforeInitialize) instead of adding a second export. Recheck against #7658 as well, which also changes some reprojection exports, and update the debt entries and the test to the resulting set. Also add the new debt lines away from the end of the section; #7658 and #7690 both append there.
|
This PR looks strictly contained in #7826: its single commit 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 |
|
Thanks for measuring these. The shared-body design and the per-answer debt entries read well. One thing blocks the stack (#7798, #7805, #7826) from merging: since its base, sceHmd2GazeActivateGazeTracking, sceHmd2GazeGetCalibrationData, sceHmd2GazeGetCalibrationDataMaxSize, sceHmd2GazeGetDeviceStatus, sceHmd2GazeGetUserCalibrationStatus, sceHmd2GazeInsertRawDataWithHandle, sceHmd2GazeObjectSelectionGetSelectedObject, sceHmd2GazeObjectSelectionInitialize, sceHmd2GazeObjectSelectionQueryMemory, sceHmd2GazeObjectSelectionTerminate, sceHmd2GazeSetEnabledEye, sceHmd2GazeSetUserCalibrationData, sceHmd2GazeSetUserCalibrationPoint, sceHmd2GazeStartUserCalibration, sceHmd2GazeStopUserCalibration, sceHmd2ReprojectionClearUserEventEnd, sceHmd2ReprojectionClearUserEventStart, sceHmd2ReprojectionGetCurrentOutput, sceHmd2ReprojectionSetUserEventEnd, sceHmd2ReprojectionSetUserEventStart, sceHmd2SetFieldOfView, sceHmd2SetIpdOffset Could you rebase the three onto current |
|
The drop for this is already verified if it saves anyone the work: my rebase handoff on #7826 (branch |
… the console does sceHmd2ReprojectionBeginFrame, sceHmd2ReprojectionDisableMirroring, sceHmd2ReprojectionDisableVrMode, sceHmd2ReprojectionGetStatus and sceHmd2ReprojectionSetMirroringOption threw. Each now returns REPROJECTION_NOT_INITIALIZED (0x8a72000b) without checking or writing an argument. A retail PS5 (firmware 13.60, no PS VR2 headset) gave that answer to all five from a homebrew payload before sceHmd2Initialize, with every argument null and with every argument pointing at a zeroed buffer: boykopovar#7798 (comment) On firmware 13.40, inside a retail game process whose sceHmd2Initialize and sceHmd2ReprojectionInitialize had failed, BeginFrame, GetStatus and SetMirroringOption gave the same answer with non-zero arguments: boykopovar#8645 (comment) On main sceHmd2Initialize always fails and sceHmd2ReprojectionInitialize throws, so every caller reaches these calls in that state. KytyPS5 names the code and gives BeginFrame its int64_t flip argument; the other four stay declared without parameters. The answers with a reprojection session are unmeasured; the debt file says a session has to gate them. guest_hmd2 calls BeginFrame with 0, 1, -1 and INT64_MAX and the other four twice each, before the library's state checks and again after the failed sceHmd2Initialize, and expects 0x8a72000b every time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the console does sceHmd2ReprojectionBeginFrame, sceHmd2ReprojectionDisableMirroring, sceHmd2ReprojectionDisableVrMode, sceHmd2ReprojectionGetStatus and sceHmd2ReprojectionSetMirroringOption threw. Each now returns REPROJECTION_NOT_INITIALIZED (0x8a72000b) without checking or writing an argument. A retail PS5 (firmware 13.60, no PS VR2 headset) gave that answer to all five from a homebrew payload before sceHmd2Initialize, with every argument null and with every argument pointing at a zeroed buffer: boykopovar#7798 (comment) On firmware 13.40, inside a retail game process whose sceHmd2Initialize and sceHmd2ReprojectionInitialize had failed, BeginFrame, GetStatus and SetMirroringOption gave the same answer with non-zero arguments: boykopovar#8645 (comment) On main sceHmd2Initialize always fails and sceHmd2ReprojectionInitialize throws, so every caller reaches these calls in that state. KytyPS5 names the code and gives BeginFrame its int64_t flip argument; the other four stay declared without parameters. The answers with a reprojection session are unmeasured; the debt file says a session has to gate them. guest_hmd2 calls BeginFrame with 0, 1, -1 and INT64_MAX and the other four twice each, before the library's state checks and again after the failed sceHmd2Initialize, and expects 0x8a72000b every time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tionEnableMirroring, GetPredictedDisplayTime and SetRenderConfig Without a reprojection session the three calls return 0x8a72000b (reprojection not initialized) for every argument and write nothing. A retail PS5 answered so from a payload before sceHmd2Initialize, with every argument null and with every argument pointing at a zeroed 16 KiB buffer (firmware 13.60, T3cm0's hmd2s log on #7798), and in a PPSA23479 game process (firmware 13.40, frankea on #8645). sceHmd2ReprojectionInitialize throws on main, so no session can exist; the in-session answers stay unimplemented and are recorded in docs/dev/debt/libSceHmd2.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the console does sceHmd2ReprojectionBeginFrame, sceHmd2ReprojectionDisableMirroring, sceHmd2ReprojectionDisableVrMode and sceHmd2ReprojectionSetMirroringOption threw for every caller. Without a reprojection session each now returns REPROJECTION_NOT_INITIALIZED (0x8a72000b) without checking or writing an argument; inside a session they still throw, because the answers there are unmeasured. A retail PS5 (firmware 13.60, no PS VR2 headset) gave that answer to all four from a homebrew payload before sceHmd2Initialize, with every argument null and with every argument pointing at a zeroed buffer: boykopovar#7798 (comment) On firmware 13.40, inside a retail game process whose sceHmd2Initialize and sceHmd2ReprojectionInitialize had failed, BeginFrame and SetMirroringOption gave the same answer with non-zero arguments: boykopovar#8645 (comment) Rebased onto the reprojection session main has since grown: the calls are gated on it as sceHmd2ReprojectionEnableMirroring is, and keep the signatures main declares in Api.hpp. sceHmd2ReprojectionGetStatus, the fifth call of this change, is already implemented on main and is left as it is. The debt entry is added through a fragment. guest_hmd2 calls BeginFrame with 0, 1, 0x123456789, -1 and INT64_MAX, the two disable calls and SetMirroringOption with a null and a filled option, before sceHmd2Initialize, after its failure and after sceHmd2ReprojectionTerminate, and expects 0x8a72000b every time with the option left unwritten; inside a session it expects none of the four to answer as without one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
What
A sweep of the 281
libSceHmd2exports on a retail PS5 (firmware 13.60), each called from a payload beforesceHmd2Initializeonce with every argument null and once with every argument pointing at a zeroed 16 KiB buffer, found 127 exports that answer the same code both ways and write nothing. This PR binds 125 of them by NID, withAPS5_EXPORTas #7463 does, to one handler per measured answer:0x8a720008(ParameterNull)0x8a7200040x8a72000b(all reprojection exports)0x8a720002(NotInitialized)0x8a720009(ParameterInvalid)0x8a7210020x8a72002c,0x8a721003,0x400,0x20000Each handler returns its value while the library is not initialized and throws through
NotImplemented_nid_no_patchifsceHmd2Initializeever succeeds, because the initialized behaviour is not measured. Since b378541sceHmd2Initializefails withUnsupportedFeatureonmain, so the uninitialized answers are the only ones a title reaches here, which is also what it sees on the console until the headset runtime is up. The debt entries list every NID with its aerolib name where one exists (72 of the 125), say thatError0004,Error002C,Error1002andError1003are placeholder names for codes whose meaning is unknown, and thatReprojectionNotInitializedis our name for0x8a72000b.Left as they were: the export that returns a pointer-like value, the one answering
0x8a72000a(whichsceHmd2Initializealso returns for some applications, per the existing debt entry), the exports that answer differently to null and to zeroed arguments or that write output (a follow-up once their argument layouts are known), the 16 that crashed the probe, and everythingmain, #7658 and #7690 already implement.Measurement: probe
hmd2s(281 NIDs, resumable across the crashes it hits), run from Payload Manager with no headset connected; log attached as a comment. The payload process is not a game process, so a game beforesceHmd2Initializeis assumed to answer the same; that assumption is stated in the debt entries.Tested
maineaae7e0:libs,guest_hmd2_testsandpatched_libraries_testsbuilt;ctest -R "guest_hmd2|patched_libraries"2/2 passed. The test calls all twelve handlers beforesceHmd2Initializeand again after its (failed) call.tools/check_conventions.pyclean;tools/pr_overlap.py: feat(libSceHmd2): export missing firmware functions from database #6844 declares throwing stubs by name for 15 of these exports (sceHmd2GazeSetEnabledEye,sceHmd2ReprojectionSetUserEventStartand others) and this PR answers them from measurement, so whichever lands second rebases; feat(libs): the Hmd2 reprojection session #7658 and feat(libSceHmd2): return the console's display and mirroring buffer sizes #7690 shareHmd2.hppand the debt file only (new constants next to theirs, new bullets at the end). 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