Repository navigation
Architecture
Isllan Toso edited this page Nov 21, 2026
·
2 revisions
Bullet is structured as a multi-crate Rust (2024 edition) workspace designed around strict state isolation, supervised async tasks, and zero-panic binary parsing.
| Crate | Responsibility |
|---|---|
bullet-core |
Pure domain types, AppState, named state transitions, GamePhase state machine, Supervisor, and IdentityLoadout validation (#![forbid(unsafe_code)]). |
bullet-wad |
Custom WAD v3.4 reader/writer (zstd, flate2, xxhash-rust), .bin (PROP) parser/serializer, .fantome / .modpkg handling, and parallel game WAD hash index. |
bullet-classic |
On-demand skin, chroma, Exalted/multi-form (Ctrl+5), TFT cosmetic, localized loading-screen (RST v5 / StringOverrides), and Classic Rift (JADE) mod generator. |
bullet-inject |
Native overlay builder (overlay_builder), incremental OverlayCache, mod compatibility & repair (mod_compat), injection pipeline orchestration (InjectionPipeline), and built-in macOS Mach-O patcher (macos_patcher). |
bullet-lcu |
League Client Update (LCU) REST & WebSocket observer (lockfile + command-line fallback discovery for all regional clients). |
bullet-party |
Encrypted Party Mode client (X25519 key exchange + XChaCha20-Poly1305 payload encryption). |
bullet-relay |
Optional self-hosted WebSocket relay server matching the relay-worker/ Cloudflare Durable Object protocol. |
bullet-platform |
OS-isolated abstractions (#[cfg(windows)] / #[cfg(target_os = "macos")]): Slint UI windows, system tray, process discovery, elevation, atomic writes, and i18n (en, pt, es). |
bullet-app |
Application entry point, lifecycle wiring (boot/), injection trigger (trigger/), selection/catalog/presets (selection/), live match stats (game/), party manager (party/), and Ed25519-verified auto-updates (updates/). |
Additional top-level components in the public repository:
-
relay-worker/: TypeScript Cloudflare Worker + Durable Object for Party Mode relay. -
installer/: Inno Setup 6 script (bullet.iss) forBullet-Setup-<version>-x64.exe. -
xtask/: Workspace automation (check,package,installer,skin-audit,wad-probe,comments,sign-sums,set-version).
-
bullet-corehas zero workspace dependencies. -
bullet-platformdepends only onbullet-coreplus OS/UI crates (windows-rs,libc,slint). - Domain crates (
bullet-wad,bullet-classic,bullet-inject,bullet-lcu,bullet-party) never depend onbullet-app. - Crates without FFI declare
#![forbid(unsafe_code)].
-
Immutable Snapshot Broadcast (
tokio::sync::watch): Shared application state (AppState) is updated exclusively through named transition helpers inbullet-core::state(set_phase,set_overlay_target,set_injection_status, etc.). Consumers subscribe to changes rather than polling. -
Supervised Tasks (
Supervisor): Every background task is spawned under aSupervisorbound to aCancellationToken. Task exits and panics are detected and logged; baretokio::spawncalls are prohibited. -
Blocking I/O Isolation: Heavy WAD parsing, hashing, and overlay construction run inside
tokio::task::spawn_blockingso the async runtime and UI loop stay responsive. -
Choice-Driven Arming: Overlay preparation is debounced (
100 mson initial pick,900 msafter selection changes) and disarmed immediately if the player switches champions/skins before match start. - RAII Resource Guards: Active overlay sessions and temporary staging directories are cleaned up automatically via RAII guards and shutdown hooks.
Every PR and release runs cargo xtask check:
-
Error-handling & lint sweep: Every discarded
Resultmust carry an explicit// ignore-ok: <reason>justification; zero comments are permitted in source files; every code file must be<= 400lines and every directory<= 5code files. -
Formatting & Static Analysis:
cargo fmt --all -- --checkandcargo clippy --workspace --all-targets -- -D warnings. - Test Suite: Unit, integration, property-based, and fuzzing suites across all crates.
Architecture & Domain
Client & Asset Pipeline
Platform & Security