perf(agc): answer small guest read checks without /proc/self/maps #6179

Merged
milescoviello merged 2 commits from upstream-pr/6179 into main 2026-10-18 20:27:37 +00:00
milescoviello commented 2026-10-15 00:41:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-15T00:41:15Z.


What

On Linux kernels without PROCMAP_QUERY (before 6.11, including the stock Ubuntu 24.04 kernel), GuestMemory's verify() reads and parses /proc/self/maps up to the covering mapping for every range check that misses its page cache. That cache only covers the guest arena and the image, so a range anywhere else misses every time. ASTRO BOT (PPSA21564) checks the 96-byte Shader headers it passes, which live in the host heap, from RegisteredHeader (through SameHeader). It does this on every sceAgcCreatePrimState, ResolveGraphicsAbi and interpolant mapping while it loads.

Measured with a temporary counter around the /proc/self/maps fallback (the process has about 3,600 mappings at that stage):

PPSA21564, 200 s, warm shader cache main ab9a47684 this change
/proc/self/maps reads in verify() 404,000, 25.7 s of CPU (63.6 µs each) 110,000, 1.8 s (16.4 µs each)
read checks answered by process_vm_readv — 17,260,000
at 140 s still in the warp tunnel past it, in the space scene with the planet and asteroids
frame counter in the window title at 190 s 2,589 3,474

The loader's checks run on its own thread, so the slow path throttled loading. With the fast path the title does about 40 times as many checks in the same time and gets further. The 110,000 remaining reads are write checks and ranges over 4 KiB.

Now, on such a kernel, a read-only check of at most 4 KiB first reads the range into a thread-local scratch buffer with process_vm_readv on its own process. If every byte comes back, the range is readable, which is all a read-only check asks. Anything else takes the existing path, which also builds the failure message:

  • a fault or a partial read;
  • EPERM (for example under a seccomp profile that blocks the call);
  • a write check;
  • a larger range;
  • a kernel with PROCMAP_QUERY.

agc_driver_graphics is registered a second time on Linux with APS5_NO_PROCMAP_QUERY=1, so the fallback is also exercised on kernels that have PROCMAP_QUERY. LiveStack gains read-only checks for a readable range and for two ranges that end in a guard page.

Tested

