ruvnet/ruflo · error · Error

Cannot compute distance between points with different curvat

Error message

Cannot compute distance between points with different curvatures

What it means

HyperbolicBridge.distance() was given two points whose curvature values differ. The Poincaré geodesic distance is only defined within one ball (one curvature), so mixing points from differently-curved embeddings is rejected before poincareDistance runs.

Source

Thrown at v3/plugins/hyperbolic-reasoning/src/bridges/hyperbolic-bridge.ts:280

    // Compute quality metrics
    const metrics = this.computeEmbeddingMetrics(hierarchy, embeddings);

    return {
      embeddings,
      model: 'poincare_ball',
      curvature,
      dimension: mergedConfig.dimensions,
      metrics,
    };
  }

  /**
   * Compute hyperbolic distance between two points
   */
  distance(a: HyperbolicPoint, b: HyperbolicPoint): number {
    if (a.curvature !== b.curvature) {
      throw new Error('Cannot compute distance between points with different curvatures');
    }
    return poincareDistance(a.coordinates, b.coordinates, a.curvature);
  }

  /**
   * Check if one point is ancestor of another (closer to origin)
   */
  isAncestor(parent: HyperbolicPoint, child: HyperbolicPoint, threshold = 0.1): boolean {
    const parentNorm = Math.sqrt(parent.coordinates.reduce((s, v) => s + v * v, 0));
    const childNorm = Math.sqrt(child.coordinates.reduce((s, v) => s + v * v, 0));
    return parentNorm < childNorm - threshold;
  }

  /**
   * Get hierarchy depth from hyperbolic point
   */
  hierarchyDepth(point: HyperbolicPoint): number {
    const norm = Math.sqrt(point.coordinates.reduce((s, v) => s + v * v, 0));

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Ensure both points use the same curvature value; project or convert one point to the other's curvature before computing distance.
  2. Validate curvature equality at the API boundary and fail fast with both values in the message.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/plugins/hyperbolic-reasoning/src/bridges/hyperbolic-bridge.ts:280 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/bdd39b0383002fc7. Report an issue: GitHub.