FAILURE MAP
← Case archive

FA-85031 / Fantasy sports scoring / Open access

Every tied entry paid the highest shared prize · case 01

Two entries tied for first each receive the first-place prize.

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

ROOT CAUSE

The tie group is paid the top occupied position times the group size instead of pooling the occupied positions.

THE FAILURE

The tie group is paid the top occupied position times the group size instead of pooling the occupied positions.

Unsuccessful approach: Extending the pool one position too far also takes the next finisher's prize.

Case contract

Daily contest entries are [entry id, score in hundredths]; payouts[r] is the prize in cents for finishing position r (0-based), positions past the list pay 0. Entries with equal scores share the positions they jointly occupy: their prizes are summed and split equally, whole cents only, with leftover cents given one each to the tied entries in ascending id order. Return id -> cents for entries receiving more than 0.

Why this case matters

Tie splitting in paid contests moves real money; cent remainders and the pooled positions must be exact.

1 / The failure

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

N = 1
observations = []
def solve(entries, payouts):
    ordered = sorted(entries, key=lambda e: (-e[1], e[0]))
    out = {}
    i = 0
    while i < len(ordered):
        j = i
        while j < len(ordered) and ordered[j][1] == ordered[i][1]:
            j += 1
        pool = sum(payouts[i:i + 1]) * (j - i)
        group = sorted(e[0] for e in ordered[i:j])
        share, extra = divmod(pool, len(group))
        for k, eid in enumerate(group):
            amt = share + (1 if k < extra else 0)
            if amt > 0:
                out[eid] = amt
        i = j
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: tied position pool',
   [[['e09', 1365], ['e21', 1420], ['e28', 1415], ['e20', 1417], ['e06', 1420], ['e25', 1410], ['e23', 1413]],
    [199, 77]],
   {'e06': 138, 'e21': 138}),
  ('partial repair probe: tied position pool',
   [[['e15', 1500], ['e29', 1493], ['e07', 1490], ['e13', 1495]], [1000, 100]], {'e13': 100, 'e15': 1000}),
  ('second regression', [[['e17', 1328], ['e09', 1333], ['e28', 1326], ['e11', 1333]], [301, 1]],
   {'e09': 151, 'e11': 151}),
  ('normal control 1',
   [[['e16', 1278], ['e04', 1278], ['e26', 1326], ['e21', 1333], ['e10', 1328], ['e07', 1333]], [77, 77]],
   {'e07': 77, 'e21': 77}),
  ('normal control 2', [[['e20', 1500], ['e12', 1445], ['e23', 1500]], [501, 501]], {'e20': 501, 'e23': 501}),
  ('normal control 3',
   [[['e26', 1365], ['e06', 1413], ['e23', 1413], ['e12', 1415], ['e24', 1420], ['e27', 1417], ['e17', 1420],
     ['e01', 1415], ['e29', 1410]],
    [301, 301]],
   {'e17': 301, 'e24': 301}),
  ('normal control 4',
   [[['e24', 1495], ['e20', 1445], ['e28', 1445], ['e12', 1445], ['e27', 1500], ['e11', 1500], ['e10', 1445],
     ['e18', 1500]],
    [500, 500, 500]],
   {'e11': 500, 'e18': 500, 'e27': 500})],
 [('regression: tied position pool',
   [[['e29', 1415], ['e18', 1415], ['e01', 1417], ['e05', 1410]], [301, 250]],
   {'e01': 301, 'e18': 125, 'e29': 125}),
  ('partial repair probe: tied position pool',
   [[['e20', 1420], ['e09', 1417], ['e07', 1365]], [501, 199, 199, 1]],
   {'e07': 199, 'e09': 199, 'e20': 501}),
  ('second regression',
   [[['e27', 1500], ['e15', 1493], ['e12', 1445], ['e24', 1445], ['e19', 1493], ['e29', 1445], ['e05', 1493],
     ['e13', 1445], ['e04', 1493]],
    [501, 301, 301, 199, 2]],
   {'e04': 201, 'e05': 201, 'e15': 201, 'e19': 200, 'e27': 501}),
  ('normal control 1',
   [[['e17', 1410], ['e19', 1365], ['e25', 1365], ['e12', 1420], ['e20', 1413], ['e27', 1417], ['e28', 1365],
     ['e10', 1420], ['e08', 1365]],
    [1, 1]],
   {'e10': 1, 'e12': 1}),
  ('normal control 2',
   [[['e24', 1415], ['e15', 1413], ['e13', 1415], ['e03', 1410], ['e22', 1420], ['e02', 1420], ['e01', 1415]],
    [199, 199]],
   {'e02': 199, 'e22': 199}),
  ('normal control 3',
   [[['e28', 1333], ['e20', 1326], ['e01', 1278], ['e19', 1278], ['e04', 1330], ['e09', 1323], ['e02', 1333],
     ['e03', 1326]],
    [250, 250]],
   {'e02': 250, 'e28': 250})],
 [('regression: tied position pool',
   [[['e02', 1420], ['e15', 1417], ['e11', 1420], ['e24', 1365], ['e16', 1365], ['e06', 1415], ['e23', 1415],
     ['e14', 1365], ['e12', 1420]],
    [77, 77, 1]],
   {'e02': 52, 'e11': 52, 'e12': 51}),
  ('partial repair probe: tied position pool',
   [[['e20', 1490], ['e18', 1500], ['e21', 1497], ['e23', 1495], ['e09', 1493], ['e29', 1493]], [1000, 199]],
   {'e18': 1000, 'e21': 199}),
  ('second regression',
   [[['e16', 1493], ['e07', 1500], ['e13', 1500], ['e23', 1500], ['e20', 1500], ['e10', 1497], ['e09', 1500],
     ['e27', 1495]],
    [501, 250, 250, 2]],
   {'e07': 201, 'e09': 201, 'e13': 201, 'e20': 200, 'e23': 200}),
  ('normal control 1',
   [[['e26', 1413], ['e13', 1415], ['e24', 1420], ['e12', 1365], ['e09', 1415], ['e23', 1410], ['e07', 1413],
     ['e29', 1420], ['e17', 1417]],
    [1, 1]],
   {'e24': 1, 'e29': 1}),
  ('normal control 2',
   [[['e19', 1420], ['e03', 1413], ['e23', 1410], ['e13', 1420], ['e15', 1410]], [301, 301]],
   {'e13': 301, 'e19': 301}),
  ('normal control 3',
   [[['e06', 1415], ['e02', 1420], ['e13', 1410], ['e14', 1417], ['e12', 1417], ['e18', 1365], ['e15', 1420]],
    [250, 250]],
   {'e02': 250, 'e15': 250}),
  ('normal control 4',
   [[['e20', 1500], ['e21', 1495], ['e01', 1445], ['e16', 1495], ['e27', 1445], ['e11', 1493], ['e24', 1500],
     ['e13', 1497]],
    [100, 100]],
   {'e20': 100, 'e24': 100})],
 [('regression: tied position pool',
   [[['e19', 1420], ['e09', 1417], ['e26', 1365], ['e13', 1410], ['e15', 1365], ['e21', 1415], ['e22', 1410],
     ['e25', 1365], ['e18', 1365]],
    [501, 250, 250, 100, 2]],
   {'e09': 250, 'e13': 51, 'e19': 501, 'e21': 250, 'e22': 51}),
  ('partial repair probe: tied position pool',
   [[['e08', 1326], ['e11', 1323], ['e10', 1328], ['e09', 1326], ['e05', 1330], ['e29', 1278], ['e26', 1323]],
    [500, 199]],
   {'e05': 500, 'e10': 199}),
  ('second regression',
   [[['e16', 1328], ['e10', 1278], ['e14', 1333], ['e23', 1278], ['e22', 1333], ['e03', 1326], ['e07', 1333],
     ['e28', 1323]],
    [500, 2]],
   {'e07': 168, 'e14': 167, 'e22': 167}),
  ('normal control 1', [[['e14', 1420], ['e05', 1420], ['e03', 1415], ['e12', 1415]], [2, 2]],
   {'e05': 2, 'e14': 2}),
  ('normal control 2',
   [[['e12', 1417], ['e06', 1420], ['e29', 1410], ['e28', 1420], ['e18', 1417], ['e11', 1410]], [199, 199]],
   {'e06': 199, 'e28': 199}),
  ('normal control 3', [[['e07', 1328], ['e02', 1333], ['e23', 1278], ['e05', 1333]], [199, 199]],
   {'e02': 199, 'e05': 199}),
  ('normal control 4',
   [[['e07', 1495], ['e17', 1445], ['e22', 1493], ['e29', 1500], ['e09', 1490], ['e20', 1490], ['e15', 1500]],
    [501, 501]],
   {'e15': 501, 'e29': 501})],
 [('regression: tied position pool',
   [[['e18', 1333], ['e22', 1326], ['e11', 1326], ['e16', 1333], ['e28', 1323], ['e13', 1278], ['e07', 1323],
     ['e26', 1330]],
    [301, 199, 2]],
   {'e16': 250, 'e18': 250, 'e26': 2}),
  ('partial repair probe: tied position pool',
   [[['e02', 1333], ['e19', 1333], ['e08', 1326], ['e09', 1326], ['e25', 1328], ['e17', 1330], ['e16', 1333]],
    [301, 100, 100, 2]],
   {'e02': 167, 'e16': 167, 'e17': 2, 'e19': 167}),
  ('second regression',
   [[['e26', 1413], ['e12', 1415], ['e08', 1420], ['e20', 1420], ['e11', 1420], ['e28', 1365], ['e23', 1413]],
    [250, 250, 199]],
   {'e08': 233, 'e11': 233, 'e20': 233}),
  ('normal control 1',
   [[['e14', 1500], ['e27', 1497], ['e13', 1495], ['e03', 1493], ['e02', 1500]], [77, 77]],
   {'e02': 77, 'e14': 77}),
  ('normal control 2',
   [[['e03', 1415], ['e21', 1420], ['e25', 1410], ['e13', 1420], ['e24', 1413], ['e26', 1415], ['e01', 1410]],
    [301, 301]],
   {'e13': 301, 'e21': 301}),
  ('normal control 3',
   [[['e28', 1420], ['e02', 1417], ['e23', 1420], ['e26', 1417], ['e16', 1417], ['e18', 1417]], [301, 301]],
   {'e23': 301, 'e28': 301}),
  ('normal control 4',
   [[['e02', 1490], ['e09', 1500], ['e28', 1500], ['e29', 1497], ['e12', 1445], ['e19', 1490]], [301, 301]],
   {'e09': 301, 'e28': 301})]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
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
regression: tied position pool{'e06': 199, 'e21': 199}{'e06': 138, 'e21': 138}Failed
partial repair probe: tied position pool{'e13': 100, 'e15': 1000}{'e13': 100, 'e15': 1000}Passed
second regression{'e09': 301, 'e11': 301}{'e09': 151, 'e11': 151}Failed
normal control 1{'e07': 77, 'e21': 77}{'e07': 77, 'e21': 77}Passed
normal control 2{'e20': 501, 'e23': 501}{'e20': 501, 'e23': 501}Passed
normal control 3{'e17': 301, 'e24': 301}{'e17': 301, 'e24': 301}Passed
normal control 4{'e11': 500, 'e18': 500, 'e27': 500}{'e11': 500, 'e18': 500, 'e27': 500}Passed

