Development

DevelopmentπŸ”—

Build, test, and package LocalGPT Verse β€” plus the map of what’s inside.

Repository layoutπŸ”—

crates/verse/             # a member of the localgpt workspace
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.rs           app wiring, schedules, states
β”‚   β”œβ”€β”€ theme.rs          design tokens + the world-mood registry
β”‚   β”œβ”€β”€ hud.rs            now-playing, progress, hints, three-state fade
β”‚   β”œβ”€β”€ overlays/         onboarding, pause, queue, settings, credits, library
β”‚   β”œβ”€β”€ playback.rs       transport signals, the ownership ladder
β”‚   β”œβ”€β”€ audio.rs          kira playback, live tap, pause/end-of-track
β”‚   β”œβ”€β”€ analysis.rs       symphonia β†’ realfft: tempo, grid, sections, mood
β”‚   β”œβ”€β”€ world.rs          procedural backdrop, cameras, time-dilation
β”‚   β”œβ”€β”€ world_assets.rs   manifest pack, placement, LOD, embeddings
β”‚   β”œβ”€β”€ ml.rs             CLAP zero-shot mood + embeddings  (feature: ml)
β”‚   β”œβ”€β”€ demucs.rs         stem separation + curves          (feature: ml)
β”‚   └── recipe.rs         the authored WorldRecipe, applied from the sidecar
β”œβ”€β”€ assets/               fonts, models (synced), ml/

xtask/                    cargo xtask fetch-assets β€” the asset pack every app shares

Threading is channels-and-atomics only across boundaries (the single shared-state exception is a microsecond Mutex around the audio manager). No unsafe, no GPL dependencies.

Feature flagsπŸ”—

FlagWhat it addsFetch first
(default)Playback, DSP analysis, rule-mapped worldsβ€”
mlCLAP zero-shot moods, embedding-ranked placement, Demucs stemscargo xtask fetch-clap (~78 MB)

CI compiles the optional tier so it can’t rot, and it falls back to the rule-derived world when its model is absent. There is no language-model tier: a recipe comes from the sidecar, written by an agent.

Smoke testπŸ”—

Boots through every screen, then exits β€” the fastest way to catch a broken overlay:

VERSE_SMOKE=1 cargo run -p localgpt-verse                    # walk every screen, then quit
VERSE_SMOKE=1 VERSE_SHOT=/tmp cargo run -p localgpt-verse  # + save verse-hud.png / verse-overlays.png

Screenshot readback can intermittently return black frames on some machines (that’s why Photo mode retries). A consistent black frame is a scene bug, not the flake β€” check the logs.

Perf stress testπŸ”—

VERSE_STRESS=5000 cargo run -p localgpt-verse --release   # 5000 extra props, fps log, exit after 30s
VERSE_STRESS=0 cargo run -p localgpt-verse --release      # control run: report only

Runs uncapped so the numbers show true frame cost. On the dev machine (2026-07): baseline world ~60 fps, ~1k props β‰ˆ 14 fps, 5k β‰ˆ 9 fps β€” CPU-side entity overhead dominates, so ~70–90 props is the comfortable ceiling until real instancing lands. Treat dense-pack budgets as measured, not promised.

PackagingπŸ”—

cargo xtask verse-bundle         # assembles crates/verse/dist/: release binary + fonts + models from localgpt-world-assets

The 171-model CC0 pack lives in the separate localgpt-world-assets repository (formerly localgpt-verse-assets); its fetch_polyhaven.py downloads it and writes the manifest (with a semantic kind per asset β€” 19 kinds), normalize.py packs each model to a single uncompressed .glb (bevy_gltf supports neither quantized nor meshopt-compressed geometry), and the workspace’s cargo xtask fetch-assets copies the manifest-referenced set into the folder every LocalGPT app reads. The macOS LocalGPT.app bundle does not carry the pack; that script fetches it once per machine.

Architecture at a glanceπŸ”—

                 Bevy main thread                        other threads
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ UI (hud.rs, overlays/)                   β”‚   β”‚ kira audio thread (cpal)  β”‚
β”‚   reads: Playback, Beat, Theme, Comfort  β”‚   β”‚   StreamingSound decode   β”‚
β”‚   writes: intent resources (Paused, …)   β”‚   β”‚   TapEffect: energy/onset β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”‚   β†’ AtomicU32 (lock-free) β”‚
β”‚ Transport (audio.rs systems)             │◄───                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Signals (playback.rs advance_playback)   β”‚   β”‚ import scan thread        β”‚
β”‚   ladder: simulation β†’ live tap β†’ grid   │◄───   walkdir+lofty β†’ mpsc    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ World (world.rs, world_assets.rs)        β”‚   β”‚ analysis worker thread    β”‚
│   procedural ambient + manifest props    │   │   symphonia→realfft→tempo │
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚   /sections/energy/mood   β”‚
                                               β”‚   β†’ mpsc, JSON sidecars   β”‚
                                               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

The full review β€” load-bearing decisions and findings β€” lives in ARCHITECTURE.md; milestone status in PLAN.md. The audio engine is now the shared localgpt-world-audio crate (one kira mixer, FunDSP graphs as sources); Verse’s own code keeps its analysis, moods, placement and performance.

LicensesπŸ”—

PartLicense
LocalGPT Verse codeApache License 2.0
Marcellus & Hanken Grotesk fontsSIL Open Font License 1.1
3D model pack & starter music (localgpt-world-assets)CC0 1.0 (public domain)
CLAP audio model weightsCC-BY-NC-4.0 β€” non-commercial only

The optional model downloads (scripts/fetch-*.sh) carry their own licenses; the asset manifest records every model’s source, author, and license, and the in-app Credits & Licenses screen renders it.