Ubuntu 24.04, kernel 6.8.0 (no PROCMAP_QUERY), GCC 13.3, Release with CI's configure flags, on main ab9a47684:

  • agc_driver_graphics and agc_driver_graphics_maps_fallback pass.
  • PPSA21564, 200 s from a warm shader cache, with the temporary counter added to both builds and screenshots at 60, 100, 140 and 190 s: the table above.
  • The full ctest suite passes (1,225 tests).
  • With #6184, which records inaccessible pages in the same page table, the probe would have answered for a page the table already holds as inaccessible (found by @nicolasfalesy). 2108971566 runs the probe only for ranges with no recorded page state. Merged with #6184, the previous head fails agc_driver_graphics_maps_fallback 2 of 2; this head passes it and agc_driver_graphics 3 of 3, and all 663 ^agc_ tests pass alone.
  • tools/check_conventions.py --base upstream/main passes.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4866485662 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6179). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-15T00:41:15Z. --- ### What On Linux kernels without `PROCMAP_QUERY` (before 6.11, including the stock Ubuntu 24.04 kernel), `GuestMemory`'s `verify()` reads and parses `/proc/self/maps` up to the covering mapping for every range check that misses its page cache. That cache only covers the guest arena and the image, so a range anywhere else misses every time. ASTRO BOT (PPSA21564) checks the 96-byte `Shader` headers it passes, which live in the host heap, from `RegisteredHeader` (through `SameHeader`). It does this on every `sceAgcCreatePrimState`, `ResolveGraphicsAbi` and interpolant mapping while it loads. Measured with a temporary counter around the `/proc/self/maps` fallback (the process has about 3,600 mappings at that stage): | PPSA21564, 200 s, warm shader cache | `main` ab9a47684 | this change | |---|---|---| | `/proc/self/maps` reads in `verify()` | 404,000, 25.7 s of CPU (63.6 µs each) | 110,000, 1.8 s (16.4 µs each) | | read checks answered by `process_vm_readv` | — | 17,260,000 | | at 140 s | still in the warp tunnel | past it, in the space scene with the planet and asteroids | | frame counter in the window title at 190 s | 2,589 | 3,474 | The loader's checks run on its own thread, so the slow path throttled loading. With the fast path the title does about 40 times as many checks in the same time and gets further. The 110,000 remaining reads are write checks and ranges over 4 KiB. Now, on such a kernel, a read-only check of at most 4 KiB first reads the range into a thread-local scratch buffer with `process_vm_readv` on its own process. If every byte comes back, the range is readable, which is all a read-only check asks. Anything else takes the existing path, which also builds the failure message: - a fault or a partial read; - `EPERM` (for example under a seccomp profile that blocks the call); - a write check; - a larger range; - a kernel with `PROCMAP_QUERY`. `agc_driver_graphics` is registered a second time on Linux with `APS5_NO_PROCMAP_QUERY=1`, so the fallback is also exercised on kernels that have `PROCMAP_QUERY`. `LiveStack` gains read-only checks for a readable range and for two ranges that end in a guard page. ### Tested Ubuntu 24.04, kernel 6.8.0 (no `PROCMAP_QUERY`), GCC 13.3, Release with CI's configure flags, on `main` ab9a47684: - `agc_driver_graphics` and `agc_driver_graphics_maps_fallback` pass. - PPSA21564, 200 s from a warm shader cache, with the temporary counter added to both builds and screenshots at 60, 100, 140 and 190 s: the table above. - The full `ctest` suite passes (1,225 tests). - With #6184, which records inaccessible pages in the same page table, the probe would have answered for a page the table already holds as inaccessible ([found by @nicolasfalesy](https://github.com/boykopovar/AnyPS5/pull/6179#issuecomment-6243564022)). 2108971566 runs the probe only for ranges with no recorded page state. Merged with #6184, the previous head fails `agc_driver_graphics_maps_fallback` 2 of 2; this head passes it and `agc_driver_graphics` 3 of 3, and all 663 `^agc_` tests pass alone. - `tools/check_conventions.py --base upstream/main` passes. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-15 12:16:10 +00:00 (Migrated from github.com)

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


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 1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4448 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 4650 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6273 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6292 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6320 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6360 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6486 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6490 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6503 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6535 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6615 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6741 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6763 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6905 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6937 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6941 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6963 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7332 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191823092 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6179#issuecomment-6191823092). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T12:16:10Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 1341](https://www.github.com/boykopovar/AnyPS5/pull/1341) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 4650](https://www.github.com/boykopovar/AnyPS5/pull/4650) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 4891](https://www.github.com/boykopovar/AnyPS5/pull/4891) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 5371](https://www.github.com/boykopovar/AnyPS5/pull/5371) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5426](https://www.github.com/boykopovar/AnyPS5/pull/5426) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6185](https://www.github.com/boykopovar/AnyPS5/pull/6185) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6186](https://www.github.com/boykopovar/AnyPS5/pull/6186) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`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 6280](https://www.github.com/boykopovar/AnyPS5/pull/6280) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6292](https://www.github.com/boykopovar/AnyPS5/pull/6292) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6300](https://www.github.com/boykopovar/AnyPS5/pull/6300) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6320](https://www.github.com/boykopovar/AnyPS5/pull/6320) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6360](https://www.github.com/boykopovar/AnyPS5/pull/6360) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6486](https://www.github.com/boykopovar/AnyPS5/pull/6486) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6490](https://www.github.com/boykopovar/AnyPS5/pull/6490) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6499](https://www.github.com/boykopovar/AnyPS5/pull/6499) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6501](https://www.github.com/boykopovar/AnyPS5/pull/6501) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6503](https://www.github.com/boykopovar/AnyPS5/pull/6503) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6535](https://www.github.com/boykopovar/AnyPS5/pull/6535) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6741](https://www.github.com/boykopovar/AnyPS5/pull/6741) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6747](https://www.github.com/boykopovar/AnyPS5/pull/6747) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6763](https://www.github.com/boykopovar/AnyPS5/pull/6763) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6788](https://www.github.com/boykopovar/AnyPS5/pull/6788) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6905](https://www.github.com/boykopovar/AnyPS5/pull/6905) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6937](https://www.github.com/boykopovar/AnyPS5/pull/6937) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6941](https://www.github.com/boykopovar/AnyPS5/pull/6941) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6963](https://www.github.com/boykopovar/AnyPS5/pull/6963) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 7223](https://www.github.com/boykopovar/AnyPS5/pull/7223) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` |
nicolasfalesy commented 2026-10-18 00:09:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by nicolasfalesy on 2026-10-18T00:09:50Z.


