FAILURE MAP
← Case archive

FA-99521 / Vector retrieval ranking / Open access

Vector retrieval: Per-shard top results are concatenated without global ranking · case 01

Per-shard top results are concatenated without global ranking.

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

ROOT CAUSE

Each shard’s local order is concatenated and treated as globally ranked.

THE FAILURE

Each shard’s local order is concatenated and treated as globally ranked.

Unsuccessful approach: Sorting ascending fixes merge order in the wrong score direction.

Case contract

Shard lists contain [id,score], unique IDs; globally return top k by score then ID.

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, k):
    return [r[0] for shard in shards for r in shard][:k]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('global winner',solve([[['a',N]], [['b',N+4]]],1),['b'])
check('tie across shards',solve([[['z',N]], [['a',N]]],2),['a','z'])
check('third shard',solve([[['x',1]],[['y',N+2]],[['z',N+3]]],2),['z','y'])
check('zero limit',solve([[['a',N]]],0),[])
check('empty shards',solve([[],[]],N),[])
check('reordered shards',solve([[['b',N+1]],[['a',N+2]]],2),['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
global winner['a']['b']Failed
tie across shards['z', 'a']['a', 'z']Failed
third shard['x', 'y']['z', 'y']Failed
zero limit[][]Passed
empty shards[][]Passed
reordered shards['b', 'a']['a', 'b']Failed

SHA-256 / 6ec991e5969b05c268d9d8d0c98be79387c5908cd319c705d16205d84fe90b9f

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(shards, k):
    return [r[0] for r in sorted([r for shard in shards for r in shard],key=lambda r:r[1])[:k]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('global winner',solve([[['a',N]], [['b',N+4]]],1),['b'])
check('tie across shards',solve([[['z',N]], [['a',N]]],2),['a','z'])
check('third shard',solve([[['x',1]],[['y',N+2]],[['z',N+3]]],2),['z','y'])
check('zero limit',solve([[['a',N]]],0),[])
check('empty shards',solve([[],[]],N),[])
check('reordered shards',solve([[['b',N+1]],[['a',N+2]]],2),['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
global winner['a']['b']Failed
tie across shards['z', 'a']['a', 'z']Failed
third shard['x', 'y']['z', 'y']Failed
zero limit[][]Passed
empty shards[][]Passed
reordered shards['b', 'a']['a', 'b']Failed

SHA-256 / 948d230f7c51df7e9725d5173556c9cab36f7e67fa83f258fd8555596e0e4789

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

Case digest / de958229903c05074056368b36bcb7855a2fb22349f0763628a12d9cbe2333b1