perf(agc): load the pipeline cache file only on the windowed device and save without re-reading an unchanged file #6372

Merged
AlxcBTW merged 2 commits from upstream-pr/6372 into main 2026-10-15 21:58:29 +00:00
AlxcBTW commented 2026-10-15 13:27:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-15T13:27:26Z.


What

The headless device is replaced by the windowed one at window attach and then only lingers for in-flight workers, but it parsed its own full copy of the pipeline cache file. In Sword of the Sea (PPSA25344) the census showed pipeline-cache-data: 1.17 GiB in 2 allocations for a 560 MiB file, stderr printed [pipeline-cache] loaded 561548 KiB twice, and the app committed 20-25 GiB in gameplay on a 31 GiB machine.

  • Load once. PipelineCache gets a loadFromFile parameter. The headless device passes false and starts empty (it still merges what it compiles into the file); only the windowed device loads the file.
  • No second copy on load. load() reuses the file buffer as the initial data (the header is erased in place) instead of copying it.
  • Cheaper save. save() writes the live data directly when the file still carries the header this object loaded or wrote last (the header holds size and hash), so nobody else added pipelines. It then skips the read-back and the merge cache.
  • A test in tests/Recorder.cpp covers the empty start.

Tested

Windows 11, MinGW-w64 GCC 15.2. Rebased onto origin/main 8dc92ae29.

  • Not run locally: ctest.
  • Built: the fork CI builds of our lab stacks compiled this change; tools/check_conventions.py --base origin/main passes on this head.
  • Before (measured): census pipeline-cache-data: 1.17 GiB in 2 allocations, [pipeline-cache] loaded 561548 KiB twice, 20-25 GiB committed in gameplay.
  • After (measured on Minecraft Dungeons II, PPSA16064 01.100.100, same card, the Sword of the Sea dump is no longer available): [pipeline-cache] loaded once (37956 KiB) instead of twice (37756 KiB each), app working set 5.65-5.69 GiB against 5.74-5.76 GiB on main 636b1b93c at the title after 135-146 s, title presents per 10 s unchanged (21-24 against 19-23). The census line above comes from a lab build and is not part of this PR. With a 37 MiB cache file the saving is 70-100 MiB; the 1.17 GiB case was not re-measured.
  • Linux, other titles: not tested.

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
  • Unblocks: none
  • GPUs tested: n/a (no GPU test ran; see Tested)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4874031087 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6372). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-15T13:27:26Z. --- ### What The headless device is replaced by the windowed one at window attach and then only lingers for in-flight workers, but it parsed its own full copy of the pipeline cache file. In Sword of the Sea (PPSA25344) the census showed `pipeline-cache-data: 1.17 GiB in 2 allocations` for a 560 MiB file, stderr printed `[pipeline-cache] loaded 561548 KiB` twice, and the app committed 20-25 GiB in gameplay on a 31 GiB machine. - **Load once.** `PipelineCache` gets a `loadFromFile` parameter. The headless device passes `false` and starts empty (it still merges what it compiles into the file); only the windowed device loads the file. - **No second copy on load.** `load()` reuses the file buffer as the initial data (the header is erased in place) instead of copying it. - **Cheaper save.** `save()` writes the live data directly when the file still carries the header this object loaded or wrote last (the header holds size and hash), so nobody else added pipelines. It then skips the read-back and the merge cache. - A test in `tests/Recorder.cpp` covers the empty start. ### Tested Windows 11, MinGW-w64 GCC 15.2. Rebased onto `origin/main` `8dc92ae29`. - **Not run locally:** `ctest`. - **Built:** the fork CI builds of our lab stacks compiled this change; `tools/check_conventions.py --base origin/main` passes on this head. - **Before (measured):** census `pipeline-cache-data: 1.17 GiB in 2 allocations`, `[pipeline-cache] loaded 561548 KiB` twice, 20-25 GiB committed in gameplay. - **After (measured on Minecraft Dungeons II, PPSA16064 01.100.100, same card, the Sword of the Sea dump is no longer available):** `[pipeline-cache] loaded` once (37956 KiB) instead of twice (37756 KiB each), app working set 5.65-5.69 GiB against 5.74-5.76 GiB on `main` 636b1b93c at the title after 135-146 s, title presents per 10 s unchanged (21-24 against 19-23). The census line above comes from a lab build and is not part of this PR. With a 37 MiB cache file the saving is 70-100 MiB; the 1.17 GiB case was not re-measured. - Linux, other titles: not tested. ### 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] Unblocks: none - [x] GPUs tested: n/a (no GPU test ran; see Tested) - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-15 13:33:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T13:33:22Z.


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 1368 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1896 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 3891 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4040 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4048 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4072 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4156 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4396 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4397 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4422 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4423 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4424 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4472 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4520 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4521 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4522 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4523 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4566 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4599 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4650 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4718 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4740 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4749 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4760 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4813 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4891 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5021 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5431 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5499 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6038 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6177 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6222 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6499 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6193327004 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6372#issuecomment-6193327004). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T13:33:22Z. --- <!-- pr-overlap --> 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 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 1896](https://www.github.com/boykopovar/AnyPS5/pull/1896) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 3891](https://www.github.com/boykopovar/AnyPS5/pull/3891) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4040](https://www.github.com/boykopovar/AnyPS5/pull/4040) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 4048](https://www.github.com/boykopovar/AnyPS5/pull/4048) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 4072](https://www.github.com/boykopovar/AnyPS5/pull/4072) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 4156](https://www.github.com/boykopovar/AnyPS5/pull/4156) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4396](https://www.github.com/boykopovar/AnyPS5/pull/4396) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4397](https://www.github.com/boykopovar/AnyPS5/pull/4397) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4422](https://www.github.com/boykopovar/AnyPS5/pull/4422) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4423](https://www.github.com/boykopovar/AnyPS5/pull/4423) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4424](https://www.github.com/boykopovar/AnyPS5/pull/4424) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4472](https://www.github.com/boykopovar/AnyPS5/pull/4472) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 4520](https://www.github.com/boykopovar/AnyPS5/pull/4520) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4521](https://www.github.com/boykopovar/AnyPS5/pull/4521) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4522](https://www.github.com/boykopovar/AnyPS5/pull/4522) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4523](https://www.github.com/boykopovar/AnyPS5/pull/4523) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4566](https://www.github.com/boykopovar/AnyPS5/pull/4566) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4599](https://www.github.com/boykopovar/AnyPS5/pull/4599) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4650](https://www.github.com/boykopovar/AnyPS5/pull/4650) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 4718](https://www.github.com/boykopovar/AnyPS5/pull/4718) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4740](https://www.github.com/boykopovar/AnyPS5/pull/4740) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4749](https://www.github.com/boykopovar/AnyPS5/pull/4749) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4760](https://www.github.com/boykopovar/AnyPS5/pull/4760) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4813](https://www.github.com/boykopovar/AnyPS5/pull/4813) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 4891](https://www.github.com/boykopovar/AnyPS5/pull/4891) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 5431](https://www.github.com/boykopovar/AnyPS5/pull/5431) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6038](https://www.github.com/boykopovar/AnyPS5/pull/6038) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6177](https://www.github.com/boykopovar/AnyPS5/pull/6177) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6222](https://www.github.com/boykopovar/AnyPS5/pull/6222) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6499](https://www.github.com/boykopovar/AnyPS5/pull/6499) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` |
adriadam10 commented 2026-10-15 14:01:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T14:01:37Z.

