FAILURE MAP
← Case archive

FA-100271 / Dataset deduplication grouping / Open access

Dataset deduplication: deduplication retains a lower-quality example · case 01

deduplication retains a lower-quality example.

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

ROOT CAUSE

Representative selection uses input order instead of the supplied quality score.

THE FAILURE

Representative selection uses input order instead of the supplied quality score.

Unsuccessful approach: Choosing the greatest ID ignores quality and only appears right on tied fixtures.

Case contract

Rows [key,id,quality]. Return [key,id] for the highest-quality row per key, sorted by key; ties choose lexical ID.

Why this case matters

This deterministic toy operation makes one dataset equivalence or representative rule explicit.

1 / The failure

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

N = 1
observations = []
def solve(rows):
    out={};
    for k,i,q in rows: out.setdefault(k,[k,i])
    return [out[k] for k in sorted(out)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('quality wins',solve([['k','low',N],['k','best',N+1]]),[['k','best']])
check('quality over ID',solve([['k','z',N+2],['k','a',N+1]]),[['k','z']])
check('tie lexical ID',solve([['k','z',N],['k','a',N]]),[['k','a']])
check('empty',solve([]),[])
check('different keys',solve([['b','B',1],['a','A',2]]),[['a','A'],['b','B']])
check('singleton',solve([['x','X',0]]),[['x','X']])
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
quality wins[['k', 'low']][['k', 'best']]Failed
quality over ID[['k', 'z']][['k', 'z']]Passed
tie lexical ID[['k', 'z']][['k', 'a']]Failed
empty[][]Passed
different keys[['a', 'A'], ['b', 'B']][['a', 'A'], ['b', 'B']]Passed
singleton[['x', 'X']][['x', 'X']]Passed

SHA-256 / 4a0a56960f04912b20591f36237828afbbe1997b11041fcb356a27c711139e95

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(rows):
    out={};
    for k,i,q in rows:
     if k not in out or i>out[k][1]: out[k]=[k,i]
    return [out[k] for k in sorted(out)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('quality wins',solve([['k','low',N],['k','best',N+1]]),[['k','best']])
check('quality over ID',solve([['k','z',N+2],['k','a',N+1]]),[['k','z']])
check('tie lexical ID',solve([['k','z',N],['k','a',N]]),[['k','a']])
check('empty',solve([]),[])
check('different keys',solve([['b','B',1],['a','A',2]]),[['a','A'],['b','B']])
check('singleton',solve([['x','X',0]]),[['x','X']])
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
quality wins[['k', 'low']][['k', 'best']]Failed
quality over ID[['k', 'z']][['k', 'z']]Passed
tie lexical ID[['k', 'z']][['k', 'a']]Failed
empty[][]Passed
different keys[['a', 'A'], ['b', 'B']][['a', 'A'], ['b', 'B']]Passed
singleton[['x', 'X']][['x', 'X']]Passed

SHA-256 / 9ce28f6f276e18cd33c6a1e08d64964dac25c81c48390dc34a816eb7514755a5

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 in-memory fixtures with the stated contract; results do not claim production deduplication quality. 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:33.560648+00:00.

Case digest / d2fc6f3ed32cf879191bbe44f61264027165a1af52e725d5beac567940de4bda