FAILURE MAP
← Case archive

FA-82051 / Poker hand evaluation / Open access

Remainder computed over table size instead of winners · case 01

The number of odd units depends on how many seats are at the table.

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

ROOT CAUSE

The leftover count divides by the number of seats rather than the number of winners.

THE FAILURE

The leftover count divides by the number of seats rather than the number of winners.

Unsuccessful approach: Paying at most one odd unit leaves chips unpaid when the remainder is two or more.

Case contract

Input: {"pot", "winners", "seats" (clockwise), "button", "unit" (smallest chip in play; pot is a multiple of it)}. Split the pot equally in whole units; each leftover unit goes to one winner, starting with the first winner clockwise from the button (the button itself is last). Return {winner: amount} sorted by name.

Why this case matters

Odd-chip placement is where split pots disagree between dealers and software.

1 / The failure

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

N = 1
observations = []
def solve(x):
    pot=x['pot']; unit=x['unit']; winners=x['winners']; seats=x['seats']
    k=len(winners)
    units=pot//unit
    share=units//k
    rem=units%len(seats)
    out={w:share*unit for w in winners}
    start=(seats.index(x['button'])+1)%len(seats)
    order=seats[start:]+seats[:start]
    for w in [s for s in order if s in winners][:rem]:
        out[w]+=unit
    return dict(sorted(out.items()))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('three-way odd units',
   {'button': 'c',
    'pot': 110,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 5,
    'winners': ['b', 'd', 'e']},
   {'b': 35, 'd': 40, 'e': 35}),
  ('two-way one unit',
   {'button': 'b', 'pot': 25, 'seats': ['a', 'b', 'c', 'd'], 'unit': 5, 'winners': ['a', 'c']},
   {'a': 10, 'c': 15}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('winner right of button',
   {'button': 'b', 'pot': 5, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'c']},
   {'a': 2, 'c': 3})],
 [('two-way one unit',
   {'button': 'b', 'pot': 25, 'seats': ['a', 'b', 'c', 'd'], 'unit': 5, 'winners': ['a', 'c']},
   {'a': 10, 'c': 15}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('button left winner',
   {'button': 'a', 'pot': 5, 'seats': ['a', 'b', 'c'], 'unit': 1, 'winners': ['b', 'c']},
   {'b': 3, 'c': 2})],
 [('two-way one unit',
   {'button': 'b', 'pot': 25, 'seats': ['a', 'b', 'c', 'd'], 'unit': 5, 'winners': ['a', 'c']},
   {'a': 10, 'c': 15}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('button left winner',
   {'button': 'a', 'pot': 5, 'seats': ['a', 'b', 'c'], 'unit': 1, 'winners': ['b', 'c']},
   {'b': 3, 'c': 2}),
  ('winner right of button',
   {'button': 'b', 'pot': 5, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'c']},
   {'a': 2, 'c': 3})],
 [('three-way odd units',
   {'button': 'c',
    'pot': 110,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 5,
    'winners': ['b', 'd', 'e']},
   {'b': 35, 'd': 40, 'e': 35}),
  ('two-way one unit',
   {'button': 'b', 'pot': 25, 'seats': ['a', 'b', 'c', 'd'], 'unit': 5, 'winners': ['a', 'c']},
   {'a': 10, 'c': 15}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('button left winner',
   {'button': 'a', 'pot': 5, 'seats': ['a', 'b', 'c'], 'unit': 1, 'winners': ['b', 'c']},
   {'b': 3, 'c': 2}),
  ('winner right of button',
   {'button': 'b', 'pot': 5, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'c']},
   {'a': 2, 'c': 3})],
 [('three-way odd units',
   {'button': 'c',
    'pot': 110,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 5,
    'winners': ['b', 'd', 'e']},
   {'b': 35, 'd': 40, 'e': 35}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('button left winner',
   {'button': 'a', 'pot': 5, 'seats': ['a', 'b', 'c'], 'unit': 1, 'winners': ['b', 'c']},
   {'b': 3, 'c': 2})]]
for label, args, expected in fixtures[N-1]:
    try:
        actual = solve(args)
    except Exception as exc:
        actual = 'error:' + type(exc).__name__
    check(label, actual, 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
three-way odd units{'b': 35, 'd': 40, 'e': 40}{'b': 35, 'd': 40, 'e': 35}Failed
two-way one unit{'a': 10, 'c': 15}{'a': 10, 'c': 15}Passed
button is a winner{'a': 4, 'd': 4}{'a': 4, 'd': 3}Failed
even split{'a': 55, 'b': 55}{'a': 50, 'b': 50}Failed
single winner{'c': 40}{'c': 35}Failed
wrap past last seat{'a': 3, 'b': 3, 'e': 4}{'a': 4, 'b': 3, 'e': 4}Failed
four-way three odd{'a': 4, 'b': 4, 'c': 5, 'd': 4}{'a': 5, 'b': 4, 'c': 5, 'd': 5}Failed
winner right of button{'a': 2, 'c': 3}{'a': 2, 'c': 3}Passed

SHA-256 / c4bbd4d65e615f79d87c3fe4aab377da56da09b93585fc5df779792ed7837191

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    pot=x['pot']; unit=x['unit']; winners=x['winners']; seats=x['seats']
    k=len(winners)
    units=pot//unit
    share=units//k
    rem=1 if units%k else 0
    out={w:share*unit for w in winners}
    start=(seats.index(x['button'])+1)%len(seats)
    order=seats[start:]+seats[:start]
    for w in [s for s in order if s in winners][:rem]:
        out[w]+=unit
    return dict(sorted(out.items()))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('three-way odd units',
   {'button': 'c',
    'pot': 110,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 5,
    'winners': ['b', 'd', 'e']},
   {'b': 35, 'd': 40, 'e': 35}),
  ('two-way one unit',
   {'button': 'b', 'pot': 25, 'seats': ['a', 'b', 'c', 'd'], 'unit': 5, 'winners': ['a', 'c']},
   {'a': 10, 'c': 15}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('winner right of button',
   {'button': 'b', 'pot': 5, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'c']},
   {'a': 2, 'c': 3})],
 [('two-way one unit',
   {'button': 'b', 'pot': 25, 'seats': ['a', 'b', 'c', 'd'], 'unit': 5, 'winners': ['a', 'c']},
   {'a': 10, 'c': 15}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('button left winner',
   {'button': 'a', 'pot': 5, 'seats': ['a', 'b', 'c'], 'unit': 1, 'winners': ['b', 'c']},
   {'b': 3, 'c': 2})],
 [('two-way one unit',
   {'button': 'b', 'pot': 25, 'seats': ['a', 'b', 'c', 'd'], 'unit': 5, 'winners': ['a', 'c']},
   {'a': 10, 'c': 15}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('button left winner',
   {'button': 'a', 'pot': 5, 'seats': ['a', 'b', 'c'], 'unit': 1, 'winners': ['b', 'c']},
   {'b': 3, 'c': 2}),
  ('winner right of button',
   {'button': 'b', 'pot': 5, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'c']},
   {'a': 2, 'c': 3})],
 [('three-way odd units',
   {'button': 'c',
    'pot': 110,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 5,
    'winners': ['b', 'd', 'e']},
   {'b': 35, 'd': 40, 'e': 35}),
  ('two-way one unit',
   {'button': 'b', 'pot': 25, 'seats': ['a', 'b', 'c', 'd'], 'unit': 5, 'winners': ['a', 'c']},
   {'a': 10, 'c': 15}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('button left winner',
   {'button': 'a', 'pot': 5, 'seats': ['a', 'b', 'c'], 'unit': 1, 'winners': ['b', 'c']},
   {'b': 3, 'c': 2}),
  ('winner right of button',
   {'button': 'b', 'pot': 5, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'c']},
   {'a': 2, 'c': 3})],
 [('three-way odd units',
   {'button': 'c',
    'pot': 110,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 5,
    'winners': ['b', 'd', 'e']},
   {'b': 35, 'd': 40, 'e': 35}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('button left winner',
   {'button': 'a', 'pot': 5, 'seats': ['a', 'b', 'c'], 'unit': 1, 'winners': ['b', 'c']},
   {'b': 3, 'c': 2})]]
for label, args, expected in fixtures[N-1]:
    try:
        actual = solve(args)
    except Exception as exc:
        actual = 'error:' + type(exc).__name__
    check(label, actual, 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
three-way odd units{'b': 35, 'd': 40, 'e': 35}{'b': 35, 'd': 40, 'e': 35}Passed
two-way one unit{'a': 10, 'c': 15}{'a': 10, 'c': 15}Passed
button is a winner{'a': 4, 'd': 3}{'a': 4, 'd': 3}Passed
even split{'a': 50, 'b': 50}{'a': 50, 'b': 50}Passed
single winner{'c': 35}{'c': 35}Passed
wrap past last seat{'a': 3, 'b': 3, 'e': 4}{'a': 4, 'b': 3, 'e': 4}Failed
four-way three odd{'a': 4, 'b': 4, 'c': 5, 'd': 4}{'a': 5, 'b': 4, 'c': 5, 'd': 5}Failed
winner right of button{'a': 2, 'c': 3}{'a': 2, 'c': 3}Passed

SHA-256 / 051e60e92fedded759247720cf463be333cbdbc4280a53880663603f8b021721

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 8 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 model with an explicitly stated contract; no claim of conformance to any casino or tournament rulebook. 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:08.571240+00:00.

Case digest / 5a1a4543fbc93b6682b2e1a48955bb3d2126f9b17246ed6b60c0f4febdef29f5