AnyKyty is this fork's default branch: AnyPS5 running PS5 titles with the Kyty graphics core. This page is what a new contributor needs: how to build, run, test and measure, the rules, and how a pull request gets in. Open tasks are listed in the pinned "Start here" issue, by label (see Find work).
- Where things are
- Build
- Run a title
- Run the tests
- Measure
- Rules
- How a pull request is integrated
- Find work
- What CONTRIBUTING.md says that does not apply here
| Path | What it is |
|---|---|
core/kyty/ |
The Kyty graphics core: command processor, the Resolve, Execute and Record stages, caches, shader recompiler (graphics/shader/recompiler), ray tracing. Maintained here, derived from KytyPS5 (GPL-2.0) |
core/libs/prx/libSceAgcDriver/KytyShim/ |
The glue between Kyty and AnyPS5: memory, faults, entry points, presentation, settings (src/Config.cpp), and most tests (tests/) |
core/libs/prx/ |
AnyPS5's reimplemented system libraries (libc, libkernel, libSceAgc, libSceVideoOut…) |
core/relinker/ |
The relinker, which converts a PS5 executable into a native Linux or Windows program |
tools/ |
Checks, measurement and analysis scripts. tools/precache/ and tools/graphics-precache/ precook a title's shaders (PRECOOK_INTERNALS.md) |
docs/dev/, docs/user/ |
Documentation; ANYKYTY.md is the user page, ANYKYTY_SETTINGS.md the settings for developers, THIRD_PARTY_KYTY.md the full reference of the Kyty core and its settings |
A frame goes through the stages in order, one thread each: the command processor decodes the title's command buffers, Resolve prepares resources ahead, Execute records each draw and dispatch (the CPU limit on GPU-driven titles), Record submits to Vulkan.
There is one build: the Kyty core is compiled by Clang in a sub-project, the rest of AnyPS5 by GCC on Linux or MinGW-w64 GCC on Windows. The commands below are those of the AnyKyty workflow. On the 4-core CI runner a first build takes about 20 minutes; with ccache the next ones take a few.
Git, CMake 3.21 or newer, Ninja, GCC 14 and LLVM 21 (clang, clang++, ld.lld and llvm-profdata of the same major version, on PATH). The package list for Ubuntu is in the AnyKyty page; on Ubuntu 24.04 LLVM 21 comes from apt.llvm.org.
git clone --recurse-submodules https://github.com/simnJS/AnyPS5.git
cd AnyPS5
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \
-DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14 \
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DANYPS5_KYTY_JOBS="$(nproc)"
cmake --build build --target kyty_gpu libs relinker --parallel "$(nproc)"-DANYPS5_KYTY_THIN_LTO=OFF skips ThinLTO and the pre-link of the Kyty core, which makes builds of the core faster while you iterate.
WinLibs GCC 15.2.0 (UCRT), LLVM 21.1.8 (clang, clang++, llvm-ar, llvm-ranlib, llvm-profdata and its lib/clang directory), Git for Windows with Bash, Python 3, CMake and Ninja. Put the WinLibs and LLVM bin directories first on PATH, then from cmd.exe:
git clone --recurse-submodules https://github.com/simnJS/AnyPS5.git
cd AnyPS5
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DANYPS5_KYTY_JOBS=%NUMBER_OF_PROCESSORS%
cmake --build build --target kyty_gpu libs relinker --parallel %NUMBER_OF_PROCESSORS%The toolchain's runtime DLLs go beside the libraries (Windows setup and troubleshooting).
Bring your own legally dumped PS5 title; games are never provided. PS4 titles (GNM) do not run: the Kyty driver stops at start with PS4 (GNM) titles are not supported by the Kyty GPU driver. The relinker takes the extracted, decrypted executable of the title and its bundled modules (where to put the files). Convert it, put the libraries (build/core/libs/libs/*.prx) in a libs/ folder beside the output, and start it:
build/core/relinker/relinker source/input.elf app.elf
./app.elfOn Windows: relinker --windows source/input.elf app.exe, plus --to-intel on an Intel CPU. Module folders, add-ons and the other options are in usage. No setting is needed: the defaults are the fastest and most stable choices measured. The host report (OS, CPU, GPU, driver) prints at start; anyps5-report.json is written beside the game when it exits.
Build the shim test executables and run them as the CI does (the exact list is the "Run the shim tests" step of the AnyKyty workflow):
mapfile -t tests < <(ninja -C build -t targets all | grep -oE '^(kyty_shim_[A-Za-z0-9_]+_tests|guest_gpu_fault_tests|guest_host_write_filter_tests|agc_kyty_shaders_tests|guest_clock_pause_tests):' | tr -d ':' | sort -u)
cmake --build build --target "${tests[@]}" --parallel "$(nproc)"
sudo sysctl -w vm.unprivileged_userfaultfd=1 vm.max_map_count=2147483642
ctest --test-dir build -R '^(kyty_shim_.*|guest_gpu_fault|guest_host_write_filter|agc_kyty_shaders|guest_clock_pause(_scaled)?)$' --output-on-failure --timeout 300The GPU tests need a Vulkan GPU; without one they report a skip. For a change to the shader recompiler or the renderer, also run the tests you touched with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation on the base and on your change, and check that no new VUID- error appears.
Before pushing:
python3 tools/check_conventions.py --base origin/AnyKyty
python3 tools/check_kyty_settings.pyThe first checks commit subjects, comments in code, file types and paths, links in Markdown; the second checks that every KYTY_* setting the code reads has its row in THIRD_PARTY_KYTY.md and its name in the list of KytyShim/src/Settings.cpp. A new test goes in KytyShim/tests/ with its registration in that folder's CMakeLists.txt, and finishes in 30 s.
Numbers are taken with the default settings, warm caches (play the scene once, then restart the title) and the same scene on both sides. Say which settings you changed in any number you publish.
A change that can be switched while the title runs: an in-run A/B. KYTY_AB alternates two arms in one session, so both play the same scene:
- Put your change behind a temporary switch: an entry in
Switch(core/kyty/common/runtimeSwitches.h) and inEntries(runtimeSwitches.cpp), read where it is used withCommon::RuntimeSwitches::On(Switch::YourSwitch), and its row in THIRD_PARTY_KYTY.md. A switch can flip only if work done under one value stays right under the other (details). - Run the scene:
KYTY_AB=40:KYTY_YOUR_SWITCH KYTY_AB_SETTLE=8 ./app.elf > session.log 2>&1, for at least five phases of each arm. python3 tools/kyty_ab_report.py session.logprints each arm's frame rate, the difference corrected for drift, and the[kyty-*]counters. Paste it into the pull request.- Once the numbers decide, the switch goes: the winning behaviour stays without a setting. AnyKyty keeps no setting that is off by default.
A change that cannot be switched while running (shader compile forms, the command processor thread, thread placement): two sessions, same scene, with the flip telemetry. Give each run a new APS5_VIDEOOUT_TELEMETRY_DIR and the same APS5_VIDEOOUT_FLIP_TIMING=FIRST:COUNT, then python3 tools/videoout_flip_compare.py base/videoout.jsonl change/videoout.jsonl --baseline-revision <sha> --candidate-revision <sha> (more).
Where the time goes: every run profiles itself by default into _FrameProfile/<date>_<time>/ of the working directory, with a flame.svg and a short report.md written by the emulator itself, no Python needed. PROFILING.md says how to read them, how to open the live window and how to attach a run to an issue. KYTY_FRAME_PROFILE=0 turns it off.
Stutters: KYTY_SESSION_LOG=<file> with the flip telemetry, then python3 tools/kyty_pipeline_stalls.py videoout.jsonl <file> --top 10.
Shader waits: python3 tools/stall-report.py <session directory> classifies every [kyty-gpl] stall and translate of a session by the reason no prepared form served it: the cause= the build writes on the line, or one inferred from the manifests of the session. --variants ranks the fields of the variant key by the variants they make.
Precook and compilations in game: a title should start with nothing left to compile. PRECOOK.md is the user guide, PRECOOK_INTERNALS.md the pipeline, the stamp and what invalidates a precook. Run the title with KYTY_PIPELINE_COMPILE_AUDIT=1 KYTY_SHADER_VARIANT_LOG=1 and pass its stderr to python3 tools/kyty_precook_audit.py <log> --require-zero; a change to the shader recompiler (core/kyty/graphics/shader/) changes the stamp and every precook, so say so in the pull request.
You do not need every game: the maintainers run one title per engine family (Unity, Unreal Engine 4, an in-house engine designed for the PS5, an in-house engine of the PS4 era) on each integration.
- One topic per pull request, against
AnyKyty. Follow-ups go in a new pull request. - Conventional Commits for commit subjects and the pull request title:
fix(kyty): …,perf(kyty): …,feat(kyty): …,test(kyty): …,docs: …,ci: …. - No comments in code, in
core/kytyas elsewhere, except the licence notice of code taken from another project. Explanations go in the pull request. - Nothing specific to one title: no title IDs, shader hashes, per-title branches or data taken from a game in the code or the tests. Fix the class of problem. Naming the title you tested in the pull request text is fine.
- Defaults are the fastest and most stable measured. A new behaviour lands on by default once measured; a temporary switch lives only as long as its A/B.
- Every setting is documented: a
KYTY_*name in THIRD_PARTY_KYTY.md, anAPS5_*orANYPS5_*name in ENVIRONMENT. - No notes, logs or images in the repository: attach them to the pull request. A new Markdown file goes under
docs/dev/ordocs/user/. - AI-assisted work is accepted. Say so on the template's
AI-assistedline; you answer for every line. - Shader semantics: say where a behaviour comes from (a hardware measurement, the ISA document, Mesa or LLVM).
- Keep changes to code shared with upstream AnyPS5 (outside
core/kytyandKytyShim) small: they conflict at every synchronisation. - Code taken from KytyPS5 keeps its licence header; AnyKyty is GPL-2.0 (licences).
The coding conventions give the naming and formatting rules.
- Open it against
AnyKytyand fill in the template. It is AnyPS5's and saysmain: readAnyKyty. - The CI runs on every push (workflow): the conventions and settings checks, a Linux build with the shim tests, the CPU tests under ThreadSanitizer and AddressSanitizer, and a Windows build with the shim tests. It must be green. A change to documentation only skips the builds.
- A maintainer reviews it: the diff, both checks, the builds and tests on Linux. A change on a path every title uses (presentation, memory, faults) may get a session on a title.
- Larger changes go through a
test/<name>branch first, sometimes grouped with others: the maintainers run one title per engine family, and testers with AMD, Intel or Windows are asked to run theirs. - The maintainer pushes your commits to
AnyKyty, with you as the author, and closes the pull request with "merged as<sha>". GitHub shows it as closed, not merged: that is expected.
- The pinned "Start here" issue: the roadmap and the open tasks.
- By label:
good first issue,medium,hard; thearea: …labels (shaders, gpu-memory, execute, rendering, ray-tracing, windows, tools-ci, docs) and theneeds: …labels (AMD, Windows, game, measurement). - Architecture v2, the main performance work: #168. Steps are claimed there.
- Without code: test a title (#141), or survey its ray tracing (#111).
Comment on an issue before you start, so two people don't do the same work. Questions go to Discussions.
CONTRIBUTING.md is upstream AnyPS5's. Its rules for code, commits and documentation apply. Its instructions for AnyPS5's own GPU driver and shader recompiler (core/shader) do not, since both were removed from AnyKyty; the validation-layer check they describe still applies to the Kyty recompiler and renderer, as above. Its description of the pull request process does not apply either, because it is about upstream's main: the limit on open pull requests, the review queue, stale and already in main labels, the manually started Build workflow, tools/pr_overlap.py, the trace-based performance report form and the Game bring-up discussions of the upstream repository.