FAILURE MAP
← Case archive

FA-99526 / Vector retrieval ranking / Open access

Vector retrieval: Duplicate IDs keep the first shard score · case 01

Duplicate IDs keep the first shard score.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The merge preserves first-seen scores or chooses the minimum score.

THE FAILURE

The merge preserves first-seen scores or chooses the minimum score.

Unsuccessful approach: Choosing the minimum loses a stronger later shard result.

Case contract

Across shards, repeated IDs retain their maximum score before global ranking.

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(shards):
    scores={}
    for shard in shards:
     for ident,score in shard: scores.setdefault(ident,score)
    return sorted(scores,key=lambda x:(-scores[x],x))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('later better',solve([[['a',N]], [['a',N+4],['b',N+2]]]),['a','b'])
check('first better',solve([[['a',N+5]], [['a',N],['b',N+2]]]),['a','b'])
check('duplicates collapse',solve([[['x',1],['x',2]]]),['x'])
check('ties',solve([[['z',N]], [['a',N]]]),['a','z'])
check('empty',solve([[],[]]),[])
check('three shards',solve([[['a',1]],[['b',N+2]],[['a',N+3]]]),['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 fixtureActualExpectedOutcome
later better['b', 'a']['a', 'b']Failed
first better['a', 'b']['a', 'b']Passed
duplicates collapse['x']['x']Passed
ties['a', 'z']['a', 'z']Passed
empty[][]Passed
three shards['b', 'a']['a', 'b']Failed

SHA-256 / 3774e0aeb8c8d9ee507501f0ad538f48e2465c6c4938682606598ce5e5b2221e

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(shards):
    scores={}
    for shard in shards:
     for ident,score in shard: scores[ident]=min(score,scores.get(ident,score))
    return sorted(scores,key=lambda x:(-scores[x],x))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('later better',solve([[['a',N]], [['a',N+4],['b',N+2]]]),['a','b'])
check('first better',solve([[['a',N+5]], [['a',N],['b',N+2]]]),['a','b'])
check('duplicates collapse',solve([[['x',1],['x',2]]]),['x'])
check('ties',solve([[['z',N]], [['a',N]]]),['a','z'])
check('empty',solve([[],[]]),[])
check('three shards',solve([[['a',1]],[['b',N+2]],[['a',N+3]]]),['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 fixtureActualExpectedOutcome
later better['b', 'a']['a', 'b']Failed
first better['b', 'a']['a', 'b']Failed
duplicates collapse['x']['x']Passed
ties['a', 'z']['a', 'z']Passed
empty[][]Passed
three shards['b', 'a']['a', 'b']Failed

SHA-256 / faf203eeb46123674fcb59b8102944ca62ebebaf867881073761cf95a1710fea

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:25.348111+00:00.

Case digest / 4f9b34c077b88f66b203b1d0d78123d8fa729712ff038174ff320791f32d02bd