Skip to content

Commit 6edf8b9

Browse files
kalwaltclaude
andcommitted
doc: update README + ARCHITECTURE for the v0.8.0 milestone
- Refresh the status note: KPM/NFT is now a complete pure-Rust pipeline (native + WASM), no longer "early stage". - Bump install snippets 0.7 -> 0.8. - Add a v0.8.0 "Pure-Rust completeness, validation & polish" roadmap entry (WASM/NFT #161, pure-Rust .fset3 #179, VisualDatabase #147/#148, Gaussian pyramid SIMD/rayon #200-#207, coverage/CI hardening) and prune the now-completed short-term goals. - ARCHITECTURE: add simd-x86-avx2 to the feature table, document the freak::visual_database orchestrator and freak::gaussian_pyramid modules, and the wasm crate's NFT bindings + browser demo. Refs #161 #179 #147 #148 #177 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent d7d48b1 commit 6edf8b9

2 files changed

Lines changed: 22 additions & 8 deletions

File tree

ARCHITECTURE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ The unified core library containing all AR functionality:
3636
- `kpm::ref_data_set``.fset3` reference data I/O and compression modes.
3737
- `kpm::types` — KPM data structures and constants.
3838
- `kpm::freak` — FREAK descriptor math, homography, and matching utilities (pure Rust port of `WebARKitLib/lib/SRC/KPM/FreakMatcher`):
39+
- `freak::visual_database` — top-level per-frame query orchestrator (M9-1): builds the query keyframe, then runs the two-pass pipeline (feature match → Hough voting → homography → inlier filter, then a homography-guided re-match) across stored reference keyframes. Exposes `query` / `query_from_keyframe` and facade-parity accessors on the database + `FeatureStore` slices (#147, #148).
3940
- `freak::math` — linear algebra (matrix operations, linear solvers) and Padé matrix exponential.
4041
- `freak::homography` — homography estimation and refinement pipeline.
4142
- `freak::hough` — Hough similarity voting (4D bin discretization over translation × angle × scale) for filtering matches by transformation consistency.
4243
- `freak::clustering` — K-Medoids partitioning + Binary Hierarchical Clustering (BHC) vocabulary tree for fast approximate-NN search on 96-byte FREAK descriptors. Hamming distance via 24×32-bit bit-magic. Includes a byte-identical port of C++ `vision::FastRandom` / `vision::ArrayShuffle` so the BHC tree topology matches the C++ baseline given the same seed.
4344
- `freak::matcher``FeatureStore` (points + flat descriptor buffer) and `FeatureMatcher` with three match variants: brute force, BHC-indexed (fast path), and homography-guided (spatial filter via 3×3 inverse + `tr` radius). All three apply the C++ ratio test (default 0.7) and filter by `FeaturePoint::maxima`.
4445
- `freak::image_pyramid` — image pyramid construction via `BoxFilterPyramid8u` (box filtering for 8-bit grayscale) and `BinomialPyramid32f` (32-bit floating-point binomial pyramid with scale-space interpolation).
46+
- `freak::gaussian_pyramid` — Gaussian scale-space pyramid driving the DoG detector. Hot binomial-filter passes have NO-FMA SSE4.1 / AVX2 / wasm SIMD paths (runtime-detected, bit-exact against the scalar fallback for dual-mode parity) and rayon-parallelized rows (v0.8.0, #200#207).
4547
- `freak::feature_extraction` — keypoint detection via Difference-of-Gaussians (DoG), dominant orientation assignment via circular gradient voting, and FREAK descriptor computation with native Rust implementation of the FREAK binary pattern and bit-pair comparison.
4648
- **Types** (`types`): core data structures (`ARHandle`, `ARParam`, etc.).
4749

@@ -50,6 +52,13 @@ The unified core library containing all AR functionality:
5052
WASM wrapper and JavaScript/TypeScript glue code for browser targets.
5153
Depends only on `webarkitlib-rs` (the core crate).
5254

55+
Since **v0.8.0 (#161)** it exposes the pure-Rust NFT pipeline to the
56+
browser: a `WasmKpmHandle` binding for KPM detection (load reference data
57+
from bytes, detect), `console_log` wiring via `ar_log_init_wasm()`, a dual
58+
**standard + SIMD** build pipeline (`npm run build:wasm`), and an
59+
end-to-end browser NFT demo under `crates/wasm/www`. The `cc`/`bindgen`
60+
build dependencies are optional so the wasm target builds pure-Rust.
61+
5362
## Feature Flags
5463

5564
| Feature | Description |
@@ -58,6 +67,7 @@ Depends only on `webarkitlib-rs` (the core crate).
5867
| `simd` | Umbrella: enables all SIMD sub-features |
5968
| `simd-wasm32` | WASM SIMD128 intrinsics |
6069
| `simd-x86-sse41` | x86 SSE4.1 intrinsics |
70+
| `simd-x86-avx2` | x86 AVX2 intrinsics (runtime-detected; NO-FMA for bit-exact scalar parity) |
6171
| `log-helpers` | Enable logging infrastructure (installs `env_logger` for desktop/tests, `console_log` for WASM) |
6272
| `ffi-backend` | **Opt-in** — compile the C++ FreakMatcher library and generate FFI bindings. Used for cross-validation and the regression-test suite; not required for production tracking. |
6373
| `dual-mode` | Enables FFI-based parity tests that validate pure-Rust ports against the live C++ baseline (M6 math/solvers/homography, M7 BHC/matcher, PRNG). Transitively enables `ffi-backend`. Run in CI on Linux/macOS/Windows. |

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
This project aims to provide a pure-Rust implementation of the core ARToolKit algorithms, targeting both **native** systems and **WebAssembly (WASM)** for high-performance augmented reality in the browser.
1515

1616
> [!NOTE]
17-
> This project is currently a **Work in Progress**. Core marker detection and pose estimation are functional. KPM/NFT (Natural Feature Tracking) is in an early stage with partial Rust porting -- a fully idiomatic Rust KPM pipeline with a working example is the primary goal for v1.0.0.
17+
> Core marker detection and pose estimation are functional, and as of **v0.8.0** the **KPM/NFT (Natural Feature Tracking) pipeline is fully ported to pure Rust** — end-to-end keypoint matching, marker generation (`.iset`/`.fset`/`.fset3`), and runtime tracking all run with **no C++ toolchain**, natively and in the browser via WebAssembly. The project remains a **Work in Progress** toward v1.0.0 (broader API docs, multi-marker support, and a dedicated KPM benchmark are the remaining focus areas).
1818
1919
## 🌟 Key Features
2020

@@ -40,7 +40,7 @@ Add `webarkitlib-rs` to your `Cargo.toml`:
4040

4141
```toml
4242
[dependencies]
43-
webarkitlib-rs = "0.7"
43+
webarkitlib-rs = "0.8"
4444
```
4545

4646
### Pure Rust tracking (no C++ compiler required)
@@ -66,7 +66,7 @@ need to do anything special:
6666

6767
```toml
6868
[dependencies]
69-
webarkitlib-rs = "0.7" # default backend is pure Rust
69+
webarkitlib-rs = "0.8" # default backend is pure Rust
7070
```
7171

7272
```bash
@@ -83,7 +83,7 @@ NFT tracking**:
8383

8484
```toml
8585
[dependencies]
86-
webarkitlib-rs = { version = "0.7", features = ["ffi-backend"] }
86+
webarkitlib-rs = { version = "0.8", features = ["ffi-backend"] }
8787
```
8888

8989
> When installing from crates.io, no extra setup is required — the C++
@@ -248,7 +248,7 @@ Enable the `log-helpers` feature and call the bundled initializer once in your b
248248

249249
```toml
250250
[dependencies]
251-
webarkitlib-rs = { version = "0.7", features = ["log-helpers"] }
251+
webarkitlib-rs = { version = "0.8", features = ["log-helpers"] }
252252
```
253253

254254
```rust
@@ -429,12 +429,16 @@ The workspace contains two crates:
429429
- Cross-platform / cross-stack matcher determinism — Rust `HashMap` → `BTreeMap` and upstream C++ `unordered_map` → `std::map` ([WebARKitLib#39](https://github.com/webarkit/WebARKitLib/pull/39)).
430430
- Hand-annotated absolute corner-error regression gate (browser-based annotation tool + 5 fixtures + Linux CI gate). Finding: pure-Rust backend is more accurate than C++ on `pinball-demo` (5.27 px vs 18.79 px max corner error).
431431
- Cross-stack parity gate against `@webarkit/jsartoolkit-nft@1.10.0` ([jsartoolkitNFT#584](https://github.com/webarkit/jsartoolkitNFT/pull/584)) — guarantees native Rust pose matches what production WASM consumers see.
432+
- **v0.8.0 — Pure-Rust completeness, validation & polish**: Closed out the remaining gaps on top of M9:
433+
- **Full WASM/NFT support** ([#161](https://github.com/webarkit/WebARKitLib-rs/issues/161)): `WasmKpmHandle` KPM-detection bindings, `console_log` wiring, clean dual (standard + SIMD) wasm builds, and an end-to-end **browser NFT demo** of the pure-Rust pipeline.
434+
- **Pure-Rust `.fset3` marker generation** ([#179](https://github.com/webarkit/WebARKitLib-rs/issues/179)): `nft_marker_gen` now produces `.iset` + `.fset` + `.fset3` entirely via `RustFreakMatcher` — the `ffi-backend` is no longer needed for marker creation.
435+
- **`VisualDatabase` ergonomics** ([#147](https://github.com/webarkit/WebARKitLib-rs/issues/147), [#148](https://github.com/webarkit/WebARKitLib-rs/issues/148)): factored the per-frame query loop, added `query_from_keyframe`, and facade-parity accessors on `VisualDatabase` + `FeatureStore` slices.
436+
- **Gaussian scale-space pyramid performance** ([#200](https://github.com/webarkit/WebARKitLib-rs/issues/200)/[#201](https://github.com/webarkit/WebARKitLib-rs/issues/201)/[#207](https://github.com/webarkit/WebARKitLib-rs/issues/207)): criterion benchmark, NO-FMA SSE4.1/AVX2/wasm SIMD binomial filter with bit-exact scalar parity, and rayon-parallelized filter passes.
437+
- **Validation & CI hardening**: raised M9 patch coverage ≥90% ([#177](https://github.com/webarkit/WebARKitLib-rs/issues/177)), Miri UB gate ([#182](https://github.com/webarkit/WebARKitLib-rs/issues/182)), strict `--all-targets --all-features` clippy gate ([#180](https://github.com/webarkit/WebARKitLib-rs/issues/180)), benchmark download hardening ([#204](https://github.com/webarkit/WebARKitLib-rs/issues/204)), and macOS/Windows build + cache fixes ([#134](https://github.com/webarkit/WebARKitLib-rs/issues/134), [#119](https://github.com/webarkit/WebARKitLib-rs/issues/119)).
432438
433439
### 🎯 Short-term Goals (toward v1.0.0)
434440
- **KPM-specific benchmark** ([deferred from #142](https://github.com/webarkit/WebARKitLib-rs/issues/142)): Add a dedicated `kpm_bench.rs` Criterion bench so we can verify the pure-Rust backend stays within 20% of C++ on `pinball-demo`. The existing `marker_bench` only measures barcode marker detection.
435-
- **WASM browser examples for KPM/NFT** ([#161](https://github.com/webarkit/WebARKitLib-rs/issues/161)): End-to-end runnable browser demo of the pure-Rust NFT pipeline.
436-
- **Raise M9 patch coverage** ([#177](https://github.com/webarkit/WebARKitLib-rs/issues/177)): Lift M9 modules from 84.76% → ≥90% patch coverage with no file under 85%.
437-
- **Dependency upgrades**: Criterion 0.5 → 0.8 ([#174](https://github.com/webarkit/WebARKitLib-rs/issues/174)).
441+
- **Live-camera WASM demo + pose parity** ([#215](https://github.com/webarkit/WebARKitLib-rs/issues/215)): Extend the browser NFT demo with a live camera feed and jsartoolkitNFT pose parity.
438442
- **Enhanced Documentation**: Expand API reference with complete module-level docs, integration walkthroughs for JS/TS, and detailed usage examples.
439443
- **WASM Memory Management**: Improve resource cleanup when switching engines or markers in long-running browser sessions.
440444

0 commit comments

Comments
 (0)