fix(memory): honor low guest mapping hints #6469

Merged
QRMOE merged 1 commit from upstream-pr/6469 into main 2026-10-23 19:06:12 +00:00
QRMOE commented 2026-10-15 16:30:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by QRMOE on 2026-10-15T16:30:21Z.


What

Private anonymous mmap without MAP_FIXED drops the caller's address hint, and the guest arena starts at 8 GiB, so a title cannot get guest memory below 2 GiB even when it asks for it. Super Mario Sunshine (PPSA99312) stops with [port] no memory below 2 GiB for the game's stack this way (report on #5217; bring-up #6468). Its port's public MIT memory probe requests a 64 MiB mapping at hint 0x20000000 and a 128 MiB pool at hint 0x40000000.

This change forwards private anonymous hints to the existing placement allocator and extends the Linux and Windows arena down to 64 KiB. Host mappings already in that range stay occupied, and low chunks Linux refuses by address policy are skipped. Null-hint allocations and the fallback for a high hint with no room still start at 8 GiB. macOS and ASan builds keep their current 8 GiB start. There are no title-ID branches, new exports or silent stubs.

The new guest_low_address_memory test covers the probe's two low requests, readable and writable endpoints, relocation of an occupied hint, fixed and exclusive replacement, protection and query, unmap and reuse, and the unchanged default allocation start.

Not changed here, recorded in the libc and libkernel debt entries:

  • On Windows, 0x7ffe0000 always holds the host's own KUSER_SHARED_DATA, so Wine's shared user data page (Forever Launcher PPSA99030) still cannot be placed there.
  • scePthreadCreate still ignores a stack address set with pthread_attr_setstack.
  • A PIE loaded above the arena still gets no JIT memory within 2 GiB of its code. The broader address-space problem in #5217 remains open.

Rebased onto main 4997726a5. Main moved the arena offset to GuestArena::GuestAddressOffset and extended the Fixed anonymous mmap debt entry; both are kept. Thanks to @xXPBSXx for the earlier carry branch.

Tested

Local, Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7, Ninja Release, BUILD_TESTING=ON, head 583687317 on main 4997726a5:

  • libs and all memory test executables build with no warnings in the changed files.
  • The memory family (ctest -R 'memory|mmap|arena|alloc|mprotect|munmap|madvise|msync|mincore|flexible|heap|stack|ampr|jit|write_watch|patched_libraries' -E '^agc_'), 50 tests, passes serially. With -j8, windows_write_watch and guest_allocator_failures timed out once and passed when rerun alone.
  • guest_low_address_memory, guest_memory and guest_mmap_fixed_anonymous pass 5/5 (--repeat until-fail:5). The two mappings land at 0x20000000 and 0x40000000.
  • With GuestArena.cpp and PosixMemory.cpp restored to main (new tests kept), guest_low_address_memory fails at line 35 with the mappings at 0x200000000 and 0x204000000, and guest_memory fails at its arena-base check.
  • python tools/check_conventions.py --base origin/main: 0 errors, one [debt-length] warning on the Fixed anonymous mmap entry, which was already over the limit on main (2053 characters, now 2334).
  • Not run: the full build and suite.

Reports from other contributors in this thread (on earlier heads/carries of the same change):

  • Linux, @jotitadev: guest_low_address_memory and guest_memory 10/10; 650-test non-GPU suite same as main.
  • Linux, @babyhuey (carry e1b43da): memory family 24/24 ×3. Super Mario Sunshine: main stopped at "no memory below 2 GiB" in 6 of 22 runs; with the change, 0 of 22 did and all 22 reached the port's own "no disc image" stop. No game image was supplied, so gameplay is not verified.
  • Linux, @milescoviello: Forever Launcher gets past Wine's shared user data mapping and stops later at unsupported sendmsg control data. On Windows it still stops there (see above).
  • Windows, @xXPBSXx (carry e1b43da): low-address test 3/3, memory family 23/23.
  • PS5X360 (#10143) reaches its launcher without this change, per @Nciibi's correction; it is not claimed here.

Not tested: macOS, ASan, gameplay of any title.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: PPSA99312 #6468 (low allocation stop only; gameplay not verified)
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4876531451 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6469). Originally posted by [QRMOE](https://github.com/QRMOE) on 2026-10-15T16:30:21Z. --- ### What Private anonymous `mmap` without `MAP_FIXED` drops the caller's address hint, and the guest arena starts at 8 GiB, so a title cannot get guest memory below 2 GiB even when it asks for it. Super Mario Sunshine (PPSA99312) stops with `[port] no memory below 2 GiB for the game's stack` this way ([report on #5217](https://github.com/boykopovar/AnyPS5/issues/5217#issuecomment-6196217273); bring-up #6468). Its port's public [MIT memory probe](https://github.com/griches/PS5_Sunshine/blob/e01f5db1702ac21f2683666abc10917ff9dd206b/ps5/probe/memprobe.c) requests a 64 MiB mapping at hint `0x20000000` and a 128 MiB pool at hint `0x40000000`. This change forwards private anonymous hints to the existing placement allocator and extends the Linux and Windows arena down to 64 KiB. Host mappings already in that range stay occupied, and low chunks Linux refuses by address policy are skipped. Null-hint allocations and the fallback for a high hint with no room still start at 8 GiB. macOS and ASan builds keep their current 8 GiB start. There are no title-ID branches, new exports or silent stubs. The new `guest_low_address_memory` test covers the probe's two low requests, readable and writable endpoints, relocation of an occupied hint, fixed and exclusive replacement, protection and query, unmap and reuse, and the unchanged default allocation start. Not changed here, recorded in the libc and libkernel debt entries: - On Windows, 0x7ffe0000 always holds the host's own `KUSER_SHARED_DATA`, so Wine's shared user data page (Forever Launcher PPSA99030) still cannot be placed there. - `scePthreadCreate` still ignores a stack address set with `pthread_attr_setstack`. - A PIE loaded above the arena still gets no JIT memory within 2 GiB of its code. The broader address-space problem in #5217 remains open. Rebased onto main `4997726a5`. Main moved the arena offset to `GuestArena::GuestAddressOffset` and extended the Fixed anonymous mmap debt entry; both are kept. Thanks to @xXPBSXx for the earlier carry branch. ### Tested Local, Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7, Ninja Release, BUILD_TESTING=ON, head `583687317` on main `4997726a5`: - `libs` and all memory test executables build with no warnings in the changed files. - The memory family (`ctest -R 'memory|mmap|arena|alloc|mprotect|munmap|madvise|msync|mincore|flexible|heap|stack|ampr|jit|write_watch|patched_libraries' -E '^agc_'`), 50 tests, passes serially. With `-j8`, `windows_write_watch` and `guest_allocator_failures` timed out once and passed when rerun alone. - `guest_low_address_memory`, `guest_memory` and `guest_mmap_fixed_anonymous` pass 5/5 (`--repeat until-fail:5`). The two mappings land at `0x20000000` and `0x40000000`. - With `GuestArena.cpp` and `PosixMemory.cpp` restored to main (new tests kept), `guest_low_address_memory` fails at line 35 with the mappings at `0x200000000` and `0x204000000`, and `guest_memory` fails at its arena-base check. - `python tools/check_conventions.py --base origin/main`: 0 errors, one `[debt-length]` warning on the Fixed anonymous mmap entry, which was already over the limit on main (2053 characters, now 2334). - Not run: the full build and suite. Reports from other contributors in this thread (on earlier heads/carries of the same change): - Linux, @jotitadev: `guest_low_address_memory` and `guest_memory` 10/10; 650-test non-GPU suite same as main. - Linux, @babyhuey (carry `e1b43da`): memory family 24/24 ×3. Super Mario Sunshine: main stopped at "no memory below 2 GiB" in 6 of 22 runs; with the change, 0 of 22 did and all 22 reached the port's own "no disc image" stop. No game image was supplied, so gameplay is not verified. - Linux, @milescoviello: Forever Launcher gets past Wine's shared user data mapping and stops later at unsupported `sendmsg` control data. On Windows it still stops there (see above). - Windows, @xXPBSXx (carry `e1b43da`): low-address test 3/3, memory family 23/23. - PS5X360 (#10143) reaches its launcher without this change, per @Nciibi's correction; it is not claimed here. Not tested: macOS, ASan, gameplay of any title. ### 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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: PPSA99312 #6468 (low allocation stop only; gameplay not verified) - [x] GPUs tested: n/a - [x] AI-assisted: yes
jotitadev commented 2026-10-15 18:09:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T18:09:33Z.

Review: COMMENTED


Linux run, since the description says Linux was not tested locally.

Ubuntu 26.04 (kernel 7.0), i7-8700, gcc 15.2, Release, BUILD_TESTING=ON, no ASan, full build. Head 29a84d07b applied on main 03c4cb5e7. vm.mmap_min_addr is 65536 here, which is the new arena start.

  • Test only (the PR's GuestLowAddressMemory.cpp, the GuestMemory.cpp change and the test registration, on main's source): guest_low_address_memory fails at line 35 with buffer=0x200000000 stack=0x204000000. guest_memory fails at GuestMemory.cpp:1138, the new arena-base check.
  • With the fix: the mappings land at buffer=0x20000000 stack=0x40000000. guest_low_address_memory and guest_memory pass 10 of 10 runs.
  • Non-GPU suite (650 tests with the new one, -E "^agc|gpu|vulkan|video_out", -j8): same result as main. Only file_writer_binary and file_writer_text fail, on main too (this host's coreutils rejects the command they run).

Not run with ASan, and no title run.

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

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5537799340 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6469#pullrequestreview-5537799340). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-15T18:09:33Z. **Review:** COMMENTED --- Linux run, since the description says Linux was not tested locally. Ubuntu 26.04 (kernel 7.0), i7-8700, gcc 15.2, Release, `BUILD_TESTING=ON`, no ASan, full build. Head `29a84d07b` applied on `main` 03c4cb5e7. `vm.mmap_min_addr` is 65536 here, which is the new arena start. - Test only (the PR's `GuestLowAddressMemory.cpp`, the `GuestMemory.cpp` change and the test registration, on `main`'s source): `guest_low_address_memory` fails at line 35 with `buffer=0x200000000 stack=0x204000000`. `guest_memory` fails at `GuestMemory.cpp:1138`, the new arena-base check. - With the fix: the mappings land at `buffer=0x20000000 stack=0x40000000`. `guest_low_address_memory` and `guest_memory` pass 10 of 10 runs. - Non-GPU suite (650 tests with the new one, `-E "^agc|gpu|vulkan|video_out"`, `-j8`): same result as `main`. Only `file_writer_binary` and `file_writer_text` fail, on `main` too (this host's coreutils rejects the command they run). Not run with ASan, and no title run. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
milescoviello commented 2026-10-17 10:31:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-17T10:31:34Z.


Another title that needs low guest mappings, a fixed one this time: Forever Launcher (PPSA99030, 01.000.012, catalog build) runs Wine. Linux, RTX 4070 Ti, main bf20538169, 60 s, 2 runs each. To reach this point I merged the open PRs for its earlier stops locally: #6915, #6028, #6939, #6787 and #7070.

  • Without this PR, 2 of 2: Wine exits with status 1 from virtual_alloc_first_teb ("wine: failed to map the shared user data"). It maps that page at the fixed address 0x7ffe0000, below the current 0x200000000 arena start.
  • With this PR (29a84d07b3), 2 of 2: Wine gets past it. It maps the page, sets up its prefix and its in-process wineserver, and stops on the next unimplemented call, sendmsg: control data is not supported. I'm working on that separately.

So the arena extension also helps fixed mappings, not only hints.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6232846264 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6469#issuecomment-6232846264). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-17T10:31:34Z. --- Another title that needs low guest mappings, a fixed one this time: Forever Launcher (PPSA99030, 01.000.012, catalog build) runs Wine. Linux, RTX 4070 Ti, `main` bf20538169, 60 s, 2 runs each. To reach this point I merged the open PRs for its earlier stops locally: #6915, #6028, #6939, #6787 and #7070. - **Without this PR**, 2 of 2: Wine exits with status 1 from `virtual_alloc_first_teb` ("wine: failed to map the shared user data"). It maps that page at the fixed address 0x7ffe0000, below the current 0x200000000 arena start. - **With this PR (29a84d07b3)**, 2 of 2: Wine gets past it. It maps the page, sets up its prefix and its in-process wineserver, and stops on the next unimplemented call, `sendmsg: control data is not supported`. I'm working on that separately. So the arena extension also helps fixed mappings, not only hints. AI-assisted: yes (Claude Code)
milescoviello commented 2026-10-17 11:29:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-17T11:29:42Z.


A Linux data point for Super Mario Sunshine (PPSA99312), the title @0xRickx mentioned on #5217. RTX 4070 Ti, main 984e5d7201 with #6220 (its earlier uname sysctl stop) in both builds, 40 s, no disc image in the folder:

  • main + #6220: after no disc image in the title's folder, the title exits at once (0 s) and prints nothing more.
  • main + #6220 + this PR (29a84d07b3): it continues past that line:
    [port] widescreen: 1.333 times the 4:3 width
    [port] frame rate: 60 during gameplay
    [port] MEM1: 64 MiB at 0xc0000000
    [dvd] no game: pass a GMSE01 disc image (or extracted files/ folder), or set SMS_DISC_IMAGE
    exit status 0
    
    That is the port's own stop when no game is supplied. Its 64 MiB at 0xc0000000 is below the current arena start.

PS5CEMU-HAR (PPSA99360) runs its launcher to the limit with and without this PR here; scripted input doesn't reach the 3DS side where Azahar's JIT reserves memory, so that case isn't covered.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6233362377 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6469#issuecomment-6233362377). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-17T11:29:42Z. --- A Linux data point for Super Mario Sunshine (PPSA99312), the title @0xRickx mentioned on #5217. RTX 4070 Ti, `main` 984e5d7201 with #6220 (its earlier `uname` sysctl stop) in both builds, 40 s, no disc image in the folder: - **`main` + #6220:** after `no disc image in the title's folder`, the title exits at once (0 s) and prints nothing more. - **`main` + #6220 + this PR (29a84d07b3):** it continues past that line: ``` [port] widescreen: 1.333 times the 4:3 width [port] frame rate: 60 during gameplay [port] MEM1: 64 MiB at 0xc0000000 [dvd] no game: pass a GMSE01 disc image (or extracted files/ folder), or set SMS_DISC_IMAGE exit status 0 ``` That is the port's own stop when no game is supplied. Its 64 MiB at 0xc0000000 is below the current arena start. PS5CEMU-HAR (PPSA99360) runs its launcher to the limit with and without this PR here; scripted input doesn't reach the 3DS side where Azahar's JIT reserves memory, so that case isn't covered. AI-assisted: yes (Claude Code)
babyhuey commented 2026-10-18 16:10:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-18T16:10:44Z.


A Windows run for the Forever Launcher case @milescoviello reported above. Windows 11, RTX 3080, WinLibs GCC 15.2, Release, head 29a84d07b on main e5f18ea99 plus #6915, #6939, #6787 and #7070 (plain merges, no conflicts; this PR and the stack share PosixMemory.cpp and the debt docs in separate hunks):

  • guest_memory and guest_low_address_memory pass 5/5 (--repeat until-fail:5). No warnings in GuestArena.cpp, PosixMemory.cpp, GuestLowAddressMemory.cpp or GuestMemory.cpp.
  • A temporary print at the top of mmap_nid_postfix shows that Wine's shared-user-data request is a hint, not a fixed mapping: mmap(0x7ffe0000, 0x4000, PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0) (flags 0x1002). Wine's FreeBSD anon_mmap_tryfixed maps with the hint, then unmaps and fails if the result isn't that address. On main the hint is dropped and the page lands in the arena (0x203164000).
  • With this PR, 2 of 2 60 s runs: the hint now reaches the host, but the page comes back at 0x7fff0000, one 64 KiB block above, because Windows keeps its own KUSER_SHARED_DATA at 0x7ffe0000 in every process. Wine then still exits 1 with err:virtual:virtual_alloc_first_teb wine: failed to map the shared user data: c0000018, as on main. Elsewhere in the same runs this PR's hints work: Wine's top-down probe is honored exactly at 0x8000000000, so its lower probes and its 0x10000 reservation no longer happen.

So on a Windows host this PR fixes the hints but not this title's stop. No guest mapping can sit at 0x7ffe0000 there. Could that page be translated to a different host address for the guest, or is this better left as a Windows-only debt entry for now?

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252113889 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6469#issuecomment-6252113889). Originally posted by [babyhuey](https://github.com/babyhuey) on 2026-10-18T16:10:44Z. --- A Windows run for the Forever Launcher case @milescoviello reported above. Windows 11, RTX 3080, WinLibs GCC 15.2, Release, head `29a84d07b` on `main` `e5f18ea99` plus #6915, #6939, #6787 and #7070 (plain merges, no conflicts; this PR and the stack share `PosixMemory.cpp` and the debt docs in separate hunks): - `guest_memory` and `guest_low_address_memory` pass 5/5 (`--repeat until-fail:5`). No warnings in `GuestArena.cpp`, `PosixMemory.cpp`, `GuestLowAddressMemory.cpp` or `GuestMemory.cpp`. - A temporary print at the top of `mmap_nid_postfix` shows that Wine's shared-user-data request is a hint, not a fixed mapping: `mmap(0x7ffe0000, 0x4000, PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0)` (flags `0x1002`). Wine's FreeBSD `anon_mmap_tryfixed` maps with the hint, then unmaps and fails if the result isn't that address. On `main` the hint is dropped and the page lands in the arena (`0x203164000`). - With this PR, 2 of 2 60 s runs: the hint now reaches the host, but the page comes back at `0x7fff0000`, one 64 KiB block above, because Windows keeps its own `KUSER_SHARED_DATA` at `0x7ffe0000` in every process. Wine then still exits 1 with `err:virtual:virtual_alloc_first_teb wine: failed to map the shared user data: c0000018`, as on `main`. Elsewhere in the same runs this PR's hints work: Wine's top-down probe is honored exactly at `0x8000000000`, so its lower probes and its `0x10000` reservation no longer happen. So on a Windows host this PR fixes the hints but not this title's stop. No guest mapping can sit at `0x7ffe0000` there. Could that page be translated to a different host address for the guest, or is this better left as a Windows-only debt entry for now? AI-assisted: yes
milescoviello commented 2026-10-18 17:53:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-18T17:53:04Z.


@babyhuey thanks for running it on Windows. On translating the page: I don't think it can be done here. Relinked guest code dereferences guest addresses as host addresses, and Windows programs (Wine's included) read the shared user data at its absolute address, 0x7ffe0000 plus a field offset, with plain loads. Putting the page anywhere else would mean trapping every load from that page. On an x64 Windows host, 0x7ffe0000 already holds the system's own read-only KUSER_SHARED_DATA in every process, so the guest can't map there.

So a Windows-only debt entry seems right to me: this PR fixes the hints there, and the shared user data mapping stays a known Windows limit. On Linux this PR gets Wine past that stop (my run above). It's @QRMOE's PR, though, so it's their decision.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6253169631 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6469#issuecomment-6253169631). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-18T17:53:04Z. --- @babyhuey thanks for running it on Windows. On translating the page: I don't think it can be done here. Relinked guest code dereferences guest addresses as host addresses, and Windows programs (Wine's included) read the shared user data at its absolute address, 0x7ffe0000 plus a field offset, with plain loads. Putting the page anywhere else would mean trapping every load from that page. On an x64 Windows host, 0x7ffe0000 already holds the system's own read-only `KUSER_SHARED_DATA` in every process, so the guest can't map there. So a Windows-only debt entry seems right to me: this PR fixes the hints there, and the shared user data mapping stays a known Windows limit. On Linux this PR gets Wine past that stop (my run above). It's @QRMOE's PR, though, so it's their decision. AI-assisted: yes (Claude Code)
xXPBSXx commented 2026-10-21 04:48:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T04:48:42Z.


@QRMOE this PR now conflicts with main in core/libs/prx/libc/src/GuestArena.cpp (main moved GuestArenaOffset to the shared GuestArena::GuestAddressOffset) and in the Fixed anonymous mmap entry of docs/dev/debt/libkernel.md (which gained the native-stack replacement text).

In case it helps: I rebased your commit onto current main (7ab4b2e561) without changing your changes to the allocator, keeping you as its author. In GuestArena.cpp I kept main's shared offset and re-applied your DefaultAllocationStart / ArenaStart lines on top of it. In the debt entry I kept main's text and swapped in only your replacement for the sentence about where the arena starts. Branch xXPBSXx:carry/6469-low-guest-mapping-hints, head e1b43da6ce. You can take it with git fetch https://github.com/xXPBSXx/AnyPS5 carry/6469-low-guest-mapping-hints and git reset --hard FETCH_HEAD, or rebase yourself; I will not open a second PR for it.

Windows 10 19045, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON, on that head:

  • ctest -R '^guest_low_address_memory$' passes 3 of 3.
  • The memory family passes: 23 of 23 (-R 'memory|mmap|arena|alloc|mprotect|munmap|madvise|msync|mincore|flexible' -E '^agc_', after building the missing executables).
  • With GuestArena.cpp and PosixMemory.cpp restored to main (your tests kept), guest_low_address_memory and guest_memory both fail with exit code 0xc0000409.
  • python tools/check_conventions.py --base upstream/main passes with two [debt-length] warnings (the libc.md and libkernel.md entries you changed are over 1000 characters; both were already long on main). git merge-tree against current main is clean.
    Not tested: Linux/macOS, the titles named in the description (PPSA99312, PPSA99030).

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6308302140 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6469#issuecomment-6308302140). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-21T04:48:42Z. --- @QRMOE this PR now conflicts with `main` in `core/libs/prx/libc/src/GuestArena.cpp` (`main` moved `GuestArenaOffset` to the shared `GuestArena::GuestAddressOffset`) and in the `Fixed anonymous mmap` entry of `docs/dev/debt/libkernel.md` (which gained the native-stack replacement text). In case it helps: I rebased your commit onto current `main` (`7ab4b2e561`) without changing your changes to the allocator, keeping you as its author. In `GuestArena.cpp` I kept `main`'s shared offset and re-applied your `DefaultAllocationStart` / `ArenaStart` lines on top of it. In the debt entry I kept `main`'s text and swapped in only your replacement for the sentence about where the arena starts. Branch `xXPBSXx:carry/6469-low-guest-mapping-hints`, head `e1b43da6ce`. You can take it with `git fetch https://github.com/xXPBSXx/AnyPS5 carry/6469-low-guest-mapping-hints` and `git reset --hard FETCH_HEAD`, or rebase yourself; I will not open a second PR for it. Windows 10 19045, WinLibs GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`, on that head: - `ctest -R '^guest_low_address_memory$'` passes 3 of 3. - The memory family passes: 23 of 23 (`-R 'memory|mmap|arena|alloc|mprotect|munmap|madvise|msync|mincore|flexible' -E '^agc_'`, after building the missing executables). - With `GuestArena.cpp` and `PosixMemory.cpp` restored to `main` (your tests kept), `guest_low_address_memory` and `guest_memory` both fail with exit code `0xc0000409`. - `python tools/check_conventions.py --base upstream/main` passes with two `[debt-length]` warnings (the `libc.md` and `libkernel.md` entries you changed are over 1000 characters; both were already long on `main`). `git merge-tree` against current `main` is clean. Not tested: Linux/macOS, the titles named in the description (PPSA99312, PPSA99030). AI-assisted (Claude Code).
babyhuey commented 2026-10-22 08:50:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-22T08:50:56Z.


Linux run of @xXPBSXx's rebase of this PR (carry/6469-low-guest-mapping-hints, e1b43da6c), since that covers Windows only. Merged onto main 7e2ba73e4 (clean merge). Ubuntu 24.04 container, GCC 13, Release, BUILD_TESTING=ON. Full build, no warnings in GuestArena.cpp or PosixMemory.cpp.

  • The memory family (-R 'memory|mmap|arena|alloc|mprotect|munmap|madvise|msync|mincore|flexible' -E '^agc_', 24 tests including guest_low_address_memory) passes 3 of 3 (--repeat until-fail:3).
  • Super Mario Sunshine (PPSA99312, catalog 0.10.0), headless with SDL's offscreen driver, 30 s runs. On Linux main its stack request only fails some of the time:
Build [port] no memory below 2 GiB for the game's stack Reaches the title's own no disc image in the title's folder
main (d6eafa54) 6 of 22 runs 16 of 22
With the rebase 0 of 22 runs 22 of 22

My catalog sweeps showed the same intermittent stop on main (4 of the last 7). So on Linux the hints are honored often enough by chance that a single run can miss it.

  • Forever Launcher (PPSA99030): no change on Linux. It reaches the headless DisplayWindow Vulkan check on both builds (2 runs each).

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336726954 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6469#issuecomment-6336726954). Originally posted by [babyhuey](https://github.com/babyhuey) on 2026-10-22T08:50:56Z. --- Linux run of @xXPBSXx's rebase of this PR (`carry/6469-low-guest-mapping-hints`, e1b43da6c), since that covers Windows only. Merged onto `main` `7e2ba73e4` (clean merge). Ubuntu 24.04 container, GCC 13, Release, `BUILD_TESTING=ON`. Full build, no warnings in `GuestArena.cpp` or `PosixMemory.cpp`. - The memory family (`-R 'memory|mmap|arena|alloc|mprotect|munmap|madvise|msync|mincore|flexible' -E '^agc_'`, 24 tests including `guest_low_address_memory`) passes 3 of 3 (`--repeat until-fail:3`). - Super Mario Sunshine (PPSA99312, catalog 0.10.0), headless with SDL's offscreen driver, 30 s runs. On Linux `main` its stack request only fails some of the time: | Build | `[port] no memory below 2 GiB for the game's stack` | Reaches the title's own `no disc image in the title's folder` | |---|---|---| | `main` (d6eafa54) | 6 of 22 runs | 16 of 22 | | With the rebase | 0 of 22 runs | 22 of 22 | My catalog sweeps showed the same intermittent stop on `main` (4 of the last 7). So on Linux the hints are honored often enough by chance that a single run can miss it. - Forever Launcher (PPSA99030): no change on Linux. It reaches the headless `DisplayWindow` Vulkan check on both builds (2 runs each). AI-assisted: yes
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!6469
No description provided.