Skip to content

Commit 4764f70

Browse files
committed
bump version 0.5.0
1 parent fd0580b commit 4764f70

7 files changed

Lines changed: 85 additions & 11 deletions

File tree

ARCHITECTURE.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@ The unified core library containing all AR functionality:
3434
- `kpm::matching` — per-frame matching and ICP-based pose estimation.
3535
- `kpm::ref_data_set``.fset3` reference data I/O and compression modes.
3636
- `kpm::types` — KPM data structures and constants.
37-
- `kpm::freak` — FREAK descriptor math and homography utilities:
37+
- `kpm::freak` — FREAK descriptor math, homography, and matching utilities (pure Rust port of `WebARKitLib/lib/SRC/KPM/FreakMatcher`):
3838
- `freak::math` — linear algebra (matrix operations, linear solvers) and Padé matrix exponential.
3939
- `freak::homography` — homography estimation and refinement pipeline.
40+
- `freak::hough` — Hough similarity voting (4D bin discretization over translation × angle × scale) for filtering matches by transformation consistency.
41+
- `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.
42+
- `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`.
4043
- **Types** (`types`): core data structures (`ARHandle`, `ARParam`, etc.).
4144

4245
### `crates/wasm``webarkitlib-wasm`
@@ -53,7 +56,7 @@ Depends only on `webarkitlib-rs` (the core crate).
5356
| `simd-x86-sse41` | x86 SSE4.1 intrinsics |
5457
| `log-helpers` | Enable logging infrastructure (installs `env_logger` for desktop/tests, `console_log` for WASM) |
5558
| `ffi-backend` | Compile the C++ FreakMatcher library and generate FFI bindings |
56-
| `dual-mode` | Reserved for future dual Rust/C++ backend support |
59+
| `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. |
5760

5861
## SIMD Strategy
5962

