# belobug/victory-belobug-amd architecture

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

- Interactive diagram: https://gitdiagram.com/belobug/victory-belobug-amd
- Repository: https://github.com/belobug/victory-belobug-amd

## Overview

VIctory is a work-in-progress Windows runtime for running a user-supplied console game on AMD Radeon hardware. The principal path is to invoke the CLI with the game executable, prepare and load it, provide console services through HLE, translate console shaders and record GPU work for host D3D12, then present frames. Separate branches cover persistent saves and shader diagnostics. The README documents capabilities and observed behavior; many runtime files were not sampled, so unverified internal connections are omitted or shown as dashed.

Main entry points: [`apps/victory/src/run.rs`](https://github.com/belobug/victory-belobug-amd/blob/main/apps/victory/src/run.rs) (Run command), [`apps/victory/src/main.rs`](https://github.com/belobug/victory-belobug-amd/blob/main/apps/victory/src/main.rs) (Victory CLI), [`crates/victory-gpu/src/list.rs`](https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-gpu/src/list.rs) (Command lists and queues), [`crates/victory-gpu/src/pipeline.rs`](https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-gpu/src/pipeline.rs) (GPU pipelines)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and configuration"]
  node_cli["Victory CLI<br/>[main.rs]"]
  node_run["Run command<br/>[run.rs]"]
  node_inspect["Inspect tools<br/>[inspect.rs]"]
  node_translate_cmd["Translate command<br/>[translate.rs]"]
  node_config["Runtime policy<br/>[policy.rs]"]
end

subgraph group_execution["Game execution"]
  node_pe["PE image handling<br/>[image.rs]"]
  node_loader["Game loading<br/>[windows.rs]"]
end

subgraph group_compat["Console compatibility"]
  node_hle_runtime["HLE runtime<br/>[runtime.rs]"]
  node_hle_modules["Console services"]
  node_save_storage[("Save storage<br/>[storage.rs]")]
end

subgraph group_graphics["GPU and shaders"]
  node_gpu_host["Host D3D12 device<br/>[host.rs]"]
  node_commands["Command lists and queues<br/>[list.rs]"]
  node_resources["Resources and copies<br/>[resource.rs]"]
  node_descriptors["Descriptor heaps<br/>[host.rs]"]
  node_pipelines["GPU pipelines<br/>[pipeline.rs]"]
  node_shader_translate["Shader translation<br/>[native.rs]"]
  node_shader_emit["DXIL emission<br/>[mod.rs]"]
  node_isa["GFX10 decoding<br/>[mod.rs]"]
  node_shader_cache[("Shader cache<br/>[cache.rs]")]
  node_ambient["Ambient lighting<br/>[ambient.rs]"]
end

subgraph group_support["Formats and diagnostics"]
  node_formats["Game formats"]
  node_census["Runtime census<br/>[census.rs]"]
end

node_user(("Game owner"))
node_game["Game executable"]

node_user -->|"invokes"| node_cli
node_user -->|"supplies"| node_game
node_cli -->|"dispatches"| node_run
node_run -.->|"loads"| node_game
node_run -.->|"starts"| node_loader
node_loader -.->|"maps image"| node_pe
node_run -.->|"initializes"| node_hle_runtime
node_hle_runtime -.->|"provides services"| node_hle_modules
node_hle_modules -->|"serves saves"| node_save_storage
node_save_storage -->|"exposes storage"| node_game
node_run -->|"runs on"| node_gpu_host
node_commands -.->|"submits work"| node_gpu_host
node_commands -.->|"records resource use"| node_resources
node_commands -.->|"uses descriptors"| node_descriptors
node_commands -.->|"draws with"| node_pipelines
node_pipelines -->|"translates shaders"| node_shader_translate
node_shader_translate -->|"emits DXIL"| node_shader_emit
node_shader_translate -.->|"decodes ISA"| node_isa
node_pipelines -->|"reuses entries"| node_shader_cache
node_pipelines -->|"applies lighting"| node_ambient
node_cli -->|"dispatches"| node_inspect
node_cli -->|"dispatches"| node_translate_cmd
node_cli -->|"dispatches"| node_census
node_run -.->|"reads policy"| node_config
node_run -.->|"uses formats"| node_formats

click node_cli "https://github.com/belobug/victory-belobug-amd/blob/main/apps/victory/src/main.rs"
click node_run "https://github.com/belobug/victory-belobug-amd/blob/main/apps/victory/src/run.rs"
click node_inspect "https://github.com/belobug/victory-belobug-amd/blob/main/apps/victory/src/inspect.rs"
click node_translate_cmd "https://github.com/belobug/victory-belobug-amd/blob/main/apps/victory/src/translate.rs"
click node_config "https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-core/src/policy.rs"
click node_pe "https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-pe/src/image.rs"
click node_loader "https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-loader/src/windows.rs"
click node_hle_runtime "https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-hle/src/runtime.rs"
click node_hle_modules "https://github.com/belobug/victory-belobug-amd/tree/main/crates/victory-hle/src/modules"
click node_save_storage "https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-hle/src/modules/storage.rs"
click node_formats "https://github.com/belobug/victory-belobug-amd/tree/main/crates/victory-formats/src"
click node_gpu_host "https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-gpu/src/host.rs"
click node_commands "https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-gpu/src/list.rs"
click node_resources "https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-gpu/src/resource.rs"
click node_descriptors "https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-gpu/src/descriptor/host.rs"
click node_pipelines "https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-gpu/src/pipeline.rs"
click node_shader_translate "https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-shader/src/native.rs"
click node_shader_emit "https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-shader/src/emit/mod.rs"
click node_isa "https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-shader/src/gfx10/mod.rs"
click node_shader_cache "https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-pipeline/src/cache.rs"
click node_ambient "https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-gpu/src/ambient.rs"
click node_census "https://github.com/belobug/victory-belobug-amd/blob/main/apps/victory/src/census.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_inspect,node_translate_cmd,node_config toneBlue
class node_pe,node_loader toneAmber
class node_hle_runtime,node_hle_modules,node_save_storage toneMint
class node_gpu_host,node_commands,node_resources,node_descriptors,node_pipelines,node_shader_translate,node_shader_emit,node_isa,node_shader_cache,node_ambient toneRose
class node_formats,node_census,node_user,node_game toneIndigo
```

## Components

### CLI and configuration

- [Victory CLI](https://github.com/belobug/victory-belobug-amd/blob/main/apps/victory/src/main.rs): `apps/victory/src/main.rs`
- [Run command](https://github.com/belobug/victory-belobug-amd/blob/main/apps/victory/src/run.rs): `apps/victory/src/run.rs`
- [Inspect tools](https://github.com/belobug/victory-belobug-amd/blob/main/apps/victory/src/inspect.rs): `apps/victory/src/inspect.rs`
- [Translate command](https://github.com/belobug/victory-belobug-amd/blob/main/apps/victory/src/translate.rs): `apps/victory/src/translate.rs`
- [Runtime policy](https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-core/src/policy.rs): `crates/victory-core/src/policy.rs`

### Game execution

- [PE image handling](https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-pe/src/image.rs): `crates/victory-pe/src/image.rs`
- [Game loading](https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-loader/src/windows.rs): `crates/victory-loader/src/windows.rs`

### Console compatibility

- [HLE runtime](https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-hle/src/runtime.rs): `crates/victory-hle/src/runtime.rs`
- [Console services](https://github.com/belobug/victory-belobug-amd/tree/main/crates/victory-hle/src/modules): `crates/victory-hle/src/modules`
- [Save storage](https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-hle/src/modules/storage.rs): `crates/victory-hle/src/modules/storage.rs`

### GPU and shaders

- [Host D3D12 device](https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-gpu/src/host.rs): `crates/victory-gpu/src/host.rs`
- [Command lists and queues](https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-gpu/src/list.rs): `crates/victory-gpu/src/list.rs`
- [Resources and copies](https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-gpu/src/resource.rs): `crates/victory-gpu/src/resource.rs`
- [Descriptor heaps](https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-gpu/src/descriptor/host.rs): `crates/victory-gpu/src/descriptor/host.rs`
- [GPU pipelines](https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-gpu/src/pipeline.rs): `crates/victory-gpu/src/pipeline.rs`
- [Shader translation](https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-shader/src/native.rs): `crates/victory-shader/src/native.rs`
- [DXIL emission](https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-shader/src/emit/mod.rs): `crates/victory-shader/src/emit/mod.rs`
- [GFX10 decoding](https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-shader/src/gfx10/mod.rs): `crates/victory-shader/src/gfx10/mod.rs`
- [Shader cache](https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-pipeline/src/cache.rs): `crates/victory-pipeline/src/cache.rs`
- [Ambient lighting](https://github.com/belobug/victory-belobug-amd/blob/main/crates/victory-gpu/src/ambient.rs): `crates/victory-gpu/src/ambient.rs`

### Formats and diagnostics

- [Game formats](https://github.com/belobug/victory-belobug-amd/tree/main/crates/victory-formats/src): `crates/victory-formats/src`
- [Runtime census](https://github.com/belobug/victory-belobug-amd/blob/main/apps/victory/src/census.rs): `apps/victory/src/census.rs`

### Other components

- **Game owner**
- **Game executable**

## Connections

- Game owner → Victory CLI: invokes
- Game owner → Game executable: supplies
- Victory CLI → Run command: dispatches (evidence: `apps/victory/src/main.rs`)
- Run command → Game executable: loads
- Run command → Game loading: starts
- Game loading → PE image handling: maps image
- Run command → HLE runtime: initializes
- HLE runtime → Console services: provides services (evidence: `crates/victory-hle/src/modules/storage.rs`)
- Console services → Save storage: serves saves (evidence: `crates/victory-hle/src/modules/storage.rs`)
- Save storage → Game executable: exposes storage
- Run command → Host D3D12 device: runs on
- Command lists and queues → Host D3D12 device: submits work (evidence: `crates/victory-gpu/src/list.rs`)
- Command lists and queues → Resources and copies: records resource use (evidence: `crates/victory-gpu/src/list.rs`)
- Command lists and queues → Descriptor heaps: uses descriptors (evidence: `crates/victory-gpu/src/descriptor/host.rs`)
- Command lists and queues → GPU pipelines: draws with (evidence: `crates/victory-gpu/src/list.rs`)
- GPU pipelines → Shader translation: translates shaders
- Shader translation → DXIL emission: emits DXIL (evidence: `crates/victory-shader/src/emit/mod.rs`)
- Shader translation → GFX10 decoding: decodes ISA
- GPU pipelines → Shader cache: reuses entries
- GPU pipelines → Ambient lighting: applies lighting (evidence: `crates/victory-gpu/src/pipeline.rs`)
- Victory CLI → Inspect tools: dispatches (evidence: `apps/victory/src/main.rs`)
- Victory CLI → Translate command: dispatches (evidence: `apps/victory/src/main.rs`)
- Victory CLI → Runtime census: dispatches (evidence: `apps/victory/src/main.rs`)
- Run command → Runtime policy: reads policy
- Run command → Game formats: uses formats
