A production restart storm measured 90,017ms for a single brain init vs 1,117ms quiet (~80x contention multiplier), traced to performInit() eagerly awaiting the process-global WASM embedding engine before the VFS root even existed. Every writer's open() queued on the one throttled model compile (90-140s on throttled CPUs). - VirtualFileSystem.doInitializeRoot() no longer embeds '/'. The root is system-tier plumbing nothing ever searches; when the default WASM engine is active it now gets an explicit all-zero placeholder vector (cosineDistance returns max distance for a zero vector, so it never ranks ahead of real content). deferEmbedding was considered and rejected: its landing path kicks the embed worker synchronously right after commit, which would still force the cold compile within milliseconds — just off the awaited path, not avoided. A registered native 'embeddings' provider (no cold-start cost, possibly a different dimension) still embeds the root for real, via the new Brainy.usesDefaultWasmEmbedder() seam. - performInit()'s eager-embedding step now only STARTS the WASM engine warm in the background instead of awaiting it inline. embed()/embeddingManager already serialize concurrent callers on one shared init promise, so the first real embed() converges correctly either way; a failed warm narrates loudly instead of surfacing as a silent latency spike or an unhandled rejection. eagerEmbeddings: false still means no warm at all. - FileSystemStorage.init() batches its ~8 independent bootstrap mkdirs (each creates its own full subtree via recursive:true, so none depend on the others existing) into one Promise.all. The restore-completion step and initializeCounts() stay strictly sequential — they have real order dependencies on rootDir and systemDir respectively. - performInit() now times five phases (storage init / generation-store open+fold / index init+gate / VFS bootstrap / embedding-warm-started) and logs one warning with the per-phase breakdown when total open exceeds 2000ms; silent otherwise. |
||
|---|---|---|
| .. | ||
| add.test.ts | ||
| batch-operations.test.ts | ||
| brain-format-handshake.test.ts | ||
| counts-by-type-fix.test.ts | ||
| degraded-reads-surfaced.test.ts | ||
| fill-subtypes.test.ts | ||
| find-agg-edge-cases.test.ts | ||
| find-complement-operators.test.ts | ||
| find-include-vectors.test.ts | ||
| find-index-integrity-guard.test.ts | ||
| find-orderby-pagek.test.ts | ||
| find.test.ts | ||
| get.test.ts | ||
| graph-analytics.test.ts | ||
| graph-export.test.ts | ||
| graph-native-routing.test.ts | ||
| graph-subgraph.test.ts | ||
| hybrid-search.test.ts | ||
| lazy-notready-honor.test.ts | ||
| maintenance-debt.test.ts | ||
| metadata-provider-contract.test.ts | ||
| migration-deference.test.ts | ||
| migration-gate-family-scoped.test.ts | ||
| open-path.test.ts | ||
| persistence-policy.test.ts | ||
| relate-duplicate-optimization.test.ts | ||
| relate.test.ts | ||
| related-node-bidirectional.test.ts | ||
| related-visibility-fast-path.test.ts | ||
| similar-threshold.test.ts | ||
| update.test.ts | ||
| upsert.test.ts | ||
| visibility.test.ts | ||
| warm.test.ts | ||