# errusso/vicetux architecture

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

- Interactive diagram: https://gitdiagram.com/errusso/vicetux
- Repository: https://github.com/errusso/vicetux

## Overview

ViceTux is a Linux/Proton compatibility layer for running an Xbox Series game dump. The principal workflow is to launch the title, load its console executable, answer its system calls, and translate its GPU work into host D3D12 for vkd3d-proton to carry to Vulkan. Separate launcher commands inspect and translate shaders or warm pipelines. The graph preserves the major documented subsystems; several implementation links are omitted because their source was not sampled.

Main entry points: [`apps/victory/src/run.rs`](https://github.com/errusso/vicetux/blob/main/apps/victory/src/run.rs) (Game runner), [`apps/victory/src/translate.rs`](https://github.com/errusso/vicetux/blob/main/apps/victory/src/translate.rs) (Shader commands), [`crates/victory-gpu/src/draw.rs`](https://github.com/errusso/vicetux/blob/main/crates/victory-gpu/src/draw.rs) (Draw submission), [`apps/victory/src/main.rs`](https://github.com/errusso/vicetux/blob/main/apps/victory/src/main.rs) (CLI commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Launcher and loading"]
  node_launcher["CLI commands<br/>[main.rs]"]
  node_run["Game runner<br/>[run.rs]"]
  node_loader["Executable loader"]
  node_pe["PE image handling<br/>[image.rs]"]
end

subgraph group_compat["Console compatibility"]
  node_hle["System-call runtime<br/>[runtime.rs]"]
  node_hle_apis["Console API modules"]
  node_save_storage["Save storage<br/>[storage.rs]"]
end

subgraph group_graphics["Graphics translation"]
  node_gpu_layer["D3D12 compatibility"]
  node_draws["Draw submission<br/>[draw.rs]"]
  node_resources["GPU resources<br/>[resource.rs]"]
  node_descriptors["Host descriptors<br/>[host.rs]"]
  node_buffer_copies["Buffer shadows<br/>[shadow.rs]"]
  node_pipeline_cache[("Pipeline cache<br/>[cache.rs]")]
end

subgraph group_shader["Shader translation"]
  node_shader_cli["Shader commands<br/>[translate.rs]"]
  node_shader_scan["Shader scanning<br/>[scan.rs]"]
  node_shader_isa["GFX10 decoder<br/>[mod.rs]"]
  node_shader_ir["Shader IR<br/>[ir.rs]"]
  node_shader_resources["Resource analysis<br/>[resource.rs]"]
  node_shader_emit["DXIL emission<br/>[mod.rs]"]
end

subgraph group_formats["Game data"]
  node_game_formats["Game formats"]
  node_game_metadata["Game metadata<br/>[sgd5.rs]"]
end

node_player(("Player"))
node_game_dump[("Game dump")]
node_proton["Proton / vkd3d"]

node_player -->|"starts"| node_launcher
node_launcher -->|"dispatches"| node_run
node_run -->|"loads files"| node_game_dump
node_run -.->|"loads executable"| node_loader
node_loader -.->|"reads image"| node_pe
node_run -.->|"runs title"| node_hle
node_hle -->|"serves calls"| node_hle_apis
node_hle_apis -->|"provides saves"| node_save_storage
node_hle_apis -.->|"reads game data"| node_game_dump
node_run -->|"translates GPU work"| node_gpu_layer
node_gpu_layer -->|"submits D3D12"| node_proton
node_draws -->|"uses heaps"| node_descriptors
node_draws -->|"refreshes buffers"| node_buffer_copies
node_draws -->|"uses resources"| node_resources
node_gpu_layer -->|"caches pipelines"| node_pipeline_cache
node_launcher -->|"dispatches"| node_shader_cli
node_shader_cli -.->|"finds shaders"| node_shader_scan
node_shader_cli -.->|"translates shaders"| node_shader_isa
node_shader_isa -->|"decodes instructions"| node_shader_ir
node_shader_ir -->|"analyzes resources"| node_shader_resources
node_shader_ir -->|"emits DXIL"| node_shader_emit
node_shader_cli -->|"warms pipelines"| node_pipeline_cache
node_game_dump -.->|"contains assets"| node_game_formats
node_game_dump -.->|"contains metadata"| node_game_metadata

click node_launcher "https://github.com/errusso/vicetux/blob/main/apps/victory/src/main.rs"
click node_run "https://github.com/errusso/vicetux/blob/main/apps/victory/src/run.rs"
click node_loader "https://github.com/errusso/vicetux/tree/main/crates/victory-loader/src"
click node_pe "https://github.com/errusso/vicetux/blob/main/crates/victory-pe/src/image.rs"
click node_hle "https://github.com/errusso/vicetux/blob/main/crates/victory-hle/src/runtime.rs"
click node_hle_apis "https://github.com/errusso/vicetux/tree/main/crates/victory-hle/src/modules"
click node_save_storage "https://github.com/errusso/vicetux/blob/main/crates/victory-hle/src/modules/storage.rs"
click node_game_formats "https://github.com/errusso/vicetux/tree/main/crates/victory-formats/src"
click node_game_metadata "https://github.com/errusso/vicetux/blob/main/crates/victory-game/src/sgd5.rs"
click node_gpu_layer "https://github.com/errusso/vicetux/tree/main/crates/victory-gpu/src"
click node_draws "https://github.com/errusso/vicetux/blob/main/crates/victory-gpu/src/draw.rs"
click node_resources "https://github.com/errusso/vicetux/blob/main/crates/victory-gpu/src/resource.rs"
click node_descriptors "https://github.com/errusso/vicetux/blob/main/crates/victory-gpu/src/descriptor/host.rs"
click node_buffer_copies "https://github.com/errusso/vicetux/blob/main/crates/victory-gpu/src/shadow.rs"
click node_pipeline_cache "https://github.com/errusso/vicetux/blob/main/crates/victory-pipeline/src/cache.rs"
click node_shader_cli "https://github.com/errusso/vicetux/blob/main/apps/victory/src/translate.rs"
click node_shader_scan "https://github.com/errusso/vicetux/blob/main/apps/victory/src/shader/scan.rs"
click node_shader_isa "https://github.com/errusso/vicetux/blob/main/crates/victory-shader/src/gfx10/mod.rs"
click node_shader_ir "https://github.com/errusso/vicetux/blob/main/crates/victory-shader/src/ir.rs"
click node_shader_resources "https://github.com/errusso/vicetux/blob/main/crates/victory-shader/src/resource.rs"
click node_shader_emit "https://github.com/errusso/vicetux/blob/main/crates/victory-shader/src/emit/mod.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_run,node_loader,node_pe toneBlue
class node_hle,node_hle_apis,node_save_storage,node_game_dump toneAmber
class node_gpu_layer,node_draws,node_resources,node_descriptors,node_buffer_copies,node_pipeline_cache toneMint
class node_shader_cli,node_shader_scan,node_shader_isa,node_shader_ir,node_shader_resources,node_shader_emit toneRose
class node_game_formats,node_game_metadata,node_player,node_proton toneIndigo
```

## Components

### Launcher and loading

- [CLI commands](https://github.com/errusso/vicetux/blob/main/apps/victory/src/main.rs): `apps/victory/src/main.rs`
- [Game runner](https://github.com/errusso/vicetux/blob/main/apps/victory/src/run.rs): `apps/victory/src/run.rs`
- [Executable loader](https://github.com/errusso/vicetux/tree/main/crates/victory-loader/src): `crates/victory-loader/src`
- [PE image handling](https://github.com/errusso/vicetux/blob/main/crates/victory-pe/src/image.rs): `crates/victory-pe/src/image.rs`

### Console compatibility

- [System-call runtime](https://github.com/errusso/vicetux/blob/main/crates/victory-hle/src/runtime.rs): `crates/victory-hle/src/runtime.rs`
- [Console API modules](https://github.com/errusso/vicetux/tree/main/crates/victory-hle/src/modules): `crates/victory-hle/src/modules`
- [Save storage](https://github.com/errusso/vicetux/blob/main/crates/victory-hle/src/modules/storage.rs): `crates/victory-hle/src/modules/storage.rs`

### Graphics translation

- [D3D12 compatibility](https://github.com/errusso/vicetux/tree/main/crates/victory-gpu/src): `crates/victory-gpu/src`
- [Draw submission](https://github.com/errusso/vicetux/blob/main/crates/victory-gpu/src/draw.rs): `crates/victory-gpu/src/draw.rs`
- [GPU resources](https://github.com/errusso/vicetux/blob/main/crates/victory-gpu/src/resource.rs): `crates/victory-gpu/src/resource.rs`
- [Host descriptors](https://github.com/errusso/vicetux/blob/main/crates/victory-gpu/src/descriptor/host.rs): `crates/victory-gpu/src/descriptor/host.rs`
- [Buffer shadows](https://github.com/errusso/vicetux/blob/main/crates/victory-gpu/src/shadow.rs): `crates/victory-gpu/src/shadow.rs`
- [Pipeline cache](https://github.com/errusso/vicetux/blob/main/crates/victory-pipeline/src/cache.rs): `crates/victory-pipeline/src/cache.rs`

### Shader translation

- [Shader commands](https://github.com/errusso/vicetux/blob/main/apps/victory/src/translate.rs): `apps/victory/src/translate.rs`
- [Shader scanning](https://github.com/errusso/vicetux/blob/main/apps/victory/src/shader/scan.rs): `apps/victory/src/shader/scan.rs`
- [GFX10 decoder](https://github.com/errusso/vicetux/blob/main/crates/victory-shader/src/gfx10/mod.rs): `crates/victory-shader/src/gfx10/mod.rs`
- [Shader IR](https://github.com/errusso/vicetux/blob/main/crates/victory-shader/src/ir.rs): `crates/victory-shader/src/ir.rs`
- [Resource analysis](https://github.com/errusso/vicetux/blob/main/crates/victory-shader/src/resource.rs): `crates/victory-shader/src/resource.rs`
- [DXIL emission](https://github.com/errusso/vicetux/blob/main/crates/victory-shader/src/emit/mod.rs): `crates/victory-shader/src/emit/mod.rs`

### Game data

- [Game formats](https://github.com/errusso/vicetux/tree/main/crates/victory-formats/src): `crates/victory-formats/src`
- [Game metadata](https://github.com/errusso/vicetux/blob/main/crates/victory-game/src/sgd5.rs): `crates/victory-game/src/sgd5.rs`

### Other components

- **Player**
- **Game dump**
- **Proton / vkd3d**

## Connections

- Player → CLI commands: starts (evidence: `README.md`)
- CLI commands → Game runner: dispatches (evidence: `apps/victory/src/main.rs`)
- Game runner → Game dump: loads files (evidence: `README.md`)
- Game runner → Executable loader: loads executable
- Executable loader → PE image handling: reads image
- Game runner → System-call runtime: runs title
- System-call runtime → Console API modules: serves calls (evidence: `crates/victory-hle/src/lib.rs`)
- Console API modules → Save storage: provides saves (evidence: `crates/victory-hle/src/modules/storage.rs`)
- Console API modules → Game dump: reads game data
- Game runner → D3D12 compatibility: translates GPU work (evidence: `README.md`)
- D3D12 compatibility → Proton / vkd3d: submits D3D12 (evidence: `README.md`)
- Draw submission → Host descriptors: uses heaps (evidence: `crates/victory-gpu/src/draw.rs`)
- Draw submission → Buffer shadows: refreshes buffers (evidence: `crates/victory-gpu/src/draw.rs`)
- Draw submission → GPU resources: uses resources (evidence: `crates/victory-gpu/src/draw.rs`)
- D3D12 compatibility → Pipeline cache: caches pipelines (evidence: `README.md`)
- CLI commands → Shader commands: dispatches (evidence: `apps/victory/src/main.rs`)
- Shader commands → Shader scanning: finds shaders (evidence: `apps/victory/src/translate.rs`)
- Shader commands → GFX10 decoder: translates shaders
- GFX10 decoder → Shader IR: decodes instructions (evidence: `crates/victory-shader/src/ir.rs`)
- Shader IR → Resource analysis: analyzes resources (evidence: `crates/victory-shader/src/resource.rs`)
- Shader IR → DXIL emission: emits DXIL (evidence: `crates/victory-shader/src/emit/mod.rs`)
- Shader commands → Pipeline cache: warms pipelines (evidence: `README.md`)
- Game dump → Game formats: contains assets
- Game dump → Game metadata: contains metadata
