fix(savedata): persist native save icons #8630

Merged
Ondra97 merged 11 commits from upstream-pr/8630 into main 2026-11-04 19:19:13 +00:00
Ondra97 commented 2026-10-20 19:05:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-20T19:05:28Z.


What

sceSaveDataSaveIcon previously returned success without storing bytes, and sceSaveDataLoadIcon returned success with a zero data size. The native buffer APIs now persist and reload the mounted save's sce_sys/icon0.png through the existing disk path resolver and savedata::replace_file.

Save writes min(buf_size, data_size) bytes. Load copies at most the destination capacity and reports the full stored size. Missing icons return NOT_FOUND, invalid icon/buffer pointers return PARAMETER, and I/O failures return INTERNAL. Buffer clipping and full-size reporting follow shadPS4's implementation. PS5 image validation, size limits and error precedence remain unmeasured and are recorded in debt.

The earlier revision also imported a PS4 read-only rejection. That breaks the reported Persona 5 Royal (PPSA05110) save sequence: a 0x31 mount followed by successful Prepare cannot save its icon and the caller skips Commit. This revision removes that unsupported access check and its slot state. It preserves main's accepted sequence while actually storing the icon. It does not infer PS5 transaction semantics from the title: Prepare/Commit remain as on main, and mount-access enforcement is deferred until that contract is established.