Review: CHANGES_REQUESTED


Thanks, the idea (one parse of the cache file instead of two) is sound. One problem and one request:

  • PipelineCache.cpp:176-189,236: with fileUnchanged, save() stops merging with the file and writes only the live cache, with floor = max(loadedBytes, settledFile->dataBytes). That only holds for an object that loaded the file. The headless device now has loadedBytes == 0 and an empty live cache: its first save merges with the file and sets settledFile to what it wrote, but the live cache never contains the file's pipelines. On a second save with the file untouched and new pipelines compiled, either size < floor and the new pipelines are dropped ("keeping ..."), or the live size exceeds floor and the file is overwritten without the pipelines that came from disk. On main the merge always happened. Fix direction: only take the direct-write path when this object's live cache is known to contain the file (it loaded it or wrote a merged result it also merged back into cache), otherwise keep merging.
  • tests/Recorder.cpp:7432-7453: each object saves once (the destructor), so the second-save case above isn't covered. Please add a case where an unseeded cache saves twice (the periodic save then the final one, or call save(false) through a friend/test hook) with a new pipeline in between, and check that the file still holds every pipeline. It should fail on this head.
  • The PR body says the after-state is not measured. Please post the census line and [pipeline-cache] loaded count after the change on the same title, so the 560 MiB claim is backed by a number.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5534380006 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6372#pullrequestreview-5534380006). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-15T14:01:37Z. **Review:** CHANGES_REQUESTED --- Thanks, the idea (one parse of the cache file instead of two) is sound. One problem and one request: - `PipelineCache.cpp:176-189,236`: with `fileUnchanged`, `save()` stops merging with the file and writes only the live cache, with `floor = max(loadedBytes, settledFile->dataBytes)`. That only holds for an object that loaded the file. The headless device now has `loadedBytes == 0` and an empty live cache: its first save merges with the file and sets `settledFile` to what it wrote, but the live cache never contains the file's pipelines. On a second save with the file untouched and new pipelines compiled, either `size < floor` and the new pipelines are dropped ("keeping ..."), or the live size exceeds `floor` and the file is overwritten without the pipelines that came from disk. On `main` the merge always happened. Fix direction: only take the direct-write path when this object's live cache is known to contain the file (it loaded it or wrote a merged result it also merged back into `cache`), otherwise keep merging. - `tests/Recorder.cpp:7432-7453`: each object saves once (the destructor), so the second-save case above isn't covered. Please add a case where an unseeded cache saves twice (the periodic save then the final one, or call `save(false)` through a friend/test hook) with a new pipeline in between, and check that the file still holds every pipeline. It should fail on this head. - The PR body says the after-state is not measured. Please post the census line and `[pipeline-cache] loaded` count after the change on the same title, so the 560 MiB claim is backed by a number.
