Skip to content

Commit b38016d

Browse files
committed
Availability of 0.2.1
1 parent 9125e16 commit b38016d

25 files changed

Lines changed: 262 additions & 103 deletions

File tree

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.1] - 2026-06-06
9+
10+
### Changed
11+
12+
- **Raised compile optimization for the `test` and `dev` profiles** (`Cargo.toml`): added `[profile.test] opt-level = 2` and `[profile.dev.package."*"] opt-level = 3`, so test binaries and all dependencies (including workspace path-deps like `oxibonsai-model` / `oxibonsai-kernels` when built as deps of another crate's tests) are optimized and autovectorized. At the default `opt-level = 0` the workspace's tests run real numeric work unoptimized — the parity golden references and model forward passes took *minutes* (e.g. the DiT-shape joint-attention CPU reference ~14.5 GFLOP, and the speculative decoder's ~240 forward passes over the 151936-row vocab). The crate under active edit stays at `dev` opt-level 0, so incremental compiles of your own code remain fast. Float results are unchanged: Rust does not enable fast-math, so `opt-level` does not reassociate reductions — parity gates (cos≥0.999) stay bit-stable.
13+
- **Bumped `oxiarc-deflate` 0.3.2 → 0.3.3** (`Cargo.toml`, `[workspace.dependencies]`): tracks the latest OxiARC release per the COOLJAPAN Latest-crates policy. `oxiarc-deflate` provides the Pure-Rust DEFLATE backend for PNG output in `oxibonsai-image`; the substantive fixes in the 0.3.3 OxiARC release land in sibling crates (`oxiarc-brotli` high-entropy round-trip), so for OxiBonsai this is a version-tracking bump with no change to DEFLATE/PNG behavior.
14+
15+
### Fixed
16+
17+
- **VAE precheck rejected a valid `.safetensors` file** (`oxibonsai-image`, `src/pipeline.rs`): the text-to-image precheck used `is_dir()`, so a valid `.safetensors` FILE passed via `--vae` / `OXI_VAE_WEIGHTS` was rejected with "VAE weights dir not found" before any loading — even though `VaeWeights::open` and the docs both accept a file. The precheck now accepts a file **or** a directory (`is_file() || is_dir()`), error wording is corrected, and the stale doc-comment is fixed. Added regression tests `test_issue_9_*`. (#9)
18+
19+
### Documentation
20+
21+
- **Corrected stale HuggingFace asset paths** (`docs/IMAGEN.md`, `crates/oxibonsai-image/README.md`): the DiT lives under `transformer-packed-mflux/`, and the text encoder + tokenizer ship inside the main `prism-ml/bonsai-image-ternary-4B-mlx-2bit` repo under `text_encoder-mlx-4bit/` (the standalone `prism-ml/text_encoder-mlx-4bit` repo does not exist). Consumer paths updated to match `hf download --local-dir` layout, and the bundled vs. gated `black-forest-labs/FLUX.2-dev` VAE choice is clarified. Verified against the live HF API. (#8)
22+
23+
---
24+
825
## [0.2.0] - 2026-06-02
926

1027
### Added
@@ -314,6 +331,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
314331
- Comprehensive test suite (140 tests)
315332
- Cross-platform support (macOS, Linux, Windows, WASM)
316333

334+
[0.2.1]: https://github.com/cool-japan/oxibonsai/compare/v0.2.0...v0.2.1
317335
[0.2.0]: https://github.com/cool-japan/oxibonsai/compare/v0.1.5...v0.2.0
318336
[0.1.2]: https://github.com/cool-japan/oxibonsai/compare/v0.1.1...v0.1.2
319337
[0.1.1]: https://github.com/cool-japan/oxibonsai/compare/v0.1.0...v0.1.1

Cargo.toml

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ members = [
1414
]
1515

1616
[workspace.package]
17-
version = "0.2.0"
17+
version = "0.2.1"
1818
edition = "2021"
1919
license = "Apache-2.0"
2020
repository = "https://github.com/cool-japan/oxibonsai"
@@ -27,23 +27,23 @@ categories = ["science", "algorithms", "command-line-utilities"]
2727

2828
[workspace.dependencies]
2929
# ── Internal crates ──
30-
oxibonsai-core = { path = "crates/oxibonsai-core", version = "0.2.0" }
31-
oxibonsai-image = { path = "crates/oxibonsai-image", version = "0.2.0" }
32-
oxibonsai-kernels = { path = "crates/oxibonsai-kernels", version = "0.2.0" }
33-
oxibonsai-model = { path = "crates/oxibonsai-model", version = "0.2.0" }
34-
oxibonsai-runtime = { path = "crates/oxibonsai-runtime", version = "0.2.0", default-features = false }
35-
oxibonsai-tokenizer = { path = "crates/oxibonsai-tokenizer", version = "0.2.0" }
36-
oxibonsai-serve = { path = "crates/oxibonsai-serve", version = "0.2.0" }
37-
oxibonsai-rag = { path = "crates/oxibonsai-rag", version = "0.2.0" }
38-
oxibonsai-eval = { path = "crates/oxibonsai-eval", version = "0.2.0" }
39-
oxibonsai = { path = "crates/oxibonsai", version = "0.2.0" }
30+
oxibonsai-core = { path = "crates/oxibonsai-core", version = "0.2.1" }
31+
oxibonsai-image = { path = "crates/oxibonsai-image", version = "0.2.1" }
32+
oxibonsai-kernels = { path = "crates/oxibonsai-kernels", version = "0.2.1" }
33+
oxibonsai-model = { path = "crates/oxibonsai-model", version = "0.2.1" }
34+
oxibonsai-runtime = { path = "crates/oxibonsai-runtime", version = "0.2.1", default-features = false }
35+
oxibonsai-tokenizer = { path = "crates/oxibonsai-tokenizer", version = "0.2.1" }
36+
oxibonsai-serve = { path = "crates/oxibonsai-serve", version = "0.2.1" }
37+
oxibonsai-rag = { path = "crates/oxibonsai-rag", version = "0.2.1" }
38+
oxibonsai-eval = { path = "crates/oxibonsai-eval", version = "0.2.1" }
39+
oxibonsai = { path = "crates/oxibonsai", version = "0.2.1" }
4040

4141
# ── COOLJAPAN Ecosystem (Pure Rust Policy) ──
4242
scirs2-core = { version = "0.5.0", default-features = false }
4343
scirs2-linalg = { version = "0.5.0", default-features = false }
4444
scirs2-neural = { version = "0.5.0", default-features = false }
4545
oxifft = "0.3.2"
46-
oxiarc-deflate = "0.3.2"
46+
oxiarc-deflate = "0.3.3"
4747

4848
# ── GPU backends ──
4949
metal = "0.33.0"
@@ -229,3 +229,21 @@ harness = false
229229
lto = true
230230
codegen-units = 1
231231
opt-level = 3
232+
233+
# Test/dev runtime performance. This workspace's tests run real numeric work
234+
# (parity golden references, model forward passes). At the default dev/test
235+
# opt-level=0 those are unoptimized + non-autovectorized, so some tests take
236+
# *minutes* (e.g. the DiT-shape joint-attention CPU reference ~14.5 GFLOP, and
237+
# the speculative decoder's ~240 forward passes over the 151936-row vocab).
238+
# Float results are unchanged: Rust does not enable fast-math, so opt-level does
239+
# not reassociate reductions — parity gates (cos>=0.999) stay bit-stable.
240+
[profile.test]
241+
opt-level = 2
242+
243+
# Dependencies (incl. workspace path-deps like oxibonsai-model/-kernels when
244+
# built as deps of another crate's tests) compile under the `dev` profile during
245+
# `cargo test`/`nextest`. Optimize them so the model forward in the runtime tests
246+
# isn't the bottleneck. The crate you're actively editing stays at dev
247+
# opt-level=0, so incremental compiles of your own code remain fast.
248+
[profile.dev.package."*"]
249+
opt-level = 3

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ To our knowledge, OxiBonsai is the first pure-Rust — C/C++/Fortran-free, zero-
1717

1818
## Status
1919

20-
**Version 0.2.0** — released 2026-06-02 · **4,667 tests passing** · ~177k lines of Rust · Pure Rust
20+
**Version 0.2.1** — released 2026-06-06 · **4,667 tests passing** · ~177k lines of Rust · Pure Rust
2121

2222
| Crate | Status | Tests |
2323
|-------|--------|-------|
@@ -173,7 +173,7 @@ This installs the `oxibonsai` binary. Rust 1.86+ required.
173173

174174
```toml
175175
[dependencies]
176-
oxibonsai = "0.2.0"
176+
oxibonsai = "0.2.1"
177177
```
178178

179179
### Build from source (for development)

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# OxiBonsai TODO
22

33
> Pure Rust 1-bit LLM inference engine for PrismML Bonsai models
4-
> 619 source files, ~177,000 lines of Rust code, 4,667 tests passing across workspace — verified 2026-06-02 (0.2.0)
4+
> 619 source files, ~177,000 lines of Rust code, 4,667 tests passing across workspace — verified 2026-06-02 (0.2.1)
55
66
## Bonsai-Image Port (FLUX.2 Text-to-Image, Pure Rust) — COMPLETE
77

crates/oxibonsai-core/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# oxibonsai-core
22

3-
[![Version](https://img.shields.io/badge/version-0.2.0-blue.svg)](https://crates.io/crates/oxibonsai-core)
3+
[![Version](https://img.shields.io/badge/version-0.2.1-blue.svg)](https://crates.io/crates/oxibonsai-core)
44
[![Tests](https://img.shields.io/badge/tests-207%20passing-brightgreen.svg)]()
55
[![Status](https://img.shields.io/badge/status-stable-brightgreen.svg)]()
66

@@ -37,7 +37,7 @@ Part of the [OxiBonsai](https://github.com/cool-japan/oxibonsai) project.
3737

3838
```toml
3939
[dependencies]
40-
oxibonsai-core = "0.2.0"
40+
oxibonsai-core = "0.2.1"
4141
```
4242

4343
## License

crates/oxibonsai-core/TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> GGUF loader, quant block types, tensor types, model config, error types
44
> 16 files, ~5,215 lines, 207 tests
5-
> Version: 0.2.0 — Last updated: 2026-06-02
5+
> Version: 0.2.1 — Last updated: 2026-06-06
66
77
## Status: ✅ All Features Complete
88

crates/oxibonsai-eval/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# oxibonsai-eval
22

3-
[![Version](https://img.shields.io/badge/version-0.2.0-blue.svg)](https://crates.io/crates/oxibonsai-eval)
3+
[![Version](https://img.shields.io/badge/version-0.2.1-blue.svg)](https://crates.io/crates/oxibonsai-eval)
44
[![Status](https://img.shields.io/badge/status-stable-brightgreen.svg)]()
55
[![Tests](https://img.shields.io/badge/tests-513%20passing-brightgreen.svg)]()
66

@@ -14,7 +14,7 @@ Part of the [OxiBonsai](https://github.com/cool-japan/oxibonsai) project.
1414

1515
## Status
1616

17-
**Stable** (v0.2.0) — 513 tests passing.
17+
**Stable** (v0.2.1) — 513 tests passing.
1818

1919
## Features
2020

@@ -35,7 +35,7 @@ Part of the [OxiBonsai](https://github.com/cool-japan/oxibonsai) project.
3535

3636
```toml
3737
[dependencies]
38-
oxibonsai-eval = "0.2.0"
38+
oxibonsai-eval = "0.2.1"
3939
```
4040

4141
```rust

crates/oxibonsai-eval/TODO.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
> Model evaluation harness: perplexity, accuracy, ROUGE, throughput metrics
44
> 19 source files, 11 test files, 219 integration + proptest tests passing
5-
> Version: 0.2.0 — Status: Stable
6-
> Last updated: 2026-06-02
5+
> Version: 0.2.1 — Status: Stable
6+
> Last updated: 2026-06-06
77
88
## Status: Stable — Phase 18: WinoGrande + BoolQ evaluators added
99

crates/oxibonsai-image/README.md

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Pure-Rust text-to-image pipeline: FLUX.2-Klein DiT (TQ2_0_g128 ternary) + AutoencoderKLFlux2 VAE + Qwen3-4B 4-bit text encoder + PNG output, all parity-validated against the MLX reference at cosine ≥ 0.999.
44

5-
**Version:** 0.2.0
5+
**Version:** 0.2.1
66

77
Part of the [OxiBonsai](https://github.com/cool-japan/oxibonsai) project.
88

@@ -59,7 +59,7 @@ Add to your `Cargo.toml`:
5959

6060
```toml
6161
[dependencies]
62-
oxibonsai-image = { version = "0.2.0", features = ["metal"] } # or "native-cuda"
62+
oxibonsai-image = { version = "0.2.1", features = ["metal"] } # or "native-cuda"
6363
```
6464

6565
Build with the matching GPU feature:
@@ -91,9 +91,9 @@ let cfg = TextToImageCfg {
9191
height: 512,
9292
guidance: 1.0,
9393
dit_gguf: PathBuf::from("./bonsai-dit.gguf"),
94-
vae_weights_dir: PathBuf::from("./flux2/vae/diffusion_pytorch_model.safetensors"),
95-
te_source: TeSource::Mlx4bit(PathBuf::from("./bonsai-te/model.safetensors")),
96-
tokenizer_dir: PathBuf::from("./bonsai-te"),
94+
vae_weights_dir: PathBuf::from("./bonsai-vae/vae/diffusion_pytorch_model.safetensors"),
95+
te_source: TeSource::Mlx4bit(PathBuf::from("./bonsai-te/text_encoder-mlx-4bit/model.safetensors")),
96+
tokenizer_dir: PathBuf::from("./bonsai-te/text_encoder-mlx-4bit"),
9797
golden_override: None,
9898
};
9999
@@ -119,14 +119,14 @@ flags take precedence). Create a `.env` in your working directory:
119119
OXI_DIT_GGUF=./bonsai-dit.gguf
120120
121121
# Text encoder: 4-bit MLX model.safetensors (≈2.1 GB)
122-
OXI_TE_4BIT=./bonsai-te/model.safetensors
122+
OXI_TE_4BIT=./bonsai-te/text_encoder-mlx-4bit/model.safetensors
123123
124124
# Tokenizer directory containing tokenizer.json
125125
# (defaults to the TE .safetensors parent when omitted)
126-
OXI_TE_TOKENIZER_DIR=./bonsai-te
126+
OXI_TE_TOKENIZER_DIR=./bonsai-te/text_encoder-mlx-4bit
127127
128128
# VAE weights: .safetensors file or legacy .npy directory
129-
OXI_VAE_WEIGHTS=./flux2/vae/diffusion_pytorch_model.safetensors
129+
OXI_VAE_WEIGHTS=./bonsai-vae/vae/diffusion_pytorch_model.safetensors
130130
```
131131

132132
**GPU stage toggles** (default on; set to `"0"` to opt out):
@@ -149,18 +149,24 @@ You need three model assets plus a tokenizer. Downloads use the HuggingFace CLI
149149

150150
```bash
151151
# 1. DiT: download ternary MLX checkpoint and convert to GGUF
152+
# (hf download keeps the repo subfolder, so files land under ./bonsai-dit/transformer-packed-mflux/)
152153
hf download prism-ml/bonsai-image-ternary-4B-mlx-2bit \
153-
diffusion_pytorch_model.safetensors --local-dir ./bonsai-dit
154+
transformer-packed-mflux/diffusion_pytorch_model.safetensors --local-dir ./bonsai-dit
154155
cargo run -p oxibonsai-model --example mlx_image_convert --release -- \
155-
./bonsai-dit/diffusion_pytorch_model.safetensors ./bonsai-dit.gguf tq2_0_g128
156+
./bonsai-dit/transformer-packed-mflux/diffusion_pytorch_model.safetensors ./bonsai-dit.gguf tq2_0_g128
156157

157-
# 2. Text encoder (no conversion — native 4-bit Rust loader)
158-
hf download prism-ml/text_encoder-mlx-4bit \
159-
model.safetensors tokenizer.json --local-dir ./bonsai-te
158+
# 2. Text encoder + tokenizer (same repo; no conversion — native 4-bit Rust loader)
159+
hf download prism-ml/bonsai-image-ternary-4B-mlx-2bit \
160+
text_encoder-mlx-4bit/model.safetensors text_encoder-mlx-4bit/tokenizer.json \
161+
--local-dir ./bonsai-te
160162

161-
# 3. VAE (no conversion — native safetensors Rust loader)
162-
hf download black-forest-labs/FLUX.2-dev \
163-
vae/diffusion_pytorch_model.safetensors --local-dir ./flux2
163+
# 3. VAE (no conversion — native safetensors Rust loader).
164+
# Option A (simplest, non-gated): the VAE bundled in the same PrismML repo
165+
hf download prism-ml/bonsai-image-ternary-4B-mlx-2bit \
166+
vae/diffusion_pytorch_model.safetensors --local-dir ./bonsai-vae
167+
# Option B (canonical, gated — needs huggingface-cli login + license):
168+
# hf download black-forest-labs/FLUX.2-dev \
169+
# vae/diffusion_pytorch_model.safetensors --local-dir ./flux2
164170
```
165171

166172
For the full step-by-step walkthrough see [`docs/IMAGEN.md`](../../docs/IMAGEN.md).

crates/oxibonsai-image/TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# oxibonsai-image TODO
22

3-
> v0.2.0 — 2026-06-02
3+
> v0.2.1 — 2026-06-06
44
> **STABLE** — imagen pipeline complete, GPU-accelerated, parity-validated.
55
66
## Completed

0 commit comments

Comments
 (0)