Tested on Linux (Arch), c++ (GCC) 16.2.1 20260810, Release, BUILD_TESTING=ON, main at e3838332ee31af787ad311b7eadbe53d8d012e95. GPU tests ran on lavapipe (llvmpipe, LLVM 22.1.8).

#6179 and #6184 together fail #6179's new test agc_driver_graphics_maps_fallback. Each PR alone passes it (main has no such test). With both merged it fails (2 of 2):

AGC graphics: a checked inaccessible arena page was queried again instead of read from the page table

The message is the check at GuestAllocations.cpp:259 that #6184 adds. #6179 registers the test with APS5_NO_PROCMAP_QUERY=1 (CMakeLists.txt:1641 on its head), so it runs agc_driver_graphics_tests without PROCMAP_QUERY. In that case #6179's verify() (GuestMemory.cpp:680 on its head; the call is at :684) answers a read check of up to 4096 bytes with process_vm_readv before it looks at the page table (readableWithoutQuery, :667). The page in that check is readable behind the registry, so the direct read succeeds and Accessible returns true. #6184's cache for inaccessible pages is never consulted, and the check expects false.

With the readableWithoutQuery call at :684 removed from the merge, agc_driver_graphics_maps_fallback passes (2 of 2). So whichever of the two lands second has to look at the cache before the direct read, or the fast path must not answer for a page the cache already holds as inaccessible.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6243564022 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6179#issuecomment-6243564022). Originally posted by [nicolasfalesy](https://github.com/nicolasfalesy) on 2026-10-18T00:09:50Z. --- Tested on Linux (Arch), `c++ (GCC) 16.2.1 20260810`, Release, `BUILD_TESTING=ON`, `main` at `e3838332ee31af787ad311b7eadbe53d8d012e95`. GPU tests ran on lavapipe (llvmpipe, LLVM 22.1.8). #6179 and #6184 together fail #6179's new test `agc_driver_graphics_maps_fallback`. Each PR alone passes it (`main` has no such test). With both merged it fails (2 of 2): ``` AGC graphics: a checked inaccessible arena page was queried again instead of read from the page table ``` The message is the check at `GuestAllocations.cpp:259` that #6184 adds. #6179 registers the test with `APS5_NO_PROCMAP_QUERY=1` (`CMakeLists.txt:1641` on its head), so it runs `agc_driver_graphics_tests` without `PROCMAP_QUERY`. In that case #6179's `verify()` (`GuestMemory.cpp:680` on its head; the call is at `:684`) answers a read check of up to 4096 bytes with `process_vm_readv` before it looks at the page table (`readableWithoutQuery`, `:667`). The page in that check is readable behind the registry, so the direct read succeeds and `Accessible` returns true. #6184's cache for inaccessible pages is never consulted, and the check expects false. With the `readableWithoutQuery` call at `:684` removed from the merge, `agc_driver_graphics_maps_fallback` passes (2 of 2). So whichever of the two lands second has to look at the cache before the direct read, or the fast path must not answer for a page the cache already holds as inaccessible. AI-assisted: yes
milescoviello commented 2026-10-18 00:19:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-18T00:19:39Z.


