Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
23f8c16
lpc: fix test failures - phase 1: fix JIT tests to use Fixed32 format
Yona-Appletree Jan 21, 2026
1735363
fix(emulator): improve debugging output for function execution
Yona-Appletree Jan 21, 2026
a815259
fix(emulator): separate instruction limits for bootstrap init and exe…
Yona-Appletree Jan 21, 2026
c8ebac7
fix(elf-loader): detect symbol conflicts and fail fast on linking errors
Yona-Appletree Jan 21, 2026
b236ad3
refactor(builtins-app): rename main to _lp_main to avoid symbol confl…
Yona-Appletree Jan 21, 2026
6425e03
test(fixed32): improve error output in test utilities
Yona-Appletree Jan 21, 2026
9a8fab0
style: code formatting cleanup
Yona-Appletree Jan 21, 2026
dc4ab9e
fix(transform): ensure consistent FuncId assignment during module tra…
Yona-Appletree Jan 21, 2026
74a8856
fix(transform): convert TestCase external names to User names for Obj…
Yona-Appletree Jan 21, 2026
21bf7d5
fix(test): convert User names back to TestCase names in test formatter
Yona-Appletree Jan 21, 2026
d1de6c1
fix(elf_loader): load subsections like .text._init
Yona-Appletree Jan 21, 2026
fe8ac40
fix: add ToString import and remove unused format import
Yona-Appletree Jan 21, 2026
d6c1209
fix(elf_loader): correct __USER_MAIN_PTR LMA offset calculation
Yona-Appletree Jan 21, 2026
39686f7
chore(workflows): rename ci.yml; set it up to run on features
Yona-Appletree Jan 21, 2026
d3d802f
chore(workflows): add push trigger for feature branches in CI
Yona-Appletree Jan 21, 2026
e54a834
chore(scripts): add push.sh script and update tooling
Yona-Appletree Jan 21, 2026
1ed1169
style: apply cargo fmt formatting fixes
Yona-Appletree Jan 21, 2026
6364507
fix(clippy): add safety docs and fix code quality issues
Yona-Appletree Jan 21, 2026
db3fe6d
fix(clippy): add reason attributes to all allow annotations
Yona-Appletree Jan 21, 2026
fac8322
chore(justfile): add push and merge recipes
Yona-Appletree Jan 21, 2026
5de8158
fix(ci): configure git credentials for cargo git dependencies
Yona-Appletree Jan 21, 2026
cc310c9
fix(ci): improve git credential configuration for cargo
Yona-Appletree Jan 21, 2026
881e2e8
fix(ci): simplify git credential configuration
Yona-Appletree Jan 21, 2026
5184443
fix(ci): remove unnecessary credential config for public repos
Yona-Appletree Jan 21, 2026
a4ab96b
fix(scripts): show run ID and URL in push script output
Yona-Appletree Jan 21, 2026
26aa3cc
fix(ci): use ARM64 runners for workflows
Yona-Appletree Jan 21, 2026
f3faec9
fix(ci): use correct ARM64 runner syntax
Yona-Appletree Jan 21, 2026
5025889
fix(ci): exclude dependencies from clippy checks
Yona-Appletree Jan 21, 2026
92227f7
fix(clippy): fix uninlined format args warnings
Yona-Appletree Jan 21, 2026
f4a67ba
style: run cargo fmt
Yona-Appletree Jan 21, 2026
bbf3cc7
chore: update Cargo.lock to use fixed lp-cranelift commit
Yona-Appletree Jan 21, 2026
286b141
chore: update Cargo.lock to use fixed lp-cranelift commit
Yona-Appletree Jan 21, 2026
c7b0e44
feat(ci): improve CI workflow and push script
Yona-Appletree Jan 21, 2026
17364cc
feat(jit): implement GLSL JIT compilation pipeline
Yona-Appletree Jan 22, 2026
0584a61
fix(no_std): enable esp32-glsl-jit build for riscv32imac-unknown-none…
Yona-Appletree Jan 22, 2026
cec2329
fix(workspace): configure esp32-glsl-jit as workspace member
Yona-Appletree Jan 22, 2026
190a2a1
fix(ci): exclude esp32-glsl-jit from clippy checks
Yona-Appletree Jan 22, 2026
419e10e
feat(ci): add separate clippy commands for embedded targets
Yona-Appletree Jan 22, 2026
c72f4d1
refactor(ci): simplify clippy commands for embedded targets
Yona-Appletree Jan 22, 2026
cc1a151
refactor(justfile): restructure with target-specific commands
Yona-Appletree Jan 22, 2026
c98705c
chore(lp-glsl-compiler): clean up unused imports and code style
Yona-Appletree Jan 22, 2026
95c6a99
style(lp-glsl-compiler): apply code formatting
Yona-Appletree Jan 22, 2026
438fb90
fix(tests): use only release builds for builtins executable
Yona-Appletree Jan 22, 2026
44fdd4c
fix(builtin-gen): add alloc::format import to generated registry.rs
Yona-Appletree Jan 22, 2026
d3997f8
fix(ci): update workflow to use 'just ci' command
Yona-Appletree Jan 22, 2026
042f984
fix(riscv-tools): remove unused debug imports
Yona-Appletree Jan 22, 2026
e19633a
fix(lp-riscv-tools): remove unused debug module imports
Yona-Appletree Jan 22, 2026
d2fcc52
chore: add rust-toolchain.toml to pin Rust version
Yona-Appletree Jan 22, 2026
bcd2af8
chore(scripts): remove git hook installation from dev-init.sh
Yona-Appletree Jan 22, 2026
1862fd6
chore(workflows): update CI environment to use ubuntu-24.04
Yona-Appletree Jan 22, 2026
9899b98
chore(workflows): update CI to use ubuntu-24.04-arm and adjust valida…
Yona-Appletree Jan 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .cursorrules
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,31 @@

