feat(libSceVrTracker): answer before initialization in sceVrTrackerGetTime, sceVrTrackerGpuSubmit and sceVrTrackerGpuWait #8650
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8650"
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 nikowolf123 on 2026-10-20T20:04:24Z.
What
Until sceVrTrackerInit has succeeded, sceVrTrackerGetTime, sceVrTrackerGpuSubmit and sceVrTrackerGpuWait no longer throw: they return NOT_INIT (0x81260801) for every argument and write nothing. Once the tracker is initialized they still throw. This is the answer before initialization in shadPS4's model of the PS4 module (vr_tracker.cpp at 8d50471b), which checks initialization before any argument; it is not measured on a PS5 and is recorded through the debt fragment docs/dev/debt/changes/feat-vrtracker-before-init.md.
The new guest_vr_tracker test calls each with null and non-null arguments before sceVrTrackerInit and again after sceVrTrackerTerm, checks the result and that the time value and parameter buffer are left untouched, and checks that each throws while the tracker is initialized.
Rebased onto current
mainand adapted to the declarations, test layout and debt fragments it has now.Tested
Windows 11, WinLibs MinGW-w64 GCC 15.2.0 (ucrt, posix, seh), full build of this branch on current
main.ctestpasses for guest_vr_tracker (new) and guest_vr_tracker_devices. Not run on a console or 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)Summary by CodeRabbit
NotInitwhen the VR tracker has not been initialized.Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-21T06:58:27Z.
Windows run of 7c894a1123 merged onto
mainec7eacc62d(96f7f045cb, clean), the build the description lists as not done. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release,BUILD_TESTING=ON.Built
libSceVrTrackerandguest_vr_tracker_testswith no errors or warnings;ctest --repeat until-fail:2onguest_vr_tracker: passes on both repeats. Not run: the negative control againstmain's library, a title.Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-24T15:30:06Z.
Review: COMMENTED
Checked against main
b607bfdc8band shadPS4 vr_tracker.cpp @8d50471 (L222-L255):git merge-treegives conflicts in core/libs/CMakeLists.txt, libSceVrTracker/Export.cpp and docs/dev/debt/libSceVrTracker.md.733ca2c661,sceVrTrackerIniton main can succeed: Export.cpp:200-215 setsg_initializedfor a valid 128-byte init parameter, and GuestVrTrackerDevices.cpp:176 requiressceVrTrackerInit(&init) == 0. So the "Init still throws, so the tracker never initializes" premise no longer holds.return VR_TRACKER_ERROR_NOT_INITwould answer NOT_INIT after a successful init (valid init, thensceVrTrackerGetTime(&t)gives 0x81260801). Could the three checkg_initialized(main hasNotInitand the same pattern insceVrTrackerGpuWaitAndCpuProcess, Export.cpp:232-233) and keepNotImplemented_nid_no_patchfor the initialized path?Require(Throws([] { sceVrTrackerInit(); }))would fail on main: Init now takes a parameter, and a null one returns 0x81260806. Adding the uninitialized cases to the existing GuestVrTrackerDevices.cpp might fit better, using main's typedVrTrackerGpuSubmitParam/VrTrackerGpuWaitParamprototypes.Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T00:50:14Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the code and its tests support merging.
What I ran
Reviewed head
0ccd117385f686667c7536e2bedd41197f8c8bd0. No build or tests were run in this review.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No commands, build, CTest, console, or title execution were run. The author reports a Windows 11 full build and passing
guest_vr_trackerandguest_vr_tracker_devicestests; these results were not independently verified. Read all changed files listed as reviewed inmanifest.json:core/libs/CMakeLists.txt,core/libs/prx/libSceVrTracker/Export.cpp,core/libs/tests/GuestVrTracker.cpp, anddocs/dev/debt/changes/feat-vrtracker-before-init.md. No changed files were excluded (files.jsonwas not available in the review folder).To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-30T00:54:53Z.
Review: COMMENTED
Actionable comments posted: 1
e424f78c-03e3-4b0c-8976-b4d24c1fcc2cReviewing files that changed from the base of the PR and between
9415030dfeandf5a424ba98.core/libs/CMakeLists.txtcore/libs/prx/libSceVrTracker/Export.cppcore/libs/tests/GuestVrTracker.cppdocs/dev/debt/changes/feat-vrtracker-before-init.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T01:03:57Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
f5a424ba9805869e07e5667f668d0712cb1731baagainst the prepared diff. I read every changed line incore/libs/CMakeLists.txt,core/libs/prx/libSceVrTracker/Export.cpp,core/libs/tests/GuestVrTracker.cpp, anddocs/dev/debt/changes/feat-vrtracker-before-init.md, plus the relevant API declarations and initialization state. I did not run commands or tests;repo_read.pywas unavailable as a command runner in this review interface. The description reports Windows 11 build and CTest results; those were not independently verified.Results
Findings
Blocking
None.
Non-blocking
std::array<uint8_t, ...>(core/libs/tests/GuestVrTracker.cpp:45,core/libs/tests/GuestVrTracker.cpp:49).Not verified
No build, test, console, title, or PS5 behavior was run or confirmed. The author’s reported test results were not independently verified.
files.jsonwas not available in the review folder; the changed-file list and inclusion status were checked inmanifest.jsonand the review folder listing. No excluded changed files were reported there.To get this to a good state
Nothing is required. The alignment point above is optional.