feat(libs): let relinked Linux games opt into mimalloc #14264

Merged
Astronaut10 merged 4 commits from upstream-pr/14264 into main 2026-11-06 01:12:10 +00:00
Astronaut10 commented 2026-11-01 05:17:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Astronaut10 on 2026-11-01T05:17:20Z.


What

Relinked Linux games can opt into mimalloc with APS5_MIMALLOC, as Windows games can since #6067 and macOS games since #11130. Without the variable nothing changes, and titles do not need a new relink.

  • The build copies libmimalloc.so beside the libraries as a regular file. It is built from the existing submodule with the options Windows and macOS use (MI_OVERRIDE, MI_FREE_IS_CHECKED=SHARED) and linked --as-needed, which drops an unused libatomic.so.1 dependency, so it loads wherever the libraries do. The Linux release archives ship it, and package_release.py requires it as it requires the Windows DLLs.
  • ASan and TSan builds (ANYPS5_ENABLE_ASAN, ANYPS5_ENABLE_TSAN) do not build it. With mimalloc preloaded, an ASan program stops with "ASan runtime does not come first in initial library list" and a TSan one crashes.
  • The macOS restart (MimallocMacOs.cpp) becomes one implementation with platform pieces, MimallocRestart.cpp. When APS5_MIMALLOC is set and mimalloc is not loaded, libkernel puts the libmimalloc.so beside it first in LD_PRELOAD, sets APS5_MIMALLOC_RESTARTED and runs the executable again with execv (same arguments, same process ID). The restarted process removes the marker; if the dynamic linker ignored the variable (secure-execution mode), it prints one line and keeps the system allocator instead of restarting again. The macOS messages are unchanged.
    • On Linux the executable is the target of /proc/self/exe, not /proc/self/exe itself. The kernel names a process after the path it was started from, so that would rename the title to exe. The arguments come from /proc/self/cmdline, so a title started as ld.so app.elf starts that way again.
    • The restart is a constructor with priority 101, so it runs before libkernel's other initializers, which have none: nothing they do runs twice or is carried into the restarted process.
    • A path that the variable cannot list, one with a colon (and on Linux a space), gets one line and no restart.
  • This also fixes the merged macOS restart under ANYPS5_LOG_FILE. libc's log-file copy moves the standard streams into a pipe when libc loads, before libkernel's constructor runs; execv closes the pipe's reader, and the restarted process was killed by SIGPIPE at its first write. libkernel now gives the streams back before execv, as LoadExec does. The macOS side of the shared file was compiled against stub headers only, not run on macOS.
  • ARCHITECTURE.md's "macOS allocator" section becomes "macOS and Linux allocator"; ENVIRONMENT.md and USAGE.md cover Linux. One entry in debt/libkernel.md: when that execv fails, the title goes on with the system allocator, but the log-file copy stays stopped, since libc cannot take the streams again.

Why: in this scene the frame is bound by the CPU chain of the queue worker, the draw committer and the draw finisher, which allocate on every draw; with mimalloc each of them spends 4-6 % less CPU per frame (below). The cost is memory: in the same scene about 0.9 GiB less host memory was available with mimalloc (below).

Tested

CachyOS (Linux 7.3), Ryzen 7 5700X3D, RX 9070 XT (RADV, Mesa 26.2.5, GPU clock level forced to high), 31 GB, transparent huge pages always with defrag defer+madvise, 3840x2160. PPSA21564 (ASTRO BOT 01.007.000), started into underwater_aerial_garden with -lvl, standing at the spawn with no input, warm caches.

Base: main 029463ceb6; change: this branch at 98446ecb20 run with APS5_MIMALLOC=1, mimalloc built by this PR with its options. The branch was measured before it was rebased onto main 3ab5a11d66 without conflicts (the same diff; rebuilt and its focused tests rerun after the rebase). Plain main needs a larger host-import budget than its default to run this scene at a usable rate, so both sides set APS5_HOST_IMPORT_MIB=11815. Switches on both: APS5_DEPTH_PLANE_COPY_MIB=512 APS5_DRAW_PIPELINE=1 APS5_PIPELINED_DRAWS=32 APS5_PIPELINE_DISPATCH=1 APS5_NO_PAD_INPUT=1 APS5_HOST_IMPORT_MIB=11815.