# Commits: Commit frequently with small incremental changes

# Commits: Keep commit messages short (one line when possible)
# Commits: Use Conventional Commits format: `<type>(<scope>): <description>`
# - Types: feat, fix, chore, docs, etc.
# - Scope: sbs, osmt, wrappers, etc. (or component name)
# - Description: short description of the commit
# - Body: optional, include only if changes are not obvious from description
# - Body format: bulleted list of changes made, each item a single line

# Commits: Keep code compiling and tests passing between commits (when possible)

# Formatting: Run `cargo +nightly fmt` on all changes before committing

# Code Organization: Place helper utility functions at the bottom of files
# Code Organization: Place more abstract things, entry points, and tests first
# Code Organization: Keep related functionality grouped together

# Tests: Tests should be in `mod tests` at the top of the module
# Tests: Tests should be short and concise, use utility functions to avoid duplication
# Tests: Utility functions should be at the bottom of the test module
# Tests: Use builder pattern to create test data

# Language: Keep language professional and restrained
# Language: Avoid overly optimistic language like "comprehensive", "fully production ready", "complete solution"
# Language: Avoid emoticons
# Language: Use measured, factual descriptions of what was implemented

# Style: Follow existing cranelift code style

# Style: Use `#![no_std]` where appropriate
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/pre-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
pull_request:
branches: ["feature/*"]
push:
branches: ["feature/*"]

env:
RUST_BACKTRACE: 1
RISC_V_TARGET: riscv32imac-unknown-none-elf

jobs:
test:
name: Test
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Install RISC-V target
run: rustup target add ${{ env.RISC_V_TARGET }}

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Install just
uses: extractions/setup-just@v3

- name: Validate
# Note: we don't run tests on ci right now because jit tests fail on arm
# due to memory protection, and don't run on x64 due to some cranelift
# x64 build issue.
run: just check build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ vendor
*.smt2
*.cwasm
/artifacts
.ci-artifacts
testcase*.wat
testcase*.wasm
testcase*.dna
Expand Down
1 change: 1 addition & 0 deletions .idea/lp2025.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions .vscode/keybindings.json

This file was deleted.

52 changes: 20 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 27 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,36 @@ members = [
"lp-glsl/crates/lp-jit-util",
"lp-glsl/crates/lp-riscv-shared",
"lp-glsl/crates/lp-riscv-tools",
"lp-glsl/apps/esp32-glsl-jit",
"lp-glsl/apps/lp-builtin-gen",
"lp-glsl/apps/lp-builtins-app",
"lp-glsl/apps/lp-test",
"lp-glsl/apps/test-structreturn",
"lp-glsl/apps/esp32-glsl-jit",
]
resolver = "2"

