# mathewsbinny/xenolith architecture

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

- Interactive diagram: https://gitdiagram.com/mathewsbinny/xenolith
- Repository: https://github.com/mathewsbinny/xenolith

## Overview

This workspace is a Rust Xbox 360-to-PC asset inspection and conversion toolkit, with Xenolith as its GUI and headless CLI. The main workflow starts with a user selecting or supplying an asset, then dispatches inspection or conversion through the application pipeline to format-specific platform, middleware, or Frostbite code and produces PC-oriented output. Separate branches cover container access, GPU and audio decoding, middleware conversion, and Frostbite asset upgrades. Edges are limited to relationships shown in excerpts, the source index, or README; unsampled integrations are not inferred.

Main entry points: [`apps/xenolith/src/pipeline.rs`](https://github.com/mathewsbinny/xenolith/blob/main/apps/xenolith/src/pipeline.rs) (Inspect and convert), [`apps/xenolith/src/app.rs`](https://github.com/mathewsbinny/xenolith/blob/main/apps/xenolith/src/app.rs) (Studio GUI), [`apps/xenolith/src/main.rs`](https://github.com/mathewsbinny/xenolith/blob/main/apps/xenolith/src/main.rs) (App entry), [`engines/frostbite/src/bfbc1/mod.rs`](https://github.com/mathewsbinny/xenolith/blob/main/engines/frostbite/src/bfbc1/mod.rs) (BFBC1 upgraders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Xenolith application"]
  node_main["App entry<br/>[main.rs]"]
  node_gui["Studio GUI<br/>[app.rs]"]
  node_cli["Headless CLI<br/>[cli.rs]"]
  node_pipeline["Inspect and convert<br/>[pipeline.rs]"]
  node_tasks["Background tasks<br/>[task.rs]"]
  node_theme["Themes<br/>[theme.rs]"]
end

subgraph group_platform["Xbox 360 formats"]
  node_containers["Xbox containers<br/>[stfs.rs]"]
  node_xenos_tex["Xenos textures<br/>[xenos.rs]"]
  node_xenos_shader["Xenos shaders<br/>[xenos.rs]"]
  node_shader_tools["Shader translation<br/>[hlsl.rs]"]
  node_xma["XMA audio decoder<br/>[wmapro.rs]"]
  node_xma_bits["Audio bitstream<br/>[bits.rs]"]
end

subgraph group_middleware["Middleware formats"]
  node_havok["Havok packfiles<br/>[packfile.rs]"]
  node_havok_reflect["Havok reflection<br/>[reflect.rs]"]
  node_havok_port["Havok porting<br/>[port.rs]"]
  node_granny["Granny reader<br/>[format.rs]"]
  node_granny_convert["Granny conversion<br/>[convert.rs]"]
end

subgraph group_frostbite["Frostbite assets"]
  node_fb_dbx["DBX assets<br/>[dbx.rs]"]
  node_fb_archive["FbRB archives<br/>[fbrb.rs]"]
  node_fb_mesh["Mesh conversion<br/>[meshconv.rs]"]
  node_fb_meshdata["Mesh data<br/>[meshdata.rs]"]
  node_fb_terrain["Terrain assets<br/>[terrain.rs]"]
  node_fb_shaderdb["Shader database<br/>[shader_db.rs]"]
  node_fb_bfbc1["BFBC1 upgraders<br/>[mod.rs]"]
  node_fb_audio["Frostbite audio<br/>[audio.rs]"]
end

node_user(("User"))
node_output["PC asset files"]

node_user -->|"launches"| node_main
node_main -->|"dispatches arguments"| node_cli
node_main -->|"opens GUI"| node_gui
node_gui -->|"runs inspection and jobs"| node_pipeline
node_gui -->|"spawns background work"| node_tasks
node_gui -->|"applies themes"| node_theme
node_cli -->|"runs commands"| node_pipeline
node_pipeline -->|"untiles textures"| node_xenos_tex
node_pipeline -->|"parses shaders"| node_xenos_shader
node_pipeline -->|"translates shaders"| node_shader_tools
node_pipeline -->|"checks packfile magic"| node_havok
node_pipeline -->|"inspects Havok header"| node_fb_bfbc1
node_pipeline -->|"writes conversions"| node_output
node_havok -->|"uses reflection walk"| node_havok_reflect
node_havok_port -->|"converts packfiles"| node_havok
node_granny_convert -->|"reads Granny data"| node_granny
node_fb_mesh -->|"writes mesh data"| node_fb_meshdata
node_fb_terrain -->|"uses mesh conversion"| node_fb_mesh
node_fb_bfbc1 -->|"upgrades DBX"| node_fb_dbx
node_fb_bfbc1 -->|"deduplicates archive data"| node_fb_archive
node_xma -->|"reads bitstream"| node_xma_bits

click node_main "https://github.com/mathewsbinny/xenolith/blob/main/apps/xenolith/src/main.rs"
click node_gui "https://github.com/mathewsbinny/xenolith/blob/main/apps/xenolith/src/app.rs"
click node_cli "https://github.com/mathewsbinny/xenolith/blob/main/apps/xenolith/src/cli.rs"
click node_pipeline "https://github.com/mathewsbinny/xenolith/blob/main/apps/xenolith/src/pipeline.rs"
click node_tasks "https://github.com/mathewsbinny/xenolith/blob/main/apps/xenolith/src/task.rs"
click node_theme "https://github.com/mathewsbinny/xenolith/blob/main/apps/xenolith/src/theme.rs"
click node_containers "https://github.com/mathewsbinny/xenolith/blob/main/platform/x360-containers/src/stfs.rs"
click node_xenos_tex "https://github.com/mathewsbinny/xenolith/blob/main/platform/x360-xenos-texture/src/xenos.rs"
click node_xenos_shader "https://github.com/mathewsbinny/xenolith/blob/main/platform/x360-xenos-shader/src/xenos.rs"
click node_shader_tools "https://github.com/mathewsbinny/xenolith/blob/main/platform/x360-xenos-shader/src/hlsl.rs"
click node_xma "https://github.com/mathewsbinny/xenolith/blob/main/platform/x360-xma/src/wmapro.rs"
click node_xma_bits "https://github.com/mathewsbinny/xenolith/blob/main/platform/x360-xma/src/bits.rs"
click node_havok "https://github.com/mathewsbinny/xenolith/blob/main/middleware/havok/src/packfile.rs"
click node_havok_reflect "https://github.com/mathewsbinny/xenolith/blob/main/middleware/havok/src/packfile/reflect.rs"
click node_havok_port "https://github.com/mathewsbinny/xenolith/blob/main/middleware/havok/src/port.rs"
click node_granny "https://github.com/mathewsbinny/xenolith/blob/main/middleware/granny/src/format.rs"
click node_granny_convert "https://github.com/mathewsbinny/xenolith/blob/main/middleware/granny/src/convert.rs"
click node_fb_dbx "https://github.com/mathewsbinny/xenolith/blob/main/engines/frostbite/src/dbx.rs"
click node_fb_archive "https://github.com/mathewsbinny/xenolith/blob/main/engines/frostbite/src/fbrb.rs"
click node_fb_mesh "https://github.com/mathewsbinny/xenolith/blob/main/engines/frostbite/src/meshconv.rs"
click node_fb_meshdata "https://github.com/mathewsbinny/xenolith/blob/main/engines/frostbite/src/meshdata.rs"
click node_fb_terrain "https://github.com/mathewsbinny/xenolith/blob/main/engines/frostbite/src/terrain.rs"
click node_fb_shaderdb "https://github.com/mathewsbinny/xenolith/blob/main/engines/frostbite/src/shader_db.rs"
click node_fb_bfbc1 "https://github.com/mathewsbinny/xenolith/blob/main/engines/frostbite/src/bfbc1/mod.rs"
click node_fb_audio "https://github.com/mathewsbinny/xenolith/blob/main/engines/frostbite/src/audio.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_main,node_gui,node_cli,node_pipeline,node_tasks,node_theme,node_user toneBlue
class node_containers,node_xenos_tex,node_xenos_shader,node_shader_tools,node_xma,node_xma_bits toneAmber
class node_havok,node_havok_reflect,node_havok_port,node_granny,node_granny_convert toneMint
class node_fb_dbx,node_fb_archive,node_fb_mesh,node_fb_meshdata,node_fb_terrain,node_fb_shaderdb,node_fb_bfbc1,node_fb_audio toneRose
class node_output toneIndigo
```

## Components

### Xenolith application

- [App entry](https://github.com/mathewsbinny/xenolith/blob/main/apps/xenolith/src/main.rs): `apps/xenolith/src/main.rs`
- [Studio GUI](https://github.com/mathewsbinny/xenolith/blob/main/apps/xenolith/src/app.rs): `apps/xenolith/src/app.rs`
- [Headless CLI](https://github.com/mathewsbinny/xenolith/blob/main/apps/xenolith/src/cli.rs): `apps/xenolith/src/cli.rs`
- [Inspect and convert](https://github.com/mathewsbinny/xenolith/blob/main/apps/xenolith/src/pipeline.rs): `apps/xenolith/src/pipeline.rs`
- [Background tasks](https://github.com/mathewsbinny/xenolith/blob/main/apps/xenolith/src/task.rs): `apps/xenolith/src/task.rs`
- [Themes](https://github.com/mathewsbinny/xenolith/blob/main/apps/xenolith/src/theme.rs): `apps/xenolith/src/theme.rs`

### Xbox 360 formats

- [Xbox containers](https://github.com/mathewsbinny/xenolith/blob/main/platform/x360-containers/src/stfs.rs): `platform/x360-containers/src/stfs.rs`
- [Xenos textures](https://github.com/mathewsbinny/xenolith/blob/main/platform/x360-xenos-texture/src/xenos.rs): `platform/x360-xenos-texture/src/xenos.rs`
- [Xenos shaders](https://github.com/mathewsbinny/xenolith/blob/main/platform/x360-xenos-shader/src/xenos.rs): `platform/x360-xenos-shader/src/xenos.rs`
- [Shader translation](https://github.com/mathewsbinny/xenolith/blob/main/platform/x360-xenos-shader/src/hlsl.rs): `platform/x360-xenos-shader/src/hlsl.rs`
- [XMA audio decoder](https://github.com/mathewsbinny/xenolith/blob/main/platform/x360-xma/src/wmapro.rs): `platform/x360-xma/src/wmapro.rs`
- [Audio bitstream](https://github.com/mathewsbinny/xenolith/blob/main/platform/x360-xma/src/bits.rs): `platform/x360-xma/src/bits.rs`

### Middleware formats

- [Havok packfiles](https://github.com/mathewsbinny/xenolith/blob/main/middleware/havok/src/packfile.rs): `middleware/havok/src/packfile.rs`
- [Havok reflection](https://github.com/mathewsbinny/xenolith/blob/main/middleware/havok/src/packfile/reflect.rs): `middleware/havok/src/packfile/reflect.rs`
- [Havok porting](https://github.com/mathewsbinny/xenolith/blob/main/middleware/havok/src/port.rs): `middleware/havok/src/port.rs`
- [Granny reader](https://github.com/mathewsbinny/xenolith/blob/main/middleware/granny/src/format.rs): `middleware/granny/src/format.rs`
- [Granny conversion](https://github.com/mathewsbinny/xenolith/blob/main/middleware/granny/src/convert.rs): `middleware/granny/src/convert.rs`

### Frostbite assets

- [DBX assets](https://github.com/mathewsbinny/xenolith/blob/main/engines/frostbite/src/dbx.rs): `engines/frostbite/src/dbx.rs`
- [FbRB archives](https://github.com/mathewsbinny/xenolith/blob/main/engines/frostbite/src/fbrb.rs): `engines/frostbite/src/fbrb.rs`
- [Mesh conversion](https://github.com/mathewsbinny/xenolith/blob/main/engines/frostbite/src/meshconv.rs): `engines/frostbite/src/meshconv.rs`
- [Mesh data](https://github.com/mathewsbinny/xenolith/blob/main/engines/frostbite/src/meshdata.rs): `engines/frostbite/src/meshdata.rs`
- [Terrain assets](https://github.com/mathewsbinny/xenolith/blob/main/engines/frostbite/src/terrain.rs): `engines/frostbite/src/terrain.rs`
- [Shader database](https://github.com/mathewsbinny/xenolith/blob/main/engines/frostbite/src/shader_db.rs): `engines/frostbite/src/shader_db.rs`
- [BFBC1 upgraders](https://github.com/mathewsbinny/xenolith/blob/main/engines/frostbite/src/bfbc1/mod.rs): `engines/frostbite/src/bfbc1/mod.rs`
- [Frostbite audio](https://github.com/mathewsbinny/xenolith/blob/main/engines/frostbite/src/audio.rs): `engines/frostbite/src/audio.rs`

### Other components

- **User**
- **PC asset files**

## Connections

- User → App entry: launches (evidence: `apps/xenolith/src/main.rs`)
- App entry → Headless CLI: dispatches arguments (evidence: `apps/xenolith/src/main.rs`)
- App entry → Studio GUI: opens GUI (evidence: `apps/xenolith/src/main.rs`)
- Studio GUI → Inspect and convert: runs inspection and jobs (evidence: `apps/xenolith/src/app.rs`)
- Studio GUI → Background tasks: spawns background work (evidence: `apps/xenolith/src/app.rs`)
- Studio GUI → Themes: applies themes (evidence: `apps/xenolith/src/app.rs`)
- Headless CLI → Inspect and convert: runs commands (evidence: `apps/xenolith/src/cli.rs`)
- Inspect and convert → Xenos textures: untiles textures (evidence: `apps/xenolith/src/pipeline.rs`)
- Inspect and convert → Xenos shaders: parses shaders (evidence: `apps/xenolith/src/pipeline.rs`)
- Inspect and convert → Shader translation: translates shaders (evidence: `apps/xenolith/src/pipeline.rs`)
- Inspect and convert → Havok packfiles: checks packfile magic (evidence: `apps/xenolith/src/pipeline.rs`)
- Inspect and convert → BFBC1 upgraders: inspects Havok header (evidence: `apps/xenolith/src/pipeline.rs`)
- Inspect and convert → PC asset files: writes conversions (evidence: `README.md`)
- Havok packfiles → Havok reflection: uses reflection walk (evidence: `middleware/havok/src/packfile.rs`)
- Havok porting → Havok packfiles: converts packfiles (evidence: `middleware/havok/src/port.rs`)
- Granny conversion → Granny reader: reads Granny data (evidence: `middleware/granny/src/convert.rs`)
- Mesh conversion → Mesh data: writes mesh data (evidence: `engines/frostbite/src/meshconv.rs`)
- Terrain assets → Mesh conversion: uses mesh conversion (evidence: `engines/frostbite/src/terrain.rs`)
- BFBC1 upgraders → DBX assets: upgrades DBX (evidence: `engines/frostbite/src/bfbc1/mod.rs`)
- BFBC1 upgraders → FbRB archives: deduplicates archive data (evidence: `engines/frostbite/src/bfbc1/mod.rs`)
- XMA audio decoder → Audio bitstream: reads bitstream (evidence: `platform/x360-xma/src/wmapro.rs`)