The restart happened in every B run: /proc/<pid>/maps of the running title, read 60 s after it started, maps run-prMI/libs/libmimalloc.so (5 mappings) in all six B runs and in no A run, and the process keeps its PID and its name app.elf.

Clean runs, each measured from 40 s to 130 s after the level started, in the order A B B A B A A B. The first B run was disturbed: memory pressure (PSI some avg10 up to 15.8 %, with 13 GB available and no other process loading the host), a 3.8 s frame and the video-start stall about 20 s later than in the other runs (2.755 FPS). It was rerun once. The table uses the four undisturbed runs per side; FPS from every frame of the window:

A: main B: this PR, APS5_MIMALLOC=1 change
FPS per run 3.102 / 3.097 / 3.103 / 3.109 3.247 / 3.201 / 3.227 / 3.202
FPS mean 3.103 3.219 +3.7 % (95 % +2.6 to +4.9 %)
process CPU ms per frame 1225 1173 -4.2 % (95 % -5.1 to -3.4 %)
five busiest threads, CPU ms per frame 316 / 246 / 239 / 186 / 36 304 / 232 / 225 / 175 / 34 -3.7 / -5.5 / -5.8 / -5.7 / -3.9 %
all other threads, CPU ms per frame 203 202 -0.4 % (95 % -7.9 to +7.1 %)
Graphics.Draw ms per frame 191.2 179.9 -5.9 % (95 % -7.4 to -4.4 %)
Driver.Draw.prepare ms per frame 184.0 174.5 -5.2 % (95 % -7.7 to -2.7 %)
Driver.DrawFinish ms per frame 187.0 178.0 -4.8 % (95 % -7.1 to -2.5 %)
GPU busy ms per present 165.7 165.5 -0.1 % (95 % -1.0 to +0.7 %)
frames, p50 / p95 / p99 ms 1076, 321.5 / 330.6 / 339.0 1149, 310.3 / 319.7 / 340.4
frames > 500 ms / > 1 s 8 / 0 6 / 1
frame at the video start, per run, ms 695 / 690 / 755 / 558 1152 / 766 / 510 / 743
launch to first present, s 8.44 / 7.59 / 7.78 / 7.51 8.41 / 9.04 / 7.92 / 7.26 +0.33 s (95 % -0.87 to +1.53)
lowest host memory available in the window, MiB 14014-14165 13128-13234 about -0.9 GiB
  • Process CPU is the title's whole CPU time over 80 s of the window, read from /proc per thread. AnyPS5's threads keep the process name, so they are listed by rank. Every thread that allocates per draw saves CPU; the GPU time does not change.
  • The video-start frame is the longest frame within 5 s after the title opens 06_nx_controller_ship.mp4, about 90 s after the level started. Four runs per side do not separate B's (mean 793 ms) from A's (675 ms).
  • The startup cost of the restart is within the noise of the launch time: the restart loads the libraries a second time, and four runs per side do not resolve that.
  • Memory pressure: PSI stayed at 0.0 % in all four A runs and the four undisturbed B runs; the one B run above reached 15.8 %. With that run included, FPS is +0.8 % (95 % -7.6 to +9.1 %) and process CPU -2.2 % (95 % -7.9 to +3.6 %).
  • An earlier measurement that preloaded a different mimalloc build by hand (the same mimalloc 3.5.4, without the mi_free pointer check) on an older main found +5.3 % in this scene; the numbers above are this PR's own build and options.

Summary lines of the attached traces, captured as the Performance report form describes (no other APS5_TRACE_* or APS5_PROFILE_* switch). The B capture keeps APS5_MIMALLOC=1, which is the change itself. The window is 4 s (APS5_TRACE_SECONDS=51:4), so the queue worker's default event buffer does not fill; 13 and 14 presents are too few to compare frame times, which the clean runs above do:

