Skip to content

feat(libScePsml): declare later MFSR exports - #15654

Open
B-Howell wants to merge 1 commit into
boykopovar:mainfrom
B-Howell:feat/psml-1360-exports
Open

B-Howell wants to merge 1 commit into
boykopovar:mainfrom
B-Howell:feat/psml-1360-exports

Conversation

@B-Howell

@B-Howell B-Howell commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

What

Declare the 8 libScePsml function exports of the PS5 13.60 export inventory that are not yet declared, as throwing placeholders. Five of them (the KytyPS5 labels listed below) are the NIDs that #12063 asked to be confirmed. The inventory gives no name for any of them, and the pinned NID database has none of the names below, but each name hashes exactly to its NID with tools/nid_names.py --name. The image label does not authenticate a retail firmware version. No game unblock is claimed.

  • They are the unversioned, 800M3 and From2023July forms of three existing export families: scePsmlMfsrCreateContext (2ecEbQaf9VU), scePsmlMfsrCreateContext800M3 (pwUkfVu0c0c), scePsmlMfsrCreateContextFrom2023July (vUk2pWMx3KQ), scePsmlMfsrGetContextBufferRequirement (EO9YQXmJEN8), scePsmlMfsrGetContextBufferRequirement800M3 (sjTyYheKTrU), scePsmlMfsrGetContextBufferRequirementFrom2023July (IMlj247LdTo), scePsmlMfsrGetDispatchMfsrPacket (CN7uea0UQso) and scePsmlMfsrGetDispatchMfsrPacketFrom2023July (wHto4IznfBE).
  • Three of the names (scePsmlMfsrGetDispatchMfsrPacket, scePsmlMfsrCreateContext800M3 and scePsmlMfsrGetDispatchMfsrPacketFrom2023July) are in ps5rs data/nids.csv (SHA-256 e6b1ddfa65b18be3f17e4539ae4dff0b956d0a0c27cc58e4aaa181ae9c8bec82). For the other five that file has only KytyPS5's labels, PsmlGetContextMemoryRequirements and PsmlContextInitialize, which KytyPS5 comparison: export gaps needing maintainer direction (ASan module, Psml NIDs, LoginDialog, throwing surface) #12063 quotes. Those labels do not hash to these NIDs: they give OSi13dtYJIk and p2oRiEbDdOE, and with the sce prefix jUxLcoPab4k and SOaQoTw-vDI. The labels are descriptive, not export names: the same file labels RUNLFro+qok, which is scePsmlMfsrGetDispatchMfsrPacket900 on main, as PsmlDispatch. The five names here come from the existing families with the version suffix replaced by nothing, 800M3 or From2023July, the suffixes that ps5rs gives for the other three. So, as KytyPS5 comparison: export gaps needing maintainer direction (ASan module, Psml NIDs, LoginDialog, throwing surface) #12063 guessed, these are more versions of the MFSR context and dispatch calls, not new functions.

Signatures, the firmware version each form serves, and behavior are unverified. The bodies of the versioned 1100 and 1300 forms on main are not reused, because nothing shows that these forms take the same arguments. Every entry is a parameterless int declaration that only resolves imports, and every body calls NotImplemented_nid_no_patch. The declarations follow #15347: they are in a new header include/LaterExports.hpp, which the libScePsml_debug.hpp umbrella includes, and in a separate extern "C" block in Export.cpp, with a debt entry that lists every name and NID. libScePsml and libScePsml_debug are built from this one source, so both libraries export the 8.

The list is the inventory's 27 function records for libScePsml minus the 19 already exported on main (1c8c0efc8c) by name hash (tools/nid_names.py --where). With these 8, every record is exported. Other PSML logical libraries still have 13.60 gaps: 3 of libScePsml_nosubmission, 1 of libScePsml_set_mfsrversion, and all 6 of libScePsmlBcSisr, which has no module in the tree. They are not part of this pull request.

Name NID
scePsmlMfsrCreateContext 2ecEbQaf9VU
scePsmlMfsrCreateContext800M3 pwUkfVu0c0c
scePsmlMfsrCreateContextFrom2023July vUk2pWMx3KQ
scePsmlMfsrGetContextBufferRequirement EO9YQXmJEN8
scePsmlMfsrGetContextBufferRequirement800M3 sjTyYheKTrU
scePsmlMfsrGetContextBufferRequirementFrom2023July IMlj247LdTo
scePsmlMfsrGetDispatchMfsrPacket CN7uea0UQso
scePsmlMfsrGetDispatchMfsrPacketFrom2023July wHto4IznfBE

