AnyPS5 Guides
Build AnyPS5 from source
Build AnyPS5 from source with Git submodules, the documented toolchain and CMake. Rebuild the libs target and keep matching tools, libraries and commit details.
Use a recorded source revision
Install the documented toolchain first. Clone recursively, record git rev-parse HEAD, and keep local patches in a separate branch. A PR number alone does not identify the exact patch tested: commits and conflict resolutions can change.
git clone --recursive https://github.com/boykopovar/AnyPS5.git
cd AnyPS5
git rev-parse HEAD
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
cmake --build build --target libs --parallelDo not skip the libraries target
The explicit libs target is required to rebuild replacement system libraries. Copy the produced host libraries from build/core/libs/libs/ into the runtime libs/ folder. Relinker-only builds do not provide a complete runtime. macOS-related relinker options do not establish supported macOS gameplay.
macOS remains a separate source target
Current upstream usage also documents --macos for x86-64 Mach-O and --to-rosetta for Apple silicon through Rosetta. The reviewed v0.1.2 assets remain Windows/Linux files. Successful conversion or a passing macOS build job does not verify a commercial game; use the upstream build and usage documents for that experimental target.
Keep a build that can be reproduced
A source checkout, build directory and runtime directory serve different purposes. Record the source commit and compiler version before configuring CMake. If you merge a testing PR, record its exact commits and any conflict resolution. Rebuild both the executable tools and libs target after source changes, then copy the matching outputs into a fresh runtime directory. Mixing an old relinker with newly built libraries makes a reported result harder to reproduce.
Run relevant upstream tests for the subsystem you changed and preserve failures with the build record. Passing library or relinker tests confirms those test cases, not a playable PS5 title. When a build fails, keep the configure command and the first compiler error; hundreds of later messages can be consequences of one missing dependency or unsupported toolchain. Avoid importing random precompiled submodule libraries into a source build.
Audit imports before judging compatibility
Current upstream tools/import_audit.py reads the registries produced by --registry against the actual built libraries. Pass the executable registry and every generated module registry, and use --libs for the matching host-library directory and --modules for the title’s module directories. The example includes only one bundled libc module; add every other registry and module directory your title generates.
implemented marks an export without a whole-function throwing stub, not complete behaviour. stub loads and throws; absent prevents loading; module identifies a title-supplied provider. Current main also audits every --modules file’s undefined symbols and needed libraries, including sectionless ELF dynamic tables. A clean import audit does not prove correct rendering, gameplay or multiplayer.
./build/core/relinker/relinker --registry source/input.elf runtime/app.elf
python3 tools/import_audit.py runtime/app.registry.json runtime/app.libc.prx.guest.prx.registry.json --libs runtime/libs --modules source/sce_moduleModule warnings and additional executables
On main after v0.1.2, #5588 adds tools/unwrap_self.py for already-decrypted SELF/fSELF containers; it is not a decryption tool. The relinker still expects clean ELF and warns when containers are skipped, so inspect all modules. #5443 makes Linux multi-executable modules depend on their own system-library union; Windows output is unchanged and macOS was not run in that PR. Peace Walker’s Linux hand-over now starts the game process, but later image failures remain. Neither tool change is in the v0.1.2 tag.
Keep the title’s original metadata and ELF modules
Preserve app0/sce_sys/param.json from your own title, including its titleId and localized titleName. Main uses it for metadata and directory creation; do not change budgets to imitate another report. For import_audit.py --modules use original unwrapped ELF modules, plus every generated registry as positional input. Converted .guest.prx files on Windows are PE output, not those audit inputs.
Lazy preparation remains opt-in
Main APS5_LAZY_SHADER_PREPARE=1 still validates and decodes shaders at registration, but defers preparation until use; explicit ABI preparation remains. Default off. This moves work and can cause first-use stalls; one memory-constrained title reaching an intro is not a universal RAM minimum or gameplay fix. Relinker-only --macos output is x86-64 Mach-O; released runtime libraries remain Windows/Linux.
Browser relinker build is not a browser runtime
Current main adds ANYPS5_BUILD_WASM=ON for the relinker_web target, using Emscripten emcmake and BUILD_TESTING=OFF. It converts executables; it does not run PS5 games in a browser. Relinker regression tests require Python3.9+. Upstream also documents a Bitdefender-specific guest_raise_exception test hang; review its scoped diagnosis rather than disabling antivirus globally.
Guest time scaling changes timing, not throughput
APS5_TIME_SCALE accepts a positive factor, otherwise1. It scales guest processTime/TSC-derived clocks from the first observation and Windows monotonic time; Linux native clocks, hardware rdtsc, reported TSC frequency and host waits remain unscaled. It does not accelerate CPU/GPU work. Scripted input uses scaled durations/polling: at0.02, a one-second press lasts50 real seconds and reload polling can take five. Always disclose the factor in a run report.
Mac converter and experimental runtime have different scope
The converter can produce Mach-O/Rosetta output, but v0.1.3 ships no Mac runtime. Integration PR #7332 closed unmerged on 20 October. Its pinned Apple-silicon experiments remain branch results, including later local Lana tests; closure is not a merge or a released runtime. No general Mac requirements or nativeARM gameplay are established.
Mac work continues on separate integration trees. The M5 report uses ci/macos-series-2 53db0badb with #7524, #7937 code, #7332 SSL and open #9789; its converter is main 8b3e39832a. Doom 3 still lacks game data and ccleste still lacks GPU capabilities. A Linux container under Rosetta with llvmpipe is a different runtime. These observations do not provide a ready-to-download Mac package or general Apple silicon game requirements.
Include toolchain DLLs in a Windows self-build
After building libs, copy libgcc_s_seh-1.dll, libstdc++-6.dll and libwinpthread-1.dll from that toolchain beside the patched PRX files. The runtime loader does not search PATH for these dependencies; error126 can occur even when the named PRX exists. Release archives already include them. Keep Unity guest modules in their original relative folders, not libs.
Compare the same scene and counter window
Profile lines mix10s windows and cumulative totals. Use differences of cumulative values, disclose profiling overhead, cache state and streaming. ASTRO BOT/LEGO cache-budget observations apply to their measured hosts; larger budgets can exhaust VRAM. Fewer pipeline drains alone did not improve Sword of the Sea. Do not turn one host’s switch into a universal preset.
Later main: capture benchmark intervals
On reviewed main, benchmark captures retain only the most recent 240 completed intervals; intervals_dropped records the removed history and the unfinished final interval is absent. benchmark_compare.py summarizes a selected contiguous range and compares ordered, paired A/B attempts. Keep failed and excluded attempts with their reasons, use the same scene/save/input/cache recipe, and report build or host differences. Matching metadata and file hashes do not prove independent runs or that a change caused an FPS gain. These are post-v0.1.5 measurement tools, not a performance preset.
Later main: import tracing on Linux
Current main documents --trace-imports for Windows and Linux; it conflicts with --lazy-binding and records nothing without APS5_TRACE_CALLS. Linux prints the recent calls only on abort, not a Windows-style crash report. Output includes the global last 64 calls, the reporting thread’s last 32 from a 65536-call ring, and 32 top imports. These are diagnostic traces with overhead, not gameplay benchmarks; the v0.1.3 attached usage guide still limits this option to Windows.
Later main: sample the Windows committer
Windows APS5_SAMPLE_COMMITTER=<file> samples queue 0’s draw committer with the worker sampler’s two-file/offline-symbol workflow. It starts at the first pipelined draw; APS5_PIPELINED_DRAWS=0 produces no samples. A worker waiting in DrawPipeline::Enqueue does not prove the committer is idle. Keep profiling runs separate from unprofiled FPS, including Hi-Fi RUSH’s observed tracing overhead.
Later main: choose a compatible Windows exception toolchain
CMake now checks exception capabilities instead of requiring only one compiler distribution. MSYS2 UCRT64 GCC16.2.0-6 supports System-V SEH; WinLibs15.2r7 uses DWARF with -fno-asynchronous-unwind-tables. Use separate build directories and matching gcc/g++/DLLs. Scoop standalone GCC15.2 cannot build the runtime: SjLj fallback or incompatible SEH fails the required ABI handlers. Relinker-only builds are a narrower scope; a converter build does not validate game runtime.
Later main: Linux default image base and patch verification
Ordinary Linux output is now ET_EXEC at0x400000 without ASLR; --linux-fixed-base selects another aligned base. Deprecated --lazy-binding keeps ET_DYN and cannot use bundled modules. A generated patch manifest records linux_base: --verify-output checks ET_EXEC offsets with that value, while ET_DYN requires no linux_base. PE/Mach-O remain refused; module entries are not verified. Do not apply this current-main behavior retrospectively to v0.1.3 or older tests.
Later main: unwrap padding limit
The SELF unwrapper refuses more than64MiB total alignment padding before allocating output. This counts padding across file-backed and empty segments, not their data bytes. Refusal preserves input and an existing output. It does not decrypt encrypted content, and it is a current-main boundary rather than a new v0.1.3 release.
Later main: opt-in draw pipeline and measurement
APS5_DRAW_PIPELINE=1 is off by default and intended with PIPELINED_DRAWS=32 and PIPELINE_DISPATCH=1. It hands work to a finisher and reuses validity proofs. VERIFY_DRAW_PIPELINE samples full checks at a speed cost; nonzero epoch-proofs differences are bugs. PROFILE_DRAW=1 instead finishes draws on the reading thread, so that run cannot measure the handoff. PIPELINE_STATS reports finisher counters; value1 adds costly Vulkan statistics. No universal FPS gain is established.
Later main: AMD dispatch markers for device-loss reports
APS5_GPU_CHECKPOINTS=1 remains off by default. Without NV diagnostic checkpoints, supported AMD devices can use VK_AMD_buffer_marker to record dispatch reached/finished markers, naming the last programs and up to eight between them. Unsupported devices ignore it. A last marker narrows a hang investigation, not proof that the named shader caused it; keep diagnostics separate from unprofiled speed.
Later main: system dependencies still need submodules
ANYPS5_USE_SYSTEM_DEPS=ON still keeps FFmpeg, JPEG, stb, VMA, LibAtrac9, ogg and vorbis bundled: initialize the pinned submodules. The system SDL2 must supply HIDAPI, and configure errors do not silently fall back. This is a source-build rule, not a new game hardware requirement.
Later main: distinguish build-tool failures
The python.org Windows installer may provide python/py but no python3: use py -3 instead of the Store alias; other distributions differ. CTest fixes relinker test temp files under build/core/relinker/test-temp, so changing the parent shell’s TEMP does not move them. For libusb version_describe.h, check Git Bash and any overriding PowerShell Group Policy; upstream documents a Git-Bash wrapper via LIBUSB_POWERSHELL_EXECUTABLE without changing policy.
Later main: explicit Windows red-zone conversion
--frame-red-zone is Windows-only and opt-in. It gives supported leaf functions stack frames so host-delivered exceptions do not overwrite live System-V red-zone values. Bounds require .eh_frame; absent metadata fails, unsupported leaves are reported, and patches overlapping framed sites are refused. It is not a general crash fix, Linux flag or proof that an older patched GTA run now works unchanged.
Later main: replay captures have different evidence limits
APS5_FRAME_CAPTURE records calls and guest-memory snapshots, including the title image; treat capture archives as potentially containing game data, not shareable logs. The default is10frames from flip1, with a low-disk stop below4GiB free. agc_frame_replay can pace calls and release or synthesize waits; record those choices and compare actual reference pixels. Replay timing is not native gameplay FPS, and the new synthetic tests do not certify every game capture.
Later main: Rosetta instruction conversion remains explicit
--to-rosetta now also rewrites XSAVEOPT to XSAVE. It implies --to-intel and conflicts with --windows; --macos alone does not enable instruction lowering. Instruction-level M2 evidence is not a Mac commercial-game test, matching runtime build or official Mac release.
Later main: a counted implementation can still fail the import audit
For an import naming a library, import_audit now requires the literal export name. A hash-only match may still count as implemented/stub, but records symbol_mismatch and exits1; a strong mismatch is a current stop. Imports without a library retain name-to-NID fallback. Review weak bindings and exact module registries, not just the implemented count.
Building the converter is not building a Mac runtime
The converter-only build supports Apple Silicon with AppleClang from Xcode command-line tools, CMake and Ninja from Homebrew. This does not provide the full PS5 runtime libraries. Current Mac title experiments still combine open patches and use x86-64/Rosetta; v0.1.3 has no Mac runtime package.
Keep a bounded import-call snapshot
With --trace-imports and APS5_TRACE_CALLS , set APS5_TRACE_CALLS_FILE to a local path for per-import call counts rewritten every10s, most called first. A killed run retains only the latest rewrite; absence there does not prove never called. trace_digest skips window-capture lines and reports identity changes. Cold/warm caches, scene and all switches must match before comparing timings.
Symbolize the binary that actually ran
Windows APS5_SAMPLE_WORKER now writes collapsed stacks as well as self/inclusive samples; truncated walks are marked. symbolize_samples checks module size and PE timestamp before naming frames;--unverified bypasses that identity check, not a fix. APS5_SAMPLE_THREADS uses a shallower .pdata-only walk. Inclusive counts can double-count recursion; sampling overhead and incomplete stacks limit comparisons.
Local trophy statistics have a limited rule set
Later main stores local statistic values in _trophy/<user>_<service>.stats.txt across runs. Only documented latest/max integer statistics and simple event-property rules are applied; unsupported rules are logged. APS5_TRACE_UDS logs events/statistics and ignored reasons. Local unlocks do not establish PSN synchronization. A reset concerns both statistics and unlock files, not just one.
Native import patching is a separate tool
Later main’s nid_patcher --exec detects native PE/ELF64/Mach-O64 from bytes and rewrites imports in place while preserving application exports; unsupported layouts fail before writing. Use a working copy and preserve host imports explicitly with the documented export exclusions or narrower --only-sce mode. It is not the relinker command or proof of game compatibility; build a separate executable per target.
Audit imports before starting a title
Current main’s audit_dump.py combines unwrapping, conversion with --registry and import auditing. It reads every documented module folder and PRX files beside eboot.bin, writing to a temporary directory or --work directory while leaving the dump unchanged. Add --windows for Windows output. Point --libs at build/core/libs/libs, not unpatched or a game-module folder. Passing this preflight is not a game run or proof that imported functions behave correctly.
python3 tools/audit_dump.py <app0> --relinker <relinker> --libs build/core/libs/libsA verified patch list still requires a choice
suggest_patches.py --list-verified lists every catalog entry passing metadata, hash and relinker checks, in catalog order. It exits 0 when at least one verifies, even if others fail. Without this flag, multiple verified entries remain ambiguous and none is chosen. The tool does not fetch, apply or combine patches. Choose and review one matching file; matching hashes identify exact input bytes, not the catalog’s trustworthiness, patch safety or game playability.
Build paths and what a validation gate proves
Windows dependency/object paths can still hit260 characters with LongPathsEnabled=1. Use a short checkout such as C:5 and freshly configure/build there; moving an old build directory retains absolute paths. Current main documents Linux dynamic-library ThreadSanitizer, mutually exclusive with AddressSanitizer; suppressions for uninstrumented drivers do not prove race freedom. The POSIX Vulkan gate rejects dirty sources, requires fresh output outside worktrees, loaded layers and no skipped selected tests; it compares new diagnostic IDs, not just counts. Hashes identify selected binaries, not every loaded artifact. Passing repetitions neither prove all games nor rule out intermittent faults. Windows capture/replay needs guest write watch; disabling it now refuses capture. None of these development checks is a game benchmark.
Compare one exact build and scene at a time
Main’s APS5_AB uses seconds:switch[+switch...] and toggles runtime switches at flip packets; settle defaults to2 seconds and start can be a flip count or seconds. A private fork’s comma syntax is not this interface. ANYPS5_LANGUAGE accepts0–30; invalid overlay/language values can fail rather than silently default. APS5_EXACT_DRAW_WRITES is now on when unset, with0 selecting approximation. APS5_TIME_SCALE accepts positive fractions, changes guest clocks and is not an FPS multiplier. STRICT_DESCRIPTOR_WEBS selects throwing diagnosis instead of default fault selection, not a compatibility cure. Record every override, cache and trace-event loss before comparing. PREBUILD_THREADS, worker affinity and profiling change the workload, so do not combine gains from different runs.
Patch catalogs: structure, file matches and runtime are different checks
Current main documents Python 3.11+ tools/validate_patch_catalog.py --catalog <directory>. It checks catalog structure, paths, hashes covered by entries and duplicate IDs, without reading game files, downloading or applying anything. Exit0 means structurally valid, including an empty catalog; exit2 means invalid. Only relinker --verify-patches checks actual target parsing and byte matches. Optional tested records distinguish verification/conversion/launch/gameplay, with passed/failed/partial results and contributor-provided evidence; the advisor does not independently confirm those claims. A higher revision does not automatically win: replace an older same-build ID instead of leaving two verified duplicates. These current-main tools are not a new official runtime release; Check the selected release documentation before using this source feature.
Bound trace memory and separate inspection from benchmarks
Main accepts APS5_TRACE_EVENTS from1 to4194304, default262144. A current event is40 bytes: 10 MiB per default thread buffer or160 MiB at maximum, allocated before the window opens, plus formatting memory. More capacity can still overflow; dropped events remain a qualification limit. Compute-pipeline --inspect needs VK_KHR_pipeline_executable_properties, reports driver counters and null milliseconds, and cannot be treated as a compile benchmark. Runtime capture stops optionally at128 records or256 MiB while the title continues; captured shaders are not reference game pixels. Windows’ usage prose now agrees on the lowest ELF page’s default0x400000, resolving the earlier documentation discrepancy; fixed-base placement is not a general FPS or isolation setting.
Preview conversion without writing output
v0.1.5 supports relinker --dry-run. Supply the intended output path. It checks conversion and prepares the outputs in memory without creating files or testing write permissions. It cannot be combined with --autorun or --verify-patches. Use a separate run to verify startup.
Capture the host before changing runtime policy
v0.1.4 documents ANYPS5_LOG_FILE=<path>: it duplicates executable stdout/stderr to an append-only file, without filename expansion. It does not collect relinker output or separate trace files. Opening failure stops startup with status 1; there is no size limit. Reviewed main adds ANYPS5_HOST_REPORT=1 after GPU selection, including a report before a missing-feature failure. Review paths and title output before sharing logs; redaction is not a guarantee. A missing-feature list diagnoses that device/build, not whole-game compatibility.
Other reviewed-main policies remain opt-in: ANYPS5_FREE_SPACE=host checks the save volume when creating a new save; fixed is the default and console behavior is unmeasured. A default-sized 16384-block save needs 1 GiB. APS5_GAME_MODE=on/auto requests host performance mode, off by default; a request is not a measured speed gain. ANYPS5_PSN_DIALOGS=show adds a host notice while retaining the same cancellation result, not PSN access. Record each policy and keep real save/load tests separate.
Local run reports and missing milestones
v0.1.5 writes anyps5-report.json locally at supported exits. A kill, crash or abort can leave no file. Windows requires guest exit or _exit in this release, and Windows/Linux omit the loaded and started milestones. Review the file before sharing it. A submitted frame can still be black, and the report does not detect mixed library builds.
Optional Linux dependency omission has narrow conditions
Main’s --omit-unavailable-dependencies omits only an unavailable bundled dependency with no imports, no converted provider and no copy in any --rpath directory. All those directories must exist during conversion. Without the flag the dependency remains and is noted. Use it only with all system libraries already in rpath: an omitted library found later through LD_LIBRARY_PATH will not load. This is not permission to discard real imports or a universal startup fix.
Trace the actual host module name
With --trace-imports, later main labels an import lacking a library name by the host module containing its function, such as libSceAvPlayer.native. Select that filename in APS5_TRACE_CALLS rather than a guest alias. Trace collection, a clean audit and a missing error are diagnostics; preserve actual build, platform and reached scene before claiming a fix.
Rebuild the patched module you actually load
On reviewed main, rebuild a changed patched module by target name, for example cmake --build build --target libs_libSceAgcDriver. This rebuilds its dependencies and NID-patches the matching PRX. Naming an existing output path with a Makefile generator can leave it falsely up to date. Copy the resulting library into a fresh matched runtime; passing source tests while loading an older PRX does not test the change.
Read trace completeness before comparing costs
Current main separates lost trace slices from full phase-total tables: inspect events_lost and totals_full per thread, not only trace_dropped. Lost events make slice/wait inventories incomplete even when separately accumulated totals remain complete. Nested phases and parallel threads overlap; do not sum them as exclusive frame costs. worker_busy_pct includes measured waits and is not OS CPU utilization. For trace_diff.py, select matching scenes with --a-frames and --b-frames; 0:1 means the first complete interval and requires two presents. Missing or truncated captures cannot establish a universal speedup.
For APS5_DRAW_PIPELINE, unset the variable for the off arm: any supplied value, even 0, enables it on reviewed main. APS5_PROFILE_DRAW=1 prevents the finisher hand-off, so that instrumentation cannot measure the enabled path; preserve the actual switches and check the hand-off counter.