# Exclude lp-builtins-app and esp32-glsl-jit from default workspace builds (they're no_std, only build for RISC-V)
# They're still in workspace members so they can use workspace dependencies
# Build them explicitly with: just build-builtins or just esp32-build
default-members = [
# lp-app workspace members
"lp-app/crates/lp-engine",
"lp-app/crates/lp-engine-client",
"lp-app/crates/lp-shared",
"lp-app/crates/lp-server",
"lp-app/apps/lp-cli",
"lp-app/crates/lp-model",
# lp-glsl workspace members (excluding lp-builtins-app)
"lp-glsl/crates/lp-builtins",
"lp-glsl/crates/lp-filetests-gen",
"lp-glsl/crates/lp-glsl-compiler",
"lp-glsl/crates/lp-glsl-filetests",
"lp-glsl/crates/lp-jit-util",
"lp-glsl/crates/lp-riscv-shared",
"lp-glsl/crates/lp-riscv-tools",
"lp-glsl/apps/lp-builtin-gen",
"lp-glsl/apps/lp-test",
]

[workspace.package]
version = "40.0.0"
authors = ["The Wasmtime Project Developers"]
Expand Down Expand Up @@ -71,6 +93,7 @@ cranelift-interpreter = { git = "https://github.com/Yona-Appletree/lp-cranelift.
target-lexicon = "0.13.0"
hashbrown = { version = "0.15", default-features = false, features = ["alloc", "default-hasher"] }
anyhow = { version = "1.0.100", default-features = false }
log = { version = "0.4", default-features = false }
regex = "1.9.1"
glob = "0.3.3"
object = { version = "0.37.3", default-features = false, features = ['read_core', 'elf'] }
Expand All @@ -83,11 +106,12 @@ serde_json = { version = "1.0.80", default-features = false, features = ["alloc"
# This applies to all packages in the workspace
lto = true

# ESP32 app release profile optimizations (embedded target)
[profile.release.package.esp32-glsl-jit]
# Size optimizations for embedded target (ESP32-C3)
# Strip debuginfo but keep symbols (needed for defmt/probe-rs) - saves ~1-1.5 MB
strip = "debuginfo"
# Optimize for size instead of speed - saves ~200-500 KB
opt-level = "z"
# Single codegen unit for better dead code elimination - saves ~50-100 KB
codegen-units = 1
# Note: lto is inherited from workspace [profile.release]
41 changes: 26 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
# LightPlayer Application

LightPlayer is a framework for building and deploying interactive visualization applications
using GLSL primarily for addressable LED control on embedded systems.
LightPlayer is a framework for building and deploying interactive visual effects on microcontrollers and other embedded systems.

It employs a client-server architecture, where the server runs the visualization on
a headless machine (e.g. an esp32-c6 or raspberry pi), and the client communicates with
the server via a network or serial connection.
Effects are written as GLSL shaders a custom native compiler is used to allow running them on hardware without OpenGL, including microcontrollers.

The server portion is portable, and is designed to be runnable from any OS for
development, a headless host for larger deployments, or as bare-metal firmware
on an embedded system.
## Development Setup

On machines without OpenGL support, such as embedded systems, the shaders are compiled to native
code using the bespoke LightPlayer GLSL compiler which is built on a fork of Cranelift.
To get started with development:

# Workspace
1. **Initialize the development environment:**

This workspace contains the main LightPlayer application, including the device specific firmware,
engine, server, and clients.
```bash
scripts/dev-init.sh
```

It exists within cranelift temporarily during active development of the compiler, because managing
multiple repositories is too cumbersome.
This will:
- Check for required tools (Rust, Cargo, rustup, just)
- Verify Rust version meets minimum requirements (1.90.0+)
- Install the RISC-V target (`riscv32imac-unknown-none-elf`) if needed
- Set up git hooks (pre-commit hook runs `just check`)

2. **Required tools:**
- Rust toolchain (1.90.0 or later) - [Install Rust](https://rustup.rs/)
- `just` - Task runner: `cargo install just` or via package manager

3. **Common development commands:**
- `just build` - Build all packages (host and RISC-V targets)
- `just check` - Run formatting and linting checks
- `just test` - Run all tests
- `just fmt` - Format code
- `just fix` - Format code and auto-fix clippy issues

See `just --list` for all available commands.
Loading