# ivall/xcl architecture

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

- Interactive diagram: https://gitdiagram.com/ivall/xcl
- Repository: https://github.com/ivall/xcl

## Overview

XCL runs unpacked Xbox Series X|S games on Windows: native x64 title code calls XCL’s console-API implementations, while console GPU programs are translated and run through PC D3D12. The graph follows that compatibility workflow and preserves the documented storage, runtime, graphics, media, and inspection capabilities. README statements support the broad product flow; source-index references and excerpts support selected internal links. Several runtime modules were not sampled, so their detailed call relationships are omitted rather than assumed.

Main entry points: [`crates/xcl/src/hle/d3d12x/real.rs`](https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/d3d12x/real.rs) (D3D12.X objects), [`crates/xcl/src/gpu/uma.rs`](https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/uma.rs) (Shared graphics memory), [`crates/xcl/src/launcher.rs`](https://github.com/ivall/xcl/blob/main/crates/xcl/src/launcher.rs) (Launcher and host), [`crates/xcl/src/hle/kernelx.rs`](https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/kernelx.rs) (Kernel compatibility)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Boot and loading"]
  node_launcher["Launcher and host<br/>[launcher.rs]"]
  node_loader["PE loader<br/>[loader.rs]"]
  node_resolver["Import resolver<br/>[resolver.rs]"]
  node_config["Boot configuration<br/>[config.rs]"]
  node_state["Runtime state<br/>[state.rs]"]
end

subgraph group_services["Console services"]
  node_kernel["Kernel compatibility<br/>[kernelx.rs]"]
  node_lazy["Lazy page mapping<br/>[lazy.rs]"]
  node_xgame["XGameRuntime<br/>[mod.rs]"]
  node_gameinput["GameInput<br/>[gameinput.rs]"]
  node_audio["Audio codecs<br/>[xaudio2.rs]"]
  node_vfs["Virtual filesystem<br/>[vfs.rs]"]
  node_storage["DirectStorage and BCPack<br/>[dstorage.rs]"]
end

subgraph group_graphics["GPU translation"]
  node_shadercapture["Shader capture<br/>[shader.rs]"]
  node_rdna["RDNA2 decoding<br/>[rdna2.rs]"]
  node_recompiler["Shader recompiler<br/>[mod.rs]"]
  node_emitter["HLSL emission<br/>[emit.rs]"]
  node_dxc["DXC compilation<br/>[dxc.rs]"]
  node_pso["Pipeline creation<br/>[pso.rs]"]
  node_runner["GPU execution<br/>[runner.rs]"]
  node_textures["Texture layout<br/>[texture.rs]"]
  node_tiling["Texture tiling<br/>[tiling_tables.rs]"]
  node_bvh["Ray tracing BVH<br/>[bvh.rs]"]
end

subgraph group_backend["D3D12 backend"]
  node_uma[("Shared graphics memory<br/>[uma.rs]")]
  node_d3dbridge["D3D12.X objects<br/>[real.rs]"]
  node_commands["Console command lists<br/>[list_x.rs]"]
  node_sparse["Sparse VRAM<br/>[sparse.rs]"]
  node_present["Presentation<br/>[present.rs]"]
  node_desc["GPU descriptors<br/>[desc.rs]"]
  node_fence["GPU synchronization<br/>[fence.rs]"]
end

subgraph group_tools["Media and tools"]
  node_video["Video decoding<br/>[opus.rs]"]
  node_cli["Inspection and shader tools<br/>[main.rs]"]
  node_shadercli["Shader analysis<br/>[shaders.rs]"]
end

node_owner(("Game owner"))

node_owner -->|"runs game"| node_launcher
node_launcher -.->|"loads title"| node_loader
node_loader -->|"routes imports"| node_resolver
node_resolver -->|"dispatches API"| node_kernel
node_loader -.->|"routes imports"| node_xgame
node_kernel -->|"maps pages"| node_lazy
node_kernel -->|"uses memory"| node_uma
node_xgame -->|"provides input"| node_gameinput
node_kernel -->|"uses paths"| node_vfs
node_owner -->|"requests assets"| node_storage
node_storage -->|"uses graphics memory"| node_uma
node_owner -->|"requests audio"| node_audio
node_owner -->|"calls console graphics"| node_d3dbridge
node_d3dbridge -->|"creates pipelines"| node_commands
node_commands -->|"uses sparse memory"| node_sparse
node_d3dbridge -->|"presents frames"| node_present
node_commands -->|"uses shared memory"| node_uma
node_d3dbridge -.->|"captures shaders"| node_shadercapture
node_shadercapture -->|"parses programs"| node_rdna
node_rdna -->|"decodes instructions"| node_recompiler
node_recompiler -->|"emits HLSL"| node_emitter
node_recompiler -->|"compiles shaders"| node_dxc
node_recompiler -->|"builds pipelines"| node_pso
node_runner -->|"creates compute PSO"| node_pso
node_runner -->|"synchronizes GPU"| node_fence
node_runner -->|"accesses memory"| node_uma
node_d3dbridge -.->|"uses descriptors"| node_desc
node_owner -->|"submits textures"| node_textures
node_textures -->|"decodes layout"| node_tiling
node_textures -->|"uploads textures"| node_uma
node_owner -->|"builds acceleration structures"| node_bvh
node_owner -->|"plays video"| node_video
node_owner -->|"runs tools"| node_cli
node_cli -.->|"analyzes shaders"| node_shadercli
node_launcher -.->|"reads settings"| node_config
node_launcher -.->|"sets runtime state"| node_state

click node_launcher "https://github.com/ivall/xcl/blob/main/crates/xcl/src/launcher.rs"
click node_loader "https://github.com/ivall/xcl/blob/main/crates/xcl/src/loader.rs"
click node_resolver "https://github.com/ivall/xcl/blob/main/crates/xcl/src/resolver.rs"
click node_kernel "https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/kernelx.rs"
click node_lazy "https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/kernelx/lazy.rs"
click node_xgame "https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/xgameruntime/mod.rs"
click node_gameinput "https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/gameinput.rs"
click node_audio "https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/xaudio2.rs"
click node_vfs "https://github.com/ivall/xcl/blob/main/crates/xcl/src/vfs.rs"
click node_storage "https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/dstorage.rs"
click node_uma "https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/uma.rs"
click node_d3dbridge "https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/d3d12x/real.rs"
click node_commands "https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/d3d12x/list_x.rs"
click node_sparse "https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/d3d12x/sparse.rs"
click node_present "https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/d3d12x/present.rs"
click node_shadercapture "https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/shader.rs"
click node_rdna "https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/rdna2.rs"
click node_recompiler "https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/recomp/mod.rs"
click node_emitter "https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/recomp/emit.rs"
click node_dxc "https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/recomp/dxc.rs"
click node_pso "https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/recomp/pso.rs"
click node_runner "https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/recomp/runner.rs"
click node_desc "https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/desc.rs"
click node_fence "https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/fence.rs"
click node_textures "https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/texture.rs"
click node_tiling "https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/tiling_tables.rs"
click node_bvh "https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/bvh.rs"
click node_video "https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/opus.rs"
click node_cli "https://github.com/ivall/xcl/blob/main/crates/xcl/src/main.rs"
click node_shadercli "https://github.com/ivall/xcl/blob/main/crates/xcl/src/shaders.rs"
click node_config "https://github.com/ivall/xcl/blob/main/crates/xcl/src/config.rs"
click node_state "https://github.com/ivall/xcl/blob/main/crates/xcl/src/state.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_loader,node_resolver,node_config,node_state toneBlue
class node_kernel,node_lazy,node_xgame,node_gameinput,node_audio,node_vfs,node_storage toneAmber
class node_shadercapture,node_rdna,node_recompiler,node_emitter,node_dxc,node_pso,node_runner,node_textures,node_tiling,node_bvh toneMint
class node_uma,node_d3dbridge,node_commands,node_sparse,node_present,node_desc,node_fence toneRose
class node_video,node_cli,node_shadercli,node_owner toneIndigo
```

## Components

### Boot and loading

- [Launcher and host](https://github.com/ivall/xcl/blob/main/crates/xcl/src/launcher.rs): `crates/xcl/src/launcher.rs`
- [PE loader](https://github.com/ivall/xcl/blob/main/crates/xcl/src/loader.rs): `crates/xcl/src/loader.rs`
- [Import resolver](https://github.com/ivall/xcl/blob/main/crates/xcl/src/resolver.rs): `crates/xcl/src/resolver.rs`
- [Boot configuration](https://github.com/ivall/xcl/blob/main/crates/xcl/src/config.rs): `crates/xcl/src/config.rs`
- [Runtime state](https://github.com/ivall/xcl/blob/main/crates/xcl/src/state.rs): `crates/xcl/src/state.rs`

### Console services

- [Kernel compatibility](https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/kernelx.rs): `crates/xcl/src/hle/kernelx.rs`
- [Lazy page mapping](https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/kernelx/lazy.rs): `crates/xcl/src/hle/kernelx/lazy.rs`
- [XGameRuntime](https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/xgameruntime/mod.rs): `crates/xcl/src/hle/xgameruntime/mod.rs`
- [GameInput](https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/gameinput.rs): `crates/xcl/src/hle/gameinput.rs`
- [Audio codecs](https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/xaudio2.rs): `crates/xcl/src/hle/xaudio2.rs`
- [Virtual filesystem](https://github.com/ivall/xcl/blob/main/crates/xcl/src/vfs.rs): `crates/xcl/src/vfs.rs`
- [DirectStorage and BCPack](https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/dstorage.rs): `crates/xcl/src/hle/dstorage.rs`

### GPU translation

- [Shader capture](https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/shader.rs): `crates/xcl/src/gpu/shader.rs`
- [RDNA2 decoding](https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/rdna2.rs): `crates/xcl/src/gpu/rdna2.rs`
- [Shader recompiler](https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/recomp/mod.rs): `crates/xcl/src/gpu/recomp/mod.rs`
- [HLSL emission](https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/recomp/emit.rs): `crates/xcl/src/gpu/recomp/emit.rs`
- [DXC compilation](https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/recomp/dxc.rs): `crates/xcl/src/gpu/recomp/dxc.rs`
- [Pipeline creation](https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/recomp/pso.rs): `crates/xcl/src/gpu/recomp/pso.rs`
- [GPU execution](https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/recomp/runner.rs): `crates/xcl/src/gpu/recomp/runner.rs`
- [Texture layout](https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/texture.rs): `crates/xcl/src/gpu/texture.rs`
- [Texture tiling](https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/tiling_tables.rs): `crates/xcl/src/gpu/tiling_tables.rs`
- [Ray tracing BVH](https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/bvh.rs): `crates/xcl/src/gpu/bvh.rs`

### D3D12 backend

- [Shared graphics memory](https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/uma.rs): `crates/xcl/src/gpu/uma.rs`
- [D3D12.X objects](https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/d3d12x/real.rs): `crates/xcl/src/hle/d3d12x/real.rs`
- [Console command lists](https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/d3d12x/list_x.rs): `crates/xcl/src/hle/d3d12x/list_x.rs`
- [Sparse VRAM](https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/d3d12x/sparse.rs): `crates/xcl/src/hle/d3d12x/sparse.rs`
- [Presentation](https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/d3d12x/present.rs): `crates/xcl/src/hle/d3d12x/present.rs`
- [GPU descriptors](https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/desc.rs): `crates/xcl/src/gpu/desc.rs`
- [GPU synchronization](https://github.com/ivall/xcl/blob/main/crates/xcl/src/gpu/fence.rs): `crates/xcl/src/gpu/fence.rs`

### Media and tools

- [Video decoding](https://github.com/ivall/xcl/blob/main/crates/xcl/src/hle/opus.rs): `crates/xcl/src/hle/opus.rs`
- [Inspection and shader tools](https://github.com/ivall/xcl/blob/main/crates/xcl/src/main.rs): `crates/xcl/src/main.rs`
- [Shader analysis](https://github.com/ivall/xcl/blob/main/crates/xcl/src/shaders.rs): `crates/xcl/src/shaders.rs`

### Other components

- **Game owner**

## Connections

- Game owner → Launcher and host: runs game
- Launcher and host → PE loader: loads title
- PE loader → Import resolver: routes imports
- Import resolver → Kernel compatibility: dispatches API (evidence: `crates/xcl/src/hle/kernelx.rs`)
- PE loader → XGameRuntime: routes imports
- Kernel compatibility → Lazy page mapping: maps pages (evidence: `crates/xcl/src/hle/kernelx.rs`)
- Kernel compatibility → Shared graphics memory: uses memory (evidence: `crates/xcl/src/hle/kernelx.rs`)
- XGameRuntime → GameInput: provides input (evidence: `crates/xcl/src/hle/xgameruntime/mod.rs`)
- Kernel compatibility → Virtual filesystem: uses paths (evidence: `crates/xcl/src/hle/kernelx.rs`)
- Game owner → DirectStorage and BCPack: requests assets
- DirectStorage and BCPack → Shared graphics memory: uses graphics memory (evidence: `crates/xcl/src/hle/dstorage.rs`)
- Game owner → Audio codecs: requests audio
- Game owner → D3D12.X objects: calls console graphics
- D3D12.X objects → Console command lists: creates pipelines (evidence: `crates/xcl/src/hle/d3d12x/real.rs`)
- Console command lists → Sparse VRAM: uses sparse memory (evidence: `crates/xcl/src/hle/d3d12x/list_x.rs`)
- D3D12.X objects → Presentation: presents frames (evidence: `crates/xcl/src/hle/d3d12x/real.rs`)
- Console command lists → Shared graphics memory: uses shared memory (evidence: `crates/xcl/src/hle/d3d12x/list_x.rs`)
- D3D12.X objects → Shader capture: captures shaders (evidence: `crates/xcl/src/hle/d3d12x/real.rs`)
- Shader capture → RDNA2 decoding: parses programs (evidence: `crates/xcl/src/gpu/shader.rs`)
- RDNA2 decoding → Shader recompiler: decodes instructions (evidence: `crates/xcl/src/gpu/recomp/mod.rs`)
- Shader recompiler → HLSL emission: emits HLSL (evidence: `crates/xcl/src/gpu/recomp/mod.rs`)
- Shader recompiler → DXC compilation: compiles shaders (evidence: `crates/xcl/src/gpu/recomp/mod.rs`)
- Shader recompiler → Pipeline creation: builds pipelines (evidence: `crates/xcl/src/gpu/recomp/mod.rs`)
- GPU execution → Pipeline creation: creates compute PSO (evidence: `crates/xcl/src/gpu/recomp/runner.rs`)
- GPU execution → GPU synchronization: synchronizes GPU (evidence: `crates/xcl/src/gpu/recomp/runner.rs`)
- GPU execution → Shared graphics memory: accesses memory (evidence: `crates/xcl/src/gpu/recomp/runner.rs`)
- D3D12.X objects → GPU descriptors: uses descriptors (evidence: `crates/xcl/src/hle/d3d12x/real.rs`)
- Game owner → Texture layout: submits textures
- Texture layout → Texture tiling: decodes layout (evidence: `crates/xcl/src/gpu/texture.rs`)
- Texture layout → Shared graphics memory: uploads textures (evidence: `crates/xcl/src/gpu/texture.rs`)
- Game owner → Ray tracing BVH: builds acceleration structures
- Game owner → Video decoding: plays video
- Game owner → Inspection and shader tools: runs tools
- Inspection and shader tools → Shader analysis: analyzes shaders
- Launcher and host → Boot configuration: reads settings
- Launcher and host → Runtime state: sets runtime state