SHA-256 / 088d46f3421c36d01d97631c930f95e74e4d5fa36d59480fec2a33bb24fdf6ad

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(entries, payouts):
    ordered = sorted(entries, key=lambda e: (-e[1], e[0]))
    out = {}
    i = 0
    while i < len(ordered):
        j = i
        while j < len(ordered) and ordered[j][1] == ordered[i][1]:
            j += 1
        pool = sum(payouts[i:j + 1])
        group = sorted(e[0] for e in ordered[i:j])
        share, extra = divmod(pool, len(group))
        for k, eid in enumerate(group):
            amt = share + (1 if k < extra else 0)
            if amt > 0:
                out[eid] = amt
        i = j
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: tied position pool',
   [[['e09', 1365], ['e21', 1420], ['e28', 1415], ['e20', 1417], ['e06', 1420], ['e25', 1410], ['e23', 1413]],
    [199, 77]],
   {'e06': 138, 'e21': 138}),
  ('partial repair probe: tied position pool',
   [[['e15', 1500], ['e29', 1493], ['e07', 1490], ['e13', 1495]], [1000, 100]], {'e13': 100, 'e15': 1000}),
  ('second regression', [[['e17', 1328], ['e09', 1333], ['e28', 1326], ['e11', 1333]], [301, 1]],
   {'e09': 151, 'e11': 151}),
  ('normal control 1',
   [[['e16', 1278], ['e04', 1278], ['e26', 1326], ['e21', 1333], ['e10', 1328], ['e07', 1333]], [77, 77]],
   {'e07': 77, 'e21': 77}),
  ('normal control 2', [[['e20', 1500], ['e12', 1445], ['e23', 1500]], [501, 501]], {'e20': 501, 'e23': 501}),
  ('normal control 3',
   [[['e26', 1365], ['e06', 1413], ['e23', 1413], ['e12', 1415], ['e24', 1420], ['e27', 1417], ['e17', 1420],
     ['e01', 1415], ['e29', 1410]],
    [301, 301]],
   {'e17': 301, 'e24': 301}),
  ('normal control 4',
   [[['e24', 1495], ['e20', 1445], ['e28', 1445], ['e12', 1445], ['e27', 1500], ['e11', 1500], ['e10', 1445],
     ['e18', 1500]],
    [500, 500, 500]],
   {'e11': 500, 'e18': 500, 'e27': 500})],
 [('regression: tied position pool',
   [[['e29', 1415], ['e18', 1415], ['e01', 1417], ['e05', 1410]], [301, 250]],
   {'e01': 301, 'e18': 125, 'e29': 125}),
  ('partial repair probe: tied position pool',
   [[['e20', 1420], ['e09', 1417], ['e07', 1365]], [501, 199, 199, 1]],
   {'e07': 199, 'e09': 199, 'e20': 501}),
  ('second regression',
   [[['e27', 1500], ['e15', 1493], ['e12', 1445], ['e24', 1445], ['e19', 1493], ['e29', 1445], ['e05', 1493],
     ['e13', 1445], ['e04', 1493]],
    [501, 301, 301, 199, 2]],
   {'e04': 201, 'e05': 201, 'e15': 201, 'e19': 200, 'e27': 501}),
  ('normal control 1',
   [[['e17', 1410], ['e19', 1365], ['e25', 1365], ['e12', 1420], ['e20', 1413], ['e27', 1417], ['e28', 1365],
     ['e10', 1420], ['e08', 1365]],
    [1, 1]],
   {'e10': 1, 'e12': 1}),
  ('normal control 2',
   [[['e24', 1415], ['e15', 1413], ['e13', 1415], ['e03', 1410], ['e22', 1420], ['e02', 1420], ['e01', 1415]],
    [199, 199]],
   {'e02': 199, 'e22': 199}),
  ('normal control 3',
   [[['e28', 1333], ['e20', 1326], ['e01', 1278], ['e19', 1278], ['e04', 1330], ['e09', 1323], ['e02', 1333],
     ['e03', 1326]],
    [250, 250]],
   {'e02': 250, 'e28': 250})],
 [('regression: tied position pool',
   [[['e02', 1420], ['e15', 1417], ['e11', 1420], ['e24', 1365], ['e16', 1365], ['e06', 1415], ['e23', 1415],
     ['e14', 1365], ['e12', 1420]],
    [77, 77, 1]],
   {'e02': 52, 'e11': 52, 'e12': 51}),
  ('partial repair probe: tied position pool',
   [[['e20', 1490], ['e18', 1500], ['e21', 1497], ['e23', 1495], ['e09', 1493], ['e29', 1493]], [1000, 199]],
   {'e18': 1000, 'e21': 199}),
  ('second regression',
   [[['e16', 1493], ['e07', 1500], ['e13', 1500], ['e23', 1500], ['e20', 1500], ['e10', 1497], ['e09', 1500],
     ['e27', 1495]],
    [501, 250, 250, 2]],
   {'e07': 201, 'e09': 201, 'e13': 201, 'e20': 200, 'e23': 200}),
  ('normal control 1',
   [[['e26', 1413], ['e13', 1415], ['e24', 1420], ['e12', 1365], ['e09', 1415], ['e23', 1410], ['e07', 1413],
     ['e29', 1420], ['e17', 1417]],
    [1, 1]],
   {'e24': 1, 'e29': 1}),
  ('normal control 2',
   [[['e19', 1420], ['e03', 1413], ['e23', 1410], ['e13', 1420], ['e15', 1410]], [301, 301]],
   {'e13': 301, 'e19': 301}),
  ('normal control 3',
   [[['e06', 1415], ['e02', 1420], ['e13', 1410], ['e14', 1417], ['e12', 1417], ['e18', 1365], ['e15', 1420]],
    [250, 250]],
   {'e02': 250, 'e15': 250}),
  ('normal control 4',
   [[['e20', 1500], ['e21', 1495], ['e01', 1445], ['e16', 1495], ['e27', 1445], ['e11', 1493], ['e24', 1500],
     ['e13', 1497]],
    [100, 100]],
   {'e20': 100, 'e24': 100})],
 [('regression: tied position pool',
   [[['e19', 1420], ['e09', 1417], ['e26', 1365], ['e13', 1410], ['e15', 1365], ['e21', 1415], ['e22', 1410],
     ['e25', 1365], ['e18', 1365]],
    [501, 250, 250, 100, 2]],
   {'e09': 250, 'e13': 51, 'e19': 501, 'e21': 250, 'e22': 51}),
  ('partial repair probe: tied position pool',
   [[['e08', 1326], ['e11', 1323], ['e10', 1328], ['e09', 1326], ['e05', 1330], ['e29', 1278], ['e26', 1323]],
    [500, 199]],
   {'e05': 500, 'e10': 199}),
  ('second regression',
   [[['e16', 1328], ['e10', 1278], ['e14', 1333], ['e23', 1278], ['e22', 1333], ['e03', 1326], ['e07', 1333],
     ['e28', 1323]],
    [500, 2]],
   {'e07': 168, 'e14': 167, 'e22': 167}),
  ('normal control 1', [[['e14', 1420], ['e05', 1420], ['e03', 1415], ['e12', 1415]], [2, 2]],
   {'e05': 2, 'e14': 2}),
  ('normal control 2',
   [[['e12', 1417], ['e06', 1420], ['e29', 1410], ['e28', 1420], ['e18', 1417], ['e11', 1410]], [199, 199]],
   {'e06': 199, 'e28': 199}),
  ('normal control 3', [[['e07', 1328], ['e02', 1333], ['e23', 1278], ['e05', 1333]], [199, 199]],
   {'e02': 199, 'e05': 199}),
  ('normal control 4',
   [[['e07', 1495], ['e17', 1445], ['e22', 1493], ['e29', 1500], ['e09', 1490], ['e20', 1490], ['e15', 1500]],
    [501, 501]],
   {'e15': 501, 'e29': 501})],
 [('regression: tied position pool',
   [[['e18', 1333], ['e22', 1326], ['e11', 1326], ['e16', 1333], ['e28', 1323], ['e13', 1278], ['e07', 1323],
     ['e26', 1330]],
    [301, 199, 2]],
   {'e16': 250, 'e18': 250, 'e26': 2}),
  ('partial repair probe: tied position pool',
   [[['e02', 1333], ['e19', 1333], ['e08', 1326], ['e09', 1326], ['e25', 1328], ['e17', 1330], ['e16', 1333]],
    [301, 100, 100, 2]],
   {'e02': 167, 'e16': 167, 'e17': 2, 'e19': 167}),
  ('second regression',
   [[['e26', 1413], ['e12', 1415], ['e08', 1420], ['e20', 1420], ['e11', 1420], ['e28', 1365], ['e23', 1413]],
    [250, 250, 199]],
   {'e08': 233, 'e11': 233, 'e20': 233}),
  ('normal control 1',
   [[['e14', 1500], ['e27', 1497], ['e13', 1495], ['e03', 1493], ['e02', 1500]], [77, 77]],
   {'e02': 77, 'e14': 77}),
  ('normal control 2',
   [[['e03', 1415], ['e21', 1420], ['e25', 1410], ['e13', 1420], ['e24', 1413], ['e26', 1415], ['e01', 1410]],
    [301, 301]],
   {'e13': 301, 'e21': 301}),
  ('normal control 3',
   [[['e28', 1420], ['e02', 1417], ['e23', 1420], ['e26', 1417], ['e16', 1417], ['e18', 1417]], [301, 301]],
   {'e23': 301, 'e28': 301}),
  ('normal control 4',
   [[['e02', 1490], ['e09', 1500], ['e28', 1500], ['e29', 1497], ['e12', 1445], ['e19', 1490]], [301, 301]],
   {'e09': 301, 'e28': 301})]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
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
regression: tied position pool{'e06': 138, 'e21': 138}{'e06': 138, 'e21': 138}Passed
partial repair probe: tied position pool{'e13': 100, 'e15': 1100}{'e13': 100, 'e15': 1000}Failed
second regression{'e09': 151, 'e11': 151}{'e09': 151, 'e11': 151}Passed
normal control 1{'e07': 77, 'e21': 77}{'e07': 77, 'e21': 77}Passed
normal control 2{'e20': 501, 'e23': 501}{'e20': 501, 'e23': 501}Passed
normal control 3{'e17': 301, 'e24': 301}{'e17': 301, 'e24': 301}Passed
normal control 4{'e11': 500, 'e18': 500, 'e27': 500}{'e11': 500, 'e18': 500, 'e27': 500}Passed

SHA-256 / 81bfdcda994c0c6ac0c2f6b0d427de3d698b84f8563b1668b5c8c053fc2392e9

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 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

A deterministic toy scoring contract stipulated for this example; it is not the rulebook of any real fantasy platform. 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-29T14:50:36.620674+00:00.

Case digest / 9dc19aa6d0f7c70c6d65b524eacfeecb30aa9838b5ad838785686977b32998dd