feat(libSceVrTracker2): answer as the console's module before initialization #7463
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7463"
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-18T08:35:54Z.
What
Implements the 115 libSceVrTracker2 exports as the console's module answers before it is initialized, which is the state this library stays in: #7323 made libSceHmd2 report a console without a PS VR2 headset, so titles now reach the tracker. The behaviour was measured on a retail PS5 (firmware 13.60, no headset) by loading
libSceVrTracker2.sprxin a homebrew payload and calling every NID with null arguments, zeroed buffers and buffers filled with 0xAA and 0x01: 99 exports return 0x8A740001 and write nothing; two clear 24 and 16 bytes of a non-null first argument and return 0x8A740001 (0x8A740006 when it is null); one returns 0x8A740006 for a null second argument; two return 0; two write fixed values to their first argument and return 0. The memory query, found by searching its parameter's size and fields, accepts only a 32-byte parameter of size 0x20 with every other byte zero and then reports 32 MiB aligned to 64 KiB. The eight exports whose accepted input is still unknown, initialization among them, throw; the debt file records the initialization parameter PPSA05666 passes, captured under AnyPS5, and that the console's initialization called with it from a payload did not return; the debt file lists what the console returned for each. Signatures and export names are unknown, so the twelve exports that already had aerolib names keep them and the others are bound by NID withAPS5_EXPORTto this library's own names. A null output pointer for the two exports that crash on the console throwsstd::invalid_argument.Tested
Windows 11 (MinGW GCC 15.2) and Ubuntu 26.04 on WSL2 (GCC 15.2), Release builds:
ctestfor guest_vr_tracker2 (new) passes on both, and patched_libraries on Windows; the built library exports all 115 NIDs and goes throughnid_patcher. The console results come from payloads run on a PS5 (firmware 13.60) with no PS VR2 headset; the decrypted module itself was not disassembled. Not tested with a title.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-18T08:36:31Z.
Progress report (
c017549→151f116)📈 System libraries: 79.88% (+0.14%, +18 implemented, +7 declared functions)
✅ 18 implemented
VrTracker2AcceptVrTracker2CheckSecondThenReportNotInitializedVrTracker2ClearNarrowResultVrTracker2ClearWideResultVrTracker2ClearWordVrTracker2FillDefaultsVrTracker2NotInitializedsceVrTracker2FinalizesceVrTracker2GetCoordinateSystemsceVrTracker2GetPlayAreaBoundaryGeometrysceVrTracker2GetPlayAreaOrientedBoundingBoxsceVrTracker2GetResultsceVrTracker2LocateCoordinateSystemsceVrTracker2QueryMemorysceVrTracker2RegisterDevicesceVrTracker2ResetLocalCoordinatesceVrTracker2SetCoordinateSystemsceVrTracker2UnregisterDevice⚪ 12 behaviourally empty (constant return or throw)
VrTracker2AcceptVrTracker2NotInitializedsceVrTracker2FinalizesceVrTracker2GetCoordinateSystemsceVrTracker2GetPlayAreaBoundaryGeometrysceVrTracker2GetPlayAreaOrientedBoundingBoxsceVrTracker2GetResultsceVrTracker2LocateCoordinateSystemsceVrTracker2RegisterDevicesceVrTracker2ResetLocalCoordinatesceVrTracker2SetCoordinateSystemsceVrTracker2UnregisterDevice🆕 7 declared as stubs
VrTracker2Unknown01VrTracker2Unknown02VrTracker2Unknown03VrTracker2Unknown04VrTracker2Unknown05VrTracker2Unknown06VrTracker2Unknown07Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-18T17:02:44Z.
Datapoint from Horizon Call of the Mountain (PPSA05666, v01.004.011, PS VR2-only), the title whose initialization parameter the debt file records. On
maine5c2b3c32it stops 3 of 3 onsceVrTracker2QueryMemory not implemented, 11 s after launch (warm shader cache; details in the #6214 bring-up thread). With this PR it walks through the memory query and stops on the export this PR leaves throwing:maine5c2b3c32sceVrTracker2QueryMemory not implemented, SIGABRTlibSceVrTracker2.prx+0x15d0underapp.exe+0x4b8d7f7maine5c2b3c32+ this PR (head3fd2a2fe2, fast-forward)sceVrTracker2Initialize not implemented, SIGABRTlibSceVrTracker2.prx+0x1650underapp.exe+0x4b8d89bSo the title accepts the query's answer (32 MiB, 64 KiB) and goes on to initialization 0xa4 bytes later in the same function (
app.exe+0x4b8d7f7to+0x4b8d89b, with onelibc.prx.guest.prx+0x15d5aframe in between), on the same title thread: the VR set-up frames (app.exe+0x10f8eee/+0x10fadee) and alibSceHmd2.prx+0x1900return address from the #7323 device-information call are still on its stack. Nothing else in the two trees' output differs: stdout is 255 lines in all six runs with the same unknown sysmodule ids (298, 299, 304), and no otherlibSceVrTracker2export was reached before6Jy73SRfG-o. That matches the debt file: the title's next question is what initialization returns without a headset.stderr with this PR, run 2 (abort block; the full stderr and stdout follow in two comments)
Tested. Windows 11 (26200), RTX 4090 (NVIDIA 616.92), WinLibs GCC 15.2.0 r7 (UCRT), Release
libstarget, ccache; the PR branch ismaine5c2b3c32plus its one commit, built incrementally in the same worktree as themainruns.APS5_PLAYGO_UNLISTED_CHUNKS=absent(the dump has no PlayGo files),app.exerelinked on 10/14. Desktop session, 3840x2160 guest presented at 2016x1134, no input, three runs per tree in a row, 240 s cap, box otherwise idle. Not a review of the console measurements, which I cannot check.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-18T17:02:53Z.
stderr of run 2 with this PR (
maine5c2b3c32+3fd2a2fe2), 240 s cap, no input; 886 lines.stderr
Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-18T17:02:57Z.
stdout of the same run (255 lines, identical to the
mainruns apart from addresses).stdout
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T20:56:55Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)docs/dev/debt/libSceHmd2.mdL5Imported from boykopovar/AnyPS5. Originally posted by T3cm0 on 2026-10-18T21:18:21Z.
Thanks for the runs. They match what I saw with the same title under AnyPS5: after the memory query it reaches
6Jy73SRfG-ofromapp.exe+0x4b8d89b, with the 0x48-byte parameter the debt file records.What initialization returns to a title without a headset is the one thing I could not measure. Called from a payload with that parameter it never returns; called from the homebrew launcher's application context it returns 0x8A74001E, but there
sceHmd2Initializehas already rejected the process with 0x8A72001F (not a game application), so that value is the "Hmd2 not initialized" answer, not the one a title gets. It needs a game-type process, which I cannot produce on my console.With initialization answered, the title's next stop is
sceHmd2ReprojectionQueryBufferSizeAlign; a follow-up PR stacked on this one returns the console's values for that and the four other reprojection size queries.Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-19T09:08:44Z.
Rebase handoff — rebased onto current
main(authorship unchanged). One docs-debt conflict, unioned.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; conventions pass; full suite green apart from the four knownmainregressions (#5444 Mesa, #7584 BDA, #7766, #7784), none from this PR.To pick it up:
Head is
dcba3c7af.Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-19T09:21:19Z.
On the open question above, what initialization returns to a game-type title: measured inside retail game processes on a PS5 (firmware 13.40), with ptrace calls from an elfldr payload and a PS VR2 headset connected.
sceVrTracker2Initializeagain from inside GT7 with the GT7/Horizon 0x48-byte parameter (32 MiB / 64 KiB work memory) returns 0x8A740002 at once, so the title's own call succeeded with a headset present.sceVrTracker2QueryMemory({0x20, zeros})answers size 0x20, 32 MiB, 64 KiB there, as this PR does. GT7's eboot importsQueryMemory,Initialize,RegisterDevice,UnregisterDevice,GetResultandSetCoordinateSystemfrom the tracker.GetResult,RegisterDevice,GetCoordinateSystemandGetPlayAreaBoundaryGeometryreturn 0x8A740001. During the call the system stopped and continued the process (seven SIGSTOP, one SIGCONT) and the screen went black for a moment.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T22:09:46Z.
Rebased onto current
main; the only conflict was the libSceHmd2 debt line, whichmainrewrote when #7323 was reverted. I keptmain's text and changed only its libSceVrTracker2 sentence. Checked the console-measured answers in the debt file against the code and the newguest_vr_tracker2test; merged.Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T00:21:25Z.
@T3cm0, a question about
sceVrTracker2Initializewithout a headset, since you measured this library's uninitialized answers on a PS5.It's now the next stop for two titles on
main:sceVrTracker2Initialize not implemented. That's 3 of 3 runs onmain324e0e48ewith #7658 and #7690, from frankea's run. Gran Turismo 7 doesn't need a headset, so on a console without one this call must return something the title accepts.Your debt entry says the console's initialization, called from a payload with Horizon Call of the Mountain's parameter, didn't return. Two things would settle what
mainshould answer:We'd only implement the answer the console gives; we won't guess one.