edgevec 0.6.0

High-performance embedded vector database for Browser, Node, and Edge
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
# Changelog

All notable changes to EdgeVec will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- **`enableBQ()`** — WASM method to enable binary quantization after index creation
  - Required for BQ search methods (`searchBQ`, `searchBQRescored`)
  - Dimensions must be divisible by 8
  - Automatically encodes existing vectors on enable

### Changed
- **WASM Bundle Optimized** — Applied wasm-opt `-Oz` with `--strip-debug` and `--strip-producers`
  - **524 KB → 477 KB** (9.2% reduction, 47 KB saved)
  - Now **well under 500 KB target**
  - Gzipped: 217 KB (unchanged — gzip already compresses efficiently)
  - Optimization flags: `--enable-bulk-memory --enable-nontrapping-float-to-int`

### Planned (v0.7.0)
- Soft-delete BQ tracking optimization
- Incremental persistence for large indices
- Vector compression enhancements

---

## [0.6.0] - 2025-12-22 — RFC-002: Binary Quantization + Metadata Storage

**Focus:** RFC-002 Implementation — Binary Quantization for 32x memory savings and integrated metadata storage.

### Added

#### Binary Quantization (RFC-002 Phase 2)

- **`searchBQ(query, k)`** — Fast binary search using Hamming distance
  - 3-5x faster than F32 search
  - 32x memory reduction (768D: 3072 bytes → 96 bytes)
  - SIMD-optimized popcount (AVX2/SSE on x86, NEON on ARM)

- **`searchBQRescored(query, k, rescoreFactor)`** — High-recall hybrid search
  - BQ candidate retrieval + F32 rescoring
  - >0.90 recall@10 with rescoreFactor=15 (RFC-002 target achieved)
  - Factor 5: ~95% recall, 2.5x faster
  - Factor 10: ~98% recall, 2x faster

- **`HnswIndex::with_bq(config, storage)`** — Create BQ-enabled index
- **`insert_bq(vector, storage)`** — Insert with automatic BQ encoding
- **`has_bq()`** — Check if BQ is enabled

#### Metadata Storage (RFC-002 Phase 1)

- **`insertWithMetadata(vector, metadata)`** — Insert vectors with key-value metadata
  - Supports: String, Integer, Float, Boolean, StringArray
  - Automatic cleanup on soft-delete

- **`searchFiltered(query, filter, k)`** — Search with metadata filter expressions
  - Comparison: `=`, `!=`, `>`, `>=`, `<`, `<=`
  - Logical: `AND`, `OR`, `NOT`
  - Array membership: `ANY ["value1", "value2"]`
  - Grouping with parentheses

- **`getMetadata(id)`** — Retrieve metadata for a vector
- **`MetadataStore`** — Core Rust metadata storage with HashMap-based indexing

#### Memory Management (RFC-002 Phase 3)

- **`getMemoryPressure()`** — Monitor WASM heap usage
  - Returns: level (normal/warning/critical), usedBytes, totalBytes, usagePercent

- **`setMemoryConfig(config)`** — Configure thresholds
  - warning_threshold: default 70%
  - critical_threshold: default 90%
  - block_inserts_at_critical: default true

- **`canInsert()`** — Check if inserts allowed (respects memory pressure)
- **`getMemoryRecommendation()`** — Actionable memory management guidance
- **Allocation tracking** — Track memory usage per insert operation

#### WASM Bindings (RFC-002 Phase 3)

- Complete TypeScript type definitions for all new APIs
- **`EdgeVec`** class with full BQ + metadata + memory pressure support
- **`validateFilter()`** — Validate filter expression syntax

#### Integration Tests

- **`tests/hybrid_search.rs`** — 5 tests for BQ + filter search
  - Basic hybrid search, complex filters, array ANY operator
  - Fallback when BQ disabled, recall validation

- **`tests/bq_persistence.rs`** — 7 tests for BQ index persistence
  - Save/load roundtrip, F32 search after load
  - Metadata preservation, BQ state documentation

- **`tests/bq_recall_roundtrip.rs`** — 7 tests for BQ recall validation
  - RFC-002 target validation (>0.90 recall)
  - High-recall mode testing

#### Browser Demo

