brainy/src/embeddings
David Snelling f8dd93c93c fix: cancel abandoned highlight() semantic work and harden WASM engine recovery
highlight() used Promise.race with a 10s timeout, but the losing
semantic phase promise continued running 25 WASM micro-batches,
saturating the event loop and degrading all subsequent operations
(find() going from ~200ms to ~10,000ms).

Add AbortController to highlight() so the semantic phase stops
immediately on timeout or error. Pass abort signal through
embedBatch() → EmbeddingManager → micro-batch loop.

Also add defensive hardening:
- CandleEmbeddingEngine: try/catch around WASM calls resets engine
  state on failure so next call triggers re-initialization
- WASMEmbeddingEngine: initialize() now checks underlying Candle
  engine state, not just its own flag, completing the recovery chain
2026-01-27 18:26:37 -08:00
..
candle-wasm fix: prevent WASM embedding from blocking event loop during highlight() 2026-01-27 16:49:26 -08:00
wasm fix: cancel abandoned highlight() semantic work and harden WASM engine recovery 2026-01-27 18:26:37 -08:00
CachedEmbeddings.ts feat: implement clean embedding architecture with Q8/FP32 precision control 2025-09-02 10:00:52 -07:00
EmbeddingManager.ts fix: cancel abandoned highlight() semantic work and harden WASM engine recovery 2026-01-27 18:26:37 -08:00
index.ts feat: implement clean embedding architecture with Q8/FP32 precision control 2025-09-02 10:00:52 -07:00