Tested

  • Windows 11 x86-64, WinLibs GCC 15.2.0 r7: I built libs and guest_psml_tests at this commit (on top of main 1c8c0efc8c). Then I ran guest_psml, the only test registered by the PSML CMake files, and public_headers three times. Both passed on every run, with none skipped.
  • Ubuntu 22.04 (WSL2) x86-64, GCC 11.4: the same build and the same tests three times. Both passed on every run, with none skipped.
  • The 4 checker self-tests (conventions_unknown_nids, conventions_debt_length, conventions_doc_links and debt_split) ran in the same ctest invocations and passed on every run on both systems, none skipped, so each run had 6 tests. They test the convention checker itself, not these declarations.
  • The patched libScePsml.prx and libScePsml_debug.prx each export each of the 8 NIDs once on both systems (objdump -p on Windows, nm -D on Linux).
  • python3 tools/check_conventions.py --base origin/main with this title and description passed, and git diff --check is clean.
  • tools/pr_overlap.py --branch found no open pull request that changes the same exports. It failed closed on docs(debt): separate entries with blank lines and drop derived export totals #14212, which shares docs/dev/debt/libScePsml_debug.md with this branch and does not merge cleanly with main. I checked its diff by hand: in this file it only adds blank lines between entries, and it adds none of these NIDs or names. None of the commits that are not on main of the open PRs that change libScePsml_debug, libScePsml or the PSML debt file (feat(progress): count stubs no measured use needs as unobserved #13801, feat(libScePsml): port bundled-module dispatch validation for MFSR packet 1000 #14102 and docs(debt): separate entries with blank lines and drop derived export totals #14212) contains any of these NIDs or names.
  • Not tested: console behavior, titles and homebrew. No guest calls these exports in the tests above.

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

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

Progress report (1c8c0ef → 05a1f4f)

📉 System libraries: 26.64% (-0.0058%, +8 declared functions)

🆕 8 declared as stubs
Library Name
libScePsml_debug scePsmlMfsrCreateContext
libScePsml_debug scePsmlMfsrCreateContext800M3
libScePsml_debug scePsmlMfsrCreateContextFrom2023July
libScePsml_debug scePsmlMfsrGetContextBufferRequirement
libScePsml_debug scePsmlMfsrGetContextBufferRequirement800M3
libScePsml_debug scePsmlMfsrGetContextBufferRequirementFrom2023July
libScePsml_debug scePsmlMfsrGetDispatchMfsrPacket
libScePsml_debug scePsmlMfsrGetDispatchMfsrPacketFrom2023July

Changed libraries (implemented exports)

Library Before After Change
libScePsml_debug 21/31 (67.74%) 21/39 (53.85%) -13.90%

@XairRrR XairRrR left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — approved

The PR adds 8 libScePsml MFSR exports as throwing placeholders. Each name hashes to its claimed NID, each is declared once in a header the libScePsml_debug.hpp umbrella includes, each is exported once from both libScePsml.prx and libScePsml_debug.prx, and a debt entry lists them all. The relevant checks and tests pass.

What I ran

Head 05a1f4fe579d261802150d903af70cbd13eaa9ff, main 1c8c0efc8c41314402e6966da5bef6ea3d639d10, merged tree 6d4caf6b0a0bae397bfa14f62a33851c2a9b1cfd, on Debian 13 (VM, 32 vCPU Xeon Gold 6136), GCC 14.2.0, Release, Ninja.

git diff --check 1c8c0efc8c41314402e6966da5bef6ea3d639d10...05a1f4fe579d261802150d903af70cbd13eaa9ff
python3 tools/check_conventions.py --base 1c8c0efc8c41314402e6966da5bef6ea3d639d10
python3 tools/nid_names.py --name <each of the 8 names, plus PsmlGetContextMemoryRequirements and PsmlContextInitialize>
git grep -n -E "<the 8 names and NIDs>" -- . ":!docs/dev/debt/libScePsml_debug.md"
nm -D --defined-only build/core/libs/libs/libScePsml.prx        # counted each NID
nm -D --defined-only build/core/libs/libs/libScePsml_debug.prx  # counted each NID
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(guest_psml|public_headers|conventions_unknown_nids|conventions_debt_length|conventions_doc_links|debt_split)$"

The build and the selected test run by the prepare script are in build.json.

Results

Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Configure / build / libs (script) ok
Selected tests (script) 820 ran, 816 passed, 3 skipped (all expected per check_skips.py). 0 new failures, 0 timeouts. 1 known failure that also fails on main (unwrap_self_UnwrapTest_test_new_output_inherits_the_destination_directory_group), not caused by this PR
Name → NID hashes all 8 match the table in the description and in the debt entry
KytyPS5 labels PsmlGetContextMemoryRequirements → OSi13dtYJIk, PsmlContextInitialize → p2oRiEbDdOE: these do not match the new NIDs, as the description says
Duplicate declarations or NIDs elsewhere in the tree none; the only hits are Export.cpp and LaterExports.hpp
Exports in libScePsml.prx / libScePsml_debug.prx each of the 8 NIDs defined exactly once in each
guest_psml, public_headers, conventions_unknown_nids, conventions_debt_length, conventions_doc_links, debt_split 6/6 passed
Focused ctest run
1/6 Test  #503: public_headers ...................   Passed   62.36 sec
2/6 Test #3058: guest_psml .......................   Passed    0.01 sec
3/6 Test   #60: conventions_doc_links ............   Passed    0.12 sec
4/6 Test   #62: conventions_debt_length ..........   Passed    0.16 sec
5/6 Test   #61: conventions_unknown_nids .........   Passed    1.84 sec
6/6 Test  #103: debt_split .......................   Passed    1.90 sec
100% tests passed, 0 tests failed out of 6

