# marvisak/victory architecture

> Architecture diagram of the GitHub repository marvisak/victory, 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/marvisak/victory
- Repository: https://github.com/marvisak/victory

## Overview

VIctory runs user-supplied Xbox Series X|S game files as a native Windows process, implementing console services and translating console GPU work to host D3D12. The main workflow is to launch the title, satisfy its runtime and file requests, and execute its rendering through shader translation and GPU submission. The graph also preserves documented formats, persistence, and shader-cache capabilities. Some subsystem links are documented only in the README; unsampled implementation details are not inferred.

Main entry points: [`crates/victory-gpu/src/host.rs`](https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/host.rs) (Host D3D12), [`apps/victory/src/main.rs`](https://github.com/marvisak/victory/blob/main/apps/victory/src/main.rs) (CLI commands), [`crates/victory-hle/src/modules/dstorage.rs`](https://github.com/marvisak/victory/blob/main/crates/victory-hle/src/modules/dstorage.rs) (DirectStorage), [`crates/victory-loader/src/windows.rs`](https://github.com/marvisak/victory/blob/main/crates/victory-loader/src/windows.rs) (Windows loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Command and loading"]
  node_cli["CLI commands<br/>[main.rs]"]
  node_pe["PE image parser<br/>[image.rs]"]
  node_loader["Windows loader<br/>[windows.rs]"]
  node_title["Title process"]
end

subgraph group_services["Console runtime services"]
  node_hle["HLE runtime<br/>[runtime.rs]"]
  node_gameapi["Game runtime APIs<br/>[xgameruntime.rs]"]
  node_files["Title file services<br/>[files.rs]"]
  node_async["Async requests<br/>[xasync.rs]"]
  node_dstorage["DirectStorage<br/>[dstorage.rs]"]
end

subgraph group_translation["Shader translation"]
  node_shadercmd["Shader commands<br/>[shader.rs]"]
  node_gfx10["GFX10 decoder<br/>[mod.rs]"]
  node_ir["Shader IR<br/>[ir.rs]"]
  node_lower["DXIL lowering<br/>[lower.rs]"]
end

subgraph group_gpu["GPU execution"]
  node_device["GPU device<br/>[device.rs]"]
  node_host["Host D3D12<br/>[host.rs]"]
  node_frame["Frame presentation<br/>[frame.rs]"]
  node_list["Command lists<br/>[list.rs]"]
  node_queue["GPU queue<br/>[queue.rs]"]
  node_resource["GPU resources<br/>[resource.rs]"]
  node_shadow["Resource shadows<br/>[shadow.rs]"]
  node_texture["Texture handling<br/>[texture.rs]"]
  node_object["GPU objects<br/>[object.rs]"]
  node_library["Pipeline library<br/>[library.rs]"]
end

subgraph group_data["Formats and caches"]
  node_formats["BCPack decoding<br/>[bcpack.rs]"]
  node_pipelinecache[("Pipeline cache<br/>[cache.rs]")]
end

node_user(("Game user"))

node_user -->|"runs commands"| node_cli
node_cli -.->|"launches title"| node_loader
node_cli -->|"inspects images"| node_pe
node_loader -->|"loads executable"| node_title
node_title -->|"requests services"| node_hle
node_hle -->|"registers APIs"| node_gameapi
node_gameapi -->|"uses async APIs"| node_async
node_title -->|"reads title data"| node_files
node_title -->|"submits reads"| node_dstorage
node_dstorage -->|"completes requests"| node_async
node_dstorage -->|"reads files"| node_files
node_dstorage -.->|"decodes BCPack"| node_formats
node_cli -->|"runs shader tools"| node_shadercmd
node_shadercmd -.->|"translates shaders"| node_gfx10
node_gfx10 -->|"decodes instructions"| node_ir
node_lower -->|"lowers IR"| node_ir
node_title -->|"issues GPU work"| node_host
node_host -.->|"creates device"| node_device
node_host -->|"presents frames"| node_frame
node_host -->|"records commands"| node_list
node_host -->|"submits work"| node_queue
node_host -->|"creates resources"| node_resource
node_resource -->|"uses host copies"| node_shadow
node_host -->|"handles textures"| node_texture
node_host -->|"manages objects"| node_object
node_host -->|"loads pipelines"| node_library
node_library -.->|"caches pipelines"| node_pipelinecache
node_title -.->|"uses shader cache"| node_pipelinecache

click node_cli "https://github.com/marvisak/victory/blob/main/apps/victory/src/main.rs"
click node_pe "https://github.com/marvisak/victory/blob/main/crates/victory-pe/src/image.rs"
click node_loader "https://github.com/marvisak/victory/blob/main/crates/victory-loader/src/windows.rs"
click node_hle "https://github.com/marvisak/victory/blob/main/crates/victory-hle/src/runtime.rs"
click node_gameapi "https://github.com/marvisak/victory/blob/main/crates/victory-hle/src/modules/xgameruntime.rs"
click node_files "https://github.com/marvisak/victory/blob/main/crates/victory-hle/src/modules/files.rs"
click node_async "https://github.com/marvisak/victory/blob/main/crates/victory-hle/src/modules/xasync.rs"
click node_dstorage "https://github.com/marvisak/victory/blob/main/crates/victory-hle/src/modules/dstorage.rs"
click node_formats "https://github.com/marvisak/victory/blob/main/crates/victory-formats/src/bcpack.rs"
click node_shadercmd "https://github.com/marvisak/victory/blob/main/apps/victory/src/shader.rs"
click node_gfx10 "https://github.com/marvisak/victory/blob/main/crates/victory-shader/src/gfx10/mod.rs"
click node_ir "https://github.com/marvisak/victory/blob/main/crates/victory-shader/src/ir.rs"
click node_lower "https://github.com/marvisak/victory/blob/main/crates/victory-shader/src/emit/lower.rs"
click node_pipelinecache "https://github.com/marvisak/victory/blob/main/crates/victory-pipeline/src/cache.rs"
click node_device "https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/device.rs"
click node_host "https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/host.rs"
click node_frame "https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/frame.rs"
click node_list "https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/list.rs"
click node_queue "https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/queue.rs"
click node_resource "https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/resource.rs"
click node_shadow "https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/shadow.rs"
click node_texture "https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/texture.rs"
click node_object "https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/object.rs"
click node_library "https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/pipeline/library.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_pe,node_loader,node_title,node_user toneBlue
class node_hle,node_gameapi,node_files,node_async,node_dstorage toneAmber
class node_shadercmd,node_gfx10,node_ir,node_lower toneMint
class node_device,node_host,node_frame,node_list,node_queue,node_resource,node_shadow,node_texture,node_object,node_library toneRose
class node_formats,node_pipelinecache toneIndigo
```

## Components

### Command and loading

- [CLI commands](https://github.com/marvisak/victory/blob/main/apps/victory/src/main.rs): `apps/victory/src/main.rs`
- [PE image parser](https://github.com/marvisak/victory/blob/main/crates/victory-pe/src/image.rs): `crates/victory-pe/src/image.rs`
- [Windows loader](https://github.com/marvisak/victory/blob/main/crates/victory-loader/src/windows.rs): `crates/victory-loader/src/windows.rs`
- **Title process**

### Console runtime services

- [HLE runtime](https://github.com/marvisak/victory/blob/main/crates/victory-hle/src/runtime.rs): `crates/victory-hle/src/runtime.rs`
- [Game runtime APIs](https://github.com/marvisak/victory/blob/main/crates/victory-hle/src/modules/xgameruntime.rs): `crates/victory-hle/src/modules/xgameruntime.rs`
- [Title file services](https://github.com/marvisak/victory/blob/main/crates/victory-hle/src/modules/files.rs): `crates/victory-hle/src/modules/files.rs`
- [Async requests](https://github.com/marvisak/victory/blob/main/crates/victory-hle/src/modules/xasync.rs): `crates/victory-hle/src/modules/xasync.rs`
- [DirectStorage](https://github.com/marvisak/victory/blob/main/crates/victory-hle/src/modules/dstorage.rs): `crates/victory-hle/src/modules/dstorage.rs`

### Shader translation

- [Shader commands](https://github.com/marvisak/victory/blob/main/apps/victory/src/shader.rs): `apps/victory/src/shader.rs`
- [GFX10 decoder](https://github.com/marvisak/victory/blob/main/crates/victory-shader/src/gfx10/mod.rs): `crates/victory-shader/src/gfx10/mod.rs`
- [Shader IR](https://github.com/marvisak/victory/blob/main/crates/victory-shader/src/ir.rs): `crates/victory-shader/src/ir.rs`
- [DXIL lowering](https://github.com/marvisak/victory/blob/main/crates/victory-shader/src/emit/lower.rs): `crates/victory-shader/src/emit/lower.rs`

### GPU execution

- [GPU device](https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/device.rs): `crates/victory-gpu/src/device.rs`
- [Host D3D12](https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/host.rs): `crates/victory-gpu/src/host.rs`
- [Frame presentation](https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/frame.rs): `crates/victory-gpu/src/frame.rs`
- [Command lists](https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/list.rs): `crates/victory-gpu/src/list.rs`
- [GPU queue](https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/queue.rs): `crates/victory-gpu/src/queue.rs`
- [GPU resources](https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/resource.rs): `crates/victory-gpu/src/resource.rs`
- [Resource shadows](https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/shadow.rs): `crates/victory-gpu/src/shadow.rs`
- [Texture handling](https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/texture.rs): `crates/victory-gpu/src/texture.rs`
- [GPU objects](https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/object.rs): `crates/victory-gpu/src/object.rs`
- [Pipeline library](https://github.com/marvisak/victory/blob/main/crates/victory-gpu/src/pipeline/library.rs): `crates/victory-gpu/src/pipeline/library.rs`

### Formats and caches

- [BCPack decoding](https://github.com/marvisak/victory/blob/main/crates/victory-formats/src/bcpack.rs): `crates/victory-formats/src/bcpack.rs`
- [Pipeline cache](https://github.com/marvisak/victory/blob/main/crates/victory-pipeline/src/cache.rs): `crates/victory-pipeline/src/cache.rs`

### Other components

- **Game user**

## Connections

- Game user → CLI commands: runs commands (evidence: `apps/victory/src/main.rs`)
- CLI commands → Windows loader: launches title (evidence: `README.md`)
- CLI commands → PE image parser: inspects images (evidence: `apps/victory/src/main.rs`)
- Windows loader → Title process: loads executable (evidence: `README.md`)
- Title process → HLE runtime: requests services (evidence: `README.md`)
- HLE runtime → Game runtime APIs: registers APIs
- Game runtime APIs → Async requests: uses async APIs (evidence: `crates/victory-hle/src/modules/xgameruntime.rs`)
- Title process → Title file services: reads title data (evidence: `README.md`)
- Title process → DirectStorage: submits reads (evidence: `crates/victory-hle/src/modules/dstorage.rs`)
- DirectStorage → Async requests: completes requests (evidence: `crates/victory-hle/src/modules/dstorage.rs`)
- DirectStorage → Title file services: reads files (evidence: `crates/victory-hle/src/modules/dstorage.rs`)
- DirectStorage → BCPack decoding: decodes BCPack
- CLI commands → Shader commands: runs shader tools (evidence: `apps/victory/src/main.rs`)
- Shader commands → GFX10 decoder: translates shaders (evidence: `README.md`)
- GFX10 decoder → Shader IR: decodes instructions (evidence: `crates/victory-shader/src/ir.rs`)
- DXIL lowering → Shader IR: lowers IR (evidence: `crates/victory-shader/src/emit/lower.rs`)
- Title process → Host D3D12: issues GPU work (evidence: `README.md`)
- Host D3D12 → GPU device: creates device
- Host D3D12 → Frame presentation: presents frames (evidence: `crates/victory-gpu/src/host.rs`)
- Host D3D12 → Command lists: records commands (evidence: `crates/victory-gpu/src/host.rs`)
- Host D3D12 → GPU queue: submits work (evidence: `crates/victory-gpu/src/host.rs`)
- Host D3D12 → GPU resources: creates resources (evidence: `crates/victory-gpu/src/host.rs`)
- GPU resources → Resource shadows: uses host copies (evidence: `crates/victory-gpu/src/resource.rs`)
- Host D3D12 → Texture handling: handles textures (evidence: `crates/victory-gpu/src/host.rs`)
- Host D3D12 → GPU objects: manages objects (evidence: `crates/victory-gpu/src/host.rs`)
- Host D3D12 → Pipeline library: loads pipelines (evidence: `crates/victory-gpu/src/pipeline/host.rs`)
- Pipeline library → Pipeline cache: caches pipelines
- Title process → Pipeline cache: uses shader cache (evidence: `README.md`)
