Skip to content

feat(libSceSaveData): initialize through sceSaveDataInitialize2 - #12625

Merged
oneandonlydean merged 7 commits into
boykopovar:mainfrom
zaryabzip:feat/savedata-initialize2
Nov 3, 2026
Merged

oneandonlydean merged 7 commits into
boykopovar:mainfrom
zaryabzip:feat/savedata-initialize2

Conversation

@zaryabzip

@zaryabzip zaryabzip commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What

Implements sceSaveDataInitialize2 as sceSaveDataInitialize3 with the same parameter, the way sceSaveDataInitialize already forwards. A title that initializes through the v2 entry point now starts the same save-data session, and sceSaveDataTerminate ends it.

Sources agree that the three initialize entry points are one operation:

  • shadPS4 runs the same initialization for Initialize2 and Initialize3;
  • fpPS4 takes one parameter pointer for all three;
  • SharpEmu also sends Initialize and Initialize2 to one common initializer.

Nothing is measured on a console. The public header gains the parameter, and Initialize2 comes out of the pending-declaration list in the debt file. That list, a single entry of over 6,000 characters, is split into three entries under the length limit, with the same wording and names.

Depends on #10674, which edits the same debt list line. This branch is #10674's head with current main merged in, plus one commit.

The new TestInitialize2 in GuestSaveDataPs4.cpp looks the call up at runtime, because main declares it without parameters. It checks that save-data memory setup is refused before the call, works after it, and is refused again after sceSaveDataTerminate. guest_savedata_ps4_tests now links ${CMAKE_DL_LIBS} for dlsym.

Tested

After the sync with main (8197ab3, a debt-text conflict only), Windows 11 and WSL2 reran it: all 7 guest_savedata* tests pass, with guest_savedata_ps4 3 of 3 on --repeat until-fail:3, and no warnings in the changed files. They also pass merged into main ee9a9a6. The earlier runs follow.

Windows 11 Home 25H2 (i7-11800H, WinLibs MinGW-w64 GCC 15.2.0 UCRT r7, CMake 4.3.1, Ninja 1.13.2, Release, BUILD_TESTING=ON) and Ubuntu 24.04.5 on WSL2 (GCC 13.3.0, CMake 3.28.3), both at bc6a5e4 merged into main 3a2b919 (clean merge):

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: feat(libSceSaveData): declare sceSaveDataGetProgress with its known signature #10674
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)

MarcZX10 and others added 5 commits October 28, 2026 13:54
…ignature

It still throws through NotImplemented_nid_no_patch; the parameter is the
float* of the OpenOrbis headers and shadPS4.
… public header

main declares it with an empty parameter list in Api.hpp, which conflicts with the definition.
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Progress report (7feb37e → c5e2f0e)

📈 System libraries: 26.37% (+0.0027%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceSaveData.native sceSaveDataInitialize2

Changed libraries (implemented exports)

Library Before After Change
libSceSaveData.native 51/120 (42.50%) 52/120 (43.33%) +0.83%

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 14908 docs/dev/debt/libSceSaveData.native.md L25
PR 15097 docs/dev/debt/libSceSaveData.native.md L24-25

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.

Pull request Shared files not compared
PR 13486 core/libs/prx/libSceSaveData.native/Export.cpp
core/libs/prx/libSceSaveData/include/Api.hpp
docs/dev/debt/libSceSaveData.native.md
PR 14150 core/libs/prx/libSceSaveData.native/CMakeLists.txt
core/libs/prx/libSceSaveData.native/Export.cpp
core/libs/prx/libSceSaveData/include/Api.hpp
docs/dev/debt/libSceSaveData.native.md
PR 14212 docs/dev/debt/libSceSaveData.native.md
PR 15042 core/libs/prx/libSceSaveData.native/Export.cpp

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 30, 2026
…ize2

# Conflicts:
#	docs/dev/debt/libSceSaveData.native.md
@zaryabzip

Copy link
Copy Markdown
Contributor Author

Merged current main into this branch (8197ab3) to clear a conflict in docs/dev/debt/libSceSaveData.native.md. main had dropped sceSaveDataAbort, sceSaveDataClearProgress and sceSaveDataGetMountedSaveDataCount from the pending-declarations line, and the resolution keeps #10674's split entries without those three. No code was changed by hand. #10674 itself now conflicts with main too, so this PR still waits on it.

@zaryabzip

Copy link
Copy Markdown
Contributor Author

Closing for now to stay within the 20-open-PR limit. This one can't land before #10674, which conflicts with main; the branch stays as it is and I'll reopen it once #10674 is merged.

@zaryabzip zaryabzip closed this Oct 31, 2026
@zaryabzip zaryabzip reopened this Oct 31, 2026
@zaryabzip

zaryabzip commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Reopened: I now have 20 merged PRs, so the open-PR limit no longer applies to me. This still lands after #10674. Rechecked against main b9bf246: it merges cleanly with main, and the only overlaps are the debt line it shares with #10674, #12748 and #13551, plus one neighbouring declaration in include/Api.hpp with #14150, which implements a different export.

@BunnyFl BunnyFl 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.

Windows 11, WinLibs GCC 15.2.0 r7, Release. Head 8197ab3 merged into upstream/main 93dbd0f:

  • ctest -R '^guest_savedata': 8/8 pass, including guest_savedata_ps4 with the new TestInitialize2 and guest_savedata_dialog.
  • Negative control: with main's libSceSaveData.native/Export.cpp and libSceSaveData/include/Api.hpp, guest_savedata_ps4 aborts with sceSaveDataInitialize2 not implemented. So the test reaches the export through the runtime lookup, as intended.
  • tools/check_conventions.py --base upstream/main --head 8197ab33fd: passes. The split debt entries clear #10674's debt-length warning.

Forwarding to sceSaveDataInitialize3, as sceSaveDataInitialize already does, matches the three references you list. I approved #10674, which this builds on, separately.

…/savedata-initialize2

# Conflicts:
#	docs/dev/debt/libSceSaveData.native.md
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 3, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head c5e2f0e merged onto main 7feb37e · tested 2026-11-03 03:49 UTC · 14 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,132 passed · 4 failed (0 new, 3 also fail on main, 1 unstable on main) · 7 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,143 of 3,743 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 (543 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.2 s, ⚠️ public_headers 65.0 s, ⚠️ agc_driver_image_sample_unnormalized 36.4 s, ⚠️ agc_driver_lazy_resolved_abi 30.5 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 5 of the last 7 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 (4 IDs in 466 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (466 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 458 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth, agc_driver_stencil_null_feedback
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth, agc_driver_stencil_null_feedback
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_srgb8_color_target
Skipped (7)
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_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 c5e2f0ed94d9b15c0f471c0b62792e6951279803 7feb37ee3e30e10139b483fb4df689d5b5b69ab8
git checkout 7feb37ee3e30e10139b483fb4df689d5b5b69ab8 && git merge --no-ff c5e2f0ed94d9b15c0f471c0b62792e6951279803
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.

@oneandonlydean
oneandonlydean merged commit 0118801 into boykopovar:main Nov 3, 2026
12 checks passed
@blawesom blawesom mentioned this pull request Nov 4, 2026
12 tasks done
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.

5 participants