feat(libScePsml): port bundled-module dispatch validation for MFSR packet 1000 #14102
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14102"
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 akkadbakkad89 on 2026-10-31T19:02:17Z.
What
Ports the bundled
libScePsml.sprx(PPSA13197sce_module, disassembly not a console oracle) validation order forscePsmlMfsrGetDispatchMfsrPacket1000(0x2C490 -> shared submit core0x2BEA0):0x8A810001uninitialized, engine id0xA9C4/0x9231or null context ->0x8A810005(the object-map lookup is our equivalent), null command buffer ->0x8A810009, then the module-state combination that yields0x8A810016— low-latency module-param flag (global0x16ec10, written at0x2A6FEfrom bit 30 of the module's own parameter dword) clear while the sync-submit flag (global0x16ec39, set at0x2E01FfromsceVideoOutGetPipelineStatusfield +0 == 1) is set, with an always-zero pending counter folded.paramitself is never inspected before emission — it only feeds the 0x158-byte -> 0x1D8-byte descriptor copy — so the flags are modeled asg_mfsrLowLatencySubmit/g_mfsrSyncSubmit(unmodeled sources default false) and no caller input reaches the error. The AGC packet emission (0x4E0, PM4 writes into the command-buffer dmem ring at context+0x4A8) still throwsNotImplemented.The bundled module's
scePsmlMfsrInitchain (already-initialized ->0x8A810002, AGC probe0x8A810010, component registration0x8A810011, worker, flag) and itsscePsmlMfsrGetSharedResourcesInitRequirementsize-table math (0x28DE0, type-indexed u64 table at0x6CC28loaded viamovsxd+r13*8, yielding0x3E000blocks for type 0) are documented in the debt file with the load instructions quoted. Both are kept at their console-measured behavior — init throws past the Trinity check rather than fabricate the engine, and the requirement keeps the measured 52 blocks for type 0 and the throw for gated types 1/2 — because the bundled revision's fill contradicts the 13.40 console measurement and no caller-visible input distinguishes the revisions.Tested
guest_psmlrebuilt and passes (the new paths are unreachable whilesceKernelIsTrinityModereports 0 on the modelled base console; the reachable init gate is exercised twice byMfsr1OnBaseConsole).python3 tools/check_conventions.py --base origin/mainclean. Behavior verified against disassembly of the bundled module; no console oracle run.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T19:08:45Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The dispatch validation described in this PR is incomplete: the new implementation ignores the parameter and throws before checking the documented parameter-flag error.
What I ran
Reviewed head
83e79e6e6f60da13593299c0ca0eaa73befe8f58against base16452da93473aa42d8054da95f89e44a2a1d8d97. The PR merge preview against currentmainwas clean. Environment: Debian 12, Python 3.11.2, GCC 12.2.0. I inspected the exact diff and ran no build or C++ tests.Results
Unedited command output
The precheck report confirms that the head and base stayed unchanged. Its ABI-audit and test-quality helper invocations could not run because those local-only scripts are absent from the isolated PR checkout.
Findings
Blocking
In
scePsmlMfsrGetDispatchMfsrPacket1000,paramis explicitly discarded, and after the initialized/context/command-buffer checks the function immediately callsNotImplemented_nid_no_patch. The PR description and debt entry say the parameter flag combination that yields0x8A810016is validated before packet emission. That input currently throws instead of returning the documented error. Please implement that known parameter validation before the unsupported packet-emission path, and add focused coverage for the error result.Not verified
The author reports
guest_psmlwas rebuilt and passed, but the PR description says the newly added paths are unreachable with the current modeledsceKernelIsTrinityModeresult. I did not independently run that test or verify the documented flag combination against a console.To get this to a good state
Implement and test the documented
0x8A810016validation while retaining the throw for packet emission that remains unimplemented. I will rerun the same no-build checks on the updated head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T20:27:25Z.
Review: APPROVED
Re-checked — new head, looks good
The new head now keeps the measured 52-block result and unsupported initialization behavior, and adds the documented
0x8A810016check before the still-unimplemented packet emission.What I ran
Reviewed head
badfea09b69e98d6611007ec5ffd9fbc38b441cbagainst PR base16452da93473aa42d8054da95f89e44a2a1d8d97; the merge preview against currentmain0836dfdf4fecb1e0326100c490476e15d3a74da5was clean. Environment: Debian Linux, Python 3.11.2, GCC 12.2.0. No local C++ build was run.Results
Unedited local output
The ABI audit returned
"status": "passed"and"findings": [].Negative control
No negative-control run was available. The new validation is after the initialized/context checks, but initialization intentionally remains unimplemented on the modeled console, so a focused runtime test cannot reach this branch in the current environment.
Findings
Blocking: None found in the update.
Non-blocking: The author reports
guest_psmlpassed, but that result was not independently reproduced here. The new error branch is supported by the documented bundled-module disassembly but remains unreachable in the current model. The AGC packet-emission path still throws as documented.Sources