ruvnet/ruflo · error

WASM bridge failed, falling back to JS implementation

Error message

WASM bridge failed, falling back to JS implementation

What it means

Log warning in the causal-infer tool handler: calling the WASM bridge's inferCausal failed, so effect/confidence/confounders/backdoor paths are computed by the pure-JS causal inference implementation instead.

Source

Thrown at v3/plugins/prime-radiant/src/tools/causal-infer.ts:342

    let effect: number;
    let confidence: number;
    let confounders: string[];
    let backdoorPaths: string[][];
    let interventionValid: boolean;

    // Try to use WASM bridge if available
    if (context?.bridge?.initialized) {
      try {
        logger.debug('Using WASM bridge for causal inference');
        const result = await context.bridge.inferCausal(graph, intervention, outcome);
        effect = result.effect;
        confidence = result.confidence;
        confounders = result.confounders;
        backdoorPaths = result.backdoorPaths;
        interventionValid = result.interventionValid;
      } catch (wasmError) {
        logger.warn('WASM bridge failed, falling back to JS implementation', {
          error: wasmError instanceof Error ? wasmError.message : String(wasmError),
        });
        // Use JavaScript implementation
        const graphStructure = buildGraphStructure(graph);
        interventionValid = validateIntervention(intervention, outcome, graphStructure);
        confounders = identifyConfounders(intervention, outcome, graphStructure);
        backdoorPaths = findBackdoorPaths(intervention, outcome, graphStructure, maxBackdoorPaths);
        const estimation = estimateCausalEffect(intervention, outcome, confounders, backdoorPaths, graphStructure);
        effect = estimation.effect;
        confidence = estimation.confidence;
      }
    } else {
      // Pure JavaScript fallback
      logger.debug('Using JavaScript fallback for causal inference');
      const graphStructure = buildGraphStructure(graph);
      interventionValid = validateIntervention(intervention, outcome, graphStructure);
      confounders = identifyConfounders(intervention, outcome, graphStructure);
      backdoorPaths = findBackdoorPaths(intervention, outcome, graphStructure, maxBackdoorPaths);

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Check the WASM bridge error detail; the JS implementation is used — reinstall the WASM bridge to restore performance.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at v3/plugins/prime-radiant/src/tools/causal-infer.ts:342 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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