AlxcBTW commented 2026-10-15 14:20:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-15T14:20:13Z.


Thanks, both points taken. Head e37e5f0ab:

  • The direct-write path now requires that this object's live cache holds the file: holdsFile is set only by a successful load(). An object created without the file (the headless device) always merges with the file, as on main; its first save writes the merged result and later saves merge again, so pipelines that came from disk are never dropped or overwritten.
  • tests/Recorder.cpp: new case, an unseeded cache saves (SaveNow(), the periodic save made callable), builds a new pipeline, saves again; a reloaded cache must hold both the file's pipeline and the new one. On the previous head the second save takes the direct path and loses the file's pipeline, so the case fails there.
  • Measurement: the Sword of the Sea dump is no longer on this machine. I am measuring the after-state on Minecraft Dungeons II (PPSA16064) instead, same card, and will post the [pipeline-cache] loaded count and the host-memory census line for main and this head on the same title as soon as the lab build lands.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6194317319 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6372#issuecomment-6194317319). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-15T14:20:13Z. --- Thanks, both points taken. Head e37e5f0ab: - The direct-write path now requires that this object's live cache holds the file: `holdsFile` is set only by a successful `load()`. An object created without the file (the headless device) always merges with the file, as on `main`; its first save writes the merged result and later saves merge again, so pipelines that came from disk are never dropped or overwritten. - `tests/Recorder.cpp`: new case, an unseeded cache saves (`SaveNow()`, the periodic save made callable), builds a new pipeline, saves again; a reloaded cache must hold both the file's pipeline and the new one. On the previous head the second save takes the direct path and loses the file's pipeline, so the case fails there. - Measurement: the Sword of the Sea dump is no longer on this machine. I am measuring the after-state on Minecraft Dungeons II (PPSA16064) instead, same card, and will post the `[pipeline-cache] loaded` count and the host-memory census line for `main` and this head on the same title as soon as the lab build lands.
