Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
859671c
Adapt Darwin FEX integration and Unity guest startup
LuizDusky Nov 23, 2026
2964105
Read embedded vertex attributes in native Metal shaders
LuizDusky Nov 23, 2026
44e1f49
Document reproducible Apple Silicon bring-up
LuizDusky Nov 23, 2026
d5a3160
Specialize Metal vertex pulling for the active layout
LuizDusky Nov 23, 2026
52d074d
Fix sRGB color conversion in the Metal presenter
LuizDusky Nov 24, 2026
188c68b
Stream game package files through the native archive adapter
LuizDusky Nov 24, 2026
5f07318
Fix GT7 startup on Darwin ARM64
LuizDusky Nov 24, 2026
efc1923
Bring up GT7 mesh shaders and trace Metal image descriptors
LuizDusky Nov 24, 2026
48b42f6
Preserve guest LDS bounds in native Metal compute shaders
LuizDusky Nov 24, 2026
533afbb
Preserve guest LDS bounds in native Metal compute shaders
LuizDusky Nov 24, 2026
a288f2a
Document and automate the Prospero ARM64 build
LuizDusky Nov 24, 2026
bd29a0b
Back oversized Metal compute LDS with per-workgroup GPU memory
LuizDusky Nov 24, 2026
0ccde5e
Open PS5 game packages from the Prospero library
LuizDusky Nov 24, 2026
52fa466
Apply the guest component mapping to Metal image stores
LuizDusky Nov 24, 2026
fbb75b4
Apply guest component mapping to Metal image stores
LuizDusky Nov 24, 2026
22e5542
Trace GT7 lighting passes and preserve Metal array image layers
LuizDusky Nov 24, 2026
1ebbc35
Record the GT7 command buffer validation limits
LuizDusky Nov 24, 2026
78fd1a5
Isolate GT7 lighting resources and record M4 frame timing
LuizDusky Nov 24, 2026
6ddec56
Test 64 KiB LDS with the GT7 workgroup dimensions
LuizDusky Nov 24, 2026
c1aa89e
Record the GT7 uniform-branch diagnostic result
LuizDusky Nov 24, 2026
42cd25e
Trace and preserve the GT7 lighting constant buffer
LuizDusky Nov 24, 2026
e261fd6
Enable the validated GT7 lighting input fixes by default
LuizDusky Nov 24, 2026
ac3aff4
Enable GPU-written cubemaps for the verified GT7 build
LuizDusky Nov 24, 2026
601fae6
Trace packed HDR volumes in the GT7 composition pass
LuizDusky Nov 24, 2026
019cda4
Record the paired GT7 60 and 120 Hz measurements
LuizDusky Nov 24, 2026
3e2de9f
Default Prospero launches to 1080p and 60 Hz
LuizDusky Nov 25, 2026
4d0c119
Document the GT7 World Map recheck at 1080p60
LuizDusky Nov 25, 2026
a0efb42
design: add Prospero vector brand mark
LuizDusky Nov 25, 2026
0e199d9
docs: introduce Prospero branding in README
LuizDusky Nov 25, 2026
80fd175
docs: redesign project landing page and clarify architecture and comp…
LuizDusky Nov 25, 2026
356fe60
Merge pull request #1 from LuizDusky/branding/prospero
LuizDusky Nov 25, 2026
6f99e95
docs: document pending ARM64 and GT7 integration progress
LuizDusky Nov 25, 2026
1a648bc
Merge branch 'main' into prospero/gt7-metal
LuizDusky Nov 25, 2026
6a1fa38
Merge pull request #6 from LuizDusky/prospero/gt7-metal
LuizDusky Nov 25, 2026
77f81cb
Merge branch 'main' into fix/metal-image-store-components
LuizDusky Nov 25, 2026
29e0a1f
Merge pull request #3 from LuizDusky/fix/metal-image-store-components
LuizDusky Nov 25, 2026
7737d4b
Merge pull request #4 from LuizDusky/fix/metal-presenter-srgb
LuizDusky Nov 25, 2026
270dd5e
Merge branch 'main' into metal-preserve-compute-lds
LuizDusky Nov 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 64 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,94 @@
# KyTx
# Prospero

