{"abstract":"Multiple query vectors duplicate the same document.","category":"Vector retrieval ranking","checks":6,"contract":"For per-query rows [doc,score], take each document’s maximum similarity and rank documents once.","contract_signature":"hits","evaluation_group":"vector-retrieval-maxsim-deduplicate","failed_approach":"Deduplicating IDs alphabetically loses similarity ranking.","family":"w3-vector-retrieval-ranking-maxsim-deduplicate","id":"FA-99471","implementations":{"attempt":{"sha256":"6fb8aed699693e7aea83757c15dd0d2f961fc5737694eea0611a4f88ee565b87","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(hits):\n    return sorted({r[0] for r in hits})\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('repeat doc',solve([['a',0.2],['a',0.9],['b',0.5]]),['a','b'])\ncheck('duplicate lower later',solve([['a',N/10],['b',N/10+0.1],['a',0.95]]),['a','b'])\ncheck('rank by max',solve([['b',0.8],['a',0.1],['a',0.7]]),['b','a'])\ncheck('singletons',solve([['z',0.2],['a',0.9]]),['a','z'])\ncheck('empty',solve([]),[])\ncheck('negative scores',solve([['a',-0.8],['a',-0.2],['b',-0.4]]),['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":"9c310cbb4f52815e67adb3d7afd5915c1a8d8ab1342bc3648563b0c5a4e5cf43","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(hits):\n    return [r[0] for r in sorted(hits,key=lambda r:(-r[1],r[0]))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('repeat doc',solve([['a',0.2],['a',0.9],['b',0.5]]),['a','b'])\ncheck('duplicate lower later',solve([['a',N/10],['b',N/10+0.1],['a',0.95]]),['a','b'])\ncheck('rank by max',solve([['b',0.8],['a',0.1],['a',0.7]]),['b','a'])\ncheck('singletons',solve([['z',0.2],['a',0.9]]),['a','z'])\ncheck('empty',solve([]),[])\ncheck('negative scores',solve([['a',-0.8],['a',-0.2],['b',-0.4]]),['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-maxsim-deduplicate","generated_at":"2026-09-30T16:48:24.474392+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":"Each query match is emitted independently, or documents are sorted lexically.","sha256":"9e2868b6453a7823437312773f3a4bd968cb5a61911ece150ee8b6db63438dca","title":"Vector retrieval: Multiple query vectors duplicate the same document · 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":27.238,"exit_code":1,"observations":[{"actual":["a","b"],"check":"repeat doc","expected":["a","b"],"passed":true},{"actual":["a","b"],"check":"duplicate lower later","expected":["a","b"],"passed":true},{"actual":["a","b"],"check":"rank by max","expected":["b","a"],"passed":false},{"actual":["a","z"],"check":"singletons","expected":["a","z"],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["a","b"],"check":"negative scores","expected":["a","b"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"repeat doc\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"duplicate lower later\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"rank by max\", \"actual\": [\"a\", \"b\"], \"expected\": [\"b\", \"a\"], \"passed\": false}, {\"check\": \"singletons\", \"actual\": [\"a\", \"z\"], \"expected\": [\"a\", \"z\"], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"negative scores\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":26.809,"exit_code":1,"observations":[{"actual":["a","b","a"],"check":"repeat doc","expected":["a","b"],"passed":false},{"actual":["a","b","a"],"check":"duplicate lower later","expected":["a","b"],"passed":false},{"actual":["b","a","a"],"check":"rank by max","expected":["b","a"],"passed":false},{"actual":["a","z"],"check":"singletons","expected":["a","z"],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["a","b","a"],"check":"negative scores","expected":["a","b"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"repeat doc\", \"actual\": [\"a\", \"b\", \"a\"], \"expected\": [\"a\", \"b\"], \"passed\": false}, {\"check\": \"duplicate lower later\", \"actual\": [\"a\", \"b\", \"a\"], \"expected\": [\"a\", \"b\"], \"passed\": false}, {\"check\": \"rank by max\", \"actual\": [\"b\", \"a\", \"a\"], \"expected\": [\"b\", \"a\"], \"passed\": false}, {\"check\": \"singletons\", \"actual\": [\"a\", \"z\"], \"expected\": [\"a\", \"z\"], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"negative scores\", \"actual\": [\"a\", \"b\", \"a\"], \"expected\": [\"a\", \"b\"], \"passed\": false}], \"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."}}