{"record":{"id":"8fb8b4291043b5b7","repo":"ruvnet/ruflo","slug":"embeddings-must-have-same-dimension","errorCode":null,"errorMessage":"Embeddings must have same dimension","messagePattern":"Embeddings must have same dimension","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/embeddings/src/hyperbolic.ts","lineNumber":161,"sourceCode":" *\n * The geodesic distance between two points in the Poincaré ball.\n *\n * @param a - First Poincaré embedding\n * @param b - Second Poincaré embedding\n * @param config - Hyperbolic geometry configuration\n * @returns Hyperbolic distance\n */\nexport function hyperbolicDistance(\n  a: Float32Array | number[],\n  b: Float32Array | number[],\n  config: HyperbolicConfig = {}\n): number {\n  const { curvature, epsilon } = { ...DEFAULT_CONFIG, ...config };\n  const c = Math.abs(curvature);\n  const sqrtC = Math.sqrt(c);\n\n  if (a.length !== b.length) {\n    throw new Error('Embeddings must have same dimension');\n  }\n\n  // ||a - b||^2\n  let diffNormSq = 0;\n  for (let i = 0; i < a.length; i++) {\n    const d = a[i] - b[i];\n    diffNormSq += d * d;\n  }\n\n  // ||a||^2 and ||b||^2\n  let normASq = 0;\n  let normBSq = 0;\n  for (let i = 0; i < a.length; i++) {\n    normASq += a[i] * a[i];\n    normBSq += b[i] * b[i];\n  }\n\n  // Poincaré distance formula:","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/embeddings/src/hyperbolic.ts#L143-L179","documentation":"hyperbolicDistance() was called with Poincaré-ball vectors a and b whose lengths differ. The geodesic-distance formula requires dimensionally matched points, so the guard fires before any curvature math — typically mixed-model embeddings or a truncated vector.","triggerScenarios":"Thrown at v3/@claude-flow/embeddings/src/hyperbolic.ts:161 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass embeddings produced by the same model/dimension to the hyperbolic operation.","Truncate or pad is not supported; regenerate the mismatched embedding with the correct model."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}