Thanks @nicolasfalesy, that's the bug. The probe answered before the page table was consulted, so a page #6184 holds as inaccessible read as accessible whenever the host page was readable.

2108971566 makes the probe step aside for any range with a recorded page state. readableWithoutQuery now returns false when any page of the range has a non-zero entry in the arena or image page table. That covers main's readable entries and #6184's PageInaccessible, so the check goes through describePages and the table answers it, as before this PR. Ranges with no recorded state, such as the Shader headers on the host heap that this PR is for, still take the probe.

Checked on Ubuntu 24.04 (kernel 6.8, no PROCMAP_QUERY), GCC 13.3, Release, RTX 4070 Ti:

  • 081d730557 (the previous head) merged with #6184 (4a96406): agc_driver_graphics_maps_fallback fails 2 of 2 with your line, a checked inaccessible arena page was queried again instead of read from the page table.
  • 2108971566 merged with #6184: agc_driver_graphics_maps_fallback and agc_driver_graphics pass 3 of 3.
  • 2108971566 alone: the same two pass 3 of 3, and all 663 ^agc_ tests pass.

So the two should now land in either order.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6243650260 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6179#issuecomment-6243650260). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-18T00:19:39Z. --- Thanks @nicolasfalesy, that's the bug. The probe answered before the page table was consulted, so a page #6184 holds as inaccessible read as accessible whenever the host page was readable. 2108971566 makes the probe step aside for any range with a recorded page state. `readableWithoutQuery` now returns false when any page of the range has a non-zero entry in the arena or image page table. That covers `main`'s readable entries and #6184's `PageInaccessible`, so the check goes through `describePages` and the table answers it, as before this PR. Ranges with no recorded state, such as the `Shader` headers on the host heap that this PR is for, still take the probe. Checked on Ubuntu 24.04 (kernel 6.8, no `PROCMAP_QUERY`), GCC 13.3, Release, RTX 4070 Ti: - 081d730557 (the previous head) merged with #6184 (4a96406): `agc_driver_graphics_maps_fallback` fails 2 of 2 with your line, `a checked inaccessible arena page was queried again instead of read from the page table`. - 2108971566 merged with #6184: `agc_driver_graphics_maps_fallback` and `agc_driver_graphics` pass 3 of 3. - 2108971566 alone: the same two pass 3 of 3, and all 663 `^agc_` tests pass. So the two should now land in either order. AI-assisted: yes (Claude Code)
milescoviello commented 2026-10-18 16:48:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-18T16:48:33Z.


Rebased onto main 889cee5f9f (4c50918d91). The only conflict was in libSceAgcDriver/CMakeLists.txt, where #6054 added agc_driver_image_srgb_sample_copy_forced beside this branch's agc_driver_graphics_maps_fallback; both are kept. On the rebased head the 441 tests matching ^agc_driver_graphics|guest|stack|procmap|maps pass, agc_driver_graphics_maps_fallback among them (RTX 4070 Ti, 595.99.02, Ubuntu 24.04).

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252501805 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6179#issuecomment-6252501805). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-18T16:48:33Z. --- Rebased onto `main` 889cee5f9f (4c50918d91). The only conflict was in `libSceAgcDriver/CMakeLists.txt`, where #6054 added `agc_driver_image_srgb_sample_copy_forced` beside this branch's `agc_driver_graphics_maps_fallback`; both are kept. On the rebased head the 441 tests matching `^agc_driver_graphics|guest|stack|procmap|maps` pass, `agc_driver_graphics_maps_fallback` among them (RTX 4070 Ti, 595.99.02, Ubuntu 24.04). AI-assisted: yes (Claude Code)
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!6179
No description provided.