feat(libScePsml): resolve the unversioned, 800M3 and From2023July MFSR context forms #17941

Merged
AlfaRojo merged 2 commits from upstream-pr/17941 into main 2026-11-12 06:38:03 +00:00
AlfaRojo commented 2026-11-10 00:13:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlfaRojo on 2026-11-10T00:13:23Z.


What

Resolve five of the eight throwing placeholders that #15654 declared for the 13.60-labelled libScePsml image onto the library's existing MFSR context bodies. Each name hashes to the NID the placeholder exported (tools/nid_names.py --name): scePsmlMfsrGetContextBufferRequirement EO9YQXmJEN8, scePsmlMfsrGetContextBufferRequirement800M3 sjTyYheKTrU, scePsmlMfsrGetContextBufferRequirementFrom2023July IMlj247LdTo, scePsmlMfsrCreateContext 2ecEbQaf9VU, scePsmlMfsrCreateContextFrom2023July vUk2pWMx3KQ.

  • Evidence: KytyPS5 6fd43ac6 src/libs/libPsml.cpp registers one GetContextRequirements(MemoryRequirements*, const void*) for EO9YQXmJEN8, IMlj247LdTo, sjTyYheKTrU, ArakEpzsZo0 (this library's firmware-verified scePsmlMfsrGetContextBufferRequirement800M3_2) and VGjrQa-WqdU (...1100); its handler (L259) never reads the parameter. It registers CreateFixedContext(void**, const MemoryParameters*) (L306) for 2ecEbQaf9VU and CreatePrivateContext(void**, const ContextParameters*) (L313) for vUk2pWMx3KQ. KytyPS5's ContextParameters (blocks 0x8, count 0x10, width 0x18, height 0x1a, shared 0x38, static_asserted at L80) is the layout this library already uses as MfsrContextParam for 800M3_2, and its width/height offsets are the ones measured on a 13.40 console for scePsmlMfsrCreateContext1300 (#11140 comment 6420461119). KytyPS5's 24-byte MemoryParameters (profile, flags, blocks, count) is the prefix of this library's MfsrSharedResourcesParam.
  • scePsmlMfsrGetContextBufferRequirement, ...800M3 and ...From2023July take (MfsrRequirement*, const void*) and share scePsmlMfsrGetContextBufferRequirement800M3_2's body through a helper: 0x8A810001 before init, then the firmware-read four 2 MiB blocks. The parameter is only null-checked, so no per-form layout is assumed. KytyPS5 reports one block for all five NIDs; the firmware-read value is kept.
  • scePsmlMfsrCreateContextFrom2023July(void**, const MfsrContextParam*) is scePsmlMfsrCreateContext800M3_2 without the shared-resources field: same block validation and input-dimension recording, context registered with no shared resources. 800M3_2 still requires a registered shared-resources handle.
  • scePsmlMfsrCreateContext(void**, const MfsrMemoryParam*) takes the new 24-byte MfsrMemoryParam (type, reserved, blocks, blockCount; static_asserted) and, for type 0, fixes the recorded dimensions at 3840x2160 as KytyPS5 does. KytyPS5 gives 7680x4320 for type 1 and 3840x2160 for type 2, but whether the console-measured Quality8K/LightWeight gates of the shared-resources path (#11140) also apply to a fixed context is unknown, so types 1 and 2 throw NotImplemented_nid_no_patch like the gated shared-resources types do; other types throw (KytyPS5 returns 0x8A81000D there, unverified here).
  • Still throwing: scePsmlMfsrCreateContext800M3 (pwUkfVu0c0c), scePsmlMfsrGetDispatchMfsrPacket (CN7uea0UQso) and scePsmlMfsrGetDispatchMfsrPacketFrom2023July (wHto4IznfBE). KytyPS5 registers none of these NIDs (its dispatch handlers are 94iBp3KvIuI = ...1100 and RUNLFro+qok = ...900), so nothing establishes their layouts. The debt entry is cut to these three.
  • Limits, recorded in docs/dev/debt/libScePsml_debug.md: the post-init paths follow KytyPS5, not the module, and are unreachable on the modelled console, where scePsmlMfsrInit fails with 0x8A810012; the version each form serves is unverified; null pointers and short block lists throw as for 800M3_2. tools/guest_pointer_audit.py lists scePsmlMfsrCreateContext's direct accesses exactly as it does the library's existing exports; the file's direct style is kept.
  • Progress on #12063 section 2: the five NIDs it asked to confirm are the ones resolved here (confirmed by name hash in #15654 and mapped here); the issue's other sections stay open, so this does not close it.
  • Test: guest_psml now calls each of the five forms before and after the failed init with a filled requirement buffer, a sentinel context handle and null arguments, requiring 0x8A810001 and untouched outputs on every call; the requirement check is one templated helper shared with the existing 1100 and 800M3_2 calls. The post-init paths cannot be exercised while scePsmlMfsrInit fails on the modelled console.

Tested

Windows 11 Pro (10.0.26200), WinLibs GCC 15.2.0 r7 UCRT, Ninja, Release, BUILD_TESTING=ON, on main 4b71464421.

  • guest_psml: passes in 3 of 3 runs after building guest_psml_tests.
  • public_headers passes.
  • tools/check_test_registration.py reports every APS5_VABI source compiled.
  • tools/check_conventions.py --base upstream/main is clean.
  • tools/pr_overlap.py lists only #14212, the repository-wide debt reformat, which shares docs/dev/debt/libScePsml_debug.md and adds no exports.

Linux and macOS not run. The forms only validate arguments and copy fixed requirements before initialization; nothing platform-specific.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5233388769 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17941). Originally posted by [AlfaRojo](https://github.com/AlfaRojo) on 2026-11-10T00:13:23Z. --- ### What Resolve five of the eight throwing placeholders that #15654 declared for the 13.60-labelled `libScePsml` image onto the library's existing MFSR context bodies. Each name hashes to the NID the placeholder exported (`tools/nid_names.py --name`): `scePsmlMfsrGetContextBufferRequirement` `EO9YQXmJEN8`, `scePsmlMfsrGetContextBufferRequirement800M3` `sjTyYheKTrU`, `scePsmlMfsrGetContextBufferRequirementFrom2023July` `IMlj247LdTo`, `scePsmlMfsrCreateContext` `2ecEbQaf9VU`, `scePsmlMfsrCreateContextFrom2023July` `vUk2pWMx3KQ`. - Evidence: [KytyPS5 6fd43ac6 `src/libs/libPsml.cpp`](https://github.com/KytyPS5/KytyPS5/blob/6fd43ac65264468c7279a578a998b0f7c59af7f4/src/libs/libPsml.cpp#L733-L746) registers one `GetContextRequirements(MemoryRequirements*, const void*)` for `EO9YQXmJEN8`, `IMlj247LdTo`, `sjTyYheKTrU`, `ArakEpzsZo0` (this library's firmware-verified `scePsmlMfsrGetContextBufferRequirement800M3_2`) and `VGjrQa-WqdU` (`...1100`); its handler ([L259](https://github.com/KytyPS5/KytyPS5/blob/6fd43ac65264468c7279a578a998b0f7c59af7f4/src/libs/libPsml.cpp#L259)) never reads the parameter. It registers `CreateFixedContext(void**, const MemoryParameters*)` ([L306](https://github.com/KytyPS5/KytyPS5/blob/6fd43ac65264468c7279a578a998b0f7c59af7f4/src/libs/libPsml.cpp#L306)) for `2ecEbQaf9VU` and `CreatePrivateContext(void**, const ContextParameters*)` ([L313](https://github.com/KytyPS5/KytyPS5/blob/6fd43ac65264468c7279a578a998b0f7c59af7f4/src/libs/libPsml.cpp#L313)) for `vUk2pWMx3KQ`. KytyPS5's `ContextParameters` (blocks 0x8, count 0x10, width 0x18, height 0x1a, shared 0x38, `static_assert`ed at [L80](https://github.com/KytyPS5/KytyPS5/blob/6fd43ac65264468c7279a578a998b0f7c59af7f4/src/libs/libPsml.cpp#L80)) is the layout this library already uses as `MfsrContextParam` for `800M3_2`, and its width/height offsets are the ones measured on a 13.40 console for `scePsmlMfsrCreateContext1300` ([#11140 comment 6420461119](https://github.com/boykopovar/AnyPS5/pull/11140#issuecomment-6420461119)). KytyPS5's 24-byte `MemoryParameters` (profile, flags, blocks, count) is the prefix of this library's `MfsrSharedResourcesParam`. - `scePsmlMfsrGetContextBufferRequirement`, `...800M3` and `...From2023July` take `(MfsrRequirement*, const void*)` and share `scePsmlMfsrGetContextBufferRequirement800M3_2`'s body through a helper: 0x8A810001 before init, then the firmware-read four 2 MiB blocks. The parameter is only null-checked, so no per-form layout is assumed. KytyPS5 reports one block for all five NIDs; the firmware-read value is kept. - `scePsmlMfsrCreateContextFrom2023July(void**, const MfsrContextParam*)` is `scePsmlMfsrCreateContext800M3_2` without the shared-resources field: same block validation and input-dimension recording, context registered with no shared resources. `800M3_2` still requires a registered shared-resources handle. - `scePsmlMfsrCreateContext(void**, const MfsrMemoryParam*)` takes the new 24-byte `MfsrMemoryParam` (type, reserved, blocks, blockCount; `static_assert`ed) and, for type 0, fixes the recorded dimensions at 3840x2160 as KytyPS5 does. KytyPS5 gives 7680x4320 for type 1 and 3840x2160 for type 2, but whether the console-measured Quality8K/LightWeight gates of the shared-resources path (#11140) also apply to a fixed context is unknown, so types 1 and 2 throw `NotImplemented_nid_no_patch` like the gated shared-resources types do; other types throw (KytyPS5 returns 0x8A81000D there, unverified here). - Still throwing: `scePsmlMfsrCreateContext800M3` (`pwUkfVu0c0c`), `scePsmlMfsrGetDispatchMfsrPacket` (`CN7uea0UQso`) and `scePsmlMfsrGetDispatchMfsrPacketFrom2023July` (`wHto4IznfBE`). KytyPS5 registers none of these NIDs (its dispatch handlers are `94iBp3KvIuI` = `...1100` and `RUNLFro+qok` = `...900`), so nothing establishes their layouts. The debt entry is cut to these three. - Limits, recorded in `docs/dev/debt/libScePsml_debug.md`: the post-init paths follow KytyPS5, not the module, and are unreachable on the modelled console, where `scePsmlMfsrInit` fails with 0x8A810012; the version each form serves is unverified; null pointers and short block lists throw as for `800M3_2`. `tools/guest_pointer_audit.py` lists `scePsmlMfsrCreateContext`'s direct accesses exactly as it does the library's existing exports; the file's direct style is kept. - Progress on #12063 section 2: the five NIDs it asked to confirm are the ones resolved here (confirmed by name hash in #15654 and mapped here); the issue's other sections stay open, so this does not close it. - Test: `guest_psml` now calls each of the five forms before and after the failed init with a filled requirement buffer, a sentinel context handle and null arguments, requiring 0x8A810001 and untouched outputs on every call; the requirement check is one templated helper shared with the existing `1100` and `800M3_2` calls. The post-init paths cannot be exercised while `scePsmlMfsrInit` fails on the modelled console. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11 Pro (10.0.26200), WinLibs GCC 15.2.0 r7 UCRT, Ninja, Release, `BUILD_TESTING=ON`, on `main` 4b71464421. - `guest_psml`: passes in 3 of 3 runs after building `guest_psml_tests`. - `public_headers` passes. - `tools/check_test_registration.py` reports every `APS5_VABI` source compiled. - `tools/check_conventions.py --base upstream/main` is clean. - `tools/pr_overlap.py` lists only #14212, the repository-wide debt reformat, which shares `docs/dev/debt/libScePsml_debug.md` and adds no exports. Linux and macOS not run. The forms only validate arguments and copy fixed requirements before initialization; nothing platform-specific. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!17941
No description provided.