fix(agc): cache inaccessible guest pages #6184

Merged
MarcZX10 merged 2 commits from upstream-pr/6184 into main 2026-10-18 20:37:09 +00:00
MarcZX10 commented 2026-10-15 01:10:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T01:10:21Z.


What

Cache inaccessible guest-arena pages and Linux mapping gaps alongside readable runs. Repeated checks for reserved or unmapped arena addresses can then use the page table instead of calling PROCMAP_QUERY or reparsing /proc/self/maps.

Invalidate cached stack pages when guest stack protections change through DoMprotect or thread-exit restoration. The graphics regression test checks that an inaccessible page remains a cached miss until the guest-allocation registry registers it, after which it becomes accessible.

This addresses the inaccessible arena-page path in #6183. It complements #6179, whose process_vm_readv fast path handles small readable host ranges; inaccessible pages still take the mapping-query fallback there.

Tested

Ubuntu 24.04 container, GCC 12.2, Release, BUILD_TESTING=ON:

  • agc_driver_graphics_tests and its required libraries build successfully.
  • tools/check_conventions.py --base upstream/main passes; git diff --check is clean.
  • ctest --test-dir build -R '^agc_driver_graphics$' --output-on-failure aborts at the existing host CPU guard before test code runs. This Xeon E5-1620 v2 lacks LZCNT, BMI1/2, MOVBE, AVX2 and FMA. I am not claiming a local runtime test pass.

The performance and runtime measurements in #6183 are from the issue reporter's separate machines and are not repeated here.