- **`wasm/examples/v060_demo.html`** — Interactive v0.6.0 showcase
  - Cyberpunk-themed UI matching previous demos
  - BQ vs F32 performance comparison with visual bars
  - Metadata filter tags with preset expressions
  - Memory pressure monitoring with live updates
  - Recall metrics display

### Changed

- Filter syntax: `=` operator (not `==`), `ANY ["value"]` for array membership
- Persistence format: v0.4 with metadata section (Postcard serialization)
- BQ not persisted: regenerated from F32 vectors on load (expected behavior)

### Performance (RFC-002 Targets)

| Metric | Result | Target | Status |
|:-------|:-------|:-------|:-------|
| BQ memory reduction | 32x | 8-32x | ✅ Achieved |
| SIMD popcount speedup | 6.9x vs scalar | >5x | ✅ Achieved |
| BQ search speedup | 3-5x vs F32 | 2-5x | ✅ Achieved |
| BQ+rescore recall@10 | 0.936 | >0.90 | ✅ Achieved |
| Filter evaluation | <1μs/vector | <10μs | ✅ Achieved |

### Migration Guide

#### From v0.5.x

v0.6.0 is backward compatible with v0.5.x snapshots:

```javascript
// v0.5.x snapshots load automatically
import { EdgeVec } from 'edgevec';

const index = new EdgeVec({ dimensions: 768 });
index.loadSnapshot(v05Snapshot);  // Auto-migrates

// New features available immediately
index.insertWithMetadata(vector, { category: 'news' });
const results = index.searchFiltered(query, 'category = "news"', 10);
```

#### Enabling Binary Quantization

```javascript
const index = new EdgeVec({ dimensions: 768 });

// Insert vectors (BQ auto-enabled for dimension divisible by 8)
index.insertWithMetadata(vector, { category: 'tech' });

// Fast BQ search with rescoring (~95% recall, 3x faster)
const results = index.searchBQ(query, 10);
```

#### Filter Syntax (Important Changes)

```javascript
// Correct v0.6.0 syntax
index.searchFiltered(query, 'category = "news"', 10);          // = not ==
index.searchFiltered(query, 'tags ANY ["featured"]', 10);      // ANY for arrays
index.searchFiltered(query, 'score > 0.5 AND active = true', 10);
```

---

## [0.5.4] - 2025-12-20 — iOS Safari Compatibility

**Focus:** Mobile browser support — EdgeVec now works correctly on iOS Safari.

### Fixed

#### iOS Safari WASM Compatibility
- **`parse_filter_js is not a function` error** — Stale `wasm/pkg/` directory was shadowing the correct `pkg/` directory, causing old WASM bindings (without filter functions) to load
  - Deleted stale `wasm/pkg/` directory
  - Updated import paths to use only correct paths

- **Browser caching old WASM modules** — ES module caching was serving stale versions even after rebuilds
  - Added cache-busting query parameter `?v=${Date.now()}` to all WASM imports
  - Ensures fresh module loads after each rebuild

- **iOS Safari showing 0ms benchmark timings** — Safari limits `performance.now()` to 1ms resolution (Spectre mitigation)
  - Changed from per-iteration timing to batch timing (50 iterations averaged)
  - Now shows accurate sub-millisecond timings on iOS

- **NaN% filter overhead on iOS** — Division by zero when unfiltered time was 0ms
  - Added null check: display "0.0%" instead of "NaN%"

### Added

- **Embedding Integration Guide** (`docs/guides/EMBEDDING_GUIDE.md`) — Complete guide for generating embeddings with EdgeVec
  - Transformers.js browser-native examples (MiniLM, BGE, Nomic)
  - API examples: OpenAI, Cohere, HuggingFace
  - Web Worker pattern for non-blocking embedding
  - Model caching and batching best practices
  - Complete example applications (Semantic Notes, FAQ Bot, Image Search with CLIP)
  - Troubleshooting guide and model comparison table

### Changed
- Filter Playground: Removed stale import paths, added cache buster
- Benchmark Dashboard: Batch timing for iOS precision, added cache buster

### Verified Platforms
- Desktop Chrome ✓
- Desktop Firefox ✓
- Desktop Safari ✓
- iOS Safari (iPhone) ✓
- iOS Safari (iPad) ✓

