FAILURE MAP
← Case archive

FA-100261 / Dataset deduplication grouping / Open access

Dataset deduplication: token multiplicity is discarded from bag identity · case 01

token multiplicity is discarded from bag identity.

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

ROOT CAUSE

The key converts token collections to sets, erasing counts.

THE FAILURE

The key converts token collections to sets, erasing counts.

Unsuccessful approach: Using raw sequence keys incorrectly makes order significant.

Case contract

Return distinct token multisets; order does not matter and repeated tokens do.

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(docs):
    return len({frozenset(d) for d in docs})
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
a='w'+str(N)
check('same bag reordered',solve([[a,'x'],['x',a]]),1)
check('multiplicity differs',solve([[a,a,'x'],[a,'x']]),2)
check('empty bags',solve([[],[]]),1)
check('empty corpus',solve([]),0)
check('three bags',solve([[a],[a,a],['x']]),3)
check('singleton',solve([[a]]),1)
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
same bag reordered11Passed
multiplicity differs12Failed
empty bags11Passed
empty corpus00Passed
three bags23Failed
singleton11Passed

SHA-256 / 02a01947315354e9c7ea9cec9c15c39e0a4c49b3d573a35b1c90f1e2a6e4ee57

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(docs):
    return len({tuple(d) for d in docs})
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
a='w'+str(N)
check('same bag reordered',solve([[a,'x'],['x',a]]),1)
check('multiplicity differs',solve([[a,a,'x'],[a,'x']]),2)
check('empty bags',solve([[],[]]),1)
check('empty corpus',solve([]),0)
check('three bags',solve([[a],[a,a],['x']]),3)
check('singleton',solve([[a]]),1)
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
same bag reordered21Failed
multiplicity differs22Passed
empty bags11Passed
empty corpus00Passed
three bags33Passed
singleton11Passed

SHA-256 / e925fb42427da027c1034a7f5d5cf26d196f7606eb3a325af506b3d179033bd6

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

Case digest / 7f71354c0c147c46cb60379722d925a6cde351b58bcd32c2acca6c7b726da2ce