Checklist

  • Based on current main; no other open PR implements the same functions (#6179 covers readable small-range probes)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; silent stubs are unaffected
  • No notes, investigation files or images added
  • No new third-party code
  • Generic behavior, not specific to one title
  • Depends on: #6583
  • Unblocks: PPSA01748 #6183
  • GPUs tested: n/a; no GPU tests run
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4866720273 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T01:10:21Z. --- ### What Cache inaccessible guest-arena pages and Linux mapping gaps alongside readable runs. Repeated checks for reserved or unmapped arena addresses can then use the page table instead of calling `PROCMAP_QUERY` or reparsing `/proc/self/maps`. Invalidate cached stack pages when guest stack protections change through `DoMprotect` or thread-exit restoration. The graphics regression test checks that an inaccessible page remains a cached miss until the guest-allocation registry registers it, after which it becomes accessible. This addresses the inaccessible arena-page path in #6183. It complements #6179, whose `process_vm_readv` fast path handles small readable host ranges; inaccessible pages still take the mapping-query fallback there. ### Tested Ubuntu 24.04 container, GCC 12.2, Release, `BUILD_TESTING=ON`: - `agc_driver_graphics_tests` and its required libraries build successfully. - `tools/check_conventions.py --base upstream/main` passes; `git diff --check` is clean. - `ctest --test-dir build -R '^agc_driver_graphics$' --output-on-failure` aborts at the existing host CPU guard before test code runs. This Xeon E5-1620 v2 lacks LZCNT, BMI1/2, MOVBE, AVX2 and FMA. I am not claiming a local runtime test pass. The performance and runtime measurements in #6183 are from the issue reporter's separate machines and are not repeated here. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions (#6179 covers readable small-range probes) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; silent stubs are unaffected - [x] No notes, investigation files or images added - [x] No new third-party code - [x] Generic behavior, not specific to one title - [x] Depends on: #6583 - [x] Unblocks: PPSA01748 #6183 - [x] GPUs tested: n/a; no GPU tests run - [x] AI-assisted: yes
simonbbby commented 2026-10-15 02:25:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-15T02:25:36Z.


Independent Linux CPU-path execution at exact head 09633f038e15e3ec2faff6531bee3b352622a39b. This covers the new inaccessible-page regression without claiming the full graphics fixture passed.

Ubuntu 24.04, kernel 7.0.0-38, Ryzen 9 9950X, GCC 13.3. I compiled the actual PR sources GuestMemory.cpp, GuestAllocations.cpp and GuestArena.cpp with -std=c++20 -O2 -ffunction-sections -fdata-sections -pthread -msse4.2 -Icore/libs -Icore/shader/recompiler. Linked them with --gc-sections to a thin main/assertion harness containing the unchanged RunUnmappedGapTests function body from this head's tests/GuestAllocations.cpp. No replacement production getter, registry, arena or cache. The harness explicitly fails if GuestArenaAvailable_nid_postfix() is false, rather than counting that early return as a pass.

Production page-cache object Mapping query mode Result
PR GuestMemory.cpp Native kernel query 5/5 pass, separate processes
Parent's GuestMemory.cpp, same PR test/registry/arena Native kernel query fail at the new negative-cache assertion
PR GuestMemory.cpp ioctl rejected with ENOTTY, real /proc/self/maps fallback 5/5 pass, separate processes
Parent's GuestMemory.cpp, same other objects Same forced fallback fail at the same assertion

The parent failure is a checked inaccessible arena page was queried again instead of read from the page table.

The unchanged regression exercises the real mmap/mprotect/munmap operations and registry mutations: readable/writable transitions and unmapped gaps, a reserved PROT_NONE page, the cached inaccessible answer after an unregistered mprotect, then Mutation::Add invalidating that answer so the page becomes writable again.

For the fallback run I used strace -e trace=ioctl,openat -e inject=ioctl:error=ENOTTY; each trace confirms both the injected ioctl rejection and an open of /proc/self/maps. That simulates an unsupported mapping-query ioctl on this kernel; it is not a run on a pre-6.11 kernel. The native-query and fallback binaries use the same unmodified production objects. The parent control changes only the compiled GuestMemory.cpp, so the positive result does not come from skipping the regression or from a replacement cache implementation.

Scope: this validates the new CPU page-cache/registry regression. No agc_driver_graphics CTest pass, Vulkan/GPU execution, DoMprotect or thread-exit stack-restoration test, title run, or performance measurement is claimed. HAL's ordinary full configure is independently blocked by SDL XRandR development support; these standalone objects do not require SDL. The PR checkout remains clean.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6182988373 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6182988373). Originally posted by [simonbbby](https://github.com/simonbbby) on 2026-10-15T02:25:36Z. --- Independent Linux **CPU-path execution** at exact head **`09633f038e15e3ec2faff6531bee3b352622a39b`**. This covers the new inaccessible-page regression without claiming the full graphics fixture passed. Ubuntu 24.04, kernel 7.0.0-38, Ryzen 9 9950X, GCC 13.3. I compiled the actual PR sources `GuestMemory.cpp`, `GuestAllocations.cpp` and `GuestArena.cpp` with `-std=c++20 -O2 -ffunction-sections -fdata-sections -pthread -msse4.2 -Icore/libs -Icore/shader/recompiler`. Linked them with `--gc-sections` to a thin main/assertion harness containing the **unchanged `RunUnmappedGapTests` function body** from this head's `tests/GuestAllocations.cpp`. No replacement production getter, registry, arena or cache. The harness explicitly fails if `GuestArenaAvailable_nid_postfix()` is false, rather than counting that early return as a pass. | Production page-cache object | Mapping query mode | Result | |---|---|---| | PR `GuestMemory.cpp` | Native kernel query | **5/5 pass**, separate processes | | Parent's `GuestMemory.cpp`, same PR test/registry/arena | Native kernel query | **fail** at the new negative-cache assertion | | PR `GuestMemory.cpp` | `ioctl` rejected with `ENOTTY`, real `/proc/self/maps` fallback | **5/5 pass**, separate processes | | Parent's `GuestMemory.cpp`, same other objects | Same forced fallback | **fail** at the same assertion | The parent failure is `a checked inaccessible arena page was queried again instead of read from the page table`. The unchanged regression exercises the real `mmap`/`mprotect`/`munmap` operations and registry mutations: readable/writable transitions and unmapped gaps, a reserved `PROT_NONE` page, the cached inaccessible answer after an unregistered `mprotect`, then `Mutation::Add` invalidating that answer so the page becomes writable again. For the fallback run I used `strace -e trace=ioctl,openat -e inject=ioctl:error=ENOTTY`; each trace confirms both the injected ioctl rejection and an open of `/proc/self/maps`. That simulates an unsupported mapping-query ioctl on this kernel; it is not a run on a pre-6.11 kernel. The native-query and fallback binaries use the same unmodified production objects. The parent control changes only the compiled `GuestMemory.cpp`, so the positive result does not come from skipping the regression or from a replacement cache implementation. Scope: this validates the new CPU page-cache/registry regression. **No `agc_driver_graphics` CTest pass, Vulkan/GPU execution, `DoMprotect` or thread-exit stack-restoration test, title run, or performance measurement is claimed.** HAL's ordinary full configure is independently blocked by SDL XRandR development support; these standalone objects do not require SDL. The PR checkout remains clean.
Tamalero commented 2026-10-15 03:35:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-15T03:35:30Z.


Title run on this PR's exact head (09633f038), on the case from #6183: Guardians of the Galaxy (PPSA01748) on Ubuntu 24.04 with kernel 6.8, so there's no PROCMAP_QUERY and no switch is needed. Radeon Pro V620 (RADV, Mesa 25.2.8), EPYC 7452, plus one NpManager stub the title needs to start.

Build Language screen
main before this change (same machine, #6183) stalls around frame 2,400; one frame every few minutes
this PR reached in ~12.5 min, then 2.9–3.8 FPS, past frame 4,100 with no stall

The roughly 90–100 MB/s of small reads still present on this kernel are the main-image lookups noted under "Still open" in #6183. Those don't stall the screen.

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6183807053 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6183807053). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-15T03:35:30Z. --- Title run on this PR's exact head (`09633f038`), on the case from #6183: Guardians of the Galaxy (PPSA01748) on Ubuntu 24.04 with kernel 6.8, so there's no `PROCMAP_QUERY` and no switch is needed. Radeon Pro V620 (RADV, Mesa 25.2.8), EPYC 7452, plus one NpManager stub the title needs to start. | Build | Language screen | |---|---| | `main` before this change (same machine, #6183) | stalls around frame 2,400; one frame every few minutes | | this PR | reached in ~12.5 min, then 2.9–3.8 FPS, past frame 4,100 with no stall | The roughly 90–100 MB/s of small reads still present on this kernel are the main-image lookups noted under "Still open" in #6183. Those don't stall the screen. *Tested and written by Claude (AI assistant) on a contributor's machine.*
github-actions[bot] commented 2026-10-15 12:16:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:16:17Z.


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

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6234 core/libs/prx/libc/src/GuestArena.cpp L523
PR 6921 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp L445-446
PR 6926 core/libs/prx/libc/src/GuestArena.cpp L523-524
PR 7615 core/libs/prx/libc/src/GuestArena.cpp L454

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 1324 core/libs/prx/libSceAgcDriver/tests/GuestAllocations.cpp
PR 1835 core/libs/prx/libc/src/GuestArena.cpp
PR 3986 core/libs/prx/libkernel/Pthread/src/Thread.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 5021 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libc/src/GuestArena.cpp
core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp
core/libs/prx/libkernel/Pthread/src/Thread.cpp
PR 6177 core/libs/prx/libSceAgcDriver/tests/GuestAllocations.cpp
PR 6185 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6186 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6192 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6273 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6447 core/libs/prx/libc/src/GuestArena.cpp
PR 6534 core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp
core/libs/prx/libkernel/Pthread/src/Thread.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6868 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6879 core/libs/prx/libc/src/GuestArena.cpp
core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp
core/libs/prx/libkernel/Pthread/src/Thread.cpp
PR 7105 core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp
PR 7149 core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp
core/libs/prx/libkernel/Pthread/src/Thread.cpp
PR 7201 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libc/src/GuestArena.cpp
core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp
core/libs/prx/libkernel/Pthread/src/Thread.cpp
PR 7332 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp
core/libs/prx/libkernel/Pthread/src/Thread.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191825102 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6191825102). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T12:16:17Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6234](https://www.github.com/boykopovar/AnyPS5/pull/6234) | `core/libs/prx/libc/src/GuestArena.cpp` [L523](https://github.com/boykopovar/AnyPS5/blob/e8ad642fe647cfc16f3ea4a49c379efb220ff0c2/core/libs/prx/libc/src/GuestArena.cpp#L523) | | | | [PR 6921](https://www.github.com/boykopovar/AnyPS5/pull/6921) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` [L445-446](https://github.com/boykopovar/AnyPS5/blob/e8ad642fe647cfc16f3ea4a49c379efb220ff0c2/core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp#L445-L446) | | | | [PR 6926](https://www.github.com/boykopovar/AnyPS5/pull/6926) | `core/libs/prx/libc/src/GuestArena.cpp` [L523-524](https://github.com/boykopovar/AnyPS5/blob/e8ad642fe647cfc16f3ea4a49c379efb220ff0c2/core/libs/prx/libc/src/GuestArena.cpp#L523-L524) | | | | [PR 7615](https://www.github.com/boykopovar/AnyPS5/pull/7615) | `core/libs/prx/libc/src/GuestArena.cpp` [L454](https://github.com/boykopovar/AnyPS5/blob/e8ad642fe647cfc16f3ea4a49c379efb220ff0c2/core/libs/prx/libc/src/GuestArena.cpp#L454) | | | 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 1324](https://www.github.com/boykopovar/AnyPS5/pull/1324) | `core/libs/prx/libSceAgcDriver/tests/GuestAllocations.cpp` | | [PR 1835](https://www.github.com/boykopovar/AnyPS5/pull/1835) | `core/libs/prx/libc/src/GuestArena.cpp` | | [PR 3986](https://www.github.com/boykopovar/AnyPS5/pull/3986) | `core/libs/prx/libkernel/Pthread/src/Thread.cpp` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libc/src/GuestArena.cpp`<br>`core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp`<br>`core/libs/prx/libkernel/Pthread/src/Thread.cpp` | | [PR 6177](https://www.github.com/boykopovar/AnyPS5/pull/6177) | `core/libs/prx/libSceAgcDriver/tests/GuestAllocations.cpp` | | [PR 6185](https://www.github.com/boykopovar/AnyPS5/pull/6185) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6186](https://www.github.com/boykopovar/AnyPS5/pull/6186) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6273](https://www.github.com/boykopovar/AnyPS5/pull/6273) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6292](https://www.github.com/boykopovar/AnyPS5/pull/6292) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6447](https://www.github.com/boykopovar/AnyPS5/pull/6447) | `core/libs/prx/libc/src/GuestArena.cpp` | | [PR 6534](https://www.github.com/boykopovar/AnyPS5/pull/6534) | `core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp`<br>`core/libs/prx/libkernel/Pthread/src/Thread.cpp` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6879](https://www.github.com/boykopovar/AnyPS5/pull/6879) | `core/libs/prx/libc/src/GuestArena.cpp`<br>`core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp`<br>`core/libs/prx/libkernel/Pthread/src/Thread.cpp` | | [PR 7105](https://www.github.com/boykopovar/AnyPS5/pull/7105) | `core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp` | | [PR 7149](https://www.github.com/boykopovar/AnyPS5/pull/7149) | `core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp`<br>`core/libs/prx/libkernel/Pthread/src/Thread.cpp` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libc/src/GuestArena.cpp`<br>`core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp`<br>`core/libs/prx/libkernel/Pthread/src/Thread.cpp` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp`<br>`core/libs/prx/libkernel/Pthread/src/Thread.cpp` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` |
Neithennn commented 2026-10-15 15:30:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Neithennn on 2026-10-15T15:30:39Z.


Windows NVIDIA run: agc_driver_graphics fails with this PR at a Windows-only check, and passes on main.

Windows 11 Pro 26200, NVIDIA GeForce RTX 4080 (driver 617.42), AMD Ryzen 7 5800X, WinLibs GCC 15.2.0 r7, Ninja, Release, bundled dependencies, BUILD_TESTING=ON, ANYPS5_NO_SHADER_CACHE=1. Head 016bfe4b6 merged onto main ff23657f3; full build succeeds.

AGC graphics: a page committed after the mirror was made was not read into it
  • agc_driver_graphics: 0/7 pass with this PR (targeted, full suite and 5 serial runs); 5/5 pass on unchanged main ff23657f3 after a clean rebuild on the same machine.
  • The check is in sparseHeapMirrorTests (core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp:1528), which is inside #ifdef _WIN32: it commits a page with GuestArenaCommit_nid_postfix after the mirror was made and expects it to be read. Linux runs do not reach it.
  • Full ctest -j 8: 1289/1290, agc_driver_graphics being the only failure. The new GuestAllocations regression and the guest thread, memory and mprotect tests pass.

Not verified: that the page committed late is the one cached as inaccessible; this is consistent with the change and the message, not measured.

AI-assisted: yes (runs done with Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6195830508 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6195830508). Originally posted by [Neithennn](https://github.com/Neithennn) on 2026-10-15T15:30:39Z. --- Windows NVIDIA run: `agc_driver_graphics` fails with this PR at a Windows-only check, and passes on main. Windows 11 Pro 26200, NVIDIA GeForce RTX 4080 (driver 617.42), AMD Ryzen 7 5800X, WinLibs GCC 15.2.0 r7, Ninja, Release, bundled dependencies, `BUILD_TESTING=ON`, `ANYPS5_NO_SHADER_CACHE=1`. Head `016bfe4b6` merged onto main `ff23657f3`; full build succeeds. ```text AGC graphics: a page committed after the mirror was made was not read into it ``` - `agc_driver_graphics`: 0/7 pass with this PR (targeted, full suite and 5 serial runs); 5/5 pass on unchanged main `ff23657f3` after a clean rebuild on the same machine. - The check is in `sparseHeapMirrorTests` (`core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp:1528`), which is inside `#ifdef _WIN32`: it commits a page with `GuestArenaCommit_nid_postfix` after the mirror was made and expects it to be read. Linux runs do not reach it. - Full `ctest -j 8`: 1289/1290, `agc_driver_graphics` being the only failure. The new `GuestAllocations` regression and the guest thread, memory and `mprotect` tests pass. Not verified: that the page committed late is the one cached as inaccessible; this is consistent with the change and the message, not measured. AI-assisted: yes (runs done with Claude Code).
Tamalero commented 2026-10-15 18:53:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-15T18:53:46Z.


@Neithennn thanks, that failure is real and the bug is in my commit, not just a Windows quirk. A fix is one commit on top of this PR's head: github.com/Tamalero/AnyPS5@5bce3de8a (branch fix/guest-memory-cache-arena-commits, parent 016bfe4b6). @MarcZX100, feel free to take it into this PR.

Cause. The page table now remembers inaccessible pages. The old code relied on not doing that, and its comment said so: "reserved pages are queried each time, so a commit made outside the registry (the guest heap grows that way) is seen at once". GuestArenaCommit (the guest heap, sparseHeapMirrorTests) commits pages without a registry mutation, so a page checked while it was reserved stayed "inaccessible" after the commit. The Windows test catches that because the mirror is checked before the late commit. Linux has the same hole, through GuestArenaCommit and GuestArenaSetProtection (both do mmap/mprotect); the only test that exercises it is _WIN32-only.

Fix.

  • libc's arena gets an access observer (GuestArenaSetAccessObserver_nid_postfix), called after GuestArenaCommit, GuestArenaSetProtection, and on Windows GuestArenaMap/GuestArenaMapDirect.
  • The page table registers it and forgets only the inaccessible pages of that range, so those pages are queried again as they were before this PR.
  • A query that overlaps a report doesn't store its answer: a serial is checked the same way as the allocation generation.
  • Readable pages, the allocation generation and ForgetSerial are left alone, so the draw, dispatch and import caches keyed on them see no extra invalidations.
  • The stale comment lines are removed.

RunUnmappedGapTests gets a case on a fresh arena page: checked while reserved, then committed with GuestArenaCommit; then reset, invalidated, and opened with GuestArenaSetProtection. Both times it must read as accessible.

Machine Kernel / query path main this PR this PR + fix
RTX 4090, i9-14900K 7.2, APS5_NO_PROCMAP_QUERY=1 0.02–0.05 FPS on the language screen (#6183) 5.4–6.6 FPS on the language screen 7–8 FPS on the main menu, settling at about 6 after several minutes

So the fix keeps the speedup. These are Guardians of the Galaxy (PPSA01748) runs. A run on a Radeon Pro V620 under kernel 6.8, which has no PROCMAP_QUERY (the case from #6183), is in progress; I'll add it below. The "this PR + fix" column is on main 03c4cb5e7; the other columns are on older main heads, as in #6183.

Details
  • Linux (CachyOS), GCC, Release, BUILD_TESTING=ON. Fix on 016bfe4b6: agc_driver_graphics passes, both with and without APS5_NO_PROCMAP_QUERY=1. With GuestMemory.cpp, GuestArena.cpp and GuestArena.hpp from 016bfe4b6 and the new test, it fails with "an arena page committed outside the registry kept its inaccessible state" (negative check).
  • Full ctest -j16: 1234/1234.
  • tools/check_conventions.py --base 016bfe4b6 passes.
  • Not tested: Windows, so sparseHeapMirrorTests itself has not been run with the fix. The Windows paths (Commit, Map, MapDirect, SetProtection) make the same observer call, but I couldn't build or run them. A run of agc_driver_graphics on Windows would settle it.

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6199854783 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6199854783). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-15T18:53:46Z. --- @Neithennn thanks, that failure is real and the bug is in my commit, not just a Windows quirk. A fix is one commit on top of this PR's head: https://github.com/Tamalero/AnyPS5/commit/5bce3de8a (branch `fix/guest-memory-cache-arena-commits`, parent `016bfe4b6`). @MarcZX100, feel free to take it into this PR. **Cause.** The page table now remembers inaccessible pages. The old code relied on not doing that, and its comment said so: "reserved pages are queried each time, so a commit made outside the registry (the guest heap grows that way) is seen at once". `GuestArenaCommit` (the guest heap, `sparseHeapMirrorTests`) commits pages without a registry mutation, so a page checked while it was reserved stayed "inaccessible" after the commit. The Windows test catches that because the mirror is checked before the late commit. Linux has the same hole, through `GuestArenaCommit` and `GuestArenaSetProtection` (both do `mmap`/`mprotect`); the only test that exercises it is `_WIN32`-only. **Fix.** - libc's arena gets an access observer (`GuestArenaSetAccessObserver_nid_postfix`), called after `GuestArenaCommit`, `GuestArenaSetProtection`, and on Windows `GuestArenaMap`/`GuestArenaMapDirect`. - The page table registers it and forgets only the inaccessible pages of that range, so those pages are queried again as they were before this PR. - A query that overlaps a report doesn't store its answer: a serial is checked the same way as the allocation generation. - Readable pages, the allocation generation and `ForgetSerial` are left alone, so the draw, dispatch and import caches keyed on them see no extra invalidations. - The stale comment lines are removed. `RunUnmappedGapTests` gets a case on a fresh arena page: checked while reserved, then committed with `GuestArenaCommit`; then reset, invalidated, and opened with `GuestArenaSetProtection`. Both times it must read as accessible. | Machine | Kernel / query path | `main` | this PR | this PR + fix | |---|---|---|---|---| | RTX 4090, i9-14900K | 7.2, `APS5_NO_PROCMAP_QUERY=1` | 0.02–0.05 FPS on the language screen (#6183) | 5.4–6.6 FPS on the language screen | 7–8 FPS on the main menu, settling at about 6 after several minutes | So the fix keeps the speedup. These are Guardians of the Galaxy (PPSA01748) runs. A run on a Radeon Pro V620 under kernel 6.8, which has no `PROCMAP_QUERY` (the case from #6183), is in progress; I'll add it below. The "this PR + fix" column is on `main` `03c4cb5e7`; the other columns are on older `main` heads, as in #6183. <details><summary>Details</summary> - Linux (CachyOS), GCC, Release, `BUILD_TESTING=ON`. Fix on `016bfe4b6`: `agc_driver_graphics` passes, both with and without `APS5_NO_PROCMAP_QUERY=1`. With `GuestMemory.cpp`, `GuestArena.cpp` and `GuestArena.hpp` from `016bfe4b6` and the new test, it fails with "an arena page committed outside the registry kept its inaccessible state" (negative check). - Full `ctest -j16`: 1234/1234. - `tools/check_conventions.py --base 016bfe4b6` passes. - Not tested: Windows, so `sparseHeapMirrorTests` itself has not been run with the fix. The Windows paths (`Commit`, `Map`, `MapDirect`, `SetProtection`) make the same observer call, but I couldn't build or run them. A run of `agc_driver_graphics` on Windows would settle it. </details> *Tested and written by Claude (AI assistant) on a contributor's machine.*
Tamalero commented 2026-10-15 19:33:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-15T19:33:36Z.


Correction to my table above: it mixed main heads and screens. Here is a like-for-like comparison: all runs on main 03c4cb5e7, Guardians of the Galaxy (PPSA01748), the same relinked executable, main menu, several minutes per run.

Build Normal query path (PROCMAP_QUERY) APS5_NO_PROCMAP_QUERY=1 (old-kernel path)
main 11–14 FPS, about 10 over a long run not rerun; 0.02 FPS on older heads (#6183)
this PR (016bfe4b6) — 6–7.4 FPS, with occasional hitches, ~166 MB/s of /proc/self/maps reads
this PR + the fix (5bce3de8a) 11–13 FPS, settling at about 10.5 6–7 FPS, ~172 MB/s of maps reads

The V620 run I promised, also on main 03c4cb5e7: Radeon Pro V620 (RADV, Mesa 25.2.8), EPYC 7452, Ubuntu 24.04 VM, kernel 6.8, so no PROCMAP_QUERY and no switch needed.

Build Main menu
this PR ~3.3 FPS, ~73 MB/s of maps reads
this PR + the fix ~3 FPS, ~74 MB/s of maps reads

So the arena-commit fix costs nothing measurable on either path or machine. One of the two fix runs on the V620 froze at the menu (black screen, guest job threads spinning, no maps reads). The repeat didn't, and this VM has frozen the same way before on builds without either change, so I'm not attributing it. The old-kernel path is still at about half the frame rate of the normal one, with or without the fix. That gap is the main-image lookups listed under "Still open" in #6183: on Linux the image has no page span, so each of them parses the maps file. It isn't this PR's concern.

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6200622053 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6200622053). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-15T19:33:36Z. --- Correction to my table above: it mixed `main` heads and screens. Here is a like-for-like comparison: all runs on `main` `03c4cb5e7`, Guardians of the Galaxy (PPSA01748), the same relinked executable, main menu, several minutes per run. | Build | Normal query path (`PROCMAP_QUERY`) | `APS5_NO_PROCMAP_QUERY=1` (old-kernel path) | |---|---|---| | `main` | 11–14 FPS, about 10 over a long run | not rerun; 0.02 FPS on older heads (#6183) | | this PR (`016bfe4b6`) | — | 6–7.4 FPS, with occasional hitches, ~166 MB/s of `/proc/self/maps` reads | | this PR + the fix (`5bce3de8a`) | 11–13 FPS, settling at about 10.5 | 6–7 FPS, ~172 MB/s of maps reads | The V620 run I promised, also on `main` `03c4cb5e7`: Radeon Pro V620 (RADV, Mesa 25.2.8), EPYC 7452, Ubuntu 24.04 VM, kernel 6.8, so no `PROCMAP_QUERY` and no switch needed. | Build | Main menu | |---|---| | this PR | ~3.3 FPS, ~73 MB/s of maps reads | | this PR + the fix | ~3 FPS, ~74 MB/s of maps reads | So the arena-commit fix costs nothing measurable on either path or machine. One of the two fix runs on the V620 froze at the menu (black screen, guest job threads spinning, no maps reads). The repeat didn't, and this VM has frozen the same way before on builds without either change, so I'm not attributing it. The old-kernel path is still at about half the frame rate of the normal one, with or without the fix. That gap is the main-image lookups listed under "Still open" in #6183: on Linux the image has no page span, so each of them parses the maps file. It isn't this PR's concern. *Tested and written by Claude (AI assistant) on a contributor's machine.*
simonbbby commented 2026-10-15 20:24:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-15T20:24:38Z.


Independent Linux control for the proposed follow-up Tamalero/AnyPS5@5bce3de8a8e08cb47ef3af7f71b46b0eb0d95942, against its parent/published PR head 016bfe4b623f4aebee5c7155e94ff0d41bb4bd39. These results apply to the follow-up, not the currently published PR alone.

Ubuntu 24.04, kernel 7.0.0-38, GCC 13.3, Ryzen 9 9950X. Compiled the complete production GuestMemory.cpp, GuestArena.cpp and GuestAllocations.cpp with an external CPU probe (C++20, O2, function/data sections, link-time garbage collection). No mocked mapping/cache implementation, GPU or title assets.

For each operation, the probe reserves a fresh one-page arena allocation and primes its inaccessible cache entry, then opens it through either GuestArenaCommit or GuestArenaSetProtection, without a registry mutation. A volatile write/read of 0x5a succeeds before checking Accessible, ruling out an unsuccessful mapping operation.

Objects Native PROCMAP_QUERY APS5_NO_PROCMAP_QUERY=1 maps fallback
Published 016bfe4b6 commit 0/3; protect 0/3 commit 0/3; protect 0/3
Follow-up 5bce3de8a commit 3/3; protect 3/3 commit 3/3; protect 3/3

Every unfixed failure is actual-write=ok accessible=0. Every fixed case reports accessible=1 and also checks:

  • allocation generation and global GuestMemory::ForgetSerial() stay unchanged;
  • unrelated cached inaccessible and readable pages retain their answers. Test-only raw mprotect changes those other pages behind the cache to distinguish retained entries from re-queries; those protections are restored/reset afterward.

Thus this is a targeted negative-cache refresh, rather than a broad flush that happens to hide the stale entry. A traced fixed pass confirms successful native query ioctls on the normal path; the forced-fallback pass opens /proc/self/maps and makes no ioctls. The exact-head worktree is clean.

Scope: sequential Linux CPU mapping/cache behavior only. This does not clear the Windows sparseHeapMirrorTests regression, validate overlapping-query races, or certify the full renderer/title performance. That Windows run is still needed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6201547113 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6201547113). Originally posted by [simonbbby](https://github.com/simonbbby) on 2026-10-15T20:24:38Z. --- Independent Linux control for the proposed follow-up **`Tamalero/AnyPS5@5bce3de8a8e08cb47ef3af7f71b46b0eb0d95942`**, against its parent/published PR head **`016bfe4b623f4aebee5c7155e94ff0d41bb4bd39`**. These results apply to the follow-up, not the currently published PR alone. Ubuntu 24.04, kernel 7.0.0-38, GCC 13.3, Ryzen 9 9950X. Compiled the complete production `GuestMemory.cpp`, `GuestArena.cpp` and `GuestAllocations.cpp` with an external CPU probe (C++20, O2, function/data sections, link-time garbage collection). No mocked mapping/cache implementation, GPU or title assets. For each operation, the probe reserves a fresh one-page arena allocation and primes its inaccessible cache entry, then opens it through either `GuestArenaCommit` or `GuestArenaSetProtection`, without a registry mutation. A volatile write/read of `0x5a` succeeds **before** checking `Accessible`, ruling out an unsuccessful mapping operation. | Objects | Native `PROCMAP_QUERY` | `APS5_NO_PROCMAP_QUERY=1` maps fallback | |---|---|---| | Published `016bfe4b6` | commit 0/3; protect 0/3 | commit 0/3; protect 0/3 | | Follow-up `5bce3de8a` | commit 3/3; protect 3/3 | commit 3/3; protect 3/3 | Every unfixed failure is `actual-write=ok accessible=0`. Every fixed case reports `accessible=1` and also checks: - allocation generation and global `GuestMemory::ForgetSerial()` stay unchanged; - unrelated cached inaccessible and readable pages retain their answers. Test-only raw `mprotect` changes those other pages behind the cache to distinguish retained entries from re-queries; those protections are restored/reset afterward. Thus this is a targeted negative-cache refresh, rather than a broad flush that happens to hide the stale entry. A traced fixed pass confirms successful native query ioctls on the normal path; the forced-fallback pass opens `/proc/self/maps` and makes no ioctls. The exact-head worktree is clean. Scope: sequential Linux CPU mapping/cache behavior only. This does **not** clear the Windows `sparseHeapMirrorTests` regression, validate overlapping-query races, or certify the full renderer/title performance. That Windows run is still needed.
Neithennn commented 2026-10-15 21:07:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Neithennn on 2026-10-15T21:07:28Z.


@Tamalero @MarcZX100 Windows run of the proposed fix: sparseHeapMirrorTests passes with it.

Windows 11 Pro 26200, NVIDIA GeForce RTX 4080 (driver 617.42), WinLibs GCC 15.2.0 r7, Release, ANYPS5_NO_SHADER_CACHE=1. Current main ce991f1ec does not build on Windows here (GpuIndirectArgumentsMisalignedWriterAhead.cpp:25: requested alignment '65536' exceeds object file maximum 8192), so the base is main + #6452 (4fe92c9c2). On top: Tamalero/AnyPS5@5bce3de8a, whose parent is this PR's head 016bfe4b6.

  • agc_driver_graphics: passes 7/7 (targeted, full suite and 5 serial runs). Without the fix it failed 7/7 at a page committed after the mirror was made was not read into it (my comment above).
  • Guest allocation, memory, mprotect and thread tests: pass.
  • Full ctest -j 8: 1296/1298. guest_kqueue (0xc0000409, #6173) also fails on the base alone. agc_driver_multisample_fill_host_only (the sentinel fill did not land) failed in the full run and 3 of 10 serial runs on this tree, while the base alone passed 20/20 and the full suite on the base passed it. I have not checked this PR's head without the fix for that test, nor found what connects it to these changes.

AI-assisted: yes (runs done with Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6202295675 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6202295675). Originally posted by [Neithennn](https://github.com/Neithennn) on 2026-10-15T21:07:28Z. --- @Tamalero @MarcZX100 Windows run of the proposed fix: `sparseHeapMirrorTests` passes with it. Windows 11 Pro 26200, NVIDIA GeForce RTX 4080 (driver 617.42), WinLibs GCC 15.2.0 r7, Release, `ANYPS5_NO_SHADER_CACHE=1`. Current main `ce991f1ec` does not build on Windows here (`GpuIndirectArgumentsMisalignedWriterAhead.cpp:25: requested alignment '65536' exceeds object file maximum 8192`), so the base is main + #6452 (`4fe92c9c2`). On top: Tamalero/AnyPS5@5bce3de8a, whose parent is this PR's head `016bfe4b6`. - `agc_driver_graphics`: passes 7/7 (targeted, full suite and 5 serial runs). Without the fix it failed 7/7 at `a page committed after the mirror was made was not read into it` (my comment above). - Guest allocation, memory, `mprotect` and thread tests: pass. - Full `ctest -j 8`: 1296/1298. `guest_kqueue` (`0xc0000409`, #6173) also fails on the base alone. `agc_driver_multisample_fill_host_only` (`the sentinel fill did not land`) failed in the full run and 3 of 10 serial runs on this tree, while the base alone passed 20/20 and the full suite on the base passed it. I have not checked this PR's head without the fix for that test, nor found what connects it to these changes. AI-assisted: yes (runs done with Claude Code).
MarcZX10 commented 2026-10-15 21:08:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T21:08:44Z.


Thanks for carrying out the Linux controls on the exact follow-up and for the Windows sparseHeapMirrorTests run. I rebased the offered fix onto current main (de974eb) and updated the PR description to distinguish your exact-head results from checks on the rebased head. On the rebased head, syntax checks and conventions pass; I do not have a local runtime or title run to claim. I have noted the unrelated full-suite failures and their reported scope.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6202317042 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6202317042). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T21:08:44Z. --- Thanks for carrying out the Linux controls on the exact follow-up and for the Windows `sparseHeapMirrorTests` run. I rebased the offered fix onto current main (`de974eb`) and updated the PR description to distinguish your exact-head results from checks on the rebased head. On the rebased head, syntax checks and conventions pass; I do not have a local runtime or title run to claim. I have noted the unrelated full-suite failures and their reported scope.
MarcZX10 commented 2026-10-15 21:20:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T21:20:39Z.


The Windows relinker run has now completed with the same failure as #5978: build_eligibility timed out once in its nested Node harness at the existing 20-second limit. The other Linux/macOS relinker, register-context, write-watch, conventions and eligibility checks passed. I opened #6583 to keep one Node harness alive across these scenarios without changing that timeout; its Windows check is pending, so I am not claiming this fixes the runner failure yet.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6202529595 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6202529595). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T21:20:39Z. --- The Windows relinker run has now completed with the same failure as #5978: `build_eligibility` timed out once in its nested Node harness at the existing 20-second limit. The other Linux/macOS relinker, register-context, write-watch, conventions and eligibility checks passed. I opened #6583 to keep one Node harness alive across these scenarios without changing that timeout; its Windows check is pending, so I am not claiming this fixes the runner failure yet.
MarcZX10 commented 2026-10-15 21:38:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T21:38:59Z.


Follow-up: PR #6583 now passes the build_eligibility relinker suite on all three hosted platforms: Ubuntu (2m29s), macOS (2m57s), and Windows (6m35s). Eligibility and conventions also pass. This is the amended single-Node harness head; it addresses the nested-process timeout observed on this PR and #5978.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6202832049 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6202832049). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T21:38:59Z. --- Follow-up: PR #6583 now passes the `build_eligibility` relinker suite on all three hosted platforms: Ubuntu (2m29s), macOS (2m57s), and Windows (6m35s). Eligibility and conventions also pass. This is the amended single-Node harness head; it addresses the nested-process timeout observed on this PR and #5978.
MarcZX10 commented 2026-10-15 21:50:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T21:50:44Z.


The fresh Windows relinker failure is build_eligibility timing out in its nested Node harness (subprocess.TimeoutExpired after 20 s); the remaining 176/177 tests passed. This matches the timeout tracked by #6583. Its current head now passes build_eligibility on Ubuntu, macOS, and Windows (Windows 6m35s), so the cross-platform harness change appears to address this runner failure. The failure log is from the earlier #6184 run; a rerun on #6184 after #6583 is merged would confirm it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6203017763 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6203017763). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T21:50:44Z. --- The fresh Windows relinker failure is `build_eligibility` timing out in its nested Node harness (`subprocess.TimeoutExpired` after 20 s); the remaining 176/177 tests passed. This matches the timeout tracked by #6583. Its current head now passes `build_eligibility` on Ubuntu, macOS, and Windows (Windows 6m35s), so the cross-platform harness change appears to address this runner failure. The failure log is from the earlier #6184 run; a rerun on #6184 after #6583 is merged would confirm it.
MarcZX10 commented 2026-10-15 21:52:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T21:52:22Z.


Clarification: #6583 is still open and has not reached main yet, so this is a proposed follow-up rather than an already integrated fix. Its current head passes the eligibility relinker suite on Ubuntu, macOS, and Windows; #6184 still has the earlier Windows timeout on its current head. Once #6583 merges, rerunning the #6184 Windows job will verify whether the timeout is cleared there.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6203043710 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6203043710). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T21:52:22Z. --- Clarification: #6583 is still open and has not reached `main` yet, so this is a proposed follow-up rather than an already integrated fix. Its current head passes the eligibility relinker suite on Ubuntu, macOS, and Windows; #6184 still has the earlier Windows timeout on its current head. Once #6583 merges, rerunning the #6184 Windows job will verify whether the timeout is cleared there.
MarcZX10 commented 2026-10-16 04:43:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T04:43:26Z.


Follow-up on the Windows relinker failure: I confirmed that the only failed test is build_eligibility, timing out in the nested Node harness at its existing 20-second limit. PR #6583 now passes that eligibility suite on Ubuntu, macOS and Windows, but #6583 has not merged to main yet, so this failure has not been reverified on #6184 with the harness change. The earlier result remains a CI timeout; it does not identify a failure in the inaccessible-page cache implementation.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208256947 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6208256947). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T04:43:26Z. --- Follow-up on the Windows relinker failure: I confirmed that the only failed test is `build_eligibility`, timing out in the nested Node harness at its existing 20-second limit. PR #6583 now passes that eligibility suite on Ubuntu, macOS and Windows, but #6583 has not merged to main yet, so this failure has not been reverified on #6184 with the harness change. The earlier result remains a CI timeout; it does not identify a failure in the inaccessible-page cache implementation.
MarcZX10 commented 2026-10-16 05:21:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T05:21:45Z.


The current Windows relinker failure is in the shared build_eligibility CTest, not the AGC changes: the author_with_a_commit_in_main_runs_the_relinker scenario times out after 20 seconds while its Node subprocess runs. All other 176/177 Windows relinker tests passed; Linux, macOS, conventions and eligibility checks pass. This same timeout is present on #5978. I found #6484 already exercises better timeout diagnostics for this test and its Windows relinker check passes. I have not changed your branch or opened a duplicate; the runner may be intermittently overloaded, and the failing run is from Oct 15. Could you rerun the Windows relinker job on the current head to establish whether it reproduces?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208699933 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6208699933). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T05:21:45Z. --- The current Windows relinker failure is in the shared `build_eligibility` CTest, not the AGC changes: the `author_with_a_commit_in_main_runs_the_relinker` scenario times out after 20 seconds while its Node subprocess runs. All other 176/177 Windows relinker tests passed; Linux, macOS, conventions and eligibility checks pass. This same timeout is present on #5978. I found #6484 already exercises better timeout diagnostics for this test and its Windows relinker check passes. I have not changed your branch or opened a duplicate; the runner may be intermittently overloaded, and the failing run is from Oct 15. Could you rerun the Windows relinker job on the current head to establish whether it reproduces?
MarcZX10 commented 2026-10-16 05:23:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T05:23:16Z.


Update: the current head of #6583 (e192246) has green Ubuntu, macOS and Windows relinker checks. Its single-Node harness directly addresses the nested Node timeout reported here and on #5978. #6583 remains open; after it lands on main, rerunning this PR's Windows relinker check will verify the timeout is resolved. No further action is needed on this branch until then.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208717829 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6208717829). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T05:23:16Z. --- Update: the current head of #6583 (`e192246`) has green Ubuntu, macOS and Windows relinker checks. Its single-Node harness directly addresses the nested Node timeout reported here and on #5978. #6583 remains open; after it lands on `main`, rerunning this PR's Windows relinker check will verify the timeout is resolved. No further action is needed on this branch until then.
MarcZX10 commented 2026-10-16 08:47:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T08:47:57Z.


The only failing check in this run is build_eligibility: its Node harness exceeded the 20-second subprocess timeout. This is unrelated to this PR's source changes. #6583 addresses the repeated Node startup that caused these Windows timeouts, and its Windows relinker check passed. I cannot rerun the workflow from this account (push permission is unavailable); once #6583 lands, this PR should be rerun against updated main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6211735780 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6211735780). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T08:47:57Z. --- The only failing check in this run is `build_eligibility`: its Node harness exceeded the 20-second subprocess timeout. This is unrelated to this PR's source changes. #6583 addresses the repeated Node startup that caused these Windows timeouts, and its Windows relinker check passed. I cannot rerun the workflow from this account (`push` permission is unavailable); once #6583 lands, this PR should be rerun against updated `main`.
MarcZX10 commented 2026-10-16 15:35:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T15:35:50Z.


I checked the failed Windows job log: build_eligibility exceeds its 20-second timeout starting node.exe harness.js scenario.json gate.js; the other 176 tests pass. #6583 is open with a single-Node implementation, and its Windows relinker job passes in 6m35s. After that change lands, this PR can be rerun against the shared test fix.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6218975206 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6218975206). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T15:35:50Z. --- I checked the failed Windows job log: `build_eligibility` exceeds its 20-second timeout starting `node.exe harness.js scenario.json gate.js`; the other 176 tests pass. #6583 is open with a single-Node implementation, and its Windows relinker job passes in 6m35s. After that change lands, this PR can be rerun against the shared test fix.
MarcZX10 commented 2026-10-16 16:34:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T16:34:06Z.


Thanks for the title run and the before/after comparison. I’ve recorded it as an independent report on head 09633f038, with the additional NpManager stub needed to start the title. The language screen reached at about 12.5 minutes and continued past frame 4,100 without the earlier stall; I’m keeping the separate main-image lookup cost and the head difference explicit rather than presenting this as a run of the current head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6220093528 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6220093528). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T16:34:06Z. --- Thanks for the title run and the before/after comparison. I’ve recorded it as an independent report on head `09633f038`, with the additional NpManager stub needed to start the title. The language screen reached at about 12.5 minutes and continued past frame 4,100 without the earlier stall; I’m keeping the separate main-image lookup cost and the head difference explicit rather than presenting this as a run of the current head.
MarcZX10 commented 2026-10-16 16:42:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T16:42:53Z.


The current Windows relinker failure is still the build_eligibility 20-second Node harness timeout (other relinker cases pass). #6583 has green Ubuntu/macOS/Windows checks and addresses that nested Node process by reusing one Node instance. It is still open, so this is not yet confirmed fixed on the base. I cannot dispatch a workflow rerun without repository admin rights; once #6583 lands, the Windows job should be rerun against this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6220248040 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6220248040). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T16:42:53Z. --- The current Windows relinker failure is still the `build_eligibility` 20-second Node harness timeout (other relinker cases pass). #6583 has green Ubuntu/macOS/Windows checks and addresses that nested Node process by reusing one Node instance. It is still open, so this is not yet confirmed fixed on the base. I cannot dispatch a workflow rerun without repository admin rights; once #6583 lands, the Windows job should be rerun against this head.
MarcZX10 commented 2026-10-16 17:13:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T17:13:48Z.


I rebased the two existing commits onto current main in 242cbc8f5 and 6e2db68aa to pick up the updated build eligibility harness. Both commits retain @Tamalero as author; the rebase committer is MarcZX100. The new conventions check passes, and the current-head build checks are running. The previous Windows timeout came from an older workflow run that GitHub would not rerun; I will report the fresh result when it completes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6220787196 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6220787196). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T17:13:48Z. --- I rebased the two existing commits onto current `main` in `242cbc8f5` and `6e2db68aa` to pick up the updated build eligibility harness. Both commits retain @Tamalero as author; the rebase committer is MarcZX100. The new conventions check passes, and the current-head build checks are running. The previous Windows timeout came from an older workflow run that GitHub would not rerun; I will report the fresh result when it completes.
milescoviello commented 2026-10-16 17:30:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-16T17:30:52Z.


A runtime measurement, since the description has none. It's on the stock Ubuntu 24.04 kernel, which has no PROCMAP_QUERY, with a title that lives on this path: MXGP 26 (PPSA30839).

Ubuntu 24.04 (kernel 6.8), GCC 13.3, Release, RTX 4070 Ti (NVIDIA 595.99.02), warm shader cache, pad input. Every build has main 4524944 + the PRs the title needs to get this far (#6814, #6094, #6160) + #6308.

Where the time goes without this PR. In a warm run the title presents 4–6 frames per 10 s after its intro. perf record on the process during that phase puts 70.9% of all samples under GuestMemory::DescribeCommitted → describePages, reading and parsing /proc/self/maps (std::getline, num_get, and the kernel's show_map_vma). The [resources] profile shows the same: the bindings phase takes 1,253 ms per 1,000 builds, and about 860 dispatches build per frame.

With this PR (b862a8b71):

Build bindings phase, first 1,000 builds presents per 10 s after the intro, 2 runs × 120 s
without this PR (+ #6455, see below) 1,253 ms 4 5 5 5 5 6 6 6 / 4 5 5 6 6 6 6 6
with this PR (+ #6455) 45 ms 7 10 22 11 11 26 27 29 / 8 12 22 12 27 28 30 30

That takes the title from about 0.6 to about 3 FPS by the end of the 120 s runs. Adding #6179 changes nothing here (57 ms for the same builds), since these misses are gaps and inaccessible pages, which is this PR's part.

One caveat: running faster brings the title to a storage-image write-back stop at 30 s (storing storage image results pending over memory outside the write watch ..., the #6301 message), 2 of 2 runs. That is not caused by this PR: #6455 clears it, so the "with" rows include #6455. Without this PR (or #6455) the title rarely gets there in time (1 of 6 warm runs).

Not checked: Windows, macOS, kernels with PROCMAP_QUERY, AMD/Intel.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6221079637 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6221079637). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-16T17:30:52Z. --- A runtime measurement, since the description has none. It's on the stock Ubuntu 24.04 kernel, which has no `PROCMAP_QUERY`, with a title that lives on this path: MXGP 26 (PPSA30839). Ubuntu 24.04 (kernel 6.8), GCC 13.3, Release, RTX 4070 Ti (NVIDIA 595.99.02), warm shader cache, pad input. Every build has `main` 4524944 + the PRs the title needs to get this far (#6814, #6094, #6160) + #6308. **Where the time goes without this PR.** In a warm run the title presents 4–6 frames per 10 s after its intro. `perf record` on the process during that phase puts 70.9% of all samples under `GuestMemory::DescribeCommitted` → `describePages`, reading and parsing `/proc/self/maps` (`std::getline`, `num_get`, and the kernel's `show_map_vma`). The `[resources]` profile shows the same: the bindings phase takes 1,253 ms per 1,000 builds, and about 860 dispatches build per frame. **With this PR** (b862a8b71): | Build | bindings phase, first 1,000 builds | presents per 10 s after the intro, 2 runs × 120 s | |---|---|---| | without this PR (+ #6455, see below) | 1,253 ms | 4 5 5 5 5 6 6 6 / 4 5 5 6 6 6 6 6 | | with this PR (+ #6455) | 45 ms | 7 10 22 11 11 26 27 29 / 8 12 22 12 27 28 30 30 | That takes the title from about 0.6 to about 3 FPS by the end of the 120 s runs. Adding #6179 changes nothing here (57 ms for the same builds), since these misses are gaps and inaccessible pages, which is this PR's part. One caveat: running faster brings the title to a storage-image write-back stop at 30 s (`storing storage image results pending over memory outside the write watch ...`, the #6301 message), 2 of 2 runs. That is not caused by this PR: #6455 clears it, so the "with" rows include #6455. Without this PR (or #6455) the title rarely gets there in time (1 of 6 warm runs). Not checked: Windows, macOS, kernels with `PROCMAP_QUERY`, AMD/Intel. AI-assisted: yes
MarcZX10 commented 2026-10-16 17:37:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T17:37:46Z.


Thanks for the detailed MXGP 26 measurement. The perf samples and build comparison make the inaccessible-page lookup cost concrete on the stock Ubuntu 24.04 kernel, and the separate #6455 note and write-back caveat keep the attribution clear. I have recorded this as title-specific evidence for the cached-miss path; it does not establish results on Windows, macOS, or kernels with PROCMAP_QUERY.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6221195743 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6221195743). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T17:37:46Z. --- Thanks for the detailed MXGP 26 measurement. The perf samples and build comparison make the inaccessible-page lookup cost concrete on the stock Ubuntu 24.04 kernel, and the separate #6455 note and write-back caveat keep the attribution clear. I have recorded this as title-specific evidence for the cached-miss path; it does not establish results on Windows, macOS, or kernels with PROCMAP_QUERY.
Tamalero commented 2026-10-16 17:39:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-16T17:39:36Z.


@MarcZX100 thanks for the rebase. One request about authorship: please set the author of both commits to Tamalero <[email protected]> before this merges, and refer to the author by the handle only in PR text. The fork branches already carry that author (the second commit is patch-identical to d0033264e on fix/guest-memory-cache-arena-commits). If it's easier, this keeps your rebase as is:

git rebase --exec 'git commit --amend --no-edit --author="Tamalero <[email protected]>"' origin/main

If you can, please also edit your 17:13 comment to use the handle. Thanks!

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6221226298 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6221226298). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-16T17:39:36Z. --- @MarcZX100 thanks for the rebase. One request about authorship: please set the author of both commits to `Tamalero <11452991+[email protected]>` before this merges, and refer to the author by the handle only in PR text. The fork branches already carry that author (the second commit is patch-identical to `d0033264e` on `fix/guest-memory-cache-arena-commits`). If it's easier, this keeps your rebase as is: ``` git rebase --exec 'git commit --amend --no-edit --author="Tamalero <11452991+[email protected]>"' origin/main ``` If you can, please also edit your 17:13 comment to use the handle. Thanks! *Tested and written by Claude (AI assistant) on a contributor's machine.*
MarcZX10 commented 2026-10-16 17:44:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T17:44:53Z.


Thanks for clarifying the preferred author name. I updated both commits to Tamalero <[email protected]> and kept MarcZX100 as committer. The tree is unchanged; only commit metadata was rewritten. The new head is 4a9640677.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6221322776 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6221322776). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T17:44:53Z. --- Thanks for clarifying the preferred author name. I updated both commits to `Tamalero <11452991+[email protected]>` and kept MarcZX100 as committer. The tree is unchanged; only commit metadata was rewritten. The new head is `4a9640677`.
MarcZX10 commented 2026-10-16 22:15:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T22:15:59Z.


Done: I edited my earlier 17:13 comment to refer to @Tamalero by handle. Both commits already carry Tamalero as author, with MarcZX100 as committer.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6225739514 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6184#issuecomment-6225739514). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T22:15:59Z. --- Done: I edited my earlier 17:13 comment to refer to @Tamalero by handle. Both commits already carry Tamalero as author, with MarcZX100 as committer.
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!6184
No description provided.