---

## [0.5.3] - 2025-12-19 — crates.io Publishing Fix

**Type:** Release engineering fix

### Fixed

- **crates.io 413 Payload Too Large** — Package was 28.0 MiB (11.0 MiB compressed), exceeding crates.io's 10 MiB limit
  - Added `exclude` patterns to Cargo.toml to strip internal development files
  - Excluded: `docs/`, `tests/`, `.claude/`, `.cursor/`, `.github/`, `benches/competitive/`, `scripts/`
  - **New size: 1.7 MiB (358 KiB compressed)** — 96% reduction

### Changed
- Version sync: Cargo.toml and pkg/package.json both at 0.5.3
- Previous versions: crates.io was stuck at v0.4.0, npm was at v0.5.2

### Note
This release enables crates.io publishing that was blocked since v0.5.0.

---

## [0.5.2] - 2025-12-19 — npm TypeScript Compilation Fix

**Type:** Hotfix

### Fixed

- **npm package missing compiled JavaScript** — v0.5.0/v0.5.1 only included TypeScript source files (`.ts`), not compiled JavaScript (`.js`)
  - Users with bundlers that don't handle TypeScript got import errors
  - Added compiled `.js` and `.d.ts` files to pkg/

### Added
- Week 25 Day 1 metrics documentation
- Enterprise-grade hostile audit review

---

## [0.5.1] - 2025-12-19 — README Update

**Type:** Documentation patch

### Changed
- Updated `pkg/README.md` with v0.5.0 Filter API content for npm display
- Tagline: "The first WASM-native vector database"
- Added Filter API Quick Start example with `Filter.parse()`
- Updated version references from v0.4.0 to v0.5.0

### Note
No code changes. This release ensures npm displays the correct v0.5.0 documentation.

---

## [0.5.0] - 2025-12-19 — Filter API Release

**Focus:** Metadata filtering — The feature that transforms EdgeVec from a search library into a vector database.

### Added

#### Filter API
- **SQL-like filter expressions** — 15 operators for metadata filtering
  - Comparison: `=`, `!=`, `>`, `<`, `>=`, `<=`
  - Set: `IN`, `NOT IN`
  - String: `CONTAINS`, `STARTS_WITH`, `ENDS_WITH`
  - Null: `IS NULL`, `IS NOT NULL`
  - Boolean: `AND`, `OR`, `NOT`
- **`Filter.parse()`** — Parse filter expressions with detailed error messages
- **`Filter.evaluate()`** — Evaluate filters against metadata objects
- **`FilterBuilder`** — TypeScript fluent API for type-safe filter construction
- **Strategy selection** — Automatic prefilter/postfilter/hybrid selection

#### Interactive Demos
- **Filter Playground** (`wasm/examples/filter-playground.html`)
  - Real-time filter parsing with syntax highlighting
  - AST visualization
  - Example expressions gallery
  - Dark/light theme toggle
  - Keyboard shortcuts (Ctrl+Enter, Ctrl+/)

- **Demo Catalog** (`wasm/examples/index.html`)
  - Professional landing page with all demos
  - Mobile responsive design
  - Filter integration across all demos

#### Documentation
- **`docs/api/FILTER_SYNTAX.md`** — Complete filter expression reference
- **`docs/api/DATABASE_OPERATIONS.md`** — CRUD operations guide
- **`docs/api/TYPESCRIPT_API.md`** — TypeScript API reference
- **`docs/COMPARISON.md`** — EdgeVec vs alternatives guide
- **`docs/design/ACCESSIBILITY_AUDIT.md`** — WCAG 2.1 AA compliance

#### Competitive Analysis
- **`docs/benchmarks/competitive_analysis_v2.md`** — Full methodology
- **`docs/benchmarks/w24_voy_comparison.md`** — EdgeVec vs voy (24x faster)
- **`docs/benchmarks/w24_hnswlib_comparison.md`** — EdgeVec vs hnswlib-node
- **`docs/benchmarks/w24_tier2_feature_matrix.md`** — Feature comparison

