open-brainy/src/embeddings/wasm
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
..
AssetLoader.ts feat: migrate embeddings to Candle WASM + remove semantic type inference 2026-01-06 12:52:34 -08:00
CandleEmbeddingEngine.ts fix: cancel abandoned highlight() semantic work and harden WASM engine recovery 2026-01-27 18:26:37 -08:00
EmbeddingPostProcessor.ts feat: replace transformers.js with direct ONNX WASM for Bun compatibility 2025-12-17 17:42:37 -08:00
index.ts feat: migrate embeddings to Candle WASM + remove semantic type inference 2026-01-06 12:52:34 -08:00
modelLoader.ts fix: exclude __words__ keyword index from corruption detection and getStats() 2026-01-27 15:38:21 -08:00
types.ts feat: migrate embeddings to Candle WASM + remove semantic type inference 2026-01-06 12:52:34 -08:00
WASMEmbeddingEngine.ts fix: cancel abandoned highlight() semantic work and harden WASM engine recovery 2026-01-27 18:26:37 -08:00
wasmLoader.ts fix: resolve WASM loading for Bun --compile single-binary executables 2026-01-06 14:09:02 -08:00
WordPieceTokenizer.ts feat: replace transformers.js with direct ONNX WASM for Bun compatibility 2025-12-17 17:42:37 -08:00