# lobomfz/victory-xmem architecture

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

- Interactive diagram: https://gitdiagram.com/lobomfz/victory-xmem
- Repository: https://github.com/lobomfz/victory-xmem

## Overview

VIctory is a Linux-oriented compatibility runtime for running a user-supplied console game dump on AMD hardware, with translated shaders and title memory mapped for GPU use. The documented workflow prepares shader pipelines from the dump before opening the game; runtime responsibilities span console APIs, loading, shader translation, and GPU execution. The graph preserves major documented capabilities, but source excerpts are incomplete, so internal links are limited to relationships supported by the README or indexed source references.

Main entry points: [`crates/victory-gpu/src/draw.rs`](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-gpu/src/draw.rs) (Draw and dispatch), [`crates/victory-gpu/src/resource.rs`](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-gpu/src/resource.rs) (GPU resources), [`apps/victory/src/run.rs`](https://github.com/lobomfz/victory-xmem/blob/main/apps/victory/src/run.rs) (Run and launch), [`crates/victory-shader/src/ir.rs`](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-shader/src/ir.rs) (Shader IR)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_front["Frontend and setup"]
  node_cli["VIctory CLI<br/>[main.rs]"]
  node_run["Run and launch<br/>[run.rs]"]
  node_warm["Pipeline warming<br/>[warm.rs]"]
  node_config["Runtime config<br/>[config.rs]"]
end

subgraph group_compat["Title compatibility"]
  node_pe["PE image loading<br/>[image.rs]"]
  node_loader["Title loader<br/>[prepare.rs]"]
  node_hle["Console API emulation<br/>[lib.rs]"]
  node_xgame["Game runtime APIs<br/>[xgameruntime.rs]"]
  node_storage["Title storage<br/>[storage.rs]"]
end

subgraph group_gpu["GPU runtime"]
  node_gpuobj["GPU objects<br/>[object.rs]"]
  node_resources["GPU resources<br/>[resource.rs]"]
  node_descriptors["Host descriptors<br/>[host.rs]"]
  node_pipelines["GPU pipelines<br/>[pipeline.rs]"]
  node_draw["Draw and dispatch<br/>[draw.rs]"]
  node_frames["Frame pacing<br/>[frame.rs]"]
  node_capture["Capture and replay<br/>[capture.rs]"]
end

subgraph group_shader["Shader translation"]
  node_isa["GFX10 decoding<br/>[mod.rs]"]
  node_ir["Shader IR<br/>[ir.rs]"]
  node_shaderresources["Shader resource analysis<br/>[resource.rs]"]
  node_emit["DXIL emission<br/>[mod.rs]"]
end

subgraph group_assets["Formats and cache"]
  node_formats["Texture formats<br/>[texture.rs]"]
  node_sgd["SGD5 game data<br/>[sgd5.rs]"]
  node_cache[("Pipeline cache<br/>[cache.rs]")]
end

node_user(("Game owner"))
node_hostgpu["AMD GPU and host stack"]

node_user -->|"runs commands"| node_cli
node_user -->|"supplies game dump"| node_run
node_run -->|"prepares pipelines"| node_warm
node_warm -->|"warms shader cache"| node_cache
node_run -->|"launches game"| node_hostgpu
node_hostgpu -->|"maps title memory"| node_resources
node_isa -->|"decodes instructions"| node_ir
node_ir -->|"analyzes resources"| node_shaderresources
node_ir -->|"emits DXIL"| node_emit
node_pipelines -->|"translates shaders"| node_emit
node_pipelines -.->|"uses shader cache"| node_cache
node_draw -->|"uses host pipeline"| node_pipelines
node_draw -->|"reads descriptors"| node_descriptors
node_draw -->|"reads resources"| node_resources
node_frames -->|"paces frames"| node_draw
node_capture -->|"captures resources"| node_resources
node_hle -->|"registers interfaces"| node_xgame
node_storage -->|"implements storage API"| node_xgame
node_formats -.->|"supports game assets"| node_sgd
node_pe -->|"provides image layout"| node_loader
node_gpuobj -->|"backs GPU resources"| node_resources
node_hostgpu -.->|"executes rendering"| node_draw

click node_cli "https://github.com/lobomfz/victory-xmem/blob/main/apps/victory/src/main.rs"
click node_run "https://github.com/lobomfz/victory-xmem/blob/main/apps/victory/src/run.rs"
click node_warm "https://github.com/lobomfz/victory-xmem/blob/main/apps/victory/src/warm.rs"
click node_config "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-core/src/config.rs"
click node_pe "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-pe/src/image.rs"
click node_loader "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-loader/src/prepare.rs"
click node_hle "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-hle/src/lib.rs"
click node_xgame "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-hle/src/modules/xgameruntime.rs"
click node_storage "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-hle/src/modules/storage.rs"
click node_gpuobj "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-gpu/src/object.rs"
click node_resources "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-gpu/src/resource.rs"
click node_descriptors "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-gpu/src/descriptor/host.rs"
click node_pipelines "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-gpu/src/pipeline.rs"
click node_draw "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-gpu/src/draw.rs"
click node_frames "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-gpu/src/frame.rs"
click node_capture "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-gpu/src/capture.rs"
click node_isa "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-shader/src/gfx10/mod.rs"
click node_ir "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-shader/src/ir.rs"
click node_shaderresources "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-shader/src/resource.rs"
click node_emit "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-shader/src/emit/mod.rs"
click node_formats "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-formats/src/texture.rs"
click node_sgd "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-game/src/sgd5.rs"
click node_cache "https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-pipeline/src/cache.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_cli,node_run,node_warm,node_config toneBlue
class node_pe,node_loader,node_hle,node_xgame,node_storage toneAmber
class node_gpuobj,node_resources,node_descriptors,node_pipelines,node_draw,node_frames,node_capture toneMint
class node_isa,node_ir,node_shaderresources,node_emit toneRose
class node_formats,node_sgd,node_cache,node_user,node_hostgpu toneIndigo
```

## Components

### Frontend and setup

- [VIctory CLI](https://github.com/lobomfz/victory-xmem/blob/main/apps/victory/src/main.rs): `apps/victory/src/main.rs`
- [Run and launch](https://github.com/lobomfz/victory-xmem/blob/main/apps/victory/src/run.rs): `apps/victory/src/run.rs`
- [Pipeline warming](https://github.com/lobomfz/victory-xmem/blob/main/apps/victory/src/warm.rs): `apps/victory/src/warm.rs`
- [Runtime config](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-core/src/config.rs): `crates/victory-core/src/config.rs`

### Title compatibility

- [PE image loading](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-pe/src/image.rs): `crates/victory-pe/src/image.rs`
- [Title loader](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-loader/src/prepare.rs): `crates/victory-loader/src/prepare.rs`
- [Console API emulation](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-hle/src/lib.rs): `crates/victory-hle/src/lib.rs`
- [Game runtime APIs](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-hle/src/modules/xgameruntime.rs): `crates/victory-hle/src/modules/xgameruntime.rs`
- [Title storage](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-hle/src/modules/storage.rs): `crates/victory-hle/src/modules/storage.rs`

### GPU runtime

- [GPU objects](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-gpu/src/object.rs): `crates/victory-gpu/src/object.rs`
- [GPU resources](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-gpu/src/resource.rs): `crates/victory-gpu/src/resource.rs`
- [Host descriptors](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-gpu/src/descriptor/host.rs): `crates/victory-gpu/src/descriptor/host.rs`
- [GPU pipelines](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-gpu/src/pipeline.rs): `crates/victory-gpu/src/pipeline.rs`
- [Draw and dispatch](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-gpu/src/draw.rs): `crates/victory-gpu/src/draw.rs`
- [Frame pacing](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-gpu/src/frame.rs): `crates/victory-gpu/src/frame.rs`
- [Capture and replay](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-gpu/src/capture.rs): `crates/victory-gpu/src/capture.rs`

### Shader translation

- [GFX10 decoding](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-shader/src/gfx10/mod.rs): `crates/victory-shader/src/gfx10/mod.rs`
- [Shader IR](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-shader/src/ir.rs): `crates/victory-shader/src/ir.rs`
- [Shader resource analysis](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-shader/src/resource.rs): `crates/victory-shader/src/resource.rs`
- [DXIL emission](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-shader/src/emit/mod.rs): `crates/victory-shader/src/emit/mod.rs`

### Formats and cache

- [Texture formats](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-formats/src/texture.rs): `crates/victory-formats/src/texture.rs`
- [SGD5 game data](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-game/src/sgd5.rs): `crates/victory-game/src/sgd5.rs`
- [Pipeline cache](https://github.com/lobomfz/victory-xmem/blob/main/crates/victory-pipeline/src/cache.rs): `crates/victory-pipeline/src/cache.rs`

### Other components

- **Game owner**
- **AMD GPU and host stack**

## Connections

- Game owner → VIctory CLI: runs commands (evidence: `README.md`)
- Game owner → Run and launch: supplies game dump (evidence: `README.md`)
- Run and launch → Pipeline warming: prepares pipelines (evidence: `README.md`)
- Pipeline warming → Pipeline cache: warms shader cache
- Run and launch → AMD GPU and host stack: launches game (evidence: `README.md`)
- AMD GPU and host stack → GPU resources: maps title memory (evidence: `README.md`)
- GFX10 decoding → Shader IR: decodes instructions (evidence: `crates/victory-shader/src/ir.rs`)
- Shader IR → Shader 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`)
- GPU pipelines → DXIL emission: translates shaders (evidence: `crates/victory-gpu/src/pipeline.rs`)
- GPU pipelines → Pipeline cache: uses shader cache
- Draw and dispatch → GPU pipelines: uses host pipeline (evidence: `crates/victory-gpu/src/draw.rs`)
- Draw and dispatch → Host descriptors: reads descriptors (evidence: `crates/victory-gpu/src/draw.rs`)
- Draw and dispatch → GPU resources: reads resources (evidence: `crates/victory-gpu/src/draw.rs`)
- Frame pacing → Draw and dispatch: paces frames (evidence: `crates/victory-gpu/src/frame.rs`)
- Capture and replay → GPU resources: captures resources (evidence: `crates/victory-gpu/src/capture.rs`)
- Console API emulation → Game runtime APIs: registers interfaces (evidence: `crates/victory-hle/src/lib.rs`)
- Title storage → Game runtime APIs: implements storage API (evidence: `crates/victory-hle/src/modules/storage.rs`)
- Texture formats → SGD5 game data: supports game assets
- PE image loading → Title loader: provides image layout (evidence: `crates/victory-pe/src/image.rs`)
- GPU objects → GPU resources: backs GPU resources (evidence: `crates/victory-gpu/src/resource.rs`)
- AMD GPU and host stack → Draw and dispatch: executes rendering