### Changed
- **README.md** — Repositioned as "vector database" with feature matrix
- **`pkg/package.json`** — 16 keywords for npm discoverability
- **All demos** — Added filter capabilities and mobile responsiveness

### Fixed
- **UTF-8 panic** — Filter parser now handles multi-byte UTF-8 correctly (`f75a4c0`)
- **XSS vulnerabilities** — Added `escapeHtml()` to all demos (`359cd7d`, `d60770c`)

### Security
- All user input in demos escaped via `escapeHtml()`
- Filter parser fuzz tested for 24+ hours (14.4B executions, 0 crashes)

### Performance
| Metric | Result | Target |
|:-------|:-------|:-------|
| Search P50 (10k) | 0.20 ms | <1 ms |
| Bundle (gzip) | 262 KB | <500 KB |
| Fuzz testing | 24h+ | 0 crashes |

---

## [0.4.1] - 2025-12-17 — Hotfix: NPM Package Fix

**Type:** HOTFIX (Critical Bug Fix)

### Fixed

- **NPM package missing `snippets` directory** — Build failures with Vite, webpack, and other bundlers due to missing `snippets` directory in published npm package. The `package.json` `files` array now correctly includes `"snippets"`. ([GitHub Issue #1]https://github.com/matte1782/edgevec/issues/1)

### Upgrade

```bash
npm install edgevec@0.4.1
```

### Affected Versions

| Version | Status |
|:--------|:-------|
| 0.4.0 | ❌ BROKEN (do not use with bundlers) |
| 0.4.1 | ✅ FIXED |

---

## [0.4.0] - 2025-12-20 — Documentation & Quality Sprint

**Focus:** Production readiness — comprehensive documentation, P99 tracking, and quality hardening.

### Added

#### User Documentation
- **`docs/TUTORIAL.md`** — Complete getting started guide
  - Step-by-step installation instructions
  - First index creation walkthrough
  - Browser and Node.js examples
  - Persistence tutorial

- **`docs/PERFORMANCE_TUNING.md`** — HNSW parameter optimization guide
  - M, efConstruction, ef parameter explanations
  - Tuning recommendations for different use cases
  - Memory vs. recall tradeoff guidance
  - Quantization configuration

- **`docs/TROUBLESHOOTING.md`** — Debugging guide
  - Top 10 common errors and solutions
  - WASM initialization issues
  - Dimension mismatch debugging
  - Search returning empty results

- **`docs/INTEGRATION_GUIDE.md`** — Third-party integration guide
  - transformers.js integration
  - TensorFlow.js Universal Sentence Encoder
  - OpenAI embeddings API
  - Cohere embeddings

#### Benchmark Dashboard
- **`wasm/examples/benchmark-dashboard.html`** — Interactive visualization
  - Real-time performance charts (Chart.js)
  - EdgeVec vs hnswlib-node vs voy comparison
  - Search latency, insert latency, memory charts
  - Dark/light theme toggle

- **`docs/benchmarks/PERFORMANCE_BASELINES.md`** — Baseline documentation
  - Official baseline values for regression detection
  - Target metrics for different scales
  - CI threshold configuration

#### Quality Infrastructure

- **Chaos Testing** (`tests/chaos_hnsw.rs`)
  - 15 edge case tests (11 required + 4 bonus)
  - Empty index, single vector, all deleted
  - Zero vector, max dimensions (4096)
  - Duplicate vectors, delete/reinsert
  - Extreme values, rapid cycles
  - Compaction stress, recall accuracy

- **Load Testing** (`tests/load_test.rs`)
  - 100k vector insertion stress test
  - Sustained search load (60 seconds)
  - Mixed workload (insert + search + delete)
  - High tombstone ratio validation
  - Memory stability testing
  - Batch insert performance

- **P99 Latency Tracking** (`benches/p99_bench.rs`)
  - P50/P99/P999 percentile reporting
  - 10k index latency benchmark
  - Tombstone impact benchmark
  - Scaling benchmark (1k to 25k)

- **CI Regression Detection** (`.github/workflows/regression.yml`)
  - Automatic P99 benchmark on PRs
  - 10% regression threshold enforcement
  - Performance summary in PR comments
  - Artifact upload for historical tracking

#### Release Documentation
- **`CONTRIBUTING.md`** — Contribution guidelines
  - Code of Conduct reference
  - PR process and requirements
  - Development setup instructions
  - Commit message conventions

- **`docs/RELEASE_CHECKLIST_v0.4.md`** — Release verification
  - 25+ verification items
  - Pre-release, release, post-release steps
  - Rollback procedures

- **`docs/MIGRATION.md`** — Migration from competitors
  - hnswlib migration guide
  - FAISS migration guide
  - Pinecone migration guide
  - General migration tips

### Changed
- Version bumped from 0.3.0 to 0.4.0
- Updated README.md with v0.4.0 features
- CI pipeline enhanced with P99 tracking

### Documentation
- Week 16-18 work reconciled with gate files
- ROADMAP.md updated to reflect v0.4.0 completion
- All pending gates (16, 17, 18) documented

---

## [0.3.0] - 2025-12-15 — Soft Delete Release

**Focus:** RFC-001 Soft Delete implementation — non-destructive vector deletion with compaction.

### Added

#### Soft Delete API (RFC-001)
- **`soft_delete(VectorId)`** — Mark vector as deleted in O(1) time
  - Tombstone-based deletion (vector remains in index but excluded from search)
  - Idempotent: returns `false` if already deleted
  - Error on invalid vector ID

- **`is_deleted(VectorId)`** — Check if vector is deleted
  - Returns `true` for tombstoned vectors
  - Error on invalid vector ID

- **`deleted_count()`** — Count of tombstoned vectors
- **`live_count()`** — Count of active (non-deleted) vectors
- **`tombstone_ratio()`** — Ratio of deleted to total vectors (0.0 to 1.0)

#### Compaction API
- **`compact()`** — Rebuild index removing all tombstones
  - Returns `CompactionResult` with statistics
  - Creates new index with only live vectors
  - Preserves vector IDs during rebuild
  - Warning: blocking operation for large indices

- **`needs_compaction()`** — Check if tombstone ratio exceeds threshold
- **`compaction_warning()`** — Get warning message if compaction recommended
- **`compaction_threshold()`** — Get current threshold (default: 0.3 / 30%)
- **`set_compaction_threshold(ratio)`** — Configure threshold (0.01 to 0.99)

- **`CompactionResult`** struct:
  - `tombstones_removed: u32` — Number of deleted vectors removed
  - `new_size: u32` — Index size after compaction
  - `duration_ms: f64` — Time taken in milliseconds

#### Batch Delete API
- **`batch_delete(ids)`** — Delete multiple vectors efficiently
- **WASM bindings:** `softDeleteBatch()`, `softDeleteBatchCompat()`

#### WASM Bindings (v0.3.0)
- **`softDelete(vectorId)`** — JavaScript soft delete
- **`isDeleted(vectorId)`** — Check deletion status
- **`deletedCount()` / `liveCount()`** — Statistics methods
- **`tombstoneRatio()`** — Get tombstone ratio
- **`needsCompaction()`** — Check compaction recommendation
- **`compactionWarning()`** — Get warning string or null
- **`compact()`** — Execute compaction, returns `WasmCompactionResult`
- **`compactionThreshold()` / `setCompactionThreshold()`** — Threshold management

#### Persistence Format v0.3
- `deleted_count` field in snapshot header (offset 60-63)
- `deleted` field per `HnswNode` (1 byte, was padding — zero memory overhead)
- Automatic migration from v0.2 snapshots on load
- VERSION_MINOR bumped from 2 to 3

#### Browser Examples
- **`wasm/examples/soft_delete.html`** — Interactive cyberpunk-themed demo
  - Particle effects for visual feedback
  - Real-time statistics dashboard
  - Vector grid visualization (live vs deleted)
  - Warning banner for compaction recommendation
  - Activity log with color-coded entries

- **`wasm/examples/soft_delete.js`** — Reusable JavaScript module
  - `SoftDeleteDemo` class with full API
  - Event system for insert/delete/compact/search
  - Benchmark functionality
  - Accessibility: focus indicators, ARIA labels, keyboard navigation

#### TypeScript Support
- Updated `pkg/edgevec.d.ts` with soft delete types
- `WasmCompactionResult` interface
- Full JSDoc documentation

### Changed
- Search now automatically excludes tombstoned vectors
- `HnswNode.pad` renamed to `HnswNode.deleted` (repurposed padding byte)
- Internal `adjusted_k()` calculation compensates for tombstones during search
- Snapshot version bumped to v0.3 (reads v0.2, writes v0.3)
- License changed to dual MIT OR Apache-2.0

### Fixed
- Memory leak prevention in browser demo particle system (MAX_PARTICLES cap)
- Silent error swallowing replaced with proper logging

### Migration Notes

**From v0.2.x to v0.3.0:**
1. v0.2 snapshots are automatically migrated to v0.3 on load
2. v0.3 snapshots **cannot** be read by v0.2.x (forward-incompatible)
3. Always backup your index files before upgrading
4. New soft delete methods are additive — existing code continues to work

**Breaking Changes:** None for existing API users.

---

## [0.2.1] - 2025-12-14 — Safety Hardening Release

**Focus:** Community feedback response — UB elimination and competitive positioning.

### Security

- **Fixed potential undefined behavior in persistence layer** — Replaced unsafe pointer casts with alignment-verified `bytemuck` operations. All `#[allow(clippy::cast_ptr_alignment)]` suppressions removed. Runtime alignment checks now active via `try_cast_slice`. Thanks to Reddit community feedback for identifying this issue. (W13.2)

### Added

- **Competitive Benchmark Suite** — New benchmark infrastructure for comparing EdgeVec against WASM vector libraries (hnswlib-wasm, voy, usearch-wasm, vectra). See `docs/benchmarks/competitive_analysis.md`. (W13.3)

- **Alignment Safety Tests** — 13 new tests validating Pod/Zeroable compliance and alignment safety. (W13.2)

- **Batch Insert API** (`BatchInsertable` trait)
  - Single API call for bulk vector insertion
  - Progress callback support at ~10% intervals (<1% overhead)
  - Best-effort semantics (partial success on non-fatal errors)
  - `BatchError` type with 5 error variants
  - Example: `examples/batch_insert.rs`
  - Benchmarks: `benches/batch_vs_sequential.rs`

---

## [0.2.0] - 2025-12-12 — Initial Alpha Release

**Focus:** First public alpha — core HNSW engine with WASM support.

### Added

#### Core Engine
- **HNSW Indexing Engine**
  - O(log n) approximate nearest neighbor search
  - Configurable `m` (connections per node, default: 16)
  - Configurable `ef_construction` (build quality, default: 200)
  - Layer-based graph structure with probabilistic level assignment
  - Efficient neighbor selection with heuristic pruning

- **Distance Metrics**
  - L2 (Euclidean distance) — default metric
  - Cosine similarity — normalized vectors
  - Dot product (inner product) — unnormalized similarity

- **Scalar Quantization (SQ8)**
  - 8-bit scalar quantization for 3.6x memory reduction
  - Configurable min/max range for precision tuning
  - AVX2 SIMD-optimized distance calculations
  - Maintains competitive recall at k=10

#### Persistence Layer
- **Write-Ahead Log (WAL)**
  - Append-only log for crash recovery
  - Automatic replay on startup
  - Configurable sync interval

- **Atomic Snapshots**
  - Safe background saves without blocking reads
  - Magic number + version + checksum validation
  - Compatible format between native and WASM builds

- **Storage Backends**
  - `FileBackend` — Native file system persistence
  - `IndexedDbBackend` — Browser IndexedDB storage
  - `MemoryBackend` — In-memory for testing

#### WASM Support
- **First-class WebAssembly support** via `wasm-pack`
- **Browser-native** ES module exports
- **Node.js compatibility** via CommonJS wrapper
- **IndexedDB integration** for browser persistence
- **148 KB gzipped bundle** (70% under 500KB target)

#### TypeScript Wrapper
- `EdgeVecClient` class with auto WASM initialization
- `EdgeVecConfigBuilder` for fluent configuration
- Promise-based async API for persistence operations
- Full TypeScript type definitions (`.d.ts`)
- Comprehensive JSDoc documentation

### Performance

Benchmarked on AMD Ryzen 7 5700U, 16GB RAM, Windows 11, Rust 1.94.0-nightly.
Criterion 0.5.x with 10 samples per configuration. `-C target-cpu=native` enabled.

#### Search Latency (768-dimensional vectors, k=10)

| Scale | Float32 | Quantized (SQ8) | Target | Status |
|:------|:--------|:----------------|:-------|:-------|
| 10k vectors | 203 µs | **88 µs** | <1 ms | 11x under target |
| 50k vectors | 480 µs | **167 µs** | <1 ms | 6x under target |
| 100k vectors | 572 µs | **329 µs** | <1 ms | 3x under target |

#### Memory Efficiency

| Mode | Per Vector | 100k Vectors | 1M Projection | Target |
|:-----|:-----------|:-------------|:--------------|:-------|
| Float32 | 3,176 bytes | 303 MB | 3.03 GB | N/A |
| Quantized (SQ8) | 872 bytes | 83 MB | **832 MB** | <1 GB (17% under) |

#### Bundle Size

| Package | Size (Gzipped) | Target | Status |
|:--------|:---------------|:-------|:-------|
| `@edgevec/core` | **213 KB** | <500 KB | 57% under target |

---

## [0.1.0] - 2025-12-05 — Genesis Release (Internal)

**Focus:** Initial architecture validation and core infrastructure.

### Added
- Project structure and Cargo configuration
- HNSW algorithm prototype
- Distance metric implementations
- Basic persistence framework
- Architecture documentation (ARCHITECTURE.md, DATA_LAYOUT.md)
- Testing infrastructure (proptest, criterion)
- CI/CD pipeline

### Notes
This version was internal only, not published to crates.io or npm.

---

## Version Comparison

| Version | Date | Highlights |
|:--------|:-----|:-----------|
| 0.6.0 | 2025-12-22 | **RFC-002:** Binary Quantization (32x memory), Metadata Storage, Memory Pressure |
| 0.5.4 | 2025-12-20 | iOS Safari compatibility fixes |
| 0.5.3 | 2025-12-19 | **FIX:** crates.io publishing (package size reduction) |
| 0.5.2 | 2025-12-19 | **FIX:** npm TypeScript compilation |
| 0.5.1 | 2025-12-19 | README update for npm display |
| 0.5.0 | 2025-12-19 | **Filter API:** 15 SQL-like operators, Filter Playground |
| 0.4.1 | 2025-12-17 | **HOTFIX:** NPM package snippets fix |
| 0.4.0 | 2025-12-16 | Documentation sprint, P99 tracking, chaos testing |
| 0.3.0 | 2025-12-15 | Soft delete API, compaction, dual-license |
| 0.2.1 | 2025-12-14 | Safety hardening, batch insert |
| 0.2.0 | 2025-12-12 | Initial alpha release |
| 0.1.0 | 2025-12-05 | Internal genesis release |

---

## Links

- [GitHub Repository]https://github.com/matte1782/edgevec
- [Documentation]docs/
- [Performance Guide]docs/PERFORMANCE_GUIDE.md
- [Tutorial]docs/TUTORIAL.md
- [API Reference]docs/API_REFERENCE.md

---

[Unreleased]: https://github.com/matte1782/edgevec/compare/v0.6.0...HEAD
[0.6.0]: https://github.com/matte1782/edgevec/compare/v0.5.4...v0.6.0
[0.5.4]: https://github.com/matte1782/edgevec/compare/v0.5.3...v0.5.4
[0.5.3]: https://github.com/matte1782/edgevec/compare/v0.5.2...v0.5.3
[0.5.2]: https://github.com/matte1782/edgevec/compare/v0.5.1...v0.5.2
[0.5.1]: https://github.com/matte1782/edgevec/compare/v0.5.0...v0.5.1
[0.5.0]: https://github.com/matte1782/edgevec/compare/v0.4.1...v0.5.0
[0.4.1]: https://github.com/matte1782/edgevec/compare/v0.4.0...v0.4.1
[0.4.0]: https://github.com/matte1782/edgevec/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/matte1782/edgevec/compare/v0.2.1...v0.3.0
[0.2.1]: https://github.com/matte1782/edgevec/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/matte1782/edgevec/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/matte1782/edgevec/releases/tag/v0.1.0