Requires Python 3.13 + uv + Xcode 16+ (for the apple/ target).
pyproject.toml's [tool.uv.sources] pins mflux and mlx to specific revisions under PrismML-Eng/. uv sync resolves both automatically — no sibling checkout required:
uv venv .venv
uv pip install --python .venv/bin/python -e .Bump the mlx rev or switch mflux to a sha pin by editing [tool.uv.sources] if you need to lock further.
Per-component setup lives in docs/.
Backend (FastAPI):
.venv/bin/python -m pytest backend/tests/Backend GPU (deployed to a CUDA host; tests exercise the loaders + server stubs):
.venv/bin/python -m pytest backend_gpu/tests/Apple (Mac Catalyst, fastest local loop):
xcodebuild test -project apple/Bonsai.xcodeproj -scheme Bonsai \
-destination 'platform=macOS,variant=Mac Catalyst,arch=arm64'iPhone parity, performance, and end-to-end tests are gated on a checkpoint payload at BONSAI_TEST_CHECKPOINT_ROOT (or the documented fallback). They XCTSkip cleanly when the payload is missing.
Short, lower-case, imperative. Match git log style. No bodies unless the change is genuinely subtle. No co-author trailers, no AI-tool attribution.
apple: fused norm+RoPE megakernel + Klein parity tests
backend: pixel-stat diag for checkpoint sweep
docs: add LICENSE Apache 2.0
- One concern per PR. If a change naturally splits into setup + behavior, split it.
- Don't auto-merge. Wait for review.
- Update
docs/andREADME.mdwhen behavior or env vars change.
- Swift: follow the existing pattern in
apple/Bonsai/— 4-space indent, no semicolons, terseletovervar. Run the test suite under Mac Catalyst before pushing. - Python: 4-space indent, type-hinted public APIs. The
backend/andbackend_gpu/modules are kept readable over clever; prefer explicit imports and short functions. - TypeScript / Next.js (
frontend/):npm run lintbefore pushing.