public_headers is an existing test, not one this PR adds or changes. It took 62 s here, on a machine shared with other builds. I did not time it on main, so I do not attribute this to the PR.

Export counts (nm -D)
== libScePsml.prx
2ecEbQaf9VU 1  pwUkfVu0c0c 1  vUk2pWMx3KQ 1  EO9YQXmJEN8 1
sjTyYheKTrU 1  IMlj247LdTo 1  CN7uea0UQso 1  wHto4IznfBE 1
== libScePsml_debug.prx
2ecEbQaf9VU 1  pwUkfVu0c0c 1  vUk2pWMx3KQ 1  EO9YQXmJEN8 1
sjTyYheKTrU 1  IMlj247LdTo 1  CN7uea0UQso 1  wHto4IznfBE 1

Negative control

None. The PR adds and changes no tests, and the project rules forbid tests that only check that a symbol is exported.

Findings

Blocking

None.

Non-blocking

None.

Code notes:

  • The bodies in core/libs/prx/libScePsml_debug/Export.cpp:372-402 have no return statement. This is well-defined: NotImplemented_nid_no_patch is declared [[noreturn]] in core/libs/prx/libc/include/General.hpp:15.
  • core/libs/prx/libScePsml_debug/include/LaterExports.hpp has one declaration per export, and the umbrella libScePsml_debug.hpp includes it, as CONTRIBUTING.md requires. public_headers passes.
  • The debt entry is under "Unknown function info" in docs/dev/debt/libScePsml_debug.md. It states first what is unverified (the parameter lists, return types, firmware version each form serves and behaviour) and says the declarations are placeholders.
  • The code has no comments. The PR claims no title unblock, and its checklist lines are filled in.

Not verified

  • I did not check the 13.60 inventory or the ps5rs nids.csv contents and their SHA-256: there is no network here. I only checked that each name hashes to its NID.
  • I could not check that the unversioned, 800M3 and From2023July names are the real Sony export names, rather than names that only hash to the right NIDs. The method is sound, but the names are still inferred.
  • I did not check the Windows (MinGW) build and run described in the PR.
  • The script skipped the Vulkan validation-layer comparison because no changed file is under the AGC driver, shader recompiler or VideoOut paths. It does not apply to this PR.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head 05a1f4f merged onto main 1c8c0ef · tested 2026-11-04 00:41 UTC · 16 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 1,121 passed · 4 failed (0 new, 3 also fail on main, 1 unstable on main) · 8 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 1,133 of 3,842 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (546 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.4 s, ⚠️ public_headers 70.7 s, ⚠️ agc_driver_image_sample_unnormalized 34.2 s, ⚠️ agc_driver_depth_clear_hle 31.2 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 8 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
agc_driver_native_depth_bda_clear
agc_driver_native_multisample_depth
Validation IDs already present on main (8 IDs in 467 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (467 tests): agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, agc_driver_bindless_images, and 459 more
VUID-vkCmdCopyImage-srcImage-01548 (4 tests): agc_driver_depth_clear_hle, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (4 tests): agc_driver_depth_clear_hle, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_srgb8_color_target
VUID-VkSamplerCreateInfo-addressModeU-01079 (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeU-parameter (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeV-parameter (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeW-parameter (1 test): agc_driver_image_gather_volume
Skipped (8)
agc_driver_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_float16_unused_nan_payloads: skipped, the device has no native f16 conversions with RTE rounding and kept f16 denormals
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
Reproduce
git fetch origin 05a1f4fe579d261802150d903af70cbd13eaa9ff 1c8c0efc8c41314402e6966da5bef6ea3d639d10
git checkout 1c8c0efc8c41314402e6966da5bef6ea3d639d10 && git merge --no-ff 05a1f4fe579d261802150d903af70cbd13eaa9ff
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 12 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 16 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@B-Howell

B-Howell commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

GitHub checks are passing on 05a1f4fe57. XairRrR approved the MFSR export mapping and header coverage, and the independent AMD run passed. Could a maintainer merge this when ready, or flag any remaining check?

AI-assisted: yes (Codex).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants