FA-99471 / Vector retrieval ranking / Open access
Vector retrieval: Multiple query vectors duplicate the same document · case 01
Multiple query vectors duplicate the same document.
ROOT CAUSE
Each query match is emitted independently, or documents are sorted lexically.
THE FAILURE
Each query match is emitted independently, or documents are sorted lexically.
Unsuccessful approach: Deduplicating IDs alphabetically loses similarity ranking.
Case contract
For per-query rows [doc,score], take each document’s maximum similarity and rank documents once.
Why this case matters
An offline vector retrieval toy model isolates one ranking contract from embedding generation, storage, and serving.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(hits):
return [r[0] for r in sorted(hits,key=lambda r:(-r[1],r[0]))]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeat doc',solve([['a',0.2],['a',0.9],['b',0.5]]),['a','b'])
check('duplicate lower later',solve([['a',N/10],['b',N/10+0.1],['a',0.95]]),['a','b'])
check('rank by max',solve([['b',0.8],['a',0.1],['a',0.7]]),['b','a'])
check('singletons',solve([['z',0.2],['a',0.9]]),['a','z'])
check('empty',solve([]),[])
check('negative scores',solve([['a',-0.8],['a',-0.2],['b',-0.4]]),['a','b'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| repeat doc | ['a', 'b', 'a'] | ['a', 'b'] | Failed |
| duplicate lower later | ['a', 'b', 'a'] | ['a', 'b'] | Failed |
| rank by max | ['b', 'a', 'a'] | ['b', 'a'] | Failed |
| singletons | ['a', 'z'] | ['a', 'z'] | Passed |
| empty | [] | [] | Passed |
| negative scores | ['a', 'b', 'a'] | ['a', 'b'] | Failed |
SHA-256 / 9c310cbb4f52815e67adb3d7afd5915c1a8d8ab1342bc3648563b0c5a4e5cf43
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(hits):
return sorted({r[0] for r in hits})
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeat doc',solve([['a',0.2],['a',0.9],['b',0.5]]),['a','b'])
check('duplicate lower later',solve([['a',N/10],['b',N/10+0.1],['a',0.95]]),['a','b'])
check('rank by max',solve([['b',0.8],['a',0.1],['a',0.7]]),['b','a'])
check('singletons',solve([['z',0.2],['a',0.9]]),['a','z'])
check('empty',solve([]),[])
check('negative scores',solve([['a',-0.8],['a',-0.2],['b',-0.4]]),['a','b'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| repeat doc | ['a', 'b'] | ['a', 'b'] | Passed |
| duplicate lower later | ['a', 'b'] | ['a', 'b'] | Passed |
| rank by max | ['a', 'b'] | ['b', 'a'] | Failed |
| singletons | ['a', 'z'] | ['a', 'z'] | Passed |
| empty | [] | [] | Passed |
| negative scores | ['a', 'b'] | ['a', 'b'] | Passed |
SHA-256 / 6fb8aed699693e7aea83757c15dd0d2f961fc5737694eea0611a4f88ee565b87
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 6 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-30T16:48:24.474392+00:00.
Case digest / 9e2868b6453a7823437312773f3a4bd968cb5a61911ece150ee8b6db63438dca