FAILURE MAP
← Case archive

FA-99531 / Vector retrieval ranking / Open access

Vector retrieval: Scores are paired with the wrong candidate IDs · case 01

Scores are paired with the wrong candidate IDs.

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

ROOT CAUSE

The index used to read scores is reversed or the score direction is ascending.

THE FAILURE

The index used to read scores is reversed or the score direction is ascending.

Unsuccessful approach: Descending identifier ties still violate the requested lexical order.

Case contract

Return IDs sorted by descending scores; IDs and scores are parallel arrays.

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(ids, scores):
    return [ids[i] for i in sorted(range(len(ids)),key=lambda i:scores[i])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('clear winner',solve(['a','b'],[N,N+4]),['b','a'])
check('three scores',solve(['a','b','c'],[N+1,N+3,N+2]),['b','c','a'])
check('tie IDs',solve(['z','a'],[N,N]),['a','z'])
check('negative',solve(['a','b'],[-N,-N-2]),['a','b'])
check('singleton',solve(['x'],[N]),['x'])
check('empty',solve([],[]),[])
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
clear winner['a', 'b']['b', 'a']Failed
three scores['a', 'c', 'b']['b', 'c', 'a']Failed
tie IDs['z', 'a']['a', 'z']Failed
negative['b', 'a']['a', 'b']Failed
singleton['x']['x']Passed
empty[][]Passed

SHA-256 / eae1a46b766dc6db7a0becb9acdbf1a4abfe3e5f6e7e8bbb5e15b95e64d6b200

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(ids, scores):
    return [ids[i] for i in sorted(range(len(ids)),key=lambda i:(-scores[i],tuple(-ord(c) for c in ids[i])))]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('clear winner',solve(['a','b'],[N,N+4]),['b','a'])
check('three scores',solve(['a','b','c'],[N+1,N+3,N+2]),['b','c','a'])
check('tie IDs',solve(['z','a'],[N,N]),['a','z'])
check('negative',solve(['a','b'],[-N,-N-2]),['a','b'])
check('singleton',solve(['x'],[N]),['x'])
check('empty',solve([],[]),[])
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
clear winner['b', 'a']['b', 'a']Passed
three scores['b', 'c', 'a']['b', 'c', 'a']Passed
tie IDs['z', 'a']['a', 'z']Failed
negative['a', 'b']['a', 'b']Passed
singleton['x']['x']Passed
empty[][]Passed

SHA-256 / b6f593d9bf241e5b707e83c065e52a29ae12330804e6472edfde1e293cbde3d0

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

Case digest / 5ec04c59ff6c06eb6ed21b6b44e1a4293bc8d10041bfedc67e3c3ae576805e9f