{"commit":"029463ceb62c","dirty":false,"env":{"APS5_DEPTH_PLANE_COPY_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_HOST_IMPORT_MIB":"11815","APS5_NO_PAD_INPUT":"1","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"51:4"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.5-arch3.1","os":"Linux 7.3.0-4-cachyos","cpu":"AMD Ryzen 7 5700X3D 8-Core Processor","cpu_threads":16,"memory_mib":31992,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 51:4","first_present":388,"ms":4178.005},"presents":13,"frame_ms":{"p50":324.953,"p90":329.066,"p99":329.435,"max":329.435},"gpu_busy_ms_per_present":167.209,"worker_busy_pct":{"queue worker 0x0":97.748,"queue worker 0x40":93.792,"queue worker 0x48":92.354,"queue worker 0x46":0.886},"top_phases_ms_per_frame":{"Driver.Packet":913.205,"Driver.Packet.memory_wait":563.695,"Driver.Packet.draw":220.949,"Driver.Draw":220.064,"Graphics.Draw":192.197,"Driver.DrawFinish":187.144,"Driver.Draw.prepare":184.036,"Graphics.Draw.draw_and_resource_release":157.225},"trace_dropped":false,"trace":"aps5-trace-029463ceb62c-636381.json.gz"}
{"commit":"98446ecb20e5","dirty":false,"env":{"APS5_DEPTH_PLANE_COPY_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_HOST_IMPORT_MIB":"11815","APS5_MIMALLOC":"1","APS5_NO_PAD_INPUT":"1","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"51:4"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.5-arch3.1","os":"Linux 7.3.0-4-cachyos","cpu":"AMD Ryzen 7 5700X3D 8-Core Processor","cpu_threads":16,"memory_mib":31992,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 51:4","first_present":401,"ms":4256.511},"presents":14,"frame_ms":{"p50":305.917,"p90":315.217,"p99":317.286,"max":317.286},"gpu_busy_ms_per_present":162.392,"worker_busy_pct":{"queue worker 0x0":97.913,"queue worker 0x48":92.809,"queue worker 0x40":93.763,"queue worker 0x46":0.905},"top_phases_ms_per_frame":{"Driver.Packet":865.395,"Driver.Packet.memory_wait":530.350,"Driver.Packet.draw":205.204,"Driver.Draw":204.340,"Graphics.Draw":177.901,"Driver.DrawFinish":175.491,"Driver.Draw.prepare":171.056,"Graphics.Draw.draw_and_resource_release":146.894},"trace_dropped":false,"trace":"aps5-trace-98446ecb20e5-636742.json.gz"}

tools/trace_digest.py: main 13 presents, frame p50 325.0 / p99 329.4 ms, GPU busy 167.2 ms per present; this PR 14 presents, frame p50 305.9 / p99 317.3 ms, GPU busy 162.4 ms per present; dropped: no on both. Busy time per frame: queue worker 0x0 278.7 -> 261.8 ms, draw committer 202.7 -> 189.6 ms, draw finisher 163.9 -> 151.6 ms.

Tests:

  • mimalloc_restart_off, _on, _once and the new _log (restart with ANYPS5_LOG_FILE set) pass on Linux. With main's macOS-only restart, _on, _once and _log fail. Without the stream hand-back, _log dies with SIGPIPE.
  • Started through ld.so, the restart test passes, and libkernel's host CPU line prints once with the restart. A libs/ path with a space prints the separator line and does not restart.
  • release_package passes; without the package_release.py change 14 of its cases fail and 1 errors.
  • The full suite (ctest -j8, 3,104 tests, ANYPS5_REQUIRE_VULKAN=1) passes apart from agc_driver_tessellation (a crash inside RADV) and agc_idle_publish_wait, which fail on main as well. The full suite again with APS5_MIMALLOC=1 set, so every test that loads libkernel restarts into mimalloc: the same two failures, nothing new.
  • No AGC, shader recompiler or VideoOut change, so the validation-layer comparison does not apply.

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: none
  • GPUs tested: n/a
  • AI-assisted: yes

aps5-trace-029463ceb62c-636381.json.gz
aps5-trace-98446ecb20e5-636742.json.gz

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5104634439 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14264). Originally posted by [Astronaut10](https://github.com/Astronaut10) on 2026-11-01T05:17:20Z. --- ### What Relinked Linux games can opt into [mimalloc](https://github.com/microsoft/mimalloc) with `APS5_MIMALLOC`, as Windows games can since #6067 and macOS games since #11130. Without the variable nothing changes, and titles do not need a new relink. - The build copies `libmimalloc.so` beside the libraries as a regular file. It is built from the existing submodule with the options Windows and macOS use (`MI_OVERRIDE`, `MI_FREE_IS_CHECKED=SHARED`) and linked `--as-needed`, which drops an unused `libatomic.so.1` dependency, so it loads wherever the libraries do. The Linux release archives ship it, and `package_release.py` requires it as it requires the Windows DLLs. - ASan and TSan builds (`ANYPS5_ENABLE_ASAN`, `ANYPS5_ENABLE_TSAN`) do not build it. With mimalloc preloaded, an ASan program stops with "ASan runtime does not come first in initial library list" and a TSan one crashes. - The macOS restart (`MimallocMacOs.cpp`) becomes one implementation with platform pieces, `MimallocRestart.cpp`. When `APS5_MIMALLOC` is set and mimalloc is not loaded, libkernel puts the `libmimalloc.so` beside it first in `LD_PRELOAD`, sets `APS5_MIMALLOC_RESTARTED` and runs the executable again with `execv` (same arguments, same process ID). The restarted process removes the marker; if the dynamic linker ignored the variable (secure-execution mode), it prints one line and keeps the system allocator instead of restarting again. The macOS messages are unchanged. - On Linux the executable is the target of `/proc/self/exe`, not `/proc/self/exe` itself. The kernel names a process after the path it was started from, so that would rename the title to `exe`. The arguments come from `/proc/self/cmdline`, so a title started as `ld.so app.elf` starts that way again. - The restart is a constructor with priority 101, so it runs before libkernel's other initializers, which have none: nothing they do runs twice or is carried into the restarted process. - A path that the variable cannot list, one with a colon (and on Linux a space), gets one line and no restart. - This also fixes the merged macOS restart under `ANYPS5_LOG_FILE`. libc's log-file copy moves the standard streams into a pipe when libc loads, before libkernel's constructor runs; `execv` closes the pipe's reader, and the restarted process was killed by `SIGPIPE` at its first write. libkernel now gives the streams back before `execv`, as LoadExec does. The macOS side of the shared file was compiled against stub headers only, not run on macOS. - ARCHITECTURE.md's "macOS allocator" section becomes "macOS and Linux allocator"; ENVIRONMENT.md and USAGE.md cover Linux. One entry in `debt/libkernel.md`: when that `execv` fails, the title goes on with the system allocator, but the log-file copy stays stopped, since libc cannot take the streams again. Why: in this scene the frame is bound by the CPU chain of the queue worker, the draw committer and the draw finisher, which allocate on every draw; with mimalloc each of them spends 4-6 % less CPU per frame (below). The cost is memory: in the same scene about 0.9 GiB less host memory was available with mimalloc (below). ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> CachyOS (Linux 7.3), Ryzen 7 5700X3D, RX 9070 XT (RADV, Mesa 26.2.5, GPU clock level forced to `high`), 31 GB, transparent huge pages `always` with defrag `defer+madvise`, 3840x2160. PPSA21564 (ASTRO BOT 01.007.000), started into `underwater_aerial_garden` with `-lvl`, standing at the spawn with no input, warm caches. Base: `main` `029463ceb6`; change: this branch at `98446ecb20` run with `APS5_MIMALLOC=1`, mimalloc built by this PR with its options. The branch was measured before it was rebased onto `main` `3ab5a11d66` without conflicts (the same diff; rebuilt and its focused tests rerun after the rebase). Plain `main` needs a larger host-import budget than its default to run this scene at a usable rate, so both sides set `APS5_HOST_IMPORT_MIB=11815`. Switches on both: `APS5_DEPTH_PLANE_COPY_MIB=512 APS5_DRAW_PIPELINE=1 APS5_PIPELINED_DRAWS=32 APS5_PIPELINE_DISPATCH=1 APS5_NO_PAD_INPUT=1 APS5_HOST_IMPORT_MIB=11815`. The restart happened in every B run: `/proc/<pid>/maps` of the running title, read 60 s after it started, maps `run-prMI/libs/libmimalloc.so` (5 mappings) in all six B runs and in no A run, and the process keeps its PID and its name `app.elf`. Clean runs, each measured from 40 s to 130 s after the level started, in the order A B B A B A A B. The first B run was disturbed: memory pressure (PSI some avg10 up to 15.8 %, with 13 GB available and no other process loading the host), a 3.8 s frame and the video-start stall about 20 s later than in the other runs (2.755 FPS). It was rerun once. The table uses the four undisturbed runs per side; FPS from every frame of the window: | | A: `main` | B: this PR, `APS5_MIMALLOC=1` | change | | --- | --- | --- | --- | | FPS per run | 3.102 / 3.097 / 3.103 / 3.109 | 3.247 / 3.201 / 3.227 / 3.202 | | | FPS mean | 3.103 | 3.219 | +3.7 % (95 % +2.6 to +4.9 %) | | process CPU ms per frame | 1225 | 1173 | -4.2 % (95 % -5.1 to -3.4 %) | | five busiest threads, CPU ms per frame | 316 / 246 / 239 / 186 / 36 | 304 / 232 / 225 / 175 / 34 | -3.7 / -5.5 / -5.8 / -5.7 / -3.9 % | | all other threads, CPU ms per frame | 203 | 202 | -0.4 % (95 % -7.9 to +7.1 %) | | `Graphics.Draw` ms per frame | 191.2 | 179.9 | -5.9 % (95 % -7.4 to -4.4 %) | | `Driver.Draw.prepare` ms per frame | 184.0 | 174.5 | -5.2 % (95 % -7.7 to -2.7 %) | | `Driver.DrawFinish` ms per frame | 187.0 | 178.0 | -4.8 % (95 % -7.1 to -2.5 %) | | GPU busy ms per present | 165.7 | 165.5 | -0.1 % (95 % -1.0 to +0.7 %) | | frames, p50 / p95 / p99 ms | 1076, 321.5 / 330.6 / 339.0 | 1149, 310.3 / 319.7 / 340.4 | | | frames > 500 ms / > 1 s | 8 / 0 | 6 / 1 | | | frame at the video start, per run, ms | 695 / 690 / 755 / 558 | 1152 / 766 / 510 / 743 | | | launch to first present, s | 8.44 / 7.59 / 7.78 / 7.51 | 8.41 / 9.04 / 7.92 / 7.26 | +0.33 s (95 % -0.87 to +1.53) | | lowest host memory available in the window, MiB | 14014-14165 | 13128-13234 | about -0.9 GiB | - Process CPU is the title's whole CPU time over 80 s of the window, read from `/proc` per thread. AnyPS5's threads keep the process name, so they are listed by rank. Every thread that allocates per draw saves CPU; the GPU time does not change. - The video-start frame is the longest frame within 5 s after the title opens `06_nx_controller_ship.mp4`, about 90 s after the level started. Four runs per side do not separate B's (mean 793 ms) from A's (675 ms). - The startup cost of the restart is within the noise of the launch time: the restart loads the libraries a second time, and four runs per side do not resolve that. - Memory pressure: PSI stayed at 0.0 % in all four A runs and the four undisturbed B runs; the one B run above reached 15.8 %. With that run included, FPS is +0.8 % (95 % -7.6 to +9.1 %) and process CPU -2.2 % (95 % -7.9 to +3.6 %). - An earlier measurement that preloaded a different mimalloc build by hand (the same mimalloc 3.5.4, without the `mi_free` pointer check) on an older `main` found +5.3 % in this scene; the numbers above are this PR's own build and options. Summary lines of the attached traces, captured as the Performance report form describes (no other `APS5_TRACE_*` or `APS5_PROFILE_*` switch). The B capture keeps `APS5_MIMALLOC=1`, which is the change itself. The window is 4 s (`APS5_TRACE_SECONDS=51:4`), so the queue worker's default event buffer does not fill; 13 and 14 presents are too few to compare frame times, which the clean runs above do: ```json {"commit":"029463ceb62c","dirty":false,"env":{"APS5_DEPTH_PLANE_COPY_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_HOST_IMPORT_MIB":"11815","APS5_NO_PAD_INPUT":"1","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"51:4"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.5-arch3.1","os":"Linux 7.3.0-4-cachyos","cpu":"AMD Ryzen 7 5700X3D 8-Core Processor","cpu_threads":16,"memory_mib":31992,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 51:4","first_present":388,"ms":4178.005},"presents":13,"frame_ms":{"p50":324.953,"p90":329.066,"p99":329.435,"max":329.435},"gpu_busy_ms_per_present":167.209,"worker_busy_pct":{"queue worker 0x0":97.748,"queue worker 0x40":93.792,"queue worker 0x48":92.354,"queue worker 0x46":0.886},"top_phases_ms_per_frame":{"Driver.Packet":913.205,"Driver.Packet.memory_wait":563.695,"Driver.Packet.draw":220.949,"Driver.Draw":220.064,"Graphics.Draw":192.197,"Driver.DrawFinish":187.144,"Driver.Draw.prepare":184.036,"Graphics.Draw.draw_and_resource_release":157.225},"trace_dropped":false,"trace":"aps5-trace-029463ceb62c-636381.json.gz"} {"commit":"98446ecb20e5","dirty":false,"env":{"APS5_DEPTH_PLANE_COPY_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_HOST_IMPORT_MIB":"11815","APS5_MIMALLOC":"1","APS5_NO_PAD_INPUT":"1","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"51:4"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.5-arch3.1","os":"Linux 7.3.0-4-cachyos","cpu":"AMD Ryzen 7 5700X3D 8-Core Processor","cpu_threads":16,"memory_mib":31992,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 51:4","first_present":401,"ms":4256.511},"presents":14,"frame_ms":{"p50":305.917,"p90":315.217,"p99":317.286,"max":317.286},"gpu_busy_ms_per_present":162.392,"worker_busy_pct":{"queue worker 0x0":97.913,"queue worker 0x48":92.809,"queue worker 0x40":93.763,"queue worker 0x46":0.905},"top_phases_ms_per_frame":{"Driver.Packet":865.395,"Driver.Packet.memory_wait":530.350,"Driver.Packet.draw":205.204,"Driver.Draw":204.340,"Graphics.Draw":177.901,"Driver.DrawFinish":175.491,"Driver.Draw.prepare":171.056,"Graphics.Draw.draw_and_resource_release":146.894},"trace_dropped":false,"trace":"aps5-trace-98446ecb20e5-636742.json.gz"} ``` `tools/trace_digest.py`: `main` 13 presents, frame p50 325.0 / p99 329.4 ms, GPU busy 167.2 ms per present; this PR 14 presents, frame p50 305.9 / p99 317.3 ms, GPU busy 162.4 ms per present; `dropped: no` on both. Busy time per frame: queue worker `0x0` 278.7 -> 261.8 ms, draw committer 202.7 -> 189.6 ms, draw finisher 163.9 -> 151.6 ms. Tests: - `mimalloc_restart_off`, `_on`, `_once` and the new `_log` (restart with `ANYPS5_LOG_FILE` set) pass on Linux. With `main`'s macOS-only restart, `_on`, `_once` and `_log` fail. Without the stream hand-back, `_log` dies with `SIGPIPE`. - Started through `ld.so`, the restart test passes, and libkernel's host CPU line prints once with the restart. A `libs/` path with a space prints the separator line and does not restart. - `release_package` passes; without the `package_release.py` change 14 of its cases fail and 1 errors. - The full suite (`ctest -j8`, 3,104 tests, `ANYPS5_REQUIRE_VULKAN=1`) passes apart from `agc_driver_tessellation` (a crash inside RADV) and `agc_idle_publish_wait`, which fail on `main` as well. The full suite again with `APS5_MIMALLOC=1` set, so every test that loads libkernel restarts into mimalloc: the same two failures, nothing new. - No AGC, shader recompiler or VideoOut change, so the validation-layer comparison does not apply. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes [aps5-trace-029463ceb62c-636381.json.gz](https://github.com/user-attachments/files/34231959/aps5-trace-029463ceb62c-636381.json.gz) [aps5-trace-98446ecb20e5-636742.json.gz](https://github.com/user-attachments/files/34231960/aps5-trace-98446ecb20e5-636742.json.gz) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-02 07:00:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T07:00:51Z.

Review: COMMENTED


Reviewed — CI is red on the merged build, for reasons this PR does not touch

Relinked Linux games can now opt into mimalloc. The hosted relinker jobs fail on this head: check_skips_ctest fails in the three relinker jobs I read (Ubuntu, macOS clang++ and Windows), and release_package also fails in the Windows relinker job. The macOS x86_64 relinker job also fails and was not read. check_skips.py and its test are identical at the base and at this head, and this PR does not change them, so the failure comes from the base code. The release_package failure has no output in the log, so I could not attribute it. I did not read the mimalloc change itself in this pass.

What I ran

  • Head 15995c6640300c9abf19e1a4fc375e51853a8f3d; base 7fad6837767a4f0cb1636ff835cd42522aae8fac. 13 files, including core/libs/prx/libkernel/System/src/MimallocRestart.cpp, MimallocMacOs.cpp, core/libs/tests/MimallocRestart.cpp, the root and core/libs/ CMake files, and the docs.
  • Hosted: the Ubuntu relinker job (job 125008291567) fails with one case: check_skips_ctest (Test #63). The output shows test_notrun_without_ctest_skip_marker_is_rejected failing because check_skips.skips does not raise for a notrun case without a skip marker.
  • Hosted: the macOS relinker jobs (clang++ and x86_64) fail with check_skips_ctest only. The Windows relinker job fails with check_skips_ctest and release_package (Test #112); its log has no assertion text for release_package.
  • Checked: tools/check_skips.py and tools/tests/test_check_skips_ctest.py have the same blob at the base and at this head, and the PR's changed files do not include them. The base check_skips.py contains no notrun handling.
  • Hosted: the Windows CTest run passed 2590 of 2590, and the Linux job is skipped on pull requests.
  • Read-only checks from the trusted main checkout: diff check, conventions and PR template, and the stack check all passed (no declared dependencies, no errors). The ABI audit is not applicable.
  • No MarcZX10 review at this head.

Results

Check Result Note
Diff check passed
Conventions and PR template passed conventions check from the main checkout
Mergeability and dependencies passed stack check passed; no declared dependencies; no errors
check_skips_ctest (hosted, three relinker jobs read) failed fails in base code: the test expects a notrun case without a skip marker to raise; the base check_skips.py does not
release_package (hosted, Windows relinker) failed the log has no assertion text; not attributed
This PR's own tests (mimalloc restart) not verified the mimalloc change was not read in this pass; the relinker job tests the merged build
Windows CTest (2590 of 2590) passed
Linux build and runtime tests not run Linux is skipped on pull requests
Negative controls not run no local build
Hosted CI failed (relinkers) conventions, eligibility, labels, library-portability, report and relinker-asan succeeded; the four relinker jobs (macOS clang++, macOS x86_64, Ubuntu g++, Windows g++) failed
Read-only check output

Precheck was not run: no PR-head code is run here. Diff check: passed. Conventions: passed. ABI audit: not applicable. Stack check: passed, no errors. Hosted: gh api repos/boykopovar/AnyPS5/commits/15995c6640300c9abf19e1a4fc375e51853a8f3d/check-runs, and the relinker job logs (Ubuntu job 125008291567, macOS and Windows relinker jobs).

Negative control

Not run here. A negative control needs a local build, and code from this head is not run here.

Findings

Blocking

  • The hosted relinker jobs are red. check_skips_ctest fails in base code that this PR does not change, so the base needs a fix (or the test needs its expectation changed) before this PR can show green. The release_package failure on Windows is not explained.

Non-blocking

  • The mimalloc change itself was not read in this pass.

Sources

  • Ubuntu relinker job: 125008291567 (check_skips_ctest)
  • macOS relinker job: relinker (macos-latest, clang++) on 15995c6640300c9abf19e1a4fc375e51853a8f3d (check_skips_ctest)
  • Windows relinker job: relinker (windows-latest, g++) on 15995c6640300c9abf19e1a4fc375e51853a8f3d (check_skips_ctest and release_package)
  • Test: github.com/boykopovar/AnyPS5@15995c6640/tools/tests/test_check_skips_ctest.py

Not verified

  • The mimalloc change and its tests.
  • The cause of the Windows release_package failure.
  • Whether main at 7fad6837 fails the same way (the base was not run here).

To get this to a good state

  • Look at check_skips_ctest on the base first: either check_skips.py lacks the notrun rule the test expects, or the test is ahead of it. Then look at the Windows release_package log.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5733037329 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14264#pullrequestreview-5733037329). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T07:00:51Z. **Review:** COMMENTED --- # Reviewed — CI is red on the merged build, for reasons this PR does not touch Relinked Linux games can now opt into mimalloc. The hosted relinker jobs fail on this head: `check_skips_ctest` fails in the three relinker jobs I read (Ubuntu, macOS clang++ and Windows), and `release_package` also fails in the Windows relinker job. The macOS x86_64 relinker job also fails and was not read. `check_skips.py` and its test are identical at the base and at this head, and this PR does not change them, so the failure comes from the base code. The `release_package` failure has no output in the log, so I could not attribute it. I did not read the mimalloc change itself in this pass. ## What I ran - Head `15995c6640300c9abf19e1a4fc375e51853a8f3d`; base `7fad6837767a4f0cb1636ff835cd42522aae8fac`. 13 files, including `core/libs/prx/libkernel/System/src/MimallocRestart.cpp`, `MimallocMacOs.cpp`, `core/libs/tests/MimallocRestart.cpp`, the root and `core/libs/` CMake files, and the docs. - Hosted: the Ubuntu relinker job (job 125008291567) fails with one case: `check_skips_ctest` (`Test #63`). The output shows `test_notrun_without_ctest_skip_marker_is_rejected` failing because `check_skips.skips` does not raise for a `notrun` case without a skip marker. - Hosted: the macOS relinker jobs (`clang++` and `x86_64`) fail with `check_skips_ctest` only. The Windows relinker job fails with `check_skips_ctest` and `release_package` (`Test #112`); its log has no assertion text for `release_package`. - Checked: `tools/check_skips.py` and `tools/tests/test_check_skips_ctest.py` have the same blob at the base and at this head, and the PR's changed files do not include them. The base `check_skips.py` contains no `notrun` handling. - Hosted: the Windows CTest run passed 2590 of 2590, and the Linux job is skipped on pull requests. - Read-only checks from the trusted main checkout: diff check, conventions and PR template, and the stack check all passed (no declared dependencies, no errors). The ABI audit is not applicable. - No MarcZX10 review at this head. ## Results | Check | Result | Note | | --- | --- | --- | | Diff check | passed | | | Conventions and PR template | passed | conventions check from the main checkout | | Mergeability and dependencies | passed | stack check passed; no declared dependencies; no errors | | `check_skips_ctest` (hosted, three relinker jobs read) | failed | fails in base code: the test expects a `notrun` case without a skip marker to raise; the base `check_skips.py` does not | | `release_package` (hosted, Windows relinker) | failed | the log has no assertion text; not attributed | | This PR's own tests (mimalloc restart) | not verified | the mimalloc change was not read in this pass; the relinker job tests the merged build | | Windows CTest (2590 of 2590) | passed | | | Linux build and runtime tests | not run | Linux is skipped on pull requests | | Negative controls | not run | no local build | | Hosted CI | failed (relinkers) | conventions, eligibility, labels, library-portability, report and relinker-asan succeeded; the four relinker jobs (macOS clang++, macOS x86_64, Ubuntu g++, Windows g++) failed | <details><summary>Read-only check output</summary> Precheck was not run: no PR-head code is run here. Diff check: passed. Conventions: passed. ABI audit: not applicable. Stack check: passed, no errors. Hosted: `gh api repos/boykopovar/AnyPS5/commits/15995c6640300c9abf19e1a4fc375e51853a8f3d/check-runs`, and the relinker job logs (Ubuntu job 125008291567, macOS and Windows relinker jobs). </details> ## Negative control Not run here. A negative control needs a local build, and code from this head is not run here. ## Findings **Blocking** - The hosted relinker jobs are red. `check_skips_ctest` fails in base code that this PR does not change, so the base needs a fix (or the test needs its expectation changed) before this PR can show green. The `release_package` failure on Windows is not explained. **Non-blocking** - The mimalloc change itself was not read in this pass. ## Sources - Ubuntu relinker job: 125008291567 (`check_skips_ctest`) - macOS relinker job: `relinker (macos-latest, clang++)` on 15995c6640300c9abf19e1a4fc375e51853a8f3d (`check_skips_ctest`) - Windows relinker job: `relinker (windows-latest, g++)` on 15995c6640300c9abf19e1a4fc375e51853a8f3d (`check_skips_ctest` and `release_package`) - Test: https://github.com/boykopovar/AnyPS5/blob/15995c6640300c9abf19e1a4fc375e51853a8f3d/tools/tests/test_check_skips_ctest.py ## Not verified - The mimalloc change and its tests. - The cause of the Windows `release_package` failure. - Whether `main` at 7fad6837 fails the same way (the base was not run here). ## To get this to a good state - Look at `check_skips_ctest` on the base first: either `check_skips.py` lacks the `notrun` rule the test expects, or the test is ahead of it. Then look at the Windows `release_package` log.
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!14264
No description provided.