# projectleonida/mandy architecture

> Architecture diagram of the GitHub repository projectleonida/mandy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/projectleonida/mandy
- Repository: https://github.com/projectleonida/mandy

## Overview

Leonida Continued runs the Xbox Series version of GTA VI on Windows: it loads the title’s native code, reimplements console services, and translates graphics programs for a PC GPU. The principal workflow is to launch the user’s local game package, prepare shader translations and caches, then run and render the game through the D3D12 runtime. The repository also includes a launcher and gameplay tools. The graph reflects documented workflow and indexed source references; unsampled implementation details and unverified call links are omitted.

Main entry points: [`d3d12/apps/leonida/src/run.rs`](https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/run.rs) (Game run), [`d3d12/apps/leonida/src/main.rs`](https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/main.rs) (Runtime CLI), [`d3d12/crates/leonida-hle/src/modules/storage.rs`](https://github.com/projectleonida/mandy/blob/main/d3d12/crates/leonida-hle/src/modules/storage.rs) (Persistent storage), [`launcher/native/src/app.rs`](https://github.com/projectleonida/mandy/blob/main/launcher/native/src/app.rs) (Launcher window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Launch and tools"]
  node_launcher["Launcher window<br/>[app.rs]"]
  node_cli["Runtime CLI<br/>[main.rs]"]
  node_actions["Game actions<br/>[game_actions.rs]"]
end

subgraph group_title["Title execution"]
  node_native_scan["Native scan<br/>[native_scan.rs]"]
  node_player_control["Player control<br/>[player.rs]"]
  node_player_context["Player context<br/>[player_context.rs]"]
  node_player_find["Player finder<br/>[player_find.rs]"]
  node_run["Game run<br/>[run.rs]"]
end

subgraph group_services["Console services"]
  node_hle_runtime["Console runtime APIs<br/>[xgameruntime.rs]"]
  node_hle_files["Console file APIs<br/>[files.rs]"]
  node_hle_async["Async services<br/>[xasync.rs]"]
  node_hle_storage["Persistent storage<br/>[storage.rs]"]
  node_directstorage["DirectStorage shim<br/>[dstorage.cpp]"]
end

subgraph group_graphics["Graphics runtime"]
  node_pipeline["Pipeline states<br/>[pipeline.rs]"]
  node_draw["Draw handling<br/>[draw.rs]"]
  node_resource["GPU resources<br/>[resource.rs]"]
  node_hwrt["Hardware ray tracing<br/>[hwrt.rs]"]
end

subgraph group_translation["Shader translation"]
  node_shader["Shader translation<br/>[shader.rs]"]
end

node_player(("Player"))
node_package[("Local game package")]
node_gpu["D3D12 graphics card"]

node_player -->|"starts game"| node_launcher
node_launcher -->|"launches"| node_cli
node_player -->|"runs directly"| node_cli
node_package -->|"provides game files"| node_run
node_cli -->|"dispatches"| node_run
node_run -->|"uses"| node_player_control
node_run -->|"uses"| node_player_context
node_run -->|"uses"| node_player_find
node_actions -->|"uses"| node_player_control
node_cli -->|"dispatches"| node_shader
node_shader -->|"translates shaders for"| node_pipeline
node_pipeline -->|"creates host pipelines"| node_gpu
node_draw -.->|"submits rendering"| node_gpu
node_resource -.->|"manages GPU resources"| node_gpu
node_hwrt -.->|"uses ray tracing"| node_gpu
node_run -.->|"uses console services"| node_hle_runtime
node_hle_runtime -.->|"exposes file services"| node_hle_files
node_hle_storage -->|"maps title storage"| node_hle_files
node_hle_storage -->|"completes operations"| node_hle_async
node_directstorage -->|"reads title files"| node_package

click node_launcher "https://github.com/projectleonida/mandy/blob/main/launcher/native/src/app.rs"
click node_cli "https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/main.rs"
click node_actions "https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/game_actions.rs"
click node_native_scan "https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/native_scan.rs"
click node_player_control "https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/player.rs"
click node_player_context "https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/player_context.rs"
click node_player_find "https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/player_find.rs"
click node_run "https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/run.rs"
click node_hle_runtime "https://github.com/projectleonida/mandy/blob/main/d3d12/crates/leonida-hle/src/modules/xgameruntime.rs"
click node_hle_files "https://github.com/projectleonida/mandy/blob/main/d3d12/crates/leonida-hle/src/modules/files.rs"
click node_hle_async "https://github.com/projectleonida/mandy/blob/main/d3d12/crates/leonida-hle/src/modules/xasync.rs"
click node_hle_storage "https://github.com/projectleonida/mandy/blob/main/d3d12/crates/leonida-hle/src/modules/storage.rs"
click node_directstorage "https://github.com/projectleonida/mandy/blob/main/runtime/shims/dstorage.cpp"
click node_shader "https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/shader.rs"
click node_pipeline "https://github.com/projectleonida/mandy/blob/main/d3d12/crates/leonida-gpu/src/pipeline.rs"
click node_draw "https://github.com/projectleonida/mandy/blob/main/d3d12/crates/leonida-gpu/src/draw.rs"
click node_resource "https://github.com/projectleonida/mandy/blob/main/d3d12/crates/leonida-gpu/src/resource.rs"
click node_hwrt "https://github.com/projectleonida/mandy/blob/main/d3d12/crates/leonida-gpu/src/hwrt.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_launcher,node_cli,node_actions toneBlue
class node_native_scan,node_player_control,node_player_context,node_player_find,node_run,node_package toneAmber
class node_hle_runtime,node_hle_files,node_hle_async,node_hle_storage,node_directstorage toneMint
class node_pipeline,node_draw,node_resource,node_hwrt toneRose
class node_shader,node_player,node_gpu toneIndigo
```

## Components

### Launch and tools

- [Launcher window](https://github.com/projectleonida/mandy/blob/main/launcher/native/src/app.rs): `launcher/native/src/app.rs`
- [Runtime CLI](https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/main.rs): `d3d12/apps/leonida/src/main.rs`
- [Game actions](https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/game_actions.rs): `d3d12/apps/leonida/src/game_actions.rs`

### Title execution

- [Native scan](https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/native_scan.rs): `d3d12/apps/leonida/src/native_scan.rs`
- [Player control](https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/player.rs): `d3d12/apps/leonida/src/player.rs`
- [Player context](https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/player_context.rs): `d3d12/apps/leonida/src/player_context.rs`
- [Player finder](https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/player_find.rs): `d3d12/apps/leonida/src/player_find.rs`
- [Game run](https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/run.rs): `d3d12/apps/leonida/src/run.rs`

### Console services

- [Console runtime APIs](https://github.com/projectleonida/mandy/blob/main/d3d12/crates/leonida-hle/src/modules/xgameruntime.rs): `d3d12/crates/leonida-hle/src/modules/xgameruntime.rs`
- [Console file APIs](https://github.com/projectleonida/mandy/blob/main/d3d12/crates/leonida-hle/src/modules/files.rs): `d3d12/crates/leonida-hle/src/modules/files.rs`
- [Async services](https://github.com/projectleonida/mandy/blob/main/d3d12/crates/leonida-hle/src/modules/xasync.rs): `d3d12/crates/leonida-hle/src/modules/xasync.rs`
- [Persistent storage](https://github.com/projectleonida/mandy/blob/main/d3d12/crates/leonida-hle/src/modules/storage.rs): `d3d12/crates/leonida-hle/src/modules/storage.rs`
- [DirectStorage shim](https://github.com/projectleonida/mandy/blob/main/runtime/shims/dstorage.cpp): `runtime/shims/dstorage.cpp`

### Graphics runtime

- [Pipeline states](https://github.com/projectleonida/mandy/blob/main/d3d12/crates/leonida-gpu/src/pipeline.rs): `d3d12/crates/leonida-gpu/src/pipeline.rs`
- [Draw handling](https://github.com/projectleonida/mandy/blob/main/d3d12/crates/leonida-gpu/src/draw.rs): `d3d12/crates/leonida-gpu/src/draw.rs`
- [GPU resources](https://github.com/projectleonida/mandy/blob/main/d3d12/crates/leonida-gpu/src/resource.rs): `d3d12/crates/leonida-gpu/src/resource.rs`
- [Hardware ray tracing](https://github.com/projectleonida/mandy/blob/main/d3d12/crates/leonida-gpu/src/hwrt.rs): `d3d12/crates/leonida-gpu/src/hwrt.rs`

### Shader translation

- [Shader translation](https://github.com/projectleonida/mandy/blob/main/d3d12/apps/leonida/src/shader.rs): `d3d12/apps/leonida/src/shader.rs`

### Other components

- **Player**
- **Local game package**
- **D3D12 graphics card**

## Connections

- Player → Launcher window: starts game
- Launcher window → Runtime CLI: launches
- Player → Runtime CLI: runs directly
- Local game package → Game run: provides game files
- Runtime CLI → Game run: dispatches (evidence: `d3d12/apps/leonida/src/main.rs`)
- Game run → Player control: uses (evidence: `d3d12/apps/leonida/src/run.rs`)
- Game run → Player context: uses (evidence: `d3d12/apps/leonida/src/run.rs`)
- Game run → Player finder: uses (evidence: `d3d12/apps/leonida/src/run.rs`)
- Game actions → Player control: uses (evidence: `d3d12/apps/leonida/src/game_actions.rs`)
- Runtime CLI → Shader translation: dispatches (evidence: `d3d12/apps/leonida/src/main.rs`)
- Shader translation → Pipeline states: translates shaders for
- Pipeline states → D3D12 graphics card: creates host pipelines (evidence: `d3d12/crates/leonida-gpu/src/pipeline.rs`)
- Draw handling → D3D12 graphics card: submits rendering
- GPU resources → D3D12 graphics card: manages GPU resources
- Hardware ray tracing → D3D12 graphics card: uses ray tracing
- Game run → Console runtime APIs: uses console services
- Console runtime APIs → Console file APIs: exposes file services
- Persistent storage → Console file APIs: maps title storage (evidence: `d3d12/crates/leonida-hle/src/modules/storage.rs`)
- Persistent storage → Async services: completes operations (evidence: `d3d12/crates/leonida-hle/src/modules/storage.rs`)
- DirectStorage shim → Local game package: reads title files (evidence: `runtime/shims/dstorage.cpp`)