@@ -85,6 +88,17 @@ cargo build --features ffi-backend
8588
cargo test --workspace --features ffi-backend
8689
```
8790

91+
### Dual-mode parity tests (Rust ↔ C++)
92+
93+
Validates the pure-Rust ports against the live C++ baseline via FFI shims.
94+
Requires the C++ submodule to be initialized:
95+
96+
```bash
97+
cargo test -p webarkitlib-rs --lib --features dual-mode
98+
```
99+
100+
CI runs this step on Linux, macOS, and Windows on every push.
101+
88102
### WASM
89103
```bash
90104
cd crates/wasm

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,47 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.5.0] - 2026-05-13
6+
7+
### Milestone 7 — Hough voting & feature matching in pure Rust
8+
9+
### 🚀 Features
10+
11+
- *(kpm)* Implement Hough similarity voting algorithm (M7)
12+
- *(kpm)* Implement binary hierarchical clustering and k-medoids for FREAK descriptors
13+
- *(kpm)* Port FeatureStore and FeatureMatcher with three match variants
14+
- *(kpm)* Port ArrayShuffle for BHC parity with C++ baseline
15+
16+
### 🐛 Bug Fixes
17+
18+
- *(kpm)* Fix arlog macro imports and unused variable warnings (#109)
19+
- *(kpm)* Apply clippy and fmt fixes to hough.rs for M7
20+
- *(kpm)* Resolve clippy warnings in clustering module
21+
- *(kpm)* Resolve remaining clippy warnings in clustering
22+
- *(kpm)* Include <limits> in kpm_c_api.cpp for GCC build
23+
- *(kpm)* Move <limits> include before matcher headers for GCC build
24+
- *(build)* Use platform-appropriate C++ stdlib (libc++ on macOS, libstdc++ on Linux)
25+
- *(kpm)* Use combined absolute+relative tolerance in M6-2 dual-mode tests
26+
- *(kpm)* Widen relative tolerance to 1e-5 for M6-2 dual-mode tests
27+
28+
### 🧪 Testing
29+
30+
- *(kpm)* Add dual-mode FFI tests for FeatureMatcher (M7-3)
31+
- *(kpm)* Strengthen dual-mode FeatureMatcher tests with pair equality and global-best invariants
32+
33+
### 📚 Documentation
34+
35+
- Add pre-commit verification workflow and arlog import pattern to CLAUDE.md
36+
37+
### 🎨 Styling
38+
39+
- Fix formatting from cargo fmt
40+
41+
### ⚙️ Miscellaneous Tasks
42+
43+
- Run dual-mode tests in CI to enforce C++ parity
44+
- Scope dual-mode tests to --lib to avoid pre-existing integration test failures
45+
546
## [0.4.1] - 2026-05-09
647

748
### Patch release — Matrix code GlobalID, paramGL ports, and quality fixes

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ exclude = [
99
resolver = "2"
1010

1111
[workspace.package]
12-
version = "0.4.1"
12+
version = "0.5.0"
1313
authors = ["kalwalt <github@kalwaltart.it>"]
1414
edition = "2021"
1515
description = "A high-performance, memory-safe Rust port of WebARKitLib (ARToolKit) for native and WASM."

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ Add `webarkitlib-rs` to your `Cargo.toml`:
3838

3939
```toml
4040
[dependencies]
41-
webarkitlib-rs = "0.4"
41+
webarkitlib-rs = "0.5"
4242
```
4343

4444
To enable the C++ FFI backend for KPM (Natural Feature Tracking):
4545

4646
```toml
4747
[dependencies]
48-
webarkitlib-rs = { version = "0.4", features = ["ffi-backend"] }
48+
webarkitlib-rs = { version = "0.5", features = ["ffi-backend"] }
4949
```
5050

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

205205
```toml
206206
[dependencies]
207-
webarkitlib-rs = { version = "0.4", features = ["log-helpers"] }
207+
webarkitlib-rs = { version = "0.5", features = ["log-helpers"] }
208208
```
209209

210210
```rust
@@ -310,6 +310,10 @@ The workspace contains two crates:
310310
- **`crates/core`** (`webarkitlib-rs`): The unified core AR engine (pure Rust), including:
311311
- `ar2` module: NFT marker generation pipeline — image pyramid (`ar2_gen_image_set`), feature map (`ar2_gen_feature_map`), JPEG-compressed `.iset` save, `.fset` / `.fset3` I/O.
312312
- `kpm` module: Keypoint Matching with pluggable backends (Rust + C++ FFI), FREAK descriptor extraction.
313+
- `kpm::freak::math` / `kpm::freak::homography`: pure-Rust math & homography pipeline (M6).
314+
- `kpm::freak::hough`: Hough similarity voting — 4D-binned voting scheme for finding the consistent similarity transformation across matched feature pairs (M7).
315+
- `kpm::freak::clustering`: K-Medoids + Binary Hierarchical Clustering (BHC) vocabulary tree for fast approximate-NN search on 96-byte FREAK descriptors. Byte-identical PRNG (`FastRandom` / `ArrayShuffle`) for C++ parity (M7).
316+
- `kpm::freak::matcher`: `FeatureStore` + `FeatureMatcher` with three match variants (brute, BHC-indexed, homography-guided), each gated by C++-faithful ratio test and `maxima` filtering (M7).
313317
- Core modules: image processing, pattern matching, labeling, ICP, pose estimation.
314318
- **`crates/wasm`** (`webarkitlib-wasm`): WASM bindings, dual-build scripts, and diagnostic web demo.
315319
- `benchmarks`: C vs Rust performance comparison suite.
@@ -329,6 +333,11 @@ The workspace contains two crates:
329333
- Detailed step-by-step logging with timestamps and per-level statistics
330334
- **M5 -- NFT Pipeline Performance**: Rayon parallelism for pyramid generation and Stage-3 feature scoring, plus optional SSE4.1/AVX2+FMA SIMD vectorization of the `get_similarity` correlation kernel. ~1.7× total speedup on x86_64.
331335
- **M6 -- Math & homography in pure Rust**: Ported all free mathematical functions from FreakMatcher into `crates/core/src/kpm/freak/math.rs` and `freak/homography.rs` (~1476 lines across 5 C++ headers). Eliminates the only remaining Eigen dependency: the 3×3 matrix exponential in `IncrementalHomographyFromLieWeights`.
336+
- **M7 -- Hough voting & feature matching in pure Rust**: Ported the full FreakMatcher matching pipeline into `crates/core/src/kpm/freak/{hough,clustering,matcher}.rs` (~2790 LOC total):
337+
- Hough similarity voting (4D bin discretization) — 734 LOC
338+
- K-Medoids clustering + Binary Hierarchical Clustering vocabulary tree, including a byte-identical `FastRandom` / `ArrayShuffle` PRNG port — 889 LOC
339+
- `FeatureStore` + `FeatureMatcher` with three match variants (brute, BHC-indexed, homography-guided), C++-faithful ratio test (default 0.7), and `maxima` filtering — 1167 LOC
340+
- **Dual-mode FFI tests run in CI on Linux / macOS / Windows** with sorted-pair equality vs the C++ baseline for brute/indexed/guided matchers (the M7 milestone validation gate). Surfaced and fixed three latent cross-platform issues: macOS `libc++` linking, GCC `<limits>` include order, and ARM64 FMA tolerance in M6-2 solvers.
332341
333342
### 🎯 Short-term Goals (toward v1.0.0)
334343
- **Complete KPM in idiomatic Rust**: Port the remaining KPM feature extraction and matching logic to pure Rust, removing the C++ FFI dependency, and ship a working end-to-end NFT example.

crates/wasm/pkg/README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ Add `webarkitlib-rs` to your `Cargo.toml`:
3838

3939
```toml
4040
[dependencies]
41-
webarkitlib-rs = "0.3"
41+
webarkitlib-rs = "0.5"
4242
```
4343

4444
To enable the C++ FFI backend for KPM (Natural Feature Tracking):
4545

4646
```toml
4747
[dependencies]
48-
webarkitlib-rs = { version = "0.3", features = ["ffi-backend"] }
48+
webarkitlib-rs = { version = "0.5", features = ["ffi-backend"] }
4949
```
5050

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

205205
```toml
206206
[dependencies]
207-
webarkitlib-rs = { version = "0.3", features = ["log-helpers"] }
207+
webarkitlib-rs = { version = "0.5", features = ["log-helpers"] }
208208
```
209209

210210
```rust
@@ -310,6 +310,10 @@ The workspace contains two crates:
310310
- **`crates/core`** (`webarkitlib-rs`): The unified core AR engine (pure Rust), including:
311311
- `ar2` module: NFT marker generation pipeline — image pyramid (`ar2_gen_image_set`), feature map (`ar2_gen_feature_map`), JPEG-compressed `.iset` save, `.fset` / `.fset3` I/O.
312312
- `kpm` module: Keypoint Matching with pluggable backends (Rust + C++ FFI), FREAK descriptor extraction.
313+
- `kpm::freak::math` / `kpm::freak::homography`: pure-Rust math & homography pipeline (M6).
314+
- `kpm::freak::hough`: Hough similarity voting — 4D-binned voting scheme for finding the consistent similarity transformation across matched feature pairs (M7).
315+
- `kpm::freak::clustering`: K-Medoids + Binary Hierarchical Clustering (BHC) vocabulary tree for fast approximate-NN search on 96-byte FREAK descriptors. Byte-identical PRNG (`FastRandom` / `ArrayShuffle`) for C++ parity (M7).
316+
- `kpm::freak::matcher`: `FeatureStore` + `FeatureMatcher` with three match variants (brute, BHC-indexed, homography-guided), each gated by C++-faithful ratio test and `maxima` filtering (M7).
313317
- Core modules: image processing, pattern matching, labeling, ICP, pose estimation.
314318
- **`crates/wasm`** (`webarkitlib-wasm`): WASM bindings, dual-build scripts, and diagnostic web demo.
315319
- `benchmarks`: C vs Rust performance comparison suite.
@@ -328,6 +332,12 @@ The workspace contains two crates:
328332
- FREAK descriptor extraction via `kpm_extract_features` C API (7000+ features per marker)
329333
- Detailed step-by-step logging with timestamps and per-level statistics
330334
- **M5 -- NFT Pipeline Performance**: Rayon parallelism for pyramid generation and Stage-3 feature scoring, plus optional SSE4.1/AVX2+FMA SIMD vectorization of the `get_similarity` correlation kernel. ~1.7× total speedup on x86_64.
335+
- **M6 -- Math & homography in pure Rust**: Ported all free mathematical functions from FreakMatcher into `crates/core/src/kpm/freak/math.rs` and `freak/homography.rs` (~1476 lines across 5 C++ headers). Eliminates the only remaining Eigen dependency: the 3×3 matrix exponential in `IncrementalHomographyFromLieWeights`.
336+
- **M7 -- Hough voting & feature matching in pure Rust**: Ported the full FreakMatcher matching pipeline into `crates/core/src/kpm/freak/{hough,clustering,matcher}.rs` (~2790 LOC total):
337+
- Hough similarity voting (4D bin discretization) — 734 LOC
338+
- K-Medoids clustering + Binary Hierarchical Clustering vocabulary tree, including a byte-identical `FastRandom` / `ArrayShuffle` PRNG port — 889 LOC
339+
- `FeatureStore` + `FeatureMatcher` with three match variants (brute, BHC-indexed, homography-guided), C++-faithful ratio test (default 0.7), and `maxima` filtering — 1167 LOC
340+
- **Dual-mode FFI tests run in CI on Linux / macOS / Windows** with sorted-pair equality vs the C++ baseline for brute/indexed/guided matchers (the M7 milestone validation gate). Surfaced and fixed three latent cross-platform issues: macOS `libc++` linking, GCC `<limits>` include order, and ARM64 FMA tolerance in M6-2 solvers.
331341
332342
### 🎯 Short-term Goals (toward v1.0.0)
333343
- **Complete KPM in idiomatic Rust**: Port the remaining KPM feature extraction and matching logic to pure Rust, removing the C++ FFI dependency, and ship a working end-to-end NFT example.

crates/wasm/pkg/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"kalwalt \u003cgithub@kalwaltart.it\u003e"
66
],
77
"description": "A high-performance, memory-safe Rust port of WebARKitLib (ARToolKit) for native and WASM.",
8-
"version": "0.4.1",
8+
"version": "0.5.0",
99
"license": "LGPL-3.0-or-later",
1010
"repository": {
1111
"type": "git",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webarkitlib-rs",
3-
"version": "0.4.1",
3+
"version": "0.5.0",
44
"description": "Port of WebARKitLib (ARToolKit) to Rust and WASM",
55
"private": true,
66
"scripts": {

0 commit comments

Comments
 (0)