The new prepared_create2 regression runs CreateTransactionResource -> Mount3(0x31, 48 blocks) -> Prepare -> SetParam -> SaveIcon -> Commit -> Umount2(0x10001), then remounts and verifies the exact icon bytes. It repeats with an existing save, different content and a shorter icon. The other cases cover separate saves, working-directory changes, clipping, zero lengths, overwrites, loading through a read-only mount, invalid arguments and I/O failure cleanup. This addresses icon persistence (C5 in #8005), without claiming a transaction implementation or title compatibility.

The current-main refresh retains icon persistence and its six-case regression. Both icon entry points now use main's existing isValidMountPoint validation together with the icon/buffer checks. The mount-status fixture preserves main's added assertions while supplying valid icon buffers, saving before loading, and expecting PARAMETER for a null icon before mount lookup. A valid buffer on an unmounted point still returns NOT_MOUNTED. This retains the existing, explicitly unverified error-precedence contract.

The November 3 integration preserves all current main mount, backup and event-callback behavior. The icon I/O implementation changes only at the initial mount-point validation; the six-case fixture retains its exact source blob.

Tested

November 3, 2026 (Europe/Prague): main 5cb015caaaaf83f8ee431414ee6a457b5b307d49, submitted head ab8360ee1e7dddeead7d22bc6b7ed19056f2b7ad.

Windows 11 Pro 10.0.26300; AMD Ryzen 9 7900X; 31.7 GiB RAM; WinLibs GCC 15.2.0 r7 UCRT; Ninja Release; BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=ON, pinned bundled dependencies, isolated workspace temporary directories. These are CPU/runtime fixtures, not GPU qualification.

  • Full production relinker/libraries and all selected fixtures build successfully. 24/24 focused SaveData/library/header checks pass, zero failures/skips; every case completed below 30 seconds.
  • All six icon modes execute, including prepared-CREATE2, existing-save/shorter overwrite and exact remounted-byte checks. Expanded mount-status tests exercise unterminated mount points with valid icon buffers, backup and mount behavior. The new event-callback case, host-space, PS4/native APIs, save-memory/journal/replacement cases and patched-library loading pass.
  • Public-header audit: 405 libraries and 27,952 exports, unique declarations and umbrella coverage verified. The public SaveData API is unchanged.
  • Comparing both icon functions against the prior submitted source after substituting the new mount-point predicate gives identical bodies. GuestSaveDataIcon.cpp remains Git blob f743eb6cf656edcf6f37a14554409cbee3e03229. No read-only rejection or title-specific transaction state is added.
  • Conventions, strict main synchronization, whitespace and registration pass: 1,883 executables, none unregistered. Original commits and authorship remain in history; publication is a normal push.

Reproduction with the supported toolchain on PATH and an isolated temporary directory configured:

cmake --build build --target guest_savedata_cancel_tests guest_savedata_convert_tests guest_savedata_delete_tests guest_savedata_dialog_tests guest_savedata_host_space_tests guest_savedata_icon_tests guest_savedata_mount_status_tests guest_savedata_ps4_tests guest_savedata_search_tests libs patched_libraries_tests relinker savedata_memory_growth_tests savedata_memory_host_write_tests savedata_memory_journal_tests savedata_memory_metadata_tests savedata_native_write_replacement_tests savedata_replace_file_failure_tests guest_savedata_event_callback_tests --parallel 8
ctest --test-dir build -R '(savedata|save_data|^patched_libraries$|^public_headers$)' -j 4 -V --timeout 30 --no-tests=error

This verifies focused runtime fixtures against current main. No new Persona 5 Royal in-game save, console transaction/access measurement, full CTest run or mixed-PR qualification is claimed. Older evidence retains its exact source and platform attribution below.

Earlier source-pinned validation

November 1 current-main refresh: base f2d874c1fdccf781c0fa5d86619bb5dd8894b958, submitted head d154e94cca15d49b9d39eb64e153df646e8cf330. Windows 11 Pro 10.0.26300, AMD Ryzen 9 7900X, 31.7 GiB RAM, NVIDIA GeForce RTX 4070 Ti SUPER (CPU fixtures only), WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT, Ninja Release, BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=ON, pinned bundled dependencies, workspace-local temporary test directories.

The CMake conflict retains main's guest_savedata_host_space target/registration and all six icon cases. All current mount-status/PS4 and native save-memory coverage remains. The two icon function bodies match the previous submitted head exactly, and GuestSaveDataIcon.cpp retains Git blob f743eb6cf656edcf6f37a14554409cbee3e03229. Original implementation/review-fix commits and authorship are preserved without rewriting history.

  • Complete production relinker/libraries and all 18 selected targets build successfully.
  • 22/22 focused CTests pass, zero failures/skips, including the six icon modes, host-space, mount status, native/PS4 save APIs, memory/journal/replacement cases and patched-library loading. The separate public_headers inventory audit also passes, 1/1.
  • The prepared-CREATE2 case executes both new-save and existing-save cycles: Mount3(0x31, 48 blocks) -> Prepare -> SetParam -> SaveIcon -> Commit -> Umount2(0x10001), shorter overwrite, remount and exact byte checks. The code does not add a transaction state or reintroduce the unsupported read-only rejection.
  • Public-header inventory: 399 libraries and 26743 exports, unique declarations and umbrella coverage verified. Conventions, strict main synchronization, whitespace and registration checks pass.

Reproduction with the supported toolchain on PATH:

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build --target guest_savedata_cancel_tests guest_savedata_convert_tests guest_savedata_delete_tests guest_savedata_dialog_tests guest_savedata_host_space_tests guest_savedata_icon_tests guest_savedata_mount_status_tests guest_savedata_ps4_tests guest_savedata_search_tests libs patched_libraries_tests relinker savedata_memory_growth_tests savedata_memory_host_write_tests savedata_memory_journal_tests savedata_memory_metadata_tests savedata_native_write_replacement_tests savedata_replace_file_failure_tests --parallel 8
ctest --test-dir build -R '(savedata|save_data|^patched_libraries$)' -j 4 -V --no-tests=error --output-on-failure
ctest --test-dir build -R '^public_headers$' -V --no-tests=error --output-on-failure

This update validates the unchanged persistence implementation against current main's surrounding APIs and tests. It does not claim a Persona 5 Royal in-game save, a console transaction/access contract, a complete CTest run or a new mixed-PR runtime result. Earlier negative controls and independent reviewer runs retain their original revisions below.

Earlier validation (historical source pins and environments)

Revalidated on 2026-10-30: base 3948413d701b093b32a194f5fe5525ea8d5f5079, submitted head fb3759c10c428d0b29ba95055c452d204a231504. Main was merged into the existing branch without rewriting its original icon/public-header/prepared-CREATE2 history.

Windows 11 Pro 10.0.26300; AMD Ryzen 9 7900X, 31.7 GiB RAM, NVIDIA GeForce RTX 4070 Ti SUPER (the fixtures use the CPU). WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT; Release, BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=ON, pinned bundled dependencies, workspace-local TEMP/TMP.

The full production relinker and libs build, patched-library checker and every fixture selected below passed on the submitted sources. 21/21 SaveData/patched-library CTests passed, zero failures or skips, including all six icon modes and the reconciled mount-status test. All 374 patched libraries loaded, zero failures. The public-header audit checked 374 libraries and 14722 exports for unique declarations and umbrella coverage.

The prepared-CREATE2 case covers a new and existing save, Mount3(0x31, 48 blocks) -> Prepare -> SetParam -> SaveIcon -> Commit -> Umount2(0x10001), a shorter overwrite and exact bytes after remounting. The two icon functions and the dedicated six-case icon fixture are byte-identical to the previously submitted d3b5b39a255405ab0894684259a388922067affa; only the integration fixture required adjustment. The earlier failing control and independent reviewer runs remain historical evidence below.

$env:TEMP = $env:TMP = (New-Item -ItemType Directory -Force build-test-temp).FullName
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
cmake --build build --target guest_savedata_cancel_tests guest_savedata_convert_tests guest_savedata_delete_tests guest_savedata_dialog_tests guest_savedata_icon_tests guest_savedata_mount_status_tests guest_savedata_ps4_tests guest_savedata_search_tests libs patched_libraries_tests relinker savedata_memory_growth_tests savedata_memory_host_write_tests savedata_memory_journal_tests savedata_memory_metadata_tests savedata_native_write_replacement_tests savedata_replace_file_failure_tests --parallel 8
ctest --test-dir build -R '(savedata|save_data|^patched_libraries$)' -j 4 -V --output-on-failure --no-tests=error
python core/libs/tests/test_public_headers.py --audit-only
python tools/check_conventions.py --base origin/main
python tools/check_main_sync.py --base origin/main --strict
python tools/check_test_registration.py build
python tools/pr_overlap.py --branch codex/pr8630-rebase-20261030 --repo boykopovar/AnyPS5 --jobs 4
git diff origin/main...HEAD --check

Conventions, strict main synchronization, registration and whitespace checks pass. The overlap scan completed; its remaining shared-file comparisons are #10674 (progress signature), #12846 (debt) and #12853 (bounded mount-point validation and mount-status assertions). Their shared patches do not implement icon persistence. When composing #12853, retain its bounded mount-point validation alongside this PR's icon validation and save-before-load fixture order. No peer dependency, author agreement or mixed-stack runtime result is claimed.

No new title or console run and no complete CTest suite is claimed. Persona 5 Royal making an in-game save remains untested; synthetic host sequences do not establish PS5 transaction semantics. Earlier evidence and attributed reviewer runs are retained below with their own revisions.

Earlier submitted-revision validation and reviewer evidence (historical) Windows 11 Pro 10.0.26300; AMD Ryzen 9 7900X, 32 GB RAM, NVIDIA GeForce RTX 4070 Ti SUPER. WinLibs GCC 15.2.0 UCRT r7; Release, `BUILD_TESTING=ON`, workspace-local `TEMP`/`TMP`.

Validated on 2026-10-26 against main afc780e681fc379a6ed1b19a2a247cae17f0fc07, final head d3b5b39a255405ab0894684259a388922067affa. The existing PR history and public-header cleanup are preserved; that main revision was merged without rewriting the branch.

The new regression was built on the merged pre-fix tree 66ea6b3290458f41f5c93b28458799c7c8a81e29 with only the new test/registration added. All three attempts failed at the SaveIcon success assertion. With the fix, all six icon cases passed three consecutive runs each. Both new-save and existing-save cycles complete and the icon survives remounting.

Metric Before (base) After (fix)
Prepared CREATE2 regression failures, 3 runs 3/3 0/3

The full Windows runtime build (relinker, libs, patched-library checker and every fixture selected below) passed on the submitted sources. All 21 selected CTests passed, with no skips; 368 patched libraries loaded with zero failures. Conventions, strict main-sync, test registration, the public-header declaration audit and whitespace checks passed. The public-header audit checked 368 libraries and 12,262 exports.

$env:TEMP = $env:TMP = (New-Item -ItemType Directory -Force build-test-temp).FullName
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DPython3_EXECUTABLE=C:/Python314/python.exe -DFFMPEG_PREBUILT_DIR=D:/Github/AnyPS5/build-runtime/externals/ffmpeg-9ac4cfd195f1
cmake --build build --parallel 6 --target relinker libs patched_libraries_tests guest_savedata_icon_tests guest_savedata_mount_status_tests guest_savedata_search_tests guest_savedata_delete_tests guest_savedata_convert_tests guest_savedata_ps4_tests guest_savedata_cancel_tests guest_savedata_dialog_tests savedata_memory_metadata_tests savedata_memory_growth_tests savedata_memory_journal_tests savedata_core_write_replacement_tests savedata_native_write_replacement_tests savedata_replace_file_failure_tests
ctest --test-dir build -R '^guest_savedata_icon_' --repeat until-fail:3 -V
ctest --test-dir build -R '(savedata|save_data|^patched_libraries$)' -V --output-on-failure
python tools/check_conventions.py --base origin/main
python tools/check_main_sync.py --base origin/main --strict
python tools/check_test_registration.py build
python core/libs/tests/test_public_headers.py --audit-only
python tools/pr_overlap.py --branch codex/pr8630-rebase-20261021 --repo boykopovar/AnyPS5
git diff origin/main...HEAD --check

Independent reviewer runs of the same PR head:

  • jotitadev, 2026-10-27: head d3b5b39a2 merged cleanly onto main e2d457be3; Ubuntu 26.04 x86_64, Intel Core i7-8700 (6 cores / 12 threads, AVX2), GCC 15.2, Release, BUILD_TESTING=ON. The build and all 21 SaveData/patched-library tests passed. The six committed icon cases and guest_savedata_mount_status each passed 20 repeated runs. Restoring main's Export.cpp made all six icon cases fail while mount-status still passed.
  • thuanquang, 2026-10-28: head d3b5b39a25 merged onto main 3a40945e62; Windows 11 26200, WinLibs GCC 15.2.0 r7, Release. All seven locally registered icon cases passed in each of three rounds: the six committed cases plus the reviewer's separate replay of Mount3(0x31) -> Prepare -> SaveIcon -> Commit -> Umount2(0x10001). That separate case had failed in all three runs on the earlier head 748cdaf1e9. The seventh case is local to the reviewer's checkout.

These results are attributed to the reviewers; this description update does not claim a new build or runtime run. Persona 5 Royal has not been tested making an in-game save: the reviewer's scripted runs do not yet reach a save point.

On 2026-10-28, git merge-tree --write-tree --name-only origin/main d3b5b39a255405ab0894684259a388922067affa completed without conflicts against main 2f34dca5b32b4e12a3a028e2f9587a15ef79d077. This checks mergeability, not runtime behavior on that newer base.

Manual review of #11720 at 410e7c4c18cb51d174f53317d7834a13dd662cd6 found a separate sceSaveDataCancel initialization change and debt edit, with no duplicate icon implementation. #12220 at 21771c59d6077ee967262f2b1ddeb43c26dea18a adds icon assertions in the same mount-status test. Its unmounted-point/null-icon assertions expect NOT_MOUNTED, whereas this PR validates a null icon first and returns PARAMETER; its surrounding fixture also loads before saving. Those expectations and test ordering need reconciliation when integrating the two PRs. Neither PR is a prerequisite for this icon implementation, and no combined runtime test is claimed.

No game save, console module or game payload is used by the fixtures. No PS5 or real-title run was performed by this update; the title trace is the reviewer's evidence. The synthetic test confirms restored host behavior and icon persistence, not console transaction correctness. The hosted full Linux and Windows build jobs for this head were skipped; full builds require a collaborator-triggered workflow.

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:4940940367 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8630). Originally posted by [Ondra97](https://github.com/Ondra97) on 2026-10-20T19:05:28Z. --- ### What `sceSaveDataSaveIcon` previously returned success without storing bytes, and `sceSaveDataLoadIcon` returned success with a zero data size. The native buffer APIs now persist and reload the mounted save's `sce_sys/icon0.png` through the existing disk path resolver and `savedata::replace_file`. Save writes `min(buf_size, data_size)` bytes. Load copies at most the destination capacity and reports the full stored size. Missing icons return `NOT_FOUND`, invalid icon/buffer pointers return `PARAMETER`, and I/O failures return `INTERNAL`. Buffer clipping and full-size reporting follow [shadPS4's implementation](https://github.com/shadps4-emu/shadPS4/blob/8d50471b7dc141dd700b51276b8edd1f293bce26/src/core/libraries/save_data/savedata.cpp). PS5 image validation, size limits and error precedence remain unmeasured and are recorded in debt. The earlier revision also imported a PS4 read-only rejection. That breaks the [reported Persona 5 Royal (PPSA05110) save sequence](https://github.com/boykopovar/AnyPS5/pull/8630#issuecomment-6423409122): a `0x31` mount followed by successful `Prepare` cannot save its icon and the caller skips `Commit`. This revision removes that unsupported access check and its slot state. It preserves main's accepted sequence while actually storing the icon. It does not infer PS5 transaction semantics from the title: `Prepare`/`Commit` remain as on main, and mount-access enforcement is deferred until that contract is established. The new `prepared_create2` regression runs `CreateTransactionResource -> Mount3(0x31, 48 blocks) -> Prepare -> SetParam -> SaveIcon -> Commit -> Umount2(0x10001)`, then remounts and verifies the exact icon bytes. It repeats with an existing save, different content and a shorter icon. The other cases cover separate saves, working-directory changes, clipping, zero lengths, overwrites, loading through a read-only mount, invalid arguments and I/O failure cleanup. This addresses icon persistence (C5 in #8005), without claiming a transaction implementation or title compatibility. The current-main refresh retains icon persistence and its six-case regression. Both icon entry points now use main's existing `isValidMountPoint` validation together with the icon/buffer checks. The mount-status fixture preserves main's added assertions while supplying valid icon buffers, saving before loading, and expecting `PARAMETER` for a null icon before mount lookup. A valid buffer on an unmounted point still returns `NOT_MOUNTED`. This retains the existing, explicitly unverified error-precedence contract. The November 3 integration preserves all current main mount, backup and event-callback behavior. The icon I/O implementation changes only at the initial mount-point validation; the six-case fixture retains its exact source blob. ### 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. --> November 3, 2026 (Europe/Prague): main `5cb015caaaaf83f8ee431414ee6a457b5b307d49`, submitted head `ab8360ee1e7dddeead7d22bc6b7ed19056f2b7ad`. Windows 11 Pro 10.0.26300; AMD Ryzen 9 7900X; 31.7 GiB RAM; WinLibs GCC 15.2.0 r7 UCRT; Ninja Release; `BUILD_TESTING=ON`, `ANYPS5_ENABLE_SPIRV_TOOLS=ON`, pinned bundled dependencies, isolated workspace temporary directories. These are CPU/runtime fixtures, not GPU qualification. - Full production relinker/libraries and all selected fixtures build successfully. **24/24 focused SaveData/library/header checks pass**, zero failures/skips; every case completed below 30 seconds. - All six icon modes execute, including prepared-CREATE2, existing-save/shorter overwrite and exact remounted-byte checks. Expanded mount-status tests exercise unterminated mount points with valid icon buffers, backup and mount behavior. The new event-callback case, host-space, PS4/native APIs, save-memory/journal/replacement cases and patched-library loading pass. - Public-header audit: **405 libraries and 27,952 exports**, unique declarations and umbrella coverage verified. The public SaveData API is unchanged. - Comparing both icon functions against the prior submitted source after substituting the new mount-point predicate gives identical bodies. `GuestSaveDataIcon.cpp` remains Git blob `f743eb6cf656edcf6f37a14554409cbee3e03229`. No read-only rejection or title-specific transaction state is added. - Conventions, strict main synchronization, whitespace and registration pass: 1,883 executables, none unregistered. Original commits and authorship remain in history; publication is a normal push. Reproduction with the supported toolchain on PATH and an isolated temporary directory configured: ```powershell cmake --build build --target guest_savedata_cancel_tests guest_savedata_convert_tests guest_savedata_delete_tests guest_savedata_dialog_tests guest_savedata_host_space_tests guest_savedata_icon_tests guest_savedata_mount_status_tests guest_savedata_ps4_tests guest_savedata_search_tests libs patched_libraries_tests relinker savedata_memory_growth_tests savedata_memory_host_write_tests savedata_memory_journal_tests savedata_memory_metadata_tests savedata_native_write_replacement_tests savedata_replace_file_failure_tests guest_savedata_event_callback_tests --parallel 8 ctest --test-dir build -R '(savedata|save_data|^patched_libraries$|^public_headers$)' -j 4 -V --timeout 30 --no-tests=error ``` This verifies focused runtime fixtures against current main. No new Persona 5 Royal in-game save, console transaction/access measurement, full CTest run or mixed-PR qualification is claimed. Older evidence retains its exact source and platform attribution below. <details> <summary>Earlier source-pinned validation</summary> November 1 current-main refresh: base `f2d874c1fdccf781c0fa5d86619bb5dd8894b958`, submitted head `d154e94cca15d49b9d39eb64e153df646e8cf330`. Windows 11 Pro 10.0.26300, AMD Ryzen 9 7900X, 31.7 GiB RAM, NVIDIA GeForce RTX 4070 Ti SUPER (CPU fixtures only), WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT, Ninja Release, `BUILD_TESTING=ON`, `ANYPS5_ENABLE_SPIRV_TOOLS=ON`, pinned bundled dependencies, workspace-local temporary test directories. The CMake conflict retains main's `guest_savedata_host_space` target/registration and all six icon cases. All current mount-status/PS4 and native save-memory coverage remains. The two icon function bodies match the previous submitted head exactly, and `GuestSaveDataIcon.cpp` retains Git blob `f743eb6cf656edcf6f37a14554409cbee3e03229`. Original implementation/review-fix commits and authorship are preserved without rewriting history. - Complete production relinker/libraries and all 18 selected targets build successfully. - **22/22 focused CTests pass**, zero failures/skips, including the six icon modes, host-space, mount status, native/PS4 save APIs, memory/journal/replacement cases and patched-library loading. The separate `public_headers` inventory audit also passes, 1/1. - The prepared-CREATE2 case executes both new-save and existing-save cycles: `Mount3(0x31, 48 blocks) -> Prepare -> SetParam -> SaveIcon -> Commit -> Umount2(0x10001)`, shorter overwrite, remount and exact byte checks. The code does not add a transaction state or reintroduce the unsupported read-only rejection. - Public-header inventory: 399 libraries and 26743 exports, unique declarations and umbrella coverage verified. Conventions, strict main synchronization, whitespace and registration checks pass. Reproduction with the supported toolchain on PATH: ```powershell cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON cmake --build build --target guest_savedata_cancel_tests guest_savedata_convert_tests guest_savedata_delete_tests guest_savedata_dialog_tests guest_savedata_host_space_tests guest_savedata_icon_tests guest_savedata_mount_status_tests guest_savedata_ps4_tests guest_savedata_search_tests libs patched_libraries_tests relinker savedata_memory_growth_tests savedata_memory_host_write_tests savedata_memory_journal_tests savedata_memory_metadata_tests savedata_native_write_replacement_tests savedata_replace_file_failure_tests --parallel 8 ctest --test-dir build -R '(savedata|save_data|^patched_libraries$)' -j 4 -V --no-tests=error --output-on-failure ctest --test-dir build -R '^public_headers$' -V --no-tests=error --output-on-failure ``` This update validates the unchanged persistence implementation against current main's surrounding APIs and tests. It does not claim a Persona 5 Royal in-game save, a console transaction/access contract, a complete CTest run or a new mixed-PR runtime result. Earlier negative controls and independent reviewer runs retain their original revisions below. <details> <summary>Earlier validation (historical source pins and environments)</summary> Revalidated on 2026-10-30: base `3948413d701b093b32a194f5fe5525ea8d5f5079`, submitted head `fb3759c10c428d0b29ba95055c452d204a231504`. Main was merged into the existing branch without rewriting its original icon/public-header/prepared-CREATE2 history. Windows 11 Pro 10.0.26300; AMD Ryzen 9 7900X, 31.7 GiB RAM, NVIDIA GeForce RTX 4070 Ti SUPER (the fixtures use the CPU). WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT; Release, `BUILD_TESTING=ON`, `ANYPS5_ENABLE_SPIRV_TOOLS=ON`, pinned bundled dependencies, workspace-local `TEMP`/`TMP`. The full production `relinker` and `libs` build, patched-library checker and every fixture selected below passed on the submitted sources. **21/21 SaveData/patched-library CTests passed, zero failures or skips**, including all six icon modes and the reconciled mount-status test. All 374 patched libraries loaded, zero failures. The public-header audit checked 374 libraries and 14722 exports for unique declarations and umbrella coverage. The prepared-CREATE2 case covers a new and existing save, `Mount3(0x31, 48 blocks) -> Prepare -> SetParam -> SaveIcon -> Commit -> Umount2(0x10001)`, a shorter overwrite and exact bytes after remounting. The two icon functions and the dedicated six-case icon fixture are byte-identical to the previously submitted `d3b5b39a255405ab0894684259a388922067affa`; only the integration fixture required adjustment. The earlier failing control and independent reviewer runs remain historical evidence below. ```powershell $env:TEMP = $env:TMP = (New-Item -ItemType Directory -Force build-test-temp).FullName cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ cmake --build build --target guest_savedata_cancel_tests guest_savedata_convert_tests guest_savedata_delete_tests guest_savedata_dialog_tests guest_savedata_icon_tests guest_savedata_mount_status_tests guest_savedata_ps4_tests guest_savedata_search_tests libs patched_libraries_tests relinker savedata_memory_growth_tests savedata_memory_host_write_tests savedata_memory_journal_tests savedata_memory_metadata_tests savedata_native_write_replacement_tests savedata_replace_file_failure_tests --parallel 8 ctest --test-dir build -R '(savedata|save_data|^patched_libraries$)' -j 4 -V --output-on-failure --no-tests=error python core/libs/tests/test_public_headers.py --audit-only python tools/check_conventions.py --base origin/main python tools/check_main_sync.py --base origin/main --strict python tools/check_test_registration.py build python tools/pr_overlap.py --branch codex/pr8630-rebase-20261030 --repo boykopovar/AnyPS5 --jobs 4 git diff origin/main...HEAD --check ``` Conventions, strict main synchronization, registration and whitespace checks pass. The overlap scan completed; its remaining shared-file comparisons are #10674 (progress signature), #12846 (debt) and #12853 (bounded mount-point validation and mount-status assertions). Their shared patches do not implement icon persistence. When composing #12853, retain its bounded mount-point validation alongside this PR's icon validation and save-before-load fixture order. No peer dependency, author agreement or mixed-stack runtime result is claimed. No new title or console run and no complete CTest suite is claimed. Persona 5 Royal making an in-game save remains untested; synthetic host sequences do not establish PS5 transaction semantics. Earlier evidence and attributed reviewer runs are retained below with their own revisions. <details> <summary>Earlier submitted-revision validation and reviewer evidence (historical)</summary> Windows 11 Pro 10.0.26300; AMD Ryzen 9 7900X, 32 GB RAM, NVIDIA GeForce RTX 4070 Ti SUPER. WinLibs GCC 15.2.0 UCRT r7; Release, `BUILD_TESTING=ON`, workspace-local `TEMP`/`TMP`. Validated on 2026-10-26 against main `afc780e681fc379a6ed1b19a2a247cae17f0fc07`, final head `d3b5b39a255405ab0894684259a388922067affa`. The existing PR history and public-header cleanup are preserved; that main revision was merged without rewriting the branch. The new regression was built on the merged pre-fix tree `66ea6b3290458f41f5c93b28458799c7c8a81e29` with only the new test/registration added. All three attempts failed at the SaveIcon success assertion. With the fix, all six icon cases passed three consecutive runs each. Both new-save and existing-save cycles complete and the icon survives remounting. | Metric | Before (base) | After (fix) | |---|---|---| | Prepared CREATE2 regression failures, 3 runs | 3/3 | 0/3 | The full Windows runtime build (`relinker`, `libs`, patched-library checker and every fixture selected below) passed on the submitted sources. All 21 selected CTests passed, with no skips; 368 patched libraries loaded with zero failures. Conventions, strict main-sync, test registration, the public-header declaration audit and whitespace checks passed. The public-header audit checked 368 libraries and 12,262 exports. ```powershell $env:TEMP = $env:TMP = (New-Item -ItemType Directory -Force build-test-temp).FullName cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DPython3_EXECUTABLE=C:/Python314/python.exe -DFFMPEG_PREBUILT_DIR=D:/Github/AnyPS5/build-runtime/externals/ffmpeg-9ac4cfd195f1 cmake --build build --parallel 6 --target relinker libs patched_libraries_tests guest_savedata_icon_tests guest_savedata_mount_status_tests guest_savedata_search_tests guest_savedata_delete_tests guest_savedata_convert_tests guest_savedata_ps4_tests guest_savedata_cancel_tests guest_savedata_dialog_tests savedata_memory_metadata_tests savedata_memory_growth_tests savedata_memory_journal_tests savedata_core_write_replacement_tests savedata_native_write_replacement_tests savedata_replace_file_failure_tests ctest --test-dir build -R '^guest_savedata_icon_' --repeat until-fail:3 -V ctest --test-dir build -R '(savedata|save_data|^patched_libraries$)' -V --output-on-failure python tools/check_conventions.py --base origin/main python tools/check_main_sync.py --base origin/main --strict python tools/check_test_registration.py build python core/libs/tests/test_public_headers.py --audit-only python tools/pr_overlap.py --branch codex/pr8630-rebase-20261021 --repo boykopovar/AnyPS5 git diff origin/main...HEAD --check ``` Independent reviewer runs of the same PR head: - [jotitadev, 2026-10-27](https://github.com/boykopovar/AnyPS5/pull/8630#pullrequestreview-5661167640): head `d3b5b39a2` merged cleanly onto main `e2d457be3`; Ubuntu 26.04 x86_64, Intel Core i7-8700 (6 cores / 12 threads, AVX2), GCC 15.2, Release, `BUILD_TESTING=ON`. The build and all 21 SaveData/patched-library tests passed. The six committed icon cases and `guest_savedata_mount_status` each passed 20 repeated runs. Restoring main's `Export.cpp` made all six icon cases fail while mount-status still passed. - [thuanquang, 2026-10-28](https://github.com/boykopovar/AnyPS5/pull/8630#issuecomment-6467346111): head `d3b5b39a25` merged onto main `3a40945e62`; Windows 11 26200, WinLibs GCC 15.2.0 r7, Release. All seven locally registered icon cases passed in each of three rounds: the six committed cases plus the reviewer's separate replay of `Mount3(0x31) -> Prepare -> SaveIcon -> Commit -> Umount2(0x10001)`. That separate case had failed in all three runs on the earlier head `748cdaf1e9`. The seventh case is local to the reviewer's checkout. These results are attributed to the reviewers; this description update does not claim a new build or runtime run. Persona 5 Royal has not been tested making an in-game save: the reviewer's scripted runs do not yet reach a save point. On 2026-10-28, `git merge-tree --write-tree --name-only origin/main d3b5b39a255405ab0894684259a388922067affa` completed without conflicts against main `2f34dca5b32b4e12a3a028e2f9587a15ef79d077`. This checks mergeability, not runtime behavior on that newer base. Manual review of [#11720](https://github.com/boykopovar/AnyPS5/pull/11720) at `410e7c4c18cb51d174f53317d7834a13dd662cd6` found a separate `sceSaveDataCancel` initialization change and debt edit, with no duplicate icon implementation. [#12220](https://github.com/boykopovar/AnyPS5/pull/12220) at `21771c59d6077ee967262f2b1ddeb43c26dea18a` adds icon assertions in the same mount-status test. Its unmounted-point/null-icon assertions expect `NOT_MOUNTED`, whereas this PR validates a null icon first and returns `PARAMETER`; its surrounding fixture also loads before saving. Those expectations and test ordering need reconciliation when integrating the two PRs. Neither PR is a prerequisite for this icon implementation, and no combined runtime test is claimed. No game save, console module or game payload is used by the fixtures. No PS5 or real-title run was performed by this update; the title trace is the reviewer's evidence. The synthetic test confirms restored host behavior and icon persistence, not console transaction correctness. The hosted full Linux and Windows build jobs for this head were skipped; full builds require a collaborator-triggered workflow. <!-- 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. --> </details> </details> </details> ### 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: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes
harisibrar1 commented 2026-10-24 15:41:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-24T15:41:02Z.

Review: APPROVED


Checked against main b607bfdc8b and shadPS4 8d50471b (savedata.cpp LoadIcon/SaveIcon, savedata_error.h):

  • It merges cleanly with current main (3-way merge-tree), and main still has the no-op LoadIcon/SaveIcon this replaces.
  • Argument order, the min(buf_size, data_size) write, the full-size report on load, NOT_FOUND for a missing icon, and BAD_MOUNTED (0x809F000D) on a read-only slot all match the cited shadPS4 code.
  • The icon path is the internal /savedataN mount point plus a fixed sce_sys/icon0.png, resolved through the absolute alias. Guest input can't reach it beyond picking a slot, and mount3 already rejects ., .., /, \ and : in directory names, so I see no traversal route.
  • read_only is set on every mount, and Umount2 resets the whole slot, so a reused slot can't inherit an old read-only flag. Looks good to me.

Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5638820016 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8630#pullrequestreview-5638820016). Originally posted by [harisibrar1](https://github.com/harisibrar1) on 2026-10-24T15:41:02Z. **Review:** APPROVED --- Checked against main b607bfdc8b and shadPS4 8d50471b (`savedata.cpp` LoadIcon/SaveIcon, `savedata_error.h`): - It merges cleanly with current main (3-way merge-tree), and main still has the no-op LoadIcon/SaveIcon this replaces. - Argument order, the `min(buf_size, data_size)` write, the full-size report on load, NOT_FOUND for a missing icon, and BAD_MOUNTED (0x809F000D) on a read-only slot all match the cited shadPS4 code. - The icon path is the internal `/savedataN` mount point plus a fixed `sce_sys/icon0.png`, resolved through the absolute alias. Guest input can't reach it beyond picking a slot, and mount3 already rejects `.`, `..`, `/`, `\` and `:` in directory names, so I see no traversal route. - `read_only` is set on every mount, and Umount2 resets the whole slot, so a reused slot can't inherit an old read-only flag. Looks good to me. Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
jotitadev commented 2026-10-27 01:20:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-27T01:20:59Z.

Review: COMMENTED


Linux run of the current head, since the tested section covers Windows only.

Machine: Linux x86_64, i7-8700 (6 cores / 12 threads, AVX2), Ubuntu 26.04, GCC 15.2, Release, BUILD_TESTING=ON. Head d3b5b39a2 merged onto main e2d457be3 (clean).

  • Build ok, no TEMP override needed. All 21 tests matching savedata plus patched_libraries pass; the six guest_savedata_icon_* cases and guest_savedata_mount_status pass 20 of 20 repeated runs.
  • Restoring main's Export.cpp and keeping the tests fails all six icon cases (roundtrip at GuestSaveDataIcon.cpp:86, the other five at line 73, including prepared_create2). guest_savedata_mount_status still passes on main, as expected after its reorder.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5661167640 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8630#pullrequestreview-5661167640). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-27T01:20:59Z. **Review:** COMMENTED --- Linux run of the current head, since the tested section covers Windows only. Machine: Linux x86_64, i7-8700 (6 cores / 12 threads, AVX2), Ubuntu 26.04, GCC 15.2, Release, `BUILD_TESTING=ON`. Head `d3b5b39a2` merged onto `main` `e2d457be3` (clean). - Build ok, no `TEMP` override needed. All 21 tests matching `savedata` plus `patched_libraries` pass; the six `guest_savedata_icon_*` cases and `guest_savedata_mount_status` pass 20 of 20 repeated runs. - Restoring `main`'s `Export.cpp` and keeping the tests fails all six icon cases (`roundtrip` at `GuestSaveDataIcon.cpp:86`, the other five at line 73, including `prepared_create2`). `guest_savedata_mount_status` still passes on `main`, as expected after its reorder. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
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!8630
No description provided.