FA-100131 / Preference pair construction / Open access
Preference pairs: pair sampling drops minority strata · case 01
pair sampling drops minority strata.
ROOT CAUSE
A single global limit is filled by early common-stratum records.
THE FAILURE
A single global limit is filled by early common-stratum records.
Unsuccessful approach: Sorting by stratum before truncating still spends the entire quota on the first group.
Case contract
Rows are [stratum,pair]. Return at most quota rows for each stratum, in original order; quota is nonnegative.
Why this case matters
A small deterministic preference-data transform makes pair semantics inspectable without a training framework.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows, quota):
return rows[:quota]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
a='a'+str(N); b='b'+str(N)
rows=[[a,1],[a,2],[a,3],[b,4],[b,5]]
check('quota per group',solve(rows,2),[[a,1],[a,2],[b,4],[b,5]])
check('zero quota',solve(rows,0),[])
check('empty',solve([],N),[])
check('one per group',solve(rows,1),[[a,1],[b,4]])
check('quota beyond group',solve([[a,1],[b,2]],5),[[a,1],[b,2]])
check('interleaved retains order',solve([[a,1],[b,2],[a,3],[b,4]],1),[[a,1],[b,2]])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| quota per group | [['a1', 1], ['a1', 2]] | [['a1', 1], ['a1', 2], ['b1', 4], ['b1', 5]] | Failed |
| zero quota | [] | [] | Passed |
| empty | [] | [] | Passed |
| one per group | [['a1', 1]] | [['a1', 1], ['b1', 4]] | Failed |
| quota beyond group | [['a1', 1], ['b1', 2]] | [['a1', 1], ['b1', 2]] | Passed |
| interleaved retains order | [['a1', 1]] | [['a1', 1], ['b1', 2]] | Failed |
SHA-256 / f34336176e4207f794ae1b769f92125c7984c0d624a2905cdee948178b8dd1f1
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows, quota):
return sorted(rows,key=lambda r:r[0])[:quota]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
a='a'+str(N); b='b'+str(N)
rows=[[a,1],[a,2],[a,3],[b,4],[b,5]]
check('quota per group',solve(rows,2),[[a,1],[a,2],[b,4],[b,5]])
check('zero quota',solve(rows,0),[])
check('empty',solve([],N),[])
check('one per group',solve(rows,1),[[a,1],[b,4]])
check('quota beyond group',solve([[a,1],[b,2]],5),[[a,1],[b,2]])
check('interleaved retains order',solve([[a,1],[b,2],[a,3],[b,4]],1),[[a,1],[b,2]])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| quota per group | [['a1', 1], ['a1', 2]] | [['a1', 1], ['a1', 2], ['b1', 4], ['b1', 5]] | Failed |
| zero quota | [] | [] | Passed |
| empty | [] | [] | Passed |
| one per group | [['a1', 1]] | [['a1', 1], ['b1', 4]] | Failed |
| quota beyond group | [['a1', 1], ['b1', 2]] | [['a1', 1], ['b1', 2]] | Passed |
| interleaved retains order | [['a1', 1]] | [['a1', 1], ['b1', 2]] | Failed |
SHA-256 / 8219dca329efc7896d533f32e2584c5e38625205544dec7ef72f4d134d8405e1
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
These are explicit toy record contracts; they do not claim compatibility with a trainer or improved model behavior. 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:32.171473+00:00.
Case digest / 4ab9debf38c411a443283e59ae1e80092f370404a91cfd97b185072ac0bd0215