adriadam10 commented 2026-10-15 14:32:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T14:32:23Z.

Review: APPROVED


Checked the interdiff against both points: holdsFile (set only by a successful load()) now gates the direct-write path, so an unseeded cache always merges with the file as on main. The new Recorder.cpp case (unseeded cache, two saves, a new pipeline in between) fails when holdsFile && is removed from fileUnchanged and passes with it. Build + ctest of libSceAgcDriver green apart from failures unrelated to this PR (agc_driver_tessellation segfault also on main, two load timeouts). Merging; the memory saving itself is not measured (stated in the PR).

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5534831576 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6372#pullrequestreview-5534831576). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-15T14:32:23Z. **Review:** APPROVED --- Checked the interdiff against both points: `holdsFile` (set only by a successful `load()`) now gates the direct-write path, so an unseeded cache always merges with the file as on `main`. The new `Recorder.cpp` case (unseeded cache, two saves, a new pipeline in between) fails when `holdsFile &&` is removed from `fileUnchanged` and passes with it. Build + ctest of libSceAgcDriver green apart from failures unrelated to this PR (`agc_driver_tessellation` segfault also on main, two load timeouts). Merging; the memory saving itself is not measured (stated in the PR).
AlxcBTW commented 2026-10-15 15:00:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-15T15:00:35Z.


After-state, measured on Minecraft Dungeons II (PPSA16064 01.100.100, RTX 5070 Laptop 8 GB, Windows 11, driver 617.42; the Sword of the Sea dump is no longer on this machine). Title screen, 150 s rows, same run copy and warm shader cache, APS5_PROFILE_DRAW=1:

main 636b1b93c this PR, head e37e5f0ab
[pipeline-cache] loaded 2 lines, 37756 KiB each 1 line, 37956 KiB
app working set at 135-146 s 5.74-5.76 GiB 5.65-5.69 GiB
title presents per 10 s 19-23 21-24

The cache file of this title is 37 MiB, so the saving here is about 70-100 MiB of working set; the 1.17 GiB figure in the description is the Sword of the Sea census with its 560 MiB file, and I cannot re-measure that one. The frame rate is unchanged, as expected. The census line itself comes from a lab build and is not in this PR; the description now says what was measured where.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6195179735 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6372#issuecomment-6195179735). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-15T15:00:35Z. --- After-state, measured on Minecraft Dungeons II (PPSA16064 01.100.100, RTX 5070 Laptop 8 GB, Windows 11, driver 617.42; the Sword of the Sea dump is no longer on this machine). Title screen, 150 s rows, same run copy and warm shader cache, `APS5_PROFILE_DRAW=1`: | | `main` 636b1b93c | this PR, head e37e5f0ab | |---|---|---| | `[pipeline-cache] loaded` | **2** lines, 37756 KiB each | **1** line, 37956 KiB | | app working set at 135-146 s | 5.74-5.76 GiB | 5.65-5.69 GiB | | title presents per 10 s | 19-23 | 21-24 | The cache file of this title is 37 MiB, so the saving here is about 70-100 MiB of working set; the 1.17 GiB figure in the description is the Sword of the Sea census with its 560 MiB file, and I cannot re-measure that one. The frame rate is unchanged, as expected. The census line itself comes from a lab build and is not in this PR; the description now says what was measured where.
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!6372
No description provided.