1# llimphi
2
3> Native UI framework — 2D **and** 3D: HAL · raster · layout · text · theme · ui · 3D voxel engine — plus widgets and modules.
4
5`llimphi` is a sovereign, retained-mode UI framework with an Elm-style loop (`input → update → view → layout → raster → present`). Declarative pipeline over `vello` 0.9 + `wgpu` 29 + `taffy` 0.12 + `parley` 0.6, with `Dark/Light/Aurora/Sunset/Tawa` themes, AccessKit accessibility and a multi-platform HAL (Wayland · X11 · Win32 · Android · Wawa bare-metal). It powers a full Rust application suite; this repository is the framework extracted to stand on its own.
6
7<p align="center">
8 <img src="docs/showreel.gif" alt="Llimphi showreel — real widgets (switch, slider, progress, segmented control, buttons, radial) animating live, then reflowing across layouts" width="900">
9 <br>
10 <sub>real widgets in motion — rendered headless, frame-by-frame, fully deterministic</sub>
11</p>
12
13<p align="center">
14 <img src="docs/counter.gif" alt="counter example — the full Elm loop in ~124 LOC" width="480">
15 <br>
16 <sub>…and the entire Elm loop in ~124 LOC — <code>cargo run -p llimphi-ui --example counter</code></sub>
17</p>
18
19## Not just 2D — a 3D voxel engine
20
21<p align="center">
22 <img src="docs/llimphi_voxel.gif" alt="Flying over an endless procedural voxel world — rendered by llimphi-3d" width="720">
23 <br>
24 <sub>flying over an endless voxel world — rendered headless by <code>llimphi-3d</code>, frame-by-frame</sub>
25</p>
26
27`llimphi-3d` is a **3D engine** on the same `wgpu`: it composes voxels (a GPU ray-march) and triangle meshes in one shared depth pass, with a keyframed cinema camera. It mounts into the ordinary 2D `View` tree through the GPU paint node (`set_viewport` + scissor), so a 3D viewport can live in a panel next to regular widgets — no second window, same Elm loop.
28
29`llimphi-voxel` adds the *content* layer on top: procedural world-gen (`WorldRecipe`), articulated characters (age + animation clips) and a scripted scene **director**. The GIF above is one such world. (A full voxel **world studio** — edit worlds, cast characters, direct filmed scenes, export to video — is built on these in the wider project.)
30
31**Usage manual:** [MANUAL.md](MANUAL.md) — full reference (Elm loop, `View<Msg>` DSL, the 76 widgets and 11 modules, GPU path, gotchas) for humans and AI. Design rationale and roadmap: [SDD.md](SDD.md).
32
33Philosophy: **widgets aren't designed against mockups; they're designed with what `vello` and `taffy` can do.**
34
35## Quick start
36
37```sh
38git clone https://git.tawasuyu.net/tawasuyu/llimphi.git
39cd llimphi
40cargo run -p llimphi-ui --example counter # ~124 LOC: the full Elm loop on screen
41```
42
43## Install
44
45From crates.io — the `llimphi` facade re-exports `llimphi-ui`, `llimphi-theme` and `llimphi-3d`:
46
47```sh
48cargo add llimphi
49```
50
51Or crate by crate (widgets are one crate each — pull only what you use):
52
53```toml
54[dependencies]
55llimphi-ui = "0.1"
56llimphi-theme = "0.1"
57llimphi-widget-button = "0.1"
58```
59
60## Beyond the 2D widget kit
61
62Pieces worth naming because they change what an app can be:
63
64- **Four paths to pixels, one compositor.** `vello` on GPU compute is the main road;
65 `llimphi-cpu` (`vello_cpu`) paints the bare-metal framebuffer; `llimphi-hybrid`
66 (`vello_hybrid`) is CPU+GPU with no compute shaders, for hardware that lacks it
67 (this is the one that runs on a phone's Mali); and `llimphi-wire-escena` serializes
68 a scene so a sandboxed guest can compose it and a host replay it. The same scene
69 tree goes through all of them and the output is diffed **per pixel** — wire vs
70 direct is bit-identical, hybrid vs CPU never differs by more than 1/255.
71- **Text.** `parley` shapes; `llimphi-glifos` rasterizes each glyph once into a
72 shelf-packed coverage atlas (4 subpixel positions per axis) so a line of text is
73 quads instead of outlines — 3.6–5× faster on the direct-GPU path.
74- **Testing.** `llimphi-test` is the headless, deterministic golden-image harness —
75 the reason a UI change can be certified as *text* (pixel-diff counts per threshold)
76 instead of by looking at a screenshot. Where two paths should paint the same thing,
77 the oracle is the other path, not a blessed image.
78- **Animation.** `llimphi-anim` is a Rive-style, clip-agnostic state machine;
79 `llimphi-lottie` and `llimphi-svg` are thin bridges to `velato` and `vello_svg`;
80 `llimphi-mesh` renders deformable meshes with bones and skinning.
81- **Surfaces.** `llimphi-layer` runs an `App` as a `wlr-layer-shell` surface (a bar
82 anchored to a screen edge) rather than a window. `llimphi-term-graphics` covers the
83 terminal graphics protocols.
84
85## Compatibility
86
87- **Linux/Wayland** — primary backend.
88- **Linux/X11** — via XWayland.
89- **macOS / Windows** — `winit` + `wgpu`.
90- **Android** — HAL via `android` crates (`hybrid` is the renderer that works on Mali).
91- **Wawa bare-metal** — alternative framebuffer HAL, over `llimphi-cpu`.
92
93Full crate index (framework · widgets · modules · android) in [MANUAL.md](MANUAL.md) §19.
94
95## Considerations
96
97- **Single API: declarative `View<Msg>`.** No imperative, no foreign vDOM.
98- **Same scene tree on Wayland and Wawa**: HAL abstracts the surface.
99- Widgets are **purely visual**; modules encapsulate state + behavior.
README.md
llimphi
Native UI framework — 2D and 3D: HAL · raster · layout · text · theme · ui · 3D voxel engine — plus widgets and modules.
llimphi is a sovereign, retained-mode UI framework with an Elm-style loop (input → update → view → layout → raster → present). Declarative pipeline over vello 0.9 + wgpu 29 + taffy 0.12 + parley 0.6, with Dark/Light/Aurora/Sunset/Tawa themes, AccessKit accessibility and a multi-platform HAL (Wayland · X11 · Win32 · Android · Wawa bare-metal). It powers a full Rust application suite; this repository is the framework extracted to stand on its own.
<p align="center">
<img src="docs/showreel.gif" alt="Llimphi showreel — real widgets (switch, slider, progress, segmented control, buttons, radial) animating live, then reflowing across layouts" width="900">
<br>
<sub>real widgets in motion — rendered headless, frame-by-frame, fully deterministic</sub>
</p>
<p align="center">
<img src="docs/counter.gif" alt="counter example — the full Elm loop in ~124 LOC" width="480">
<br>
<sub>…and the entire Elm loop in ~124 LOC — <code>cargo run -p llimphi-ui --example counter</code></sub>
</p>
Not just 2D — a 3D voxel engine
<p align="center">
<img src="docs/llimphi_voxel.gif" alt="Flying over an endless procedural voxel world — rendered by llimphi-3d" width="720">
<br>
<sub>flying over an endless voxel world — rendered headless by <code>llimphi-3d</code>, frame-by-frame</sub>
</p>
llimphi-3d is a 3D engine on the same wgpu: it composes voxels (a GPU ray-march) and triangle meshes in one shared depth pass, with a keyframed cinema camera. It mounts into the ordinary 2D View tree through the GPU paint node (set_viewport + scissor), so a 3D viewport can live in a panel next to regular widgets — no second window, same Elm loop.
llimphi-voxel adds the content layer on top: procedural world-gen (WorldRecipe), articulated characters (age + animation clips) and a scripted scene director. The GIF above is one such world. (A full voxel world studio — edit worlds, cast characters, direct filmed scenes, export to video — is built on these in the wider project.)
Usage manual: MANUAL.md — full reference (Elm loop, View<Msg> DSL, the 76 widgets and 11 modules, GPU path, gotchas) for humans and AI. Design rationale and roadmap: SDD.md.
Philosophy: widgets aren't designed against mockups; they're designed with what vello and taffy can do.
Quick start
git clone https://git.tawasuyu.net/tawasuyu/llimphi.git
cd llimphi
cargo run -p llimphi-ui --example counter # ~124 LOC: the full Elm loop on screen
Install
From crates.io — the llimphi facade re-exports llimphi-ui, llimphi-theme and llimphi-3d:
cargo add llimphi
Or crate by crate (widgets are one crate each — pull only what you use):
[dependencies]
llimphi-ui = "0.1"
llimphi-theme = "0.1"
llimphi-widget-button = "0.1"
Beyond the 2D widget kit
Pieces worth naming because they change what an app can be:
- Four paths to pixels, one compositor.
vello on GPU compute is the main road;
llimphi-cpu (vello_cpu) paints the bare-metal framebuffer; llimphi-hybrid
(vello_hybrid) is CPU+GPU with no compute shaders, for hardware that lacks it
(this is the one that runs on a phone's Mali); and llimphi-wire-escena serializes
a scene so a sandboxed guest can compose it and a host replay it. The same scene
tree goes through all of them and the output is diffed per pixel — wire vs
direct is bit-identical, hybrid vs CPU never differs by more than 1/255.
- Text.
parley shapes; llimphi-glifos rasterizes each glyph once into a
shelf-packed coverage atlas (4 subpixel positions per axis) so a line of text is
quads instead of outlines — 3.6–5× faster on the direct-GPU path.
- Testing.
llimphi-test is the headless, deterministic golden-image harness —
the reason a UI change can be certified as text (pixel-diff counts per threshold)
instead of by looking at a screenshot. Where two paths should paint the same thing,
the oracle is the other path, not a blessed image.
- Animation.
llimphi-anim is a Rive-style, clip-agnostic state machine;
llimphi-lottie and llimphi-svg are thin bridges to velato and vello_svg;
llimphi-mesh renders deformable meshes with bones and skinning.
- Surfaces.
llimphi-layer runs an App as a wlr-layer-shell surface (a bar
anchored to a screen edge) rather than a window. llimphi-term-graphics covers the
terminal graphics protocols.
Compatibility
- Linux/Wayland — primary backend.
- Linux/X11 — via XWayland.
- macOS / Windows —
winit + wgpu.
- Android — HAL via
android crates (hybrid is the renderer that works on Mali).
- Wawa bare-metal — alternative framebuffer HAL, over
llimphi-cpu.
Full crate index (framework · widgets · modules · android) in MANUAL.md §19.
Considerations
- Single API: declarative
View<Msg>. No imperative, no foreign vDOM.
- Same scene tree on Wayland and Wawa: HAL abstracts the surface.
- Widgets are purely visual; modules encapsulate state + behavior.