**KyTx** is an experimental PlayStation 5 emulator for **macOS on Apple Silicon**, built on
[KytyPS5](https://github.com/KytyPS5/KytyPS5) (itself based on [Kyty](https://github.com/InoriRus/Kyty)).
**Prospero** is a fork of [KyTx](https://github.com/TxCsOffc/KyTx) focused on
making native Apple Silicon PlayStation 5 emulation easier to build, test and use.
KyTx builds on [KytyPS5](https://github.com/KytyPS5/KytyPS5) and
[Kyty](https://github.com/InoriRus/Kyty).
It replaces the upstream x86-64 + Rosetta 2 + MoltenVK setup with a native ARM64 build:

- **Guest CPU:** x86-64 game code runs under [FEX](https://github.com/FEX-Emu/FEX) (FEXCore embedded in-process),
not Rosetta 2.
- **GPU:** RDNA shaders are translated straight to Metal Shading Language and PM4 command streams are executed on a
native Metal backend (`src/graphics/host_gpu/metal/`). The product path uses no Vulkan, MoltenVK or SPIRV-Cross; the
inherited Vulkan renderer is kept only as a diagnostic reference.
- **GPU:** PM4 command streams execute on a native Metal backend (`src/graphics/host_gpu/metal/`).
The shader recompiler emits Metal Shading Language directly for supported stages and uses SPIRV-Cross for mesh translation.

> [!IMPORTANT]
> KyTx is not affiliated with Sony Interactive Entertainment, PlayStation or any game publisher. The project does not
> Prospero is not affiliated with Sony Interactive Entertainment, PlayStation or any game publisher. The project does not
> distribute games, game data or copyrighted system software. Use only game files that you have obtained legally.

## Status
## Compatibility

Early and unstable. Only one title has been worked on so far:

| Game | State on an M5 Max |
| Game | Observed behavior |
|---|---|
| EA SPORTS FC 27 | Boots to the main menu (30 FPS, the game's own cap there) and into a playable match (30-37 FPS; the game asks for 60). Many rendering errors remain, especially in matches; occasional crashes and GPU hangs. |
| Is This Seat Taken? | On a Mac mini M4, reaches the title menu, Barcelona map and first level. |
| Gran Turismo 7 1.71 | On a Mac mini M4, boots to the World Map. The landscape and menu labels still render incorrectly. [GT7 findings](docs/bringup/gt7-metal.md) |
| EA SPORTS FC 27 | In the original KyTx tests on an M5 Max, reached the main menu and a match with rendering errors and occasional crashes or GPU hangs. |

Prospero is an experimental macOS build for Apple Silicon with Metal 4.

## Build and test

Follow the [macOS ARM64 build guide](docs/bringup/macos-arm64.md) for the pinned
FEXCore revision, dependencies and game launch command. The
[GT7 bring-up notes](docs/bringup/gt7-metal.md) list the descriptor and shader
regression tests and explain how to reproduce the Metal captures.

## Open games

Build the native launcher with `bash tools/build_prospero_launcher.sh /path/to/build/kytx`.
Open `Prospero.app` beside `kyty_emulator`, then add a game directory, .pkg, or
.fpkg to the library. You can also use Finder's **Open With** menu for package files.

Prospero starts games in a 1920×1080 window and defaults to 1080p Video Out and
a 60 Hz virtual refresh rate. **Settings → Video** controls the mode reported to
the game. Games choose their internal render resolution.

Nothing else has been tested on this fork, including UFC 5 (the target of the fork this one started from).
For supported PS5 packages, Prospero streams the original file using a compatible
`read-fpkg` helper. The launcher looks beside the emulator and in
`../fpkg-reader/read-fpkg` relative to the emulator directory. Use **Settings →
Package reader** to select a helper elsewhere. The helper and its dependencies
are separate from the launcher. A game-specific JSON patch can be selected in
**Game Options**.

- **Platforms:** macOS on Apple Silicon only. There are no Windows or Linux builds of KyTx; the upstream code for those
platforms is still in the tree but is not built or tested here.
- **Requirements:** an Apple Silicon Mac with a Metal 4 capable GPU (developed on an M5 Max, 48 GB).
## Development priorities

## Building
The following areas are proposed priorities for improving the project:

The macOS arm64 build links FEXCore from a FEX-darwin source/build tree that is **not part of this repository yet**
(CMake looks for it in `~/Developer/fex-darwin`, overridable with `KYTY_FEX_DIR` / `KYTY_FEX_BUILD_DIR` /
`KYTY_FEX_SHIMS_DIR`). With that in place:
- [ ] Document a reproducible ARM64 build and external FEX dependency setup.
- [ ] Improve shader translation and rendering correctness.
- [ ] Investigate GPU hangs and runtime stability.
- [ ] Establish repeatable compatibility and performance tests.
- [ ] Expand testing across Apple Silicon hardware and additional titles.

```bash
cmake --build _Build/macos-arm64 --target kyty_emulator -j$(sysctl -n hw.logicalcpu)
```
Diagnostic environment variables, including `KYTY_PASS_TRACE_*`, `KYTY_GPU_BUSY` and `KYTY_GPU_PASS_TIME`, are documented alongside the implementation. Inherited documentation is available in [`docs/`](docs/).

Run with the Metal backend:
## Contributing

```bash
KYTY_BACKEND=metal KYTY_MSL_ONLY=1 KYTY_VIDEO_OUT_1080P=1 \
_Build/macos-arm64/kyty_emulator --game /path/to/your/game
```
Contributions to graphics correctness, CPU integration, build reproducibility and documentation are welcome.

## Development notes
Before submitting a change, describe the problem, keep the patch focused and include reproduction steps or test results where possible. For a bug report, include the macOS version, Apple Silicon model, memory configuration, commit SHA, relevant logs and expected versus actual behavior.

Diagnostic switches are environment variables documented next to their code (for example `KYTY_PASS_TRACE_*`,
`KYTY_GPU_BUSY`, `KYTY_GPU_PASS_TIME` in `src/graphics/host_gpu/metal/`). The upstream KytyPS5 documentation is in
[`docs/`](docs/).
- [Report an issue](https://github.com/LuizDusky/Prospero/issues)
- [Browse pull requests](https://github.com/LuizDusky/Prospero/pulls)

Do not attach copyrighted game files, firmware, keys or other material you are not authorized to distribute.

## Credits

Prospero builds on the work of the open-source emulation community:

- [KyTx](https://github.com/TxCsOffc/KyTx), the immediate upstream project.

- [Kyty](https://github.com/InoriRus/Kyty) by InoriRus and contributors.
- [KytyPS5](https://github.com/KytyPS5/KytyPS5) and its contributors.
- The KytyPS5-UFC5 fork by Reece Ketley.
- [FEX](https://github.com/FEX-Emu/FEX) (MIT).

## License

GPL-2.0, as upstream. See [`LICENSE`](LICENSE) and [`LICENSES/`](LICENSES/).
GPL-2.0, as upstream. See [LICENSE](LICENSE) and [LICENSES/](LICENSES/) for licensing details.

Prospero is an independent project and is not affiliated with Sony Interactive Entertainment, PlayStation or any game publisher. It does not distribute games, game data or copyrighted system software. Use only game files you have obtained legally.

---

<p align="center"><sub>Prospero · Experimental native PS5 emulation for Apple Silicon</sub></p>
1 change: 1 addition & 0 deletions docs/branding/prospero.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/bringup/fexcore-optional-snapshot.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
diff --git a/FEXCore/Source/Interface/Core/Core.cpp b/FEXCore/Source/Interface/Core/Core.cpp
index 1d6b5e5..d1e3591 100644
--- a/FEXCore/Source/Interface/Core/Core.cpp
+++ b/FEXCore/Source/Interface/Core/Core.cpp
@@ -1165 +1165 @@ uintptr_t ContextImpl::CompileBlock(FEXCore::Core::CpuStateFrame* Frame, uint64_
- ::Loader::Fex::KytyRecordKnownBlockSnapshot(reinterpret_cast<uintptr_t>(Bytes), Bytes, CaptureLen);
+ // The embedding host does not provide the optional snapshot recorder.
160 changes: 160 additions & 0 deletions docs/bringup/gt7-metal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Prospero · GT7 on native Metal

Gran Turismo 7 1.71 reaches the World Map on a Mac mini M4. The PS5 reference
shows the coastline, terrain, water, buildings and readable menu labels. The
Metal capture preserves the coastline and some icons. The red overlay is gone.
The landscape is still mostly black, and menu labels are missing.

## What changed since KyTx

| Commit | Change |
| --- | --- |
| `859671c` | Adapted the Darwin FEX integration and Unity startup. |
| `2964105`, `d5a3160` | Read embedded vertex attributes and specialize vertex pulling by layout. |
| `44e1f49`, `a288f2a` | Pinned FEXCore and documented and scripted the ARM64 build. |
| `52d074d` | Corrected the Metal presenter's sRGB conversion. |
| `188c68b` | Added an archive adapter for streaming game packages. |
| `5f07318` | Fixed GT7 startup on ARM64. |
| `efc1923` | Added GT7 mesh translation and descriptor tracing. Added support for compute cubemap sampling. |
| `48b42f6`, `bd29a0b` | Preserved guest compute LDS bounds and backed oversized workgroups with private GPU memory. |
| `0ccde5e` | Added `.pkg` and `.fpkg` import to the Prospero library, using the existing streaming archive adapter and a local `read-fpkg` helper. |
| `52fa466` | Applied guest component selectors to Metal storage-image writes and fixed sparse store masks. |

KyTx is based on KytyPS5, a fork of Kyty. The
[macOS ARM64 build guide](macos-arm64.md) identifies the fork's FEX dependency
and the referenced toolchain.

## What the World Map trace shows

- With `KYTY_LOG_UNBOUND=1`, a baseline GT7 run reported 26 unique non-null
image failures. They pointed at the same 1×1 cubemap. All four component
selectors request zero. The native Metal bindings now use a compatible
six-slice texture with the guest selectors, with no instances of those 26
failures in the repeated scene.
- The device reports 32,768 bytes of threadgroup memory. For GT7's first mesh
pipeline, staging three indices in one word reduced Metal's original
34,000-byte requirement without reducing the guest allocation. The native
compute path now runs two kernels with their full 65,536 bytes of LDS per
group. It can allocate up to 64 MiB for an oversized dispatch, and reports
allocation failures with the shader hash.
- The display pass with Metal function key `4f4e29ec510fee3b` reads an
HDR image containing the coastline and a nearly black landscape, then
samples a 3D color table before drawing the interface. The table's ABGR
descriptor exposed the alpha written into the physical alpha channel as red.
The corrected Metal store puts alpha in the physical red channel. The table
now reads as black at the origin and has independent RGB axes. In final map
captures, a sampled region went from 44,720 of 73,080 pixels with R ≥ 240 and
G/B ≤ 16 to zero. The dark HDR input still needs investigation.
- Capturing the same scene before and after `4aa7c29794420db2` shows the pink
sky and the mountain silhouette in its input at `0x920ec00000`, with most of
the terrain already black. Its output at `0x9223690000` (color attachment 1)
is darker still. `a6c1f1e9298a6dcd` then writes that same attachment. The trace
also shows both passes using the scene depth surface at `0x9210c10000`.
- With the fixes enabled, the output of `4aa7c29794420db2` shows the terrain and
trees before the last composition passes. Its 3D inputs at `0x923dba0000`,
`0x923fd60000`, `0x926ef76000` and `0x926f296000` trace back to compute writers
`1922aae815846978`, `d2a8505196a1078e` and `e297bb22e6dc4335`. The ordered
`[RtVolume]` readback found nonzero packed texels in all four images and
zero center texels in the two 240×135×128 images. Their expected PS5 values
remain unverified.
- The dispatch for `ed3ba044f1410a06` writes to a 128×128, six-layer descriptor
at `0x9296cd0000`, but the old storage allocation was a single 2D texture.
Several World Map pixel shaders sampled a six-face cube decoded from guest
backing at the same address. That copy had zero nonzero bytes. The experimental
GPU array path retains all six layers and the mip chain for the writer and
reuses the texture for compatible array and cube readers. It is enabled by
default for `PPSA01317`, `APP_VER=01.710.000`. `KYTY_METAL_GPU_ARRAYS=0`
disables it for comparison, `=1` enables it for other titles, and
`KYTY_GPU_ARRAY_ADDRESS=9296cd0000` isolates this image.
The two compute writers at `ed3ba044f1410a06` and `4269bcac84fccc8c` share
the same six-layer allocation in the GT7 trace.
An M4 test writes the sixth layer through a view of mip level 1 and verifies
the stored channels. In the World Map run, 92 sampled bindings of
`0x9296cd0000` reused the six-face GPU texture. Trees, roads and terrain became
visible. A fixed 4K terrain region went from 7,548 of 7,548 sampled pixels
with all channels ≤3 to 1,490 of 7,548. The sample covers 4–27% of image width
and 39–64% of image height at an eight-pixel stride. The game reached the map
with the default title profile as well. The scene still lacks the reference
brightness and menu text.
- Follow-up runs intermittently stalled in Metal before reaching the cubemap
writer. With `KYTY_MTL_SPLIT_OPS=1` and `KYTY_MTL_GPU_TIME=1`, two runs isolated
the stalled command buffer to `5b8c099adc368053`, one group of 512 Metal
threads serving a 1024-thread guest group with 64 KiB of device-backed LDS.
The generated shader includes a threadgroup barrier inside a wave-vote branch.
A separate M4 test with the same group dimensions and LDS size passes
cross-wave synchronization and workgroup isolation. An isolated source probe
replaced the branch predicate with its statically known value. GT7 still
stalled at the same dispatch. The original shader remains the default.
- `KYTY_TRACE_CS_WORD=5b8c099adc368053,0,288` records the four dwords beginning
with this shader's loop bound and correlates them with command completion.
With `KYTY_TRACE_CS_WORD_GPU=1`, a Metal blit queued before the dispatch also
captures the live input. In a failing run the CPU saw `8` at bind time and
the GPU read `0x80000514` from the same address. Successful dispatches often
completed in about 0.5–0.8 ms with the bound at `8`. The failure occurred
with a six-face texture bound. The PM4 and declared compute-buffer write traces
did not identify the writer of the changed word.
- The renderer now snapshots this shader's 368-byte read-only buffer into a
separate retained upload allocation. Sampled cubemaps use the matching
six-face texture or the guest cube layout if the newest writer has one layer.
In a World Map run with both changes enabled the traced shader completed
364 dispatches, with the bound preserved at `8` and six-face views bound.
That run still used the guest-backed cubemaps. Set
`KYTY_SNAPSHOT_GT7_LIGHT_CONSTANTS=0` or `KYTY_METAL_STRICT_CUBES=0` to isolate
the changes in a diagnostic run.
- The PS5 reference is a final frame. It identifies the matching shoreline and
shows which map elements are missing. Comparing intermediate outputs against
PS5 requires a capture of the same render target on that platform.

## Checks in the existing build directory

```sh
build=/path/to/existing/build/kytx
cmake --build "$build" --target resource_tracking_tests resource_materialization_tests \
scalar_provenance_tests shader_vertex_metadata_tests
ctest --test-dir "$build" --output-on-failure \
-R '^(resource_tracking|resource_materialization|scalar_provenance|shader_vertex_metadata)$'
bash tools/test_metal_msl.sh "$build"
```

The MSL tests include cubemap sampling, full and sparse storage-image writes,
packed D16 writes, local LDS counters, and a dispatch over eight groups that
verifies the final dword of an oversized LDS
allocation, synchronization across SIMD groups and isolation between
workgroups. Replay GT7 and inspect the terrain, water, buildings and menu
text independently to verify the World Map.

For a bounded render-target trace, set `KYTY_LOG_IMAGE_PRODUCER` to the guest
image address and `KYTY_DUMP_RT_MIN_FLIP` to the start of the 12-frame window.
`KYTY_DUMP_RT_DRAW=address,pixel_shader,0,1` dumps the target before the matching
draw and before the next draw to that target. Set `KYTY_DUMP_RT_DIR` to the
existing scratch directory for the capture. The draw trace reports the color
attachment index alongside its shader hash and write masks.

## M4 frame timing

Two World Map runs between guest flips 1525 and 1850 measured a median of 8 fps
(7.5 to 8.5 fps across 35 samples). The game still uses 3840×2160 targets in the
scene when Video Out advertises 1080p. In the run with `KYTY_MTL_GPU_TIME=1`,
completed command buffers above the trace threshold of 20 ms reached 65.8 ms
in this interval. This measurement covers a command buffer, which may contain
several passes and need not align with one frame. Set `KYTY_GPU_BUSY=1` to
measure the proportion of wall time occupied by completed Metal work.
With the same default title profile, the 60 Hz and 120 Hz virtual VBlank runs
both used 3840×2160 in the World Map. Over guest flips 1500–1599, the two runs
measured 8.4 and 8.5 fps, respectively, with six samples in each interval.

## World Map recheck with the Prospero video defaults

Launching GT7 1.71 from Prospero on the M4 initialized a 1920×1080 Metal
drawable and advertised the 1080p Video Out mode with a 60 Hz virtual refresh
rate. The game's presented texture remained 3840×2160. The coastline, roads,
tree silhouettes, and parts of a few buildings were visible. The sky and
backdrop were black, the bay remained too dark to distinguish from the terrain,
and the shoreline appeared as a wide pale band. Some header icons rendered,
while their labels and the pavilion labels were missing in the captures.

The navigation replay used `KYTY_AUTO_INPUT_FILE` for Options (`enter`) and
directional movement, and `KYTY_DUMP_TRIGGER` for the corresponding Metal
frames. Left and right input changed which panel was visible. The panels stayed
unlabeled, and Options did not produce a readable GT Menu. The available PS5
frame shows the expected scene and menu; it was used as a visual reference.
Loading