FAILURE MAP
← Case archive

FA-100326 / Dataset deduplication grouping / Open access

Dataset deduplication: equivalence group IDs depend on input order · case 01

equivalence group IDs depend on input order.

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

ROOT CAUSE

A sequential counter labels components in the order their first member occurs.

THE FAILURE

A sequential counter labels components in the order their first member occurs.

Unsuccessful approach: Using the first encountered member still changes under row permutation.

Case contract

Rows [id,group_key]; return [id,canonical_group_id] in input order where canonical ID is the smallest ID for each key.

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):
    first={}; out=[]
    for i,g in rows:
     first.setdefault(g,i); out.append([i,first[g]])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('noncanonical first',solve([['z','g'],['a','g']]),[['z','a'],['a','a']])
check('separate groups',solve([['b','y'],['a','x']]),[['b','b'],['a','a']])
check('empty',solve([]),[])
check('singleton',solve([['x','g']]),[['x','x']])
check('interleaved',solve([['z','g'],['m','h'],['a','g']]),[['z','a'],['m','m'],['a','a']])
check('duplicate group rows',solve([['b','g'],['c','g'],['a','g']]),[['b','a'],['c','a'],['a','a']])
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
noncanonical first[['z', 'z'], ['a', 'z']][['z', 'a'], ['a', 'a']]Failed
separate groups[['b', 'b'], ['a', 'a']][['b', 'b'], ['a', 'a']]Passed
empty[][]Passed
singleton[['x', 'x']][['x', 'x']]Passed
interleaved[['z', 'z'], ['m', 'm'], ['a', 'z']][['z', 'a'], ['m', 'm'], ['a', 'a']]Failed
duplicate group rows[['b', 'b'], ['c', 'b'], ['a', 'b']][['b', 'a'], ['c', 'a'], ['a', 'a']]Failed

SHA-256 / baeb1995cef296d056c814685dc8e00a0827216e664ae2e135123b0fead5bdb4

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(rows):
    first={};
    for i,g in rows: first.setdefault(g,i)
    return [[i,first[g]] for i,g in rows]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('noncanonical first',solve([['z','g'],['a','g']]),[['z','a'],['a','a']])
check('separate groups',solve([['b','y'],['a','x']]),[['b','b'],['a','a']])
check('empty',solve([]),[])
check('singleton',solve([['x','g']]),[['x','x']])
check('interleaved',solve([['z','g'],['m','h'],['a','g']]),[['z','a'],['m','m'],['a','a']])
check('duplicate group rows',solve([['b','g'],['c','g'],['a','g']]),[['b','a'],['c','a'],['a','a']])
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
noncanonical first[['z', 'z'], ['a', 'z']][['z', 'a'], ['a', 'a']]Failed
separate groups[['b', 'b'], ['a', 'a']][['b', 'b'], ['a', 'a']]Passed
empty[][]Passed
singleton[['x', 'x']][['x', 'x']]Passed
interleaved[['z', 'z'], ['m', 'm'], ['a', 'z']][['z', 'a'], ['m', 'm'], ['a', 'a']]Failed
duplicate group rows[['b', 'b'], ['c', 'b'], ['a', 'b']][['b', 'a'], ['c', 'a'], ['a', 'a']]Failed

SHA-256 / 2e84f6f011a3e53bda8f97b85ecbc82cb20f9eabd4b88a87a4241f9e5bc7dd04

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

Case digest / 1f3dc1a7ef7fae27b2285c5958533ba4e4e6c5ea7266cf567ed2e98b283be60b