perf(windows): since #5596, Sword of the Sea's title drops from ~7.4 to 2.4 FPS: direct host imports are compared (~1.5 TB per 10 s) #5692

Closed
opened 2026-10-14 06:58:59 +00:00 by AlxcBTW · 9 comments
AlxcBTW commented 2026-10-14 06:58:59 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-14T06:58:59Z.


Title and scene

Sword of the Sea (PPSA25344, UE5), the title screen (static scene, the same hold in every run), Windows 11, RTX 5070 Laptop 8 GB, NVIDIA 617.42, Ryzen AI 9 365, on AC, warm caches, APS5_PROFILE_DRAW=1.

What changed

On main f40b6930f (which includes #5596) the title runs at 2.4 FPS. Our lab base from before #5596 (main of 2026-10-12 plus the depth-array store fix that has since merged as cc3b47dda) runs the same title at 7.3–7.5 FPS, mean 7.44 over four rows.

before #5596 (4 rows) main f40b6930f (2 rows)
frame ms ~134 426–430
GPU ms 102–106 158–175
queue 0 ms 130–134 422–426
top cost DRAW_INDIRECT / WAIT_REG_MEM mem.compare_ms 169–170 per frame

Both main runs log:

[write-watch] Windows direct host imports use comparisons; separate shared aliases retain guest write tracking

and [guestmem] per 10 s: compare 390283 calls 1490544 MiB 67.4 s. That is about 1.5 TB of guest memory compared every 10 s. DISPATCH_DIRECT on queue 0 rises to ~4 s per 10 s (161 ms per frame), with the device call at ~147 ms.

So the comparison fallback for direct host imports looks like it costs this title about two thirds of its frame rate. It may be worth keeping write tracking (or a cheaper dirty signal) for imported direct memory that the GPU reads every frame.

Caveats

  • The before/after bases differ by more than #5596: about two days of main. I haven't run main with only #5596 reverted yet. @johnmaia's revert run on #361 suggests that is the decisive change, for the throw at least.
  • The env also carries a few lab switches (APS5_RESOURCE_CACHE_ENTRIES, APS5_HOST_IMPORT_JOIN, APS5_HTILE_STORE_BACK, APS5_EXP_BDA_SWEEP_SKIP). They were the same on both sides.
  • Both main runs still ended on FAsyncLoadingThread (one 0xc0000005 at t197). That's the #361 class through another path, likely what #5052 covers. The storage-image debt throw from #5024 that @johnmaia reported shows up on our stack-on-main rows as well.

I can run main with #5596 reverted on the same scene if that helps. Logs are available.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5843413204 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5692). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-14T06:58:59Z. --- ### Title and scene Sword of the Sea (PPSA25344, UE5), the title screen (static scene, the same hold in every run), Windows 11, RTX 5070 Laptop 8 GB, NVIDIA 617.42, Ryzen AI 9 365, on AC, warm caches, `APS5_PROFILE_DRAW=1`. ### What changed On `main` `f40b6930f` (which includes #5596) the title runs at **2.4 FPS**. Our lab base from before #5596 (`main` of 2026-10-12 plus the depth-array store fix that has since merged as `cc3b47dda`) runs the same title at **7.3–7.5 FPS**, mean 7.44 over four rows. | | before #5596 (4 rows) | `main` f40b6930f (2 rows) | |---|---|---| | frame ms | ~134 | **426–430** | | GPU ms | 102–106 | 158–175 | | queue 0 ms | 130–134 | 422–426 | | top cost | DRAW_INDIRECT / WAIT_REG_MEM | **`mem.compare_ms` 169–170 per frame** | Both `main` runs log: ``` [write-watch] Windows direct host imports use comparisons; separate shared aliases retain guest write tracking ``` and `[guestmem]` per 10 s: `compare 390283 calls 1490544 MiB 67.4 s`. That is about **1.5 TB of guest memory compared every 10 s**. DISPATCH_DIRECT on queue 0 rises to ~4 s per 10 s (161 ms per frame), with the device call at ~147 ms. So the comparison fallback for direct host imports looks like it costs this title about two thirds of its frame rate. It may be worth keeping write tracking (or a cheaper dirty signal) for imported direct memory that the GPU reads every frame. ### Caveats - The before/after bases differ by more than #5596: about two days of `main`. I haven't run `main` with only #5596 reverted yet. @johnmaia's revert run on #361 suggests that is the decisive change, for the throw at least. - The env also carries a few lab switches (`APS5_RESOURCE_CACHE_ENTRIES`, `APS5_HOST_IMPORT_JOIN`, `APS5_HTILE_STORE_BACK`, `APS5_EXP_BDA_SWEEP_SKIP`). They were the same on both sides. - Both `main` runs still ended on `FAsyncLoadingThread` (one 0xc0000005 at t197). That's the #361 class through another path, likely what #5052 covers. The storage-image debt throw from #5024 that @johnmaia reported shows up on our stack-on-main rows as well. I can run `main` with #5596 reverted on the same scene if that helps. Logs are available.
MarcZX10 commented 2026-10-14 07:05:51 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T07:05:51Z.


Yes, a same-current-main control with only #5596 reverted would help isolate the regression. Please keep the scene, switches, cache state, and run duration fixed, and compare the per-frame mem.compare bytes/time alongside queue-0, GPU time, and FPS. That will show whether #5596 is driving the comparison increase before anyone changes the write-tracking path.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6162879140 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5692#issuecomment-6162879140). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-14T07:05:51Z. --- Yes, a same-current-main control with only #5596 reverted would help isolate the regression. Please keep the scene, switches, cache state, and run duration fixed, and compare the per-frame `mem.compare` bytes/time alongside queue-0, GPU time, and FPS. That will show whether #5596 is driving the comparison increase before anyone changes the write-tracking path.
EagleBearerYS commented 2026-10-14 07:35:47 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-14T07:35:47Z.


Resident Evil Village (PPSA01556, 01.210.000) pays the same comparison cost.

First, a note on reading the [guestmem] line: its counters are running totals since start. TimedAccess adds to per-thread counters, FoldMemoryCounters sums them for each report, and nothing resets them (GuestMemory.cpp). So compare 390283 calls 1490544 MiB 67.4 s is everything compared up to that line, and the rate per 10 s is the difference between two consecutive lines. The per-frame mem.compare_ms above is a separate measure and isn't affected.

Village, the last three [guestmem] reports of a 5-minute boot that reached the title screen, with APS5_PROFILE_DRAW=1:

report compare calls compare MiB compare s
1 77,454 1,054,720 114.1
2 81,634 1,109,411 120.0
3 85,806 1,163,388 125.5

So per 10 s there it compares about 54,000 MiB and spends about 5.5 s comparing; by then the totals are about 1.16 million MiB and 125.5 s. The log has the same line:

[write-watch] Windows direct host imports use comparisons; separate shared aliases retain guest write tracking

Setup: Windows 11 Home 10.0.26300, RTX 3070 Laptop (driver 617.42), Ryzen 9 5900HS, 15.4 GB. main 0b6d033b8, which includes #5596. Added to it:

  • local commits that prepare shaders at their first draw (APS5_RE8_LAZY_PREPARE=1, with APS5_NO_GPL=1); plain main heads for the commit limit here preparing them all at registration;
  • #5688 and #5703, for two startup stops.

None of them change the counted comparison code or its callers. I don't have a Village run with #5596 reverted yet, so this shows the size of the cost, not how much of it #5596 added.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6163334914 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5692#issuecomment-6163334914). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-14T07:35:47Z. --- Resident Evil Village (PPSA01556, 01.210.000) pays the same comparison cost. First, a note on reading the `[guestmem]` line: its counters are running totals since start. `TimedAccess` adds to per-thread counters, `FoldMemoryCounters` sums them for each report, and nothing resets them (`GuestMemory.cpp`). So `compare 390283 calls 1490544 MiB 67.4 s` is everything compared up to that line, and the rate per 10 s is the difference between two consecutive lines. The per-frame `mem.compare_ms` above is a separate measure and isn't affected. Village, the last three `[guestmem]` reports of a 5-minute boot that reached the title screen, with `APS5_PROFILE_DRAW=1`: | report | compare calls | compare MiB | compare s | |---|---|---|---| | 1 | 77,454 | 1,054,720 | 114.1 | | 2 | 81,634 | 1,109,411 | 120.0 | | 3 | 85,806 | 1,163,388 | 125.5 | So per 10 s there it compares about 54,000 MiB and spends about 5.5 s comparing; by then the totals are about 1.16 million MiB and 125.5 s. The log has the same line: ``` [write-watch] Windows direct host imports use comparisons; separate shared aliases retain guest write tracking ``` Setup: Windows 11 Home 10.0.26300, RTX 3070 Laptop (driver 617.42), Ryzen 9 5900HS, 15.4 GB. `main` 0b6d033b8, which includes #5596. Added to it: - local commits that prepare shaders at their first draw (`APS5_RE8_LAZY_PREPARE=1`, with `APS5_NO_GPL=1`); plain `main` heads for the commit limit here preparing them all at registration; - #5688 and #5703, for two startup stops. None of them change the counted comparison code or its callers. I don't have a Village run with #5596 reverted yet, so this shows the size of the cost, not how much of it #5596 added.
oneandonlydean commented 2026-10-14 09:23:52 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T09:23:52Z.


Both runs are from before #4878 (merged 06:20Z), which compares these unwatched direct imports only after a write-watch mark instead of at every epoch. Please use current main for the run with only #5596 reverted, and for the plain main row next to it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6165150799 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5692#issuecomment-6165150799). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T09:23:52Z. --- Both runs are from before #4878 (merged 06:20Z), which compares these unwatched direct imports only after a write-watch mark instead of at every epoch. Please use current main for the run with only #5596 reverted, and for the plain main row next to it.
LeandroLP23 commented 2026-10-14 13:19:30 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-14T13:19:30Z.


A run on current main (131171e77, includes #4878), with homebrew anyone can run: the same comparison cost shows up in the render-target refresh of every draw.

Setup: Windows 11 (26300), Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), Ryzen AI 7 350, WinLibs GCC 15.2.0, Release. Catalog releases relinked with --windows (SuperTuxKart also --trap-sdk-syscall-stubs), warm caches, 60 s each, the same start-up screen in every run. All three log [write-watch] Windows direct host imports use comparisons.

SuperTuxKart (PPSA69421), with APS5_NO_HOST_IMPORT=1 as the control (I couldn't revert #5596 alone: on this main the revert conflicts in core/libs/prx/libc/include/WindowsMappings.hpp):

main main, APS5_NO_HOST_IMPORT=1
FPS (window title, profiling off) 2.96 7.24
draws per 10 s, avg recorded 1487, 3215 us 4716, 313 us
readTarget per 10 s 4114 ms 564 ms
target lookups, time per lookup 1462, 2.81 ms 4636, 0.12 ms
pages walked per lookup 4320 4320
[guestmem] compare per 10 s (difference of the last two reports) 2544 calls, 21.2 GiB, 3.1 s 0
GPU busy / idle gaps per frame 17.6 / 366.2 ms 16.5 / 102.7 ms

readTarget is refreshResidentTarget → StorageTexture::Refresh (Draw.cpp), which collects writes over the colour target's pages for every draw. It walks the same 4320 pages either way. With the imports it compares them; without them it reads write-watch and is 23 times faster per lookup. The title is CPU-bound here (the GPU is idle most of each frame), so that's most of the 2.4× frame rate difference.

ProsperoLichess (PPSA99009) and ProsperoTV (PPSA99003) pay the comparisons too: per 10 s, 68577 calls / 17.7 GiB / 1.5 s and 80860 calls / 21.2 GiB / 1.6 s. But on this iGPU they are GPU-bound (134.6 and 105.7 ms GPU busy per frame), and APS5_NO_HOST_IMPORT=1 doesn't change their frame rate (4.72 → 4.50, 4.96 → 4.62 FPS).

Note for anyone repeating this with homebrew: titles that redirect their own stdout/stderr (these three do) take the APS5_PROFILE_DRAW output with them, so it lands in the title's log (app0/stk.log, download0/prosperolichess/app.log, data/prosperotv/profiles/*/logs/app.log), not in the emulator's console.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6169309449 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5692#issuecomment-6169309449). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-14T13:19:30Z. --- A run on current `main` (131171e77, includes #4878), with homebrew anyone can run: the same comparison cost shows up in the render-target refresh of every draw. Setup: Windows 11 (26300), Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), Ryzen AI 7 350, WinLibs GCC 15.2.0, Release. Catalog releases relinked with `--windows` (SuperTuxKart also `--trap-sdk-syscall-stubs`), warm caches, 60 s each, the same start-up screen in every run. All three log `[write-watch] Windows direct host imports use comparisons`. **SuperTuxKart (PPSA69421)**, with `APS5_NO_HOST_IMPORT=1` as the control (I couldn't revert #5596 alone: on this `main` the revert conflicts in `core/libs/prx/libc/include/WindowsMappings.hpp`): | | `main` | `main`, `APS5_NO_HOST_IMPORT=1` | |---|---|---| | FPS (window title, profiling off) | 2.96 | 7.24 | | draws per 10 s, avg recorded | 1487, 3215 us | 4716, 313 us | | `readTarget` per 10 s | 4114 ms | 564 ms | | target lookups, time per lookup | 1462, 2.81 ms | 4636, 0.12 ms | | pages walked per lookup | 4320 | 4320 | | `[guestmem]` compare per 10 s (difference of the last two reports) | 2544 calls, 21.2 GiB, 3.1 s | 0 | | GPU busy / idle gaps per frame | 17.6 / 366.2 ms | 16.5 / 102.7 ms | `readTarget` is `refreshResidentTarget` → `StorageTexture::Refresh` (`Draw.cpp`), which collects writes over the colour target's pages for every draw. It walks the same 4320 pages either way. With the imports it compares them; without them it reads write-watch and is 23 times faster per lookup. The title is CPU-bound here (the GPU is idle most of each frame), so that's most of the 2.4× frame rate difference. ProsperoLichess (PPSA99009) and ProsperoTV (PPSA99003) pay the comparisons too: per 10 s, 68577 calls / 17.7 GiB / 1.5 s and 80860 calls / 21.2 GiB / 1.6 s. But on this iGPU they are GPU-bound (134.6 and 105.7 ms GPU busy per frame), and `APS5_NO_HOST_IMPORT=1` doesn't change their frame rate (4.72 → 4.50, 4.96 → 4.62 FPS). Note for anyone repeating this with homebrew: titles that redirect their own stdout/stderr (these three do) take the `APS5_PROFILE_DRAW` output with them, so it lands in the title's log (`app0/stk.log`, `download0/prosperolichess/app.log`, `data/prosperotv/profiles/*/logs/app.log`), not in the emulator's console. AI-assisted: yes (Claude Code)
SoRadGaming commented 2026-10-14 13:41:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by SoRadGaming on 2026-10-14T13:41:44Z.


ASTRO BOT (PPSA21564 01.007.000) on Windows with an AMD GPU, with the comparison asked for above: current main (which already has #4878), the same build with only #5596 reverted, the same scene (title screen, title_controller_ship), warm shader cache, APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1 APS5_NO_SNAPSHOT_CHECK=1.

Host: Windows 11 Pro 26200, Ryzen 7 5800X3D (Zen 3, no AVX-512), Radeon RX 9070 XT (driver 32.0.23033.1002), 32 GB RAM, WinLibs GCC 15.2.0, Release.

  • A: main a3aeaf884 (includes #4878 and #5596) + #5671 + #5679 + #5707. Without those three, A stops at the first flip on storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented.
  • B: A + git revert -m 1 3e4fe4ce3 (#5596) + #5640, relinked with --frame-red-zone (39 of 665 red-zone leaves framed).
per 10 s at the title A (with #5596) B (#5596 reverted)
presents 15-17 (window: 0.5-1.4 FPS) 56-106 (window: 8.5-11 FPS)
[guestmem] compare, delta ~31,000 MiB, 2.2 s 0 (66 MiB since start)
[draw] packets 3,337 26,145
Graphics::Draw, us per packet 2,349 137
[gputime] batch span 1,344-1,486 ms 5,440-6,017 ms

So #4878 does not cover what this title compares. In A, the queue 0 worker's samples (APS5_SAMPLE_THREADS) sit mostly in GuestMemory::EqualsCommittedUnsynced and memcmp, below ShaderResources::PrepareDrawBindings. That is the sampled-texture snapshot lookup in cachedTexture: over excluded blocks its generation stays 0, so UnchangedSince never holds and EqualsCommitted runs over the whole surface at every lookup.

As a check, I gave that lookup the same UntrackedHint key compareUntracked uses: hint, NewestStamp, ForgetSerial, newest write note, taken before the read or compare, and only trusted with no recorded write pending over the surface. Then 7,324 snapshot hits were kept by the key and 11 compared, and Graphics::Draw dropped from 2,349 to ~1,150 us per packet. The title only reached ~2 FPS, though. What is left with #5596 is mostly storage-image traffic over the same ranges:

  • StorageTexture::captureGuestBytes reads (4.6 M of 5.0 M [guestmem] read calls);
  • the write-back compares, which still run without the memo.

B ran through the title, NEW GAME and into intro_next with audio for 6 minutes on this Zen 3 host, and a later session played for ~30 minutes, without a SceSndzAudioOutMain fault. #5640 framed only 39 of 665 leaves, so that says nothing about #361 itself.

AI-assisted (Claude Code); the builds and runs are on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6169755100 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5692#issuecomment-6169755100). Originally posted by [SoRadGaming](https://github.com/SoRadGaming) on 2026-10-14T13:41:44Z. --- ASTRO BOT (PPSA21564 01.007.000) on Windows with an AMD GPU, with the comparison asked for above: current `main` (which already has #4878), the same build with only #5596 reverted, the same scene (title screen, `title_controller_ship`), warm shader cache, `APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1 APS5_NO_SNAPSHOT_CHECK=1`. Host: Windows 11 Pro 26200, Ryzen 7 5800X3D (Zen 3, no AVX-512), Radeon RX 9070 XT (driver 32.0.23033.1002), 32 GB RAM, WinLibs GCC 15.2.0, Release. - A: `main` a3aeaf884 (includes #4878 and #5596) + #5671 + #5679 + #5707. Without those three, A stops at the first flip on `storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented`. - B: A + `git revert -m 1 3e4fe4ce3` (#5596) + #5640, relinked with `--frame-red-zone` (39 of 665 red-zone leaves framed). | per 10 s at the title | A (with #5596) | B (#5596 reverted) | |---|---|---| | presents | 15-17 (window: 0.5-1.4 FPS) | 56-106 (window: 8.5-11 FPS) | | `[guestmem]` compare, delta | ~31,000 MiB, 2.2 s | 0 (66 MiB since start) | | `[draw]` packets | 3,337 | 26,145 | | `Graphics::Draw`, us per packet | 2,349 | 137 | | `[gputime]` batch span | 1,344-1,486 ms | 5,440-6,017 ms | So #4878 does not cover what this title compares. In A, the queue 0 worker's samples (`APS5_SAMPLE_THREADS`) sit mostly in `GuestMemory::EqualsCommittedUnsynced` and `memcmp`, below `ShaderResources::PrepareDrawBindings`. That is the sampled-texture snapshot lookup in `cachedTexture`: over excluded blocks its generation stays 0, so `UnchangedSince` never holds and `EqualsCommitted` runs over the whole surface at every lookup. As a check, I gave that lookup the same `UntrackedHint` key `compareUntracked` uses: hint, `NewestStamp`, `ForgetSerial`, newest write note, taken before the read or compare, and only trusted with no recorded write pending over the surface. Then 7,324 snapshot hits were kept by the key and 11 compared, and `Graphics::Draw` dropped from 2,349 to ~1,150 us per packet. The title only reached ~2 FPS, though. What is left with #5596 is mostly storage-image traffic over the same ranges: - `StorageTexture::captureGuestBytes` reads (4.6 M of 5.0 M `[guestmem]` read calls); - the write-back compares, which still run without the memo. B ran through the title, NEW GAME and into `intro_next` with audio for 6 minutes on this Zen 3 host, and a later session played for ~30 minutes, without a `SceSndzAudioOutMain` fault. #5640 framed only 39 of 665 leaves, so that says nothing about #361 itself. AI-assisted (Claude Code); the builds and runs are on my machine.
EagleBearerYS commented 2026-10-14 14:49:53 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-14T14:49:53Z.


Current main this time. This replaces our earlier Village figure, which was from before #4878.

Resident Evil Village (PPSA01556, 01.210.000) on main 23be5a02b, the last 5 minutes at the title, warm shader cache, APS5_PROFILE_DRAW=1, Windows 11, RTX 3070 Laptop (driver 617.42):

  • [guestmem] compare: about 11,000 MiB and 1.2 s per 10 s;
  • address-based builds' compare: about 3.8 s per 10 s (6.4-6.5 ms per build);
  • 1-2 presents per 10 s.

With #5851, which keeps imported resident direct memory write-tracked, the same tree compares nothing in either place, and the title runs about 6.6 times as many frames: https://github.com/boykopovar/AnyPS5/pull/5851#issuecomment-6171130227

Both runs add #5703, #5815 and local commits that prepare shaders at their first draw (APS5_RE8_LAZY_PREPARE=1, with APS5_NO_GPL=1) and fix later stops. The measured main side also has #5688, which fixes #5596's heap-mirror abort; the #5851 side doesn't need it. Differences between consecutive running-total reports, in MiB as printed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6171153659 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5692#issuecomment-6171153659). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-14T14:49:53Z. --- Current `main` this time. This replaces our earlier Village figure, which was from before #4878. Resident Evil Village (PPSA01556, 01.210.000) on `main` 23be5a02b, the last 5 minutes at the title, warm shader cache, `APS5_PROFILE_DRAW=1`, Windows 11, RTX 3070 Laptop (driver 617.42): - `[guestmem]` compare: about 11,000 MiB and 1.2 s per 10 s; - address-based builds' compare: about 3.8 s per 10 s (6.4-6.5 ms per build); - 1-2 presents per 10 s. With #5851, which keeps imported resident direct memory write-tracked, the same tree compares nothing in either place, and the title runs about 6.6 times as many frames: https://github.com/boykopovar/AnyPS5/pull/5851#issuecomment-6171130227 Both runs add #5703, #5815 and local commits that prepare shaders at their first draw (`APS5_RE8_LAZY_PREPARE=1`, with `APS5_NO_GPL=1`) and fix later stops. The measured `main` side also has #5688, which fixes #5596's heap-mirror abort; the #5851 side doesn't need it. Differences between consecutive running-total reports, in MiB as printed.
SoRadGaming commented 2026-10-14 20:53:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by SoRadGaming on 2026-10-14T20:53:54Z.


The control asked for above, on current code without a revert. As noted above, reverting #5596 conflicts in WindowsMappings.hpp since b14d84485, 2af88da01 and 8cc20401a. Instead I made the one call that chooses the new path switchable, and compared the same binary with and without it.

GuestArenaMapDirect_nid_postfix (core/libs/prx/libc/src/GuestArena.cpp):

static const bool resident = std::getenv("APS5_NO_RESIDENT_DIRECT") == nullptr;
WindowsMappings::Get().Map(pointer, bytes, section, offset, protection, Arena::Get().WriteWatched(), resident);

With resident == false, singly mapped direct memory goes through the shared section and a separate import alias, as before #5596.

ASTRO BOT (PPSA21564), -lvl hub_crashsite, no input, no profiler, warm caches. FPS comes from the window's present counter over 120 s, after a 120 s settle once the hub has started. Windows 11 Pro 26200, Ryzen 7 5800X3D, RX 9070 XT (driver 32.0.23033.1002). The build is main e34c47921 + that switch + #5640, relinked with --frame-red-zone, with APS5_NO_SNAPSHOT_CHECK=1 APS5_RESOURCE_CACHE_ENTRIES=4096.

hub FPS 10 s samples
default (#5596's resident direct memory) 0.39 0.3-0.6
APS5_NO_RESIDENT_DIRECT=1 3.37 3.0-3.5

The same binary runs the hub 8.6× faster when direct memory stays on the shared, alias-imported path. In my earlier profile with #4878 and a sampled-snapshot hint like #5892's, what remained with #5596 was mostly storage-image traffic over the unwatched imports (StorageTexture::captureGuestBytes reads and write-back compares, see my comment above). That is where a fix would need to go to keep #5596's fault-free tracking without this cost.

The switch brings back the write faults that #5596 removed, so it is a diagnostic, not a fix for #361. On this Zen 3 host, ~15 launches with it (and --frame-red-zone framing 39 of 665 leaves) had no SceSndzAudioOutMain fault. One of them stopped with an access violation on the title's RoomLoad_ATQT thread while loading, read of 0x140 at eboot+0xd86cbb, which I have not tied to either cause.

AI-assisted (Claude Code); the builds and runs are on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6178240312 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5692#issuecomment-6178240312). Originally posted by [SoRadGaming](https://github.com/SoRadGaming) on 2026-10-14T20:53:54Z. --- The control asked for above, on current code without a revert. As noted above, reverting #5596 conflicts in `WindowsMappings.hpp` since b14d84485, 2af88da01 and 8cc20401a. Instead I made the one call that chooses the new path switchable, and compared the same binary with and without it. `GuestArenaMapDirect_nid_postfix` (`core/libs/prx/libc/src/GuestArena.cpp`): ```cpp static const bool resident = std::getenv("APS5_NO_RESIDENT_DIRECT") == nullptr; WindowsMappings::Get().Map(pointer, bytes, section, offset, protection, Arena::Get().WriteWatched(), resident); ``` With `resident == false`, singly mapped direct memory goes through the shared section and a separate import alias, as before #5596. ASTRO BOT (PPSA21564), `-lvl hub_crashsite`, no input, no profiler, warm caches. FPS comes from the window's present counter over 120 s, after a 120 s settle once the hub has started. Windows 11 Pro 26200, Ryzen 7 5800X3D, RX 9070 XT (driver 32.0.23033.1002). The build is `main` e34c47921 + that switch + #5640, relinked with `--frame-red-zone`, with `APS5_NO_SNAPSHOT_CHECK=1 APS5_RESOURCE_CACHE_ENTRIES=4096`. | | hub FPS | 10 s samples | |---|---|---| | default (#5596's resident direct memory) | 0.39 | 0.3-0.6 | | `APS5_NO_RESIDENT_DIRECT=1` | 3.37 | 3.0-3.5 | The same binary runs the hub 8.6× faster when direct memory stays on the shared, alias-imported path. In my earlier profile with #4878 and a sampled-snapshot hint like #5892's, what remained with #5596 was mostly storage-image traffic over the unwatched imports (`StorageTexture::captureGuestBytes` reads and write-back compares, see my comment above). That is where a fix would need to go to keep #5596's fault-free tracking without this cost. The switch brings back the write faults that #5596 removed, so it is a diagnostic, not a fix for #361. On this Zen 3 host, ~15 launches with it (and `--frame-red-zone` framing 39 of 665 leaves) had no `SceSndzAudioOutMain` fault. One of them stopped with an access violation on the title's `RoomLoad_ATQT` thread while loading, read of 0x140 at eboot+0xd86cbb, which I have not tied to either cause. AI-assisted (Claude Code); the builds and runs are on my machine.
frankea commented 2026-10-15 17:53:00 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-15T17:53:00Z.


A third machine for the two candidates, on Astro Bot (PPSA21564, title intro) rather than Sword of the Sea: Windows 11, Ryzen 7 5800X, RTX 4090 (NVIDIA 616.92), 3840x2160, one executable, libs/ swapped, three alternating rounds, APS5_TRACE_SECONDS=120:40.

main a077a88df #6060 (6c6a6c85a) #5851 (22091410a)
FPS in the window 3.06 / 2.97 14.96 / 15.26 / 14.94 16.04 / 16.01 / 16.05
frame p50 ms 233 / 229 66.8 / 66.1 / 67.4 62.6 / 62.7 / 62.7
GPU busy ms per present 159 / 169 33.3 / 32.3 / 32.1 33.0 / 32.5 / 32.6

Both recover the #5596 cost here, by about 5x; neither stopped in 200 s. Details and summary lines in https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6198650709.

Tested with AI assistance (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6198654814 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5692#issuecomment-6198654814). Originally posted by [frankea](https://github.com/frankea) on 2026-10-15T17:53:00Z. --- A third machine for the two candidates, on Astro Bot (PPSA21564, title intro) rather than Sword of the Sea: Windows 11, Ryzen 7 5800X, RTX 4090 (NVIDIA 616.92), 3840x2160, one executable, `libs/` swapped, three alternating rounds, `APS5_TRACE_SECONDS=120:40`. | | `main` `a077a88df` | #6060 (`6c6a6c85a`) | #5851 (`22091410a`) | |---|---|---|---| | FPS in the window | 3.06 / 2.97 | 14.96 / 15.26 / 14.94 | 16.04 / 16.01 / 16.05 | | frame p50 ms | 233 / 229 | 66.8 / 66.1 / 67.4 | 62.6 / 62.7 / 62.7 | | GPU busy ms per present | 159 / 169 | 33.3 / 32.3 / 32.1 | 33.0 / 32.5 / 32.6 | Both recover the #5596 cost here, by about 5x; neither stopped in 200 s. Details and summary lines in https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6198650709. Tested with AI assistance (Claude Code).
m335671 commented 2026-10-18 21:04:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by m335671 on 2026-10-18T21:04:54Z.


The original title after #6060 merged: Sword of the Sea (PPSA25344, 01.510.000), title screen, warm caches, APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1. Same machine for both rows: Windows 11 Pro 26200, Ryzen 9 7900, RTX 4070 12 GB (NVIDIA 616.92), WinLibs GCC 15.2.0.

release v0.1.2 (no #6060) main d7a455a90 (includes #6060 fcaa43284)
[write-watch] line Windows direct host imports use comparisons direct host imports of private memory are settled and stay watched
[guestmem] compare, difference of the last two reports 10,653 calls, 43,053 MiB, 2.5 s 0 (151 calls, 1 MiB, 0.0 s since start)
presents per 10 s 36–37 (~3.7 FPS) 128–129 (~12.9 FPS)
GPU busy / idle gaps per frame 111–115 / 159–168 ms 55.2 / 22.7–23.0 ms

So on this title the comparisons are gone after #6060. Caveat: the two builds are about 2,700 commits apart, so the FPS gap isn't all #6060. Only the compare line isolates it. One long run per side.

AI-assisted: yes (Claude Code). The builds, the runs and this comment were done and written by Claude Code on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6255131093 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5692#issuecomment-6255131093). Originally posted by [m335671](https://github.com/m335671) on 2026-10-18T21:04:54Z. --- The original title after #6060 merged: Sword of the Sea (PPSA25344, 01.510.000), title screen, warm caches, `APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1`. Same machine for both rows: Windows 11 Pro 26200, Ryzen 9 7900, RTX 4070 12 GB (NVIDIA 616.92), WinLibs GCC 15.2.0. | | release v0.1.2 (no #6060) | `main` `d7a455a90` (includes #6060 `fcaa43284`) | |---|---|---| | `[write-watch]` line | `Windows direct host imports use comparisons` | `direct host imports of private memory are settled and stay watched` | | `[guestmem]` compare, difference of the last two reports | 10,653 calls, 43,053 MiB, 2.5 s | 0 (151 calls, 1 MiB, 0.0 s since start) | | presents per 10 s | 36–37 (~3.7 FPS) | 128–129 (~12.9 FPS) | | GPU busy / idle gaps per frame | 111–115 / 159–168 ms | 55.2 / 22.7–23.0 ms | So on this title the comparisons are gone after #6060. Caveat: the two builds are about 2,700 commits apart, so the FPS gap isn't all #6060. Only the compare line isolates it. One long run per side. AI-assisted: yes (Claude Code). The builds, the runs and this comment were done and written by Claude Code on my machine.
Sign in to join this conversation.
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#5692
No description provided.