{"abstract":"Weighted distance ignores per-coordinate importance.","category":"Vector retrieval ranking","checks":6,"contract":"Rank by sum(weight_i*(candidate_i-query_i)^2), ascending; dimensions match.","contract_signature":"rows, query, weights","evaluation_group":"vector-retrieval-weighted-distance","failed_approach":"Weighted Manhattan distance remains a different metric from the contract.","family":"w3-vector-retrieval-ranking-weighted-distance","id":"FA-99486","implementations":{"attempt":{"sha256":"1184b091f17a6ad9ee3e28efb531a2a883e3f7381b0bbfc8e12af12b8a87145b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, query, weights):\n    return [r[0] for r in sorted(rows,key=lambda r:sum(w*abs(a-b) for a,b,w in zip(r[1],query,weights)))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nq=[0,0]\ncheck('important axis',solve([['a',[2,0]],['b',[0,2]]],q,[1,N+2]),['a','b'])\ncheck('reverse weights',solve([['a',[N,0]],['b',[0,2]]],q,[1,N+3]),['a','b'])\ncheck('low weighted axis',solve([['a',[0,N]],['b',[2,0]]],q,[N+4,1]),['a','b'])\ncheck('all equal weights',solve([['z',[0,1]],['a',[1,0]]],q,[1,1]),['a','z'])\ncheck('exact candidate',solve([['x',[0,0]],['y',[1,1]]],q,[N+1,2]),['x','y'])\ncheck('three dimensions',solve([['a',[1,0,0]],['b',[0,0,2]]],[0,0,0],[1,2,N+3]),['a','b'])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"a6624072d80ce0f8f7c4a9ab897675afec02451fed466f139a44d96e8184e61f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, query, weights):\n    return [r[0] for r in sorted(rows,key=lambda r:sum((a-b)**2 for a,b in zip(r[1],query)))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nq=[0,0]\ncheck('important axis',solve([['a',[2,0]],['b',[0,2]]],q,[1,N+2]),['a','b'])\ncheck('reverse weights',solve([['a',[N,0]],['b',[0,2]]],q,[1,N+3]),['a','b'])\ncheck('low weighted axis',solve([['a',[0,N]],['b',[2,0]]],q,[N+4,1]),['a','b'])\ncheck('all equal weights',solve([['z',[0,1]],['a',[1,0]]],q,[1,1]),['a','z'])\ncheck('exact candidate',solve([['x',[0,0]],['y',[1,1]]],q,[N+1,2]),['x','y'])\ncheck('three dimensions',solve([['a',[1,0,0]],['b',[0,0,2]]],[0,0,0],[1,2,N+3]),['a','b'])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"Inputs are small exact toy vectors and scores. No production index, ANN recall, embedding quality, or latency claim is implied. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w3-vector-retrieval-ranking-weighted-distance","generated_at":"2026-09-30T16:48:24.913005+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"An offline vector retrieval toy model isolates one ranking contract from embedding generation, storage, and serving.","root_cause":"Coordinate weights are discarded or only apply linearly to absolute deltas.","sha256":"fced395f411563591d3e21d7f6b6ffcdf57f07f46a348108fed80f9d75635935","title":"Vector retrieval: Weighted distance ignores per-coordinate importance · case 01","variant":1,"variant_policy":"The fixture code references N, supplied as 1 through 5. Fixed boundary checks may repeat. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":28.467,"exit_code":1,"observations":[{"actual":["a","b"],"check":"important axis","expected":["a","b"],"passed":true},{"actual":["a","b"],"check":"reverse weights","expected":["a","b"],"passed":true},{"actual":["a","b"],"check":"low weighted axis","expected":["a","b"],"passed":true},{"actual":["z","a"],"check":"all equal weights","expected":["a","z"],"passed":false},{"actual":["x","y"],"check":"exact candidate","expected":["x","y"],"passed":true},{"actual":["a","b"],"check":"three dimensions","expected":["a","b"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"important axis\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"reverse weights\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"low weighted axis\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"all equal weights\", \"actual\": [\"z\", \"a\"], \"expected\": [\"a\", \"z\"], \"passed\": false}, {\"check\": \"exact candidate\", \"actual\": [\"x\", \"y\"], \"expected\": [\"x\", \"y\"], \"passed\": true}, {\"check\": \"three dimensions\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":28.064,"exit_code":1,"observations":[{"actual":["a","b"],"check":"important axis","expected":["a","b"],"passed":true},{"actual":["a","b"],"check":"reverse weights","expected":["a","b"],"passed":true},{"actual":["a","b"],"check":"low weighted axis","expected":["a","b"],"passed":true},{"actual":["z","a"],"check":"all equal weights","expected":["a","z"],"passed":false},{"actual":["x","y"],"check":"exact candidate","expected":["x","y"],"passed":true},{"actual":["a","b"],"check":"three dimensions","expected":["a","b"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"important axis\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"reverse weights\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"low weighted axis\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"all equal weights\", \"actual\": [\"z\", \"a\"], \"expected\": [\"a\", \"z\"], \"passed\": false}, {\"check\": \"exact candidate\", \"actual\": [\"x\", \"y\"], \"expected\": [\"x\", \"y\"], \"passed\": true}, {\"check\": \"three dimensions\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}