ruvnet/ruflo · error

WASM attention module not available, using JS fallback

Error message

WASM attention module not available, using JS fallback

What it means

Fallback in AttentionBridge.initialize(): dynamic import of the WASM attention module failed, so the bridge continues with the pure-JS cross-attention implementation. Results remain correct; only throughput is affected.

Source

Thrown at v3/plugins/legal-contracts/src/bridges/attention-bridge.ts:91

  constructor(embeddingDim = 384) {
    this.embeddingDim = embeddingDim;
  }

  /**
   * Initialize the WASM module
   */
  async initialize(): Promise<void> {
    if (this.initialized) return;

    try {
      // Dynamic import of WASM module
      // In production, this would load from @claude-flow/ruvector-upstream
      const wasmModule = await this.loadWasmModule();
      this.wasmModule = wasmModule;
      this.initialized = true;
    } catch (error) {
      // Fallback to pure JS implementation if WASM not available
      console.warn('WASM attention module not available, using JS fallback');
      this.wasmModule = null;
      this.initialized = true;
    }
  }

  /**
   * Check if initialized
   */
  isInitialized(): boolean {
    return this.initialized;
  }

  /**
   * Compute cross-attention between clause embeddings
   */
  async computeCrossAttention(
    queryEmbeddings: Float32Array[],
    keyEmbeddings: Float32Array[],

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Ensure the WASM attention module is built and its path resolves so the native implementation loads.
  2. Verify runtime WebAssembly support and any required feature flags.
  3. If the JS fallback is acceptable, no action needed; otherwise fix the init-time load error.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Attention WASM module unavailable (missing build artifact or instantiation failure); legal-contracts bridge falls back to the JS attention implementation.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/03338101d36e9897. Report an issue: GitHub.