Repository navigation
Conversation
…ipeline sceHmd2ReprojectionSetMirroringOption threw on every option it was given once a reprojection session existed. The 13.40 module reads the 32-byte option first: a null or unreadable pointer answers 0x8A720008, a mode other than 0 or 1 or any nonzero reserved word answers 0x8A720009, and only then does it reach the pipeline, which still throws here because it has no host model.
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 58d31dce47:
- Conventions:
tools/check_conventions.pypassed. - Build:
guest_hmd2_testsbuilt cleanly. - CTest (
guest_hmd2):1/1 Test #4025: guest_hmd2 ....................... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 - Negative control: with
core/libs/prx/libSceHmd2/Export.cppreverted tomainand the new tests kept, the suite fails:Restoring the change makes it pass again.1/1 Test #4025: guest_hmd2 .......................Subprocess aborted***Exception: 0.43 sec 0% tests passed, 1 tests failed out of 1 - Code reading:
- Verified sceHmd2ReprojectionSetMirroringOption checks option == nullptr and GuestCopyIn_nid_no_patch failures, returning Hmd2::ParameterNull (0x8A720008).
- Verified range validation on local.mode (mode > 1) and all 7 reserved words (reserved != 0) returning Hmd2::ParameterInvalid (0x8A720009).
- Verified preservation and restoration of errno around GuestCopyIn_nid_no_patch.
- Verified session state gating under reprojectionMutex returning Hmd2::ReprojectionNotInitialized (0x8A72000B) before option validation.
- Verified unhandled valid option path terminates with NotImplemented_nid_no_patch(func) and documentation fragment in docs/dev/debt/changes/fix-hmd2-mirroring-option-checks.md conforms to AGENTS.md rules.
- Verified guest_hmd2 test additions in GuestHmd2.cpp exhaustively test null, bad pointers, mode > 1, all reserved word indices, and valid modes (0, 1) throwing NotImplemented.
Looks Good To Me
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the implementation matches the stated validation order and preserves the existing unimplemented path for valid options.
What I ran
Reviewed head 58d31dce47104dac44387911aa9430f71bab78bc against base main. No commands or tests were run; repo_read.py was unavailable as a runnable command in this interface. Read the prepared description, commits, manifest, diff, and all changed lines in core/libs/prx/libSceHmd2/Export.cpp, core/libs/tests/GuestHmd2.cpp, and docs/dev/debt/changes/fix-hmd2-mirroring-option-checks.md. Also read the option layout and the adjacent copy-in path.
Results
| Check | Result | Note |
|---|---|---|
| Changed lines | passed | All changed lines read |
| Tests | not run | Reported test results are author supplied |
| Repository checks | not run | Not independently verified |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author reports three passing tests, a passing negative control, and clean convention and debt checks; these were not run independently. Windows, console behavior, and the titled reprojection-session scenario were not verified. No changed file was excluded; all three changed files marked included in the manifest were read in full or across their changed lines. The full text of Export.cpp and GuestHmd2.cpp beyond the targeted ranges was not read.
To get this to a good state
Nothing is required.
|
@edubox, the checks themselves look right and the tests cover each branch. What I cannot see yet is an effect for a game:
Please add either a console run of this export for a null pointer, mode 2 and a nonzero reserved word, or a PPSA title that imports it with a run showing which code it reaches. With either I will re-review. |
|
Thanks, both points are fair. On the effect for a game: the valid-option throw is deliberate in this PR — it only puts the guard in the documented order, and the reprojection pipeline behind it is not implemented, so answering success would invent state. The alternative (keep throwing everything, including the null-pointer and reserved-word cases) is what the branch replaces. On the evidence, I do not have a console measurement for this export, and I would rather say so than claim one:
So the choices are: leave it open until someone with console access runs the 7th Guest call site (I can try the dump here, but I cannot promise that call is reached without a headset), or accept firmware evidence for the ordering and keep the two codes marked unmeasured in the debt entry, as they are now. Tell me which you prefer and I will follow it — I will not claim a console run I have not done. |
|
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.
|
|
I am closing this for now. The checks look right and the tests cover each branch, but a valid option still throws NotImplemented so no title gets past sceHmd2ReprojectionSetMirroringOption today, and the codes 0x8A720008 and 0x8A720009 come from 13.40 disassembly only, with no console measurement. There has been no push since 22 Nov. If you can name a title or measure it on the console, please reopen and we will look again. |
What
sceHmd2ReprojectionSetMirroringOptionthrew on every option once a reprojection session existed, including the ones the firmware rejects before it ever reaches the pipeline.mainalready answers0x8A72000B(REPROJECTION_NOT_INITIALIZED) without a session; this adds the option check the 13.40 wrapper performs next:0x8A720008(PARAMETER_NULL);modeother than 0 or 1, or any of the sevenreservedwords nonzero, answers0x8A720009(PARAMETER_INVALID);Evidence is the 13.40
libSceHmd2.sprx: the wrapper comparesmodeand each reserved word against zero and returns those codes before handing the call on. Not measured on a console beyond the module body.Hmd2::MirroringOptionis the 32-byte layoutinclude/Api.hppalready pins (mode at 0, seven reserved words). The read goes throughGuestCopyIn_nid_no_patchwitherrnopreserved, as the other argument-taking exports in this file do.Tested
Linux x86-64 (CachyOS), GCC 16.2.1, Release,
BUILD_TESTING=ON, onmaine3f556c718:guest_hmd2,guest_hmd2_gazeandguest_hmd2_gaze_args: 3/3 pass.Export.cppatmainand the new assertions kept,guest_hmd2aborts withsceHmd2ReprojectionSetMirroringOption not implemented; restoring the change makes it pass. The new cases cover a null pointer, an unmapped pointer,mode = 2, each of the seven reserved words set on its own, and both valid modes still throwing inside a session.tools/check_conventions.py --base origin/mainandtools/debt_fold.py --checkare clean.tools/pr_overlap.py --branch fix/hmd2-mirroring-option-checks: no shared exports; it lists one open pull request that also changesExport.cppand cannot be compared because it conflicts withmain(it copies other Hmd2 structures through the guest helpers, not this export).Not run: Windows, a console, and a title that opens a reprojection session.
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)