FAILURE MAP
← Case archive

FA-97846 / Dataset split isolation / Open access

Dataset split: groups are alternated by input order despite unequal sizes · case 01

groups are alternated by input order despite unequal sizes.

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

ROOT CAUSE

The implementation alternates group positions without considering how many rows each group contributes.

THE FAILURE

The implementation alternates group positions without considering how many rows each group contributes.

Unsuccessful approach: A half-total threshold approximates a split but does not compare both side loads and can cross the threshold at an exact-half boundary.

Case contract

Groups map to nonempty lists of row IDs. Return train IDs from largest-first greedy size balancing; ties choose train.

Why this case matters

This toy split allocator makes membership rules explicit for reproducible evaluation fixtures.

1 / The failure

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

N = 1
observations = []
def solve(groups):
    return [x for g,rows in groups.items() if len([r for r in rows]) and list(groups).index(g)%2==0 for x in rows]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('large first',solve({'a':list(range(N+3)),'b':['b'],'c':['c']}),list(range(N+3)))
check('one group',solve({'g':['x']}),['x'])
check('empty groups',solve({}),[])
check('stable tie',solve({'b':['b'],'a':['a']}),['a'])
check('two large',solve({'a':['a1','a2'],'b':['b1','b2']}),['a1','a2'])
check('small follows load',solve({'a':['a1','a2','a3'],'b':['b'],'c':['c']}),['a1','a2','a3'])
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
large first[0, 1, 2, 3, 'c'][0, 1, 2, 3]Failed
one group['x']['x']Passed
empty groups[][]Passed
stable tie['b']['a']Failed
two large['a1', 'a2']['a1', 'a2']Passed
small follows load['a1', 'a2', 'a3', 'c']['a1', 'a2', 'a3']Failed

SHA-256 / a9417f01d9682780c35635a48400d7b1734df29d2d5ff85e554173205df6723a

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(groups):
    out=[]; total=0
    for g,rs in sorted(groups.items(),key=lambda z:-len(z[1])):
     if total<=sum(map(len,groups.values()))//2: out+=rs; total+=len(rs)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('large first',solve({'a':list(range(N+3)),'b':['b'],'c':['c']}),list(range(N+3)))
check('one group',solve({'g':['x']}),['x'])
check('empty groups',solve({}),[])
check('stable tie',solve({'b':['b'],'a':['a']}),['a'])
check('two large',solve({'a':['a1','a2'],'b':['b1','b2']}),['a1','a2'])
check('small follows load',solve({'a':['a1','a2','a3'],'b':['b'],'c':['c']}),['a1','a2','a3'])
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
large first[0, 1, 2, 3][0, 1, 2, 3]Passed
one group['x']['x']Passed
empty groups[][]Passed
stable tie['b', 'a']['a']Failed
two large['a1', 'a2', 'b1', 'b2']['a1', 'a2']Failed
small follows load['a1', 'a2', 'a3']['a1', 'a2', 'a3']Passed

SHA-256 / c4fb72c35a61e10bc687b1fa49ff4784e1d673b74deb35d8f29e2678374db1ee

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 records with self-contained contracts; no claim is made about production sampling 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:06.687810+00:00.

Case digest / d724123d98f29acfcb67ecb34940b5d893aee4b423ce93c3e775cf7363cafcf3