FAILURE MAP
← Case archive

FA-94536 / Exam timetabling constraints / Open access

Overflow candidates wrap around to occupied seats · case 01

Two candidates are given the same seat when the rooms are full.

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

ROOT CAUSE

Seat indices wrap modulo the seat count.

VERIFIED REPAIR

Mark candidates beyond the available seats as UNSEATED.

Unsuccessful approach: Clamping to the last seat still double-books it.

Case contract

Candidates [id, surname, given, access flag], rooms [room, rows, cols]. Non-access candidates are sorted by case-folded surname, case-folded given name, then id, and take alternate seats (even row and even column indices) room by room in row-major order, labelled room-<row letter><column number>; candidates beyond the seats are UNSEATED. Access candidates go to SEP-1, SEP-2... in the same order. Return id -> seat.

Why this case matters

Seating plans are generated from the timetable's room allocation and must be deterministic and fair.

1 / The failure

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

N = 1
observations = []
def solve(cands, rooms):
    def key(c):
        return (c[1].casefold(), c[2].casefold(), c[0])
    main = sorted([c for c in cands if not c[3]], key=key)
    sep = sorted([c for c in cands if c[3]], key=key)
    seats = []
    for room, rows, cols in rooms:
        for r in range(0, rows, 2):
            for c in range(0, cols, 2):
                seats.append('%s-%s%d' % (room, chr(65 + r), c + 1))
    out = {}
    for k, c in enumerate(main):
        out[c[0]] = seats[k % len(seats)]
    for k, c in enumerate(sep):
        out[c[0]] = 'SEP-%d' % (k + 1)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: overflow wraps 1', [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 0]], [['H1', 1, 1]]],
   {'C1': 'H1-A1', 'C2': 'UNSEATED'}),
  ('regression variant: overflow wraps 2',
   [[['C16', 'Mason', 'Zed', 1], ['C72', 'Adams', 'eve', 0], ['C74', 'adams', 'Dan', 0],
     ['C42', 'Mason', 'Amy', 0], ['C96', 'Mason', 'amy', 0], ['C93', 'Zhou', 'Li', 0]],
    [['H0', 1, 2], ['H1', 1, 1]]],
   {'C74': 'H0-A1', 'C72': 'H1-A1', 'C42': 'UNSEATED', 'C96': 'UNSEATED', 'C93': 'UNSEATED', 'C16': 'SEP-1'}),
  ('partial repair guard 3',
   [[['C39', 'Strausz', 'Ben', 0], ['C53', 'Adams', 'eve', 0], ['C30', 'Mason', 'Amy', 0],
     ['C88', 'Strauß', 'Anna', 0], ['C96', 'strauss', 'Cara', 0], ['C83', 'Öberg', 'Ola', 1],
     ['C50', 'Zhou', 'Li', 0]],
    [['H0', 3, 3]]],
   {'C53': 'H0-A1',
    'C30': 'H0-A3',
    'C88': 'H0-C1',
    'C96': 'H0-C3',
    'C39': 'UNSEATED',
    'C50': 'UNSEATED',
    'C83': 'SEP-1'}),
  ('boundary control 4', [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 1]], [['H1', 1, 1]]],
   {'C1': 'H1-A1', 'C2': 'SEP-1'}),
  ('boundary control 5',
   [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 0], ['C3', 'Cole', 'Bo', 0]], [['H1', 3, 3]]],
   {'C1': 'H1-A1', 'C2': 'H1-A3', 'C3': 'H1-C1'}),
  ('normal control 6',
   [[['C76', 'Strausz', 'Ben', 0], ['C33', 'Mason', 'Amy', 0], ['C21', 'strauss', 'Cara', 0]],
    [['H0', 1, 3]]],
   {'C33': 'H0-A1', 'C21': 'H0-A3', 'C76': 'UNSEATED'}),
  ('normal control 7', [[['C64', 'Mason', 'Zed', 0], ['C40', 'Adams', 'eve', 0]], [['H0', 2, 5]]],
   {'C40': 'H0-A1', 'C64': 'H0-A3'}),
  ('normal control 8',
   [[['C49', 'Mason', 'amy', 0], ['C07', 'Strausz', 'Ben', 0], ['C08', 'Strauß', 'Anna', 0],
     ['C32', 'strauss', 'Cara', 0]],
    [['H0', 4, 4], ['H1', 3, 5]]],
   {'C49': 'H0-A1', 'C08': 'H0-A3', 'C32': 'H0-C1', 'C07': 'H0-C3'})],
 [('regression: overflow wraps 1',
   [[['C29', 'Strausz', 'Ben', 0], ['C34', 'Strauß', 'Anna', 1], ['C35', 'Zhou', 'Li', 0],
     ['C31', 'Mason', 'Amy', 0], ['C13', 'Mason', 'Zed', 0], ['C53', 'Öberg', 'Ola', 0],
     ['C48', 'strauss', 'Cara', 0], ['C28', 'Mason', 'amy', 0]],
    [['H0', 2, 4]]],
   {'C28': 'H0-A1',
    'C31': 'H0-A3',
    'C13': 'UNSEATED',
    'C48': 'UNSEATED',
    'C29': 'UNSEATED',
    'C35': 'UNSEATED',
    'C53': 'UNSEATED',
    'C34': 'SEP-1'}),
  ('regression variant: overflow wraps 2',
   [[['C86', 'Adams', 'eve', 0], ['C97', 'strauss', 'Cara', 0], ['C63', 'Strausz', 'Ben', 0],
     ['C05', 'Strauß', 'Anna', 0], ['C99', 'Mason', 'Zed', 0]],
    [['H0', 2, 3]]],
   {'C86': 'H0-A1', 'C99': 'H0-A3', 'C05': 'UNSEATED', 'C97': 'UNSEATED', 'C63': 'UNSEATED'}),
  ('partial repair guard 3',
   [[['C36', 'Strausz', 'Ben', 1], ['C77', 'Mason', 'Amy', 1], ['C37', 'Mason', 'Zed', 0],
     ['C48', 'Zhou', 'Li', 0], ['C68', 'Strauß', 'Anna', 0], ['C53', 'Mason', 'amy', 1],
     ['C47', 'Adams', 'eve', 0], ['C66', 'Öberg', 'Ola', 0]],
    [['H0', 1, 3]]],
   {'C47': 'H0-A1',
    'C37': 'H0-A3',
    'C68': 'UNSEATED',
    'C48': 'UNSEATED',
    'C66': 'UNSEATED',
    'C53': 'SEP-1',
    'C77': 'SEP-2',
    'C36': 'SEP-3'}),
  ('boundary control 4', [[['C1', 'Strauß', 'Anna', 0], ['C2', 'Strausz', 'Ben', 0]], [['H1', 1, 3]]],
   {'C1': 'H1-A1', 'C2': 'H1-A3'}),
  ('boundary control 5', [[['C9', 'Mason', 'Amy', 0], ['C1', 'Mason', 'Amy', 0]], [['H1', 2, 3]]],
   {'C1': 'H1-A1', 'C9': 'H1-A3'}),
  ('normal control 6', [[['C87', 'Strausz', 'Ben', 0], ['C05', 'Öberg', 'Ola', 0]], [['H0', 5, 5]]],
   {'C87': 'H0-A1', 'C05': 'H0-A3'}),
  ('normal control 7',
   [[['C95', 'Strauß', 'Anna', 0], ['C27', 'Zhou', 'Li', 0], ['C02', 'Mason', 'Amy', 0]], [['H0', 5, 1]]],
   {'C02': 'H0-A1', 'C95': 'H0-C1', 'C27': 'H0-E1'}),
  ('normal control 8',
   [[['C94', 'Öberg', 'Ola', 0], ['C23', 'Mason', 'Zed', 0], ['C54', 'Strauß', 'Anna', 0],
     ['C09', 'Mason', 'amy', 0], ['C24', 'Zhou', 'Li', 0]],
    [['H0', 2, 5]]],
   {'C09': 'H0-A1', 'C23': 'H0-A3', 'C54': 'H0-A5', 'C24': 'UNSEATED', 'C94': 'UNSEATED'})],
 [('regression: overflow wraps 1',
   [[['C74', 'Mason', 'amy', 0], ['C73', 'Strausz', 'Ben', 0], ['C01', 'Zhou', 'Li', 0],
     ['C14', 'Strauß', 'Anna', 1], ['C41', 'Mason', 'Amy', 0], ['C37', 'Öberg', 'Ola', 0],
     ['C25', 'strauss', 'Cara', 0], ['C86', 'Mason', 'Zed', 0]],
    [['H0', 5, 4]]],
   {'C41': 'H0-A1',
    'C74': 'H0-A3',
    'C86': 'H0-C1',
    'C25': 'H0-C3',
    'C73': 'H0-E1',
    'C01': 'H0-E3',
    'C37': 'UNSEATED',
    'C14': 'SEP-1'}),
  ('regression variant: overflow wraps 2',
   [[['C49', 'Strauß', 'Anna', 0], ['C46', 'strauss', 'Cara', 1], ['C55', 'Strausz', 'Ben', 0],
     ['C79', 'Mason', 'Zed', 0], ['C74', 'Mason', 'amy', 0], ['C03', 'Zhou', 'Li', 0],
     ['C29', 'Mason', 'Amy', 0], ['C11', 'adams', 'Dan', 0]],
    [['H0', 2, 5]]],
   {'C11': 'H0-A1',
    'C29': 'H0-A3',
    'C74': 'H0-A5',
    'C79': 'UNSEATED',
    'C49': 'UNSEATED',
    'C55': 'UNSEATED',
    'C03': 'UNSEATED',
    'C46': 'SEP-1'}),
  ('partial repair guard 3',
   [[['C95', 'Öberg', 'Ola', 0], ['C52', 'Zhou', 'Li', 0], ['C96', 'Strauß', 'Anna', 0],
     ['C39', 'Strausz', 'Ben', 0], ['C50', 'Adams', 'eve', 0], ['C28', 'strauss', 'Cara', 1]],
    [['H0', 3, 4]]],
   {'C50': 'H0-A1', 'C96': 'H0-A3', 'C39': 'H0-C1', 'C52': 'H0-C3', 'C95': 'UNSEATED', 'C28': 'SEP-1'}),
  ('boundary control 4', [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 1]], [['H1', 1, 1]]],
   {'C1': 'H1-A1', 'C2': 'SEP-1'}),
  ('boundary control 5',
   [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 0], ['C3', 'Cole', 'Bo', 0]], [['H1', 3, 3]]],
   {'C1': 'H1-A1', 'C2': 'H1-A3', 'C3': 'H1-C1'}),
  ('normal control 6',
   [[['C03', 'Mason', 'amy', 0], ['C88', 'Mason', 'Zed', 0], ['C98', 'Strauß', 'Anna', 1]], [['H0', 5, 1]]],
   {'C03': 'H0-A1', 'C88': 'H0-C1', 'C98': 'SEP-1'}),
  ('normal control 7',
   [[['C70', 'Mason', 'Zed', 0], ['C05', 'Mason', 'amy', 0], ['C61', 'Zhou', 'Li', 0]], [['H0', 1, 3]]],
   {'C05': 'H0-A1', 'C70': 'H0-A3', 'C61': 'UNSEATED'}),
  ('normal control 8',
   [[['C46', 'Mason', 'Zed', 0], ['C28', 'strauss', 'Cara', 0], ['C11', 'Zhou', 'Li', 0],
     ['C58', 'Mason', 'Amy', 1], ['C08', 'Strauß', 'Anna', 0], ['C07', 'Mason', 'amy', 0],
     ['C09', 'Öberg', 'Ola', 1]],
    [['H0', 1, 3]]],
   {'C07': 'H0-A1',
    'C46': 'H0-A3',
    'C08': 'UNSEATED',
    'C28': 'UNSEATED',
    'C11': 'UNSEATED',
    'C58': 'SEP-1',
    'C09': 'SEP-2'})],
 [('regression: overflow wraps 1',
   [[['C38', 'Strauß', 'Anna', 0], ['C46', 'Adams', 'eve', 0], ['C83', 'strauss', 'Cara', 0],
     ['C55', 'Zhou', 'Li', 0], ['C21', 'adams', 'Dan', 0], ['C03', 'Mason', 'amy', 0]],
    [['H0', 4, 4]]],
   {'C21': 'H0-A1', 'C46': 'H0-A3', 'C03': 'H0-C1', 'C38': 'H0-C3', 'C83': 'UNSEATED', 'C55': 'UNSEATED'}),
  ('regression variant: overflow wraps 2',
   [[['C56', 'Strauß', 'Anna', 0], ['C61', 'Zhou', 'Li', 0], ['C53', 'Mason', 'Zed', 0],
     ['C95', 'Adams', 'eve', 0]],
    [['H0', 2, 3]]],
   {'C95': 'H0-A1', 'C53': 'H0-A3', 'C56': 'UNSEATED', 'C61': 'UNSEATED'}),
  ('partial repair guard 3',
   [[['C83', 'strauss', 'Cara', 0], ['C89', 'Adams', 'eve', 0], ['C77', 'Strausz', 'Ben', 1],
     ['C59', 'Mason', 'Amy', 0], ['C94', 'adams', 'Dan', 0], ['C90', 'Zhou', 'Li', 0],
     ['C50', 'Mason', 'Zed', 0]],
    [['H0', 3, 4]]],
   {'C94': 'H0-A1',
    'C89': 'H0-A3',
    'C59': 'H0-C1',
    'C50': 'H0-C3',
    'C83': 'UNSEATED',
    'C90': 'UNSEATED',
    'C77': 'SEP-1'}),
  ('boundary control 4', [[['C1', 'Strauß', 'Anna', 0], ['C2', 'Strausz', 'Ben', 0]], [['H1', 1, 3]]],
   {'C1': 'H1-A1', 'C2': 'H1-A3'}),
  ('boundary control 5', [[['C9', 'Mason', 'Amy', 0], ['C1', 'Mason', 'Amy', 0]], [['H1', 2, 3]]],
   {'C1': 'H1-A1', 'C9': 'H1-A3'}),
  ('normal control 6',
   [[['C20', 'Mason', 'Amy', 0], ['C67', 'adams', 'Dan', 0], ['C12', 'strauss', 'Cara', 1],
     ['C40', 'Öberg', 'Ola', 1], ['C46', 'Strausz', 'Ben', 0], ['C00', 'Zhou', 'Li', 0],
     ['C94', 'Strauß', 'Anna', 0], ['C74', 'Mason', 'amy', 0]],
    [['H0', 5, 2], ['H1', 5, 2]]],
   {'C67': 'H0-A1',
    'C20': 'H0-C1',
    'C74': 'H0-E1',
    'C94': 'H1-A1',
    'C46': 'H1-C1',
    'C00': 'H1-E1',
    'C12': 'SEP-1',
    'C40': 'SEP-2'}),
  ('normal control 7',
   [[['C82', 'Öberg', 'Ola', 1], ['C09', 'Mason', 'amy', 0], ['C88', 'Mason', 'Zed', 1],
     ['C24', 'strauss', 'Cara', 0]],
    [['H0', 4, 2]]],
   {'C09': 'H0-A1', 'C24': 'H0-C1', 'C88': 'SEP-1', 'C82': 'SEP-2'}),
  ('normal control 8',
   [[['C46', 'Öberg', 'Ola', 1], ['C81', 'Mason', 'amy', 1], ['C07', 'Strauß', 'Anna', 0],
     ['C30', 'Zhou', 'Li', 0], ['C83', 'adams', 'Dan', 0], ['C99', 'Strausz', 'Ben', 0],
     ['C19', 'Adams', 'eve', 0]],
    [['H0', 5, 4], ['H1', 2, 2]]],
   {'C83': 'H0-A1',
    'C19': 'H0-A3',
    'C07': 'H0-C1',
    'C99': 'H0-C3',
    'C30': 'H0-E1',
    'C81': 'SEP-1',
    'C46': 'SEP-2'})],
 [('regression: overflow wraps 1',
   [[['C18', 'Mason', 'Amy', 0], ['C17', 'strauss', 'Cara', 0], ['C06', 'Mason', 'Zed', 0],
     ['C23', 'Zhou', 'Li', 0], ['C04', 'Strausz', 'Ben', 0]],
    [['H0', 4, 4]]],
   {'C18': 'H0-A1', 'C06': 'H0-A3', 'C17': 'H0-C1', 'C04': 'H0-C3', 'C23': 'UNSEATED'}),
  ('regression variant: overflow wraps 2',
   [[['C42', 'strauss', 'Cara', 0], ['C15', 'Mason', 'Zed', 0], ['C32', 'Zhou', 'Li', 0]], [['H0', 4, 2]]],
   {'C15': 'H0-A1', 'C42': 'H0-C1', 'C32': 'UNSEATED'}),
  ('partial repair guard 3',
   [[['C57', 'Adams', 'eve', 0], ['C46', 'adams', 'Dan', 0], ['C67', 'Strausz', 'Ben', 0],
     ['C05', 'Mason', 'Amy', 0], ['C42', 'Zhou', 'Li', 0], ['C90', 'Öberg', 'Ola', 0]],
    [['H0', 2, 5]]],
   {'C46': 'H0-A1', 'C57': 'H0-A3', 'C05': 'H0-A5', 'C67': 'UNSEATED', 'C42': 'UNSEATED', 'C90': 'UNSEATED'}),
  ('boundary control 4', [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 1]], [['H1', 1, 1]]],
   {'C1': 'H1-A1', 'C2': 'SEP-1'}),
  ('boundary control 5',
   [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 0], ['C3', 'Cole', 'Bo', 0]], [['H1', 3, 3]]],
   {'C1': 'H1-A1', 'C2': 'H1-A3', 'C3': 'H1-C1'}),
  ('normal control 6',
   [[['C37', 'Mason', 'Zed', 0], ['C59', 'Zhou', 'Li', 0], ['C68', 'Öberg', 'Ola', 0],
     ['C30', 'Strauß', 'Anna', 0], ['C48', 'Mason', 'Amy', 0]],
    [['H0', 3, 4], ['H1', 1, 5]]],
   {'C48': 'H0-A1', 'C37': 'H0-A3', 'C30': 'H0-C1', 'C59': 'H0-C3', 'C68': 'H1-A1'}),
  ('normal control 7',
   [[['C63', 'Mason', 'Zed', 0], ['C82', 'Strauß', 'Anna', 0], ['C15', 'Mason', 'amy', 1],
     ['C67', 'strauss', 'Cara', 0], ['C90', 'Strausz', 'Ben', 1]],
    [['H0', 5, 5], ['H1', 3, 4]]],
   {'C63': 'H0-A1', 'C82': 'H0-A3', 'C67': 'H0-A5', 'C15': 'SEP-1', 'C90': 'SEP-2'}),
  ('normal control 8',
   [[['C08', 'Adams', 'eve', 0], ['C37', 'Strauß', 'Anna', 0], ['C55', 'strauss', 'Cara', 0],
     ['C83', 'Öberg', 'Ola', 0], ['C11', 'Strausz', 'Ben', 0], ['C54', 'Mason', 'Amy', 1],
     ['C63', 'Mason', 'amy', 0]],
    [['H0', 2, 1], ['H1', 5, 2]]],
   {'C08': 'H0-A1',
    'C63': 'H1-A1',
    'C37': 'H1-C1',
    'C55': 'H1-E1',
    'C11': 'UNSEATED',
    'C83': 'UNSEATED',
    'C54': 'SEP-1'})]]
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: overflow wraps 1{'C1': 'H1-A1', 'C2': 'H1-A1'}{'C1': 'H1-A1', 'C2': 'UNSEATED'}Failed
regression variant: overflow wraps 2{'C16': 'SEP-1', 'C42': 'H0-A1', 'C72': 'H1-A1', 'C74': 'H0-A1', 'C93': 'H0-A1', 'C96': 'H1-A1'}{'C16': 'SEP-1', 'C42': 'UNSEATED', 'C72': 'H1-A1', 'C74': 'H0-A1', 'C93': 'UNSEATED', 'C96': 'UNSEATED'}Failed
partial repair guard 3{'C30': 'H0-A3', 'C39': 'H0-A1', 'C50': 'H0-A3', 'C53': 'H0-A1', 'C83': 'SEP-1', 'C88': 'H0-C1', 'C96': 'H0-C3'}{'C30': 'H0-A3', 'C39': 'UNSEATED', 'C50': 'UNSEATED', 'C53': 'H0-A1', 'C83': 'SEP-1', 'C88': 'H0-C1', 'C96': 'H0-C3'}Failed
boundary control 4{'C1': 'H1-A1', 'C2': 'SEP-1'}{'C1': 'H1-A1', 'C2': 'SEP-1'}Passed
boundary control 5{'C1': 'H1-A1', 'C2': 'H1-A3', 'C3': 'H1-C1'}{'C1': 'H1-A1', 'C2': 'H1-A3', 'C3': 'H1-C1'}Passed
normal control 6{'C21': 'H0-A3', 'C33': 'H0-A1', 'C76': 'H0-A1'}{'C21': 'H0-A3', 'C33': 'H0-A1', 'C76': 'UNSEATED'}Failed
normal control 7{'C40': 'H0-A1', 'C64': 'H0-A3'}{'C40': 'H0-A1', 'C64': 'H0-A3'}Passed
normal control 8{'C07': 'H0-C3', 'C08': 'H0-A3', 'C32': 'H0-C1', 'C49': 'H0-A1'}{'C07': 'H0-C3', 'C08': 'H0-A3', 'C32': 'H0-C1', 'C49': 'H0-A1'}Passed

SHA-256 / 5c75bc2ad1af8b0cbd443e90c2f07641fa1814fb52c5fe64954ffcd4f95dc02d

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(cands, rooms):
    def key(c):
        return (c[1].casefold(), c[2].casefold(), c[0])
    main = sorted([c for c in cands if not c[3]], key=key)
    sep = sorted([c for c in cands if c[3]], key=key)
    seats = []
    for room, rows, cols in rooms:
        for r in range(0, rows, 2):
            for c in range(0, cols, 2):
                seats.append('%s-%s%d' % (room, chr(65 + r), c + 1))
    out = {}
    for k, c in enumerate(main):
        out[c[0]] = seats[min(k, len(seats) - 1)]
    for k, c in enumerate(sep):
        out[c[0]] = 'SEP-%d' % (k + 1)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: overflow wraps 1', [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 0]], [['H1', 1, 1]]],
   {'C1': 'H1-A1', 'C2': 'UNSEATED'}),
  ('regression variant: overflow wraps 2',
   [[['C16', 'Mason', 'Zed', 1], ['C72', 'Adams', 'eve', 0], ['C74', 'adams', 'Dan', 0],
     ['C42', 'Mason', 'Amy', 0], ['C96', 'Mason', 'amy', 0], ['C93', 'Zhou', 'Li', 0]],
    [['H0', 1, 2], ['H1', 1, 1]]],
   {'C74': 'H0-A1', 'C72': 'H1-A1', 'C42': 'UNSEATED', 'C96': 'UNSEATED', 'C93': 'UNSEATED', 'C16': 'SEP-1'}),
  ('partial repair guard 3',
   [[['C39', 'Strausz', 'Ben', 0], ['C53', 'Adams', 'eve', 0], ['C30', 'Mason', 'Amy', 0],
     ['C88', 'Strauß', 'Anna', 0], ['C96', 'strauss', 'Cara', 0], ['C83', 'Öberg', 'Ola', 1],
     ['C50', 'Zhou', 'Li', 0]],
    [['H0', 3, 3]]],
   {'C53': 'H0-A1',
    'C30': 'H0-A3',
    'C88': 'H0-C1',
    'C96': 'H0-C3',
    'C39': 'UNSEATED',
    'C50': 'UNSEATED',
    'C83': 'SEP-1'}),
  ('boundary control 4', [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 1]], [['H1', 1, 1]]],
   {'C1': 'H1-A1', 'C2': 'SEP-1'}),
  ('boundary control 5',
   [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 0], ['C3', 'Cole', 'Bo', 0]], [['H1', 3, 3]]],
   {'C1': 'H1-A1', 'C2': 'H1-A3', 'C3': 'H1-C1'}),
  ('normal control 6',
   [[['C76', 'Strausz', 'Ben', 0], ['C33', 'Mason', 'Amy', 0], ['C21', 'strauss', 'Cara', 0]],
    [['H0', 1, 3]]],
   {'C33': 'H0-A1', 'C21': 'H0-A3', 'C76': 'UNSEATED'}),
  ('normal control 7', [[['C64', 'Mason', 'Zed', 0], ['C40', 'Adams', 'eve', 0]], [['H0', 2, 5]]],
   {'C40': 'H0-A1', 'C64': 'H0-A3'}),
  ('normal control 8',
   [[['C49', 'Mason', 'amy', 0], ['C07', 'Strausz', 'Ben', 0], ['C08', 'Strauß', 'Anna', 0],
     ['C32', 'strauss', 'Cara', 0]],
    [['H0', 4, 4], ['H1', 3, 5]]],
   {'C49': 'H0-A1', 'C08': 'H0-A3', 'C32': 'H0-C1', 'C07': 'H0-C3'})],
 [('regression: overflow wraps 1',
   [[['C29', 'Strausz', 'Ben', 0], ['C34', 'Strauß', 'Anna', 1], ['C35', 'Zhou', 'Li', 0],
     ['C31', 'Mason', 'Amy', 0], ['C13', 'Mason', 'Zed', 0], ['C53', 'Öberg', 'Ola', 0],
     ['C48', 'strauss', 'Cara', 0], ['C28', 'Mason', 'amy', 0]],
    [['H0', 2, 4]]],
   {'C28': 'H0-A1',
    'C31': 'H0-A3',
    'C13': 'UNSEATED',
    'C48': 'UNSEATED',
    'C29': 'UNSEATED',
    'C35': 'UNSEATED',
    'C53': 'UNSEATED',
    'C34': 'SEP-1'}),
  ('regression variant: overflow wraps 2',
   [[['C86', 'Adams', 'eve', 0], ['C97', 'strauss', 'Cara', 0], ['C63', 'Strausz', 'Ben', 0],
     ['C05', 'Strauß', 'Anna', 0], ['C99', 'Mason', 'Zed', 0]],
    [['H0', 2, 3]]],
   {'C86': 'H0-A1', 'C99': 'H0-A3', 'C05': 'UNSEATED', 'C97': 'UNSEATED', 'C63': 'UNSEATED'}),
  ('partial repair guard 3',
   [[['C36', 'Strausz', 'Ben', 1], ['C77', 'Mason', 'Amy', 1], ['C37', 'Mason', 'Zed', 0],
     ['C48', 'Zhou', 'Li', 0], ['C68', 'Strauß', 'Anna', 0], ['C53', 'Mason', 'amy', 1],
     ['C47', 'Adams', 'eve', 0], ['C66', 'Öberg', 'Ola', 0]],
    [['H0', 1, 3]]],
   {'C47': 'H0-A1',
    'C37': 'H0-A3',
    'C68': 'UNSEATED',
    'C48': 'UNSEATED',
    'C66': 'UNSEATED',
    'C53': 'SEP-1',
    'C77': 'SEP-2',
    'C36': 'SEP-3'}),
  ('boundary control 4', [[['C1', 'Strauß', 'Anna', 0], ['C2', 'Strausz', 'Ben', 0]], [['H1', 1, 3]]],
   {'C1': 'H1-A1', 'C2': 'H1-A3'}),
  ('boundary control 5', [[['C9', 'Mason', 'Amy', 0], ['C1', 'Mason', 'Amy', 0]], [['H1', 2, 3]]],
   {'C1': 'H1-A1', 'C9': 'H1-A3'}),
  ('normal control 6', [[['C87', 'Strausz', 'Ben', 0], ['C05', 'Öberg', 'Ola', 0]], [['H0', 5, 5]]],
   {'C87': 'H0-A1', 'C05': 'H0-A3'}),
  ('normal control 7',
   [[['C95', 'Strauß', 'Anna', 0], ['C27', 'Zhou', 'Li', 0], ['C02', 'Mason', 'Amy', 0]], [['H0', 5, 1]]],
   {'C02': 'H0-A1', 'C95': 'H0-C1', 'C27': 'H0-E1'}),
  ('normal control 8',
   [[['C94', 'Öberg', 'Ola', 0], ['C23', 'Mason', 'Zed', 0], ['C54', 'Strauß', 'Anna', 0],
     ['C09', 'Mason', 'amy', 0], ['C24', 'Zhou', 'Li', 0]],
    [['H0', 2, 5]]],
   {'C09': 'H0-A1', 'C23': 'H0-A3', 'C54': 'H0-A5', 'C24': 'UNSEATED', 'C94': 'UNSEATED'})],
 [('regression: overflow wraps 1',
   [[['C74', 'Mason', 'amy', 0], ['C73', 'Strausz', 'Ben', 0], ['C01', 'Zhou', 'Li', 0],
     ['C14', 'Strauß', 'Anna', 1], ['C41', 'Mason', 'Amy', 0], ['C37', 'Öberg', 'Ola', 0],
     ['C25', 'strauss', 'Cara', 0], ['C86', 'Mason', 'Zed', 0]],
    [['H0', 5, 4]]],
   {'C41': 'H0-A1',
    'C74': 'H0-A3',
    'C86': 'H0-C1',
    'C25': 'H0-C3',
    'C73': 'H0-E1',
    'C01': 'H0-E3',
    'C37': 'UNSEATED',
    'C14': 'SEP-1'}),
  ('regression variant: overflow wraps 2',
   [[['C49', 'Strauß', 'Anna', 0], ['C46', 'strauss', 'Cara', 1], ['C55', 'Strausz', 'Ben', 0],
     ['C79', 'Mason', 'Zed', 0], ['C74', 'Mason', 'amy', 0], ['C03', 'Zhou', 'Li', 0],
     ['C29', 'Mason', 'Amy', 0], ['C11', 'adams', 'Dan', 0]],
    [['H0', 2, 5]]],
   {'C11': 'H0-A1',
    'C29': 'H0-A3',
    'C74': 'H0-A5',
    'C79': 'UNSEATED',
    'C49': 'UNSEATED',
    'C55': 'UNSEATED',
    'C03': 'UNSEATED',
    'C46': 'SEP-1'}),
  ('partial repair guard 3',
   [[['C95', 'Öberg', 'Ola', 0], ['C52', 'Zhou', 'Li', 0], ['C96', 'Strauß', 'Anna', 0],
     ['C39', 'Strausz', 'Ben', 0], ['C50', 'Adams', 'eve', 0], ['C28', 'strauss', 'Cara', 1]],
    [['H0', 3, 4]]],
   {'C50': 'H0-A1', 'C96': 'H0-A3', 'C39': 'H0-C1', 'C52': 'H0-C3', 'C95': 'UNSEATED', 'C28': 'SEP-1'}),
  ('boundary control 4', [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 1]], [['H1', 1, 1]]],
   {'C1': 'H1-A1', 'C2': 'SEP-1'}),
  ('boundary control 5',
   [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 0], ['C3', 'Cole', 'Bo', 0]], [['H1', 3, 3]]],
   {'C1': 'H1-A1', 'C2': 'H1-A3', 'C3': 'H1-C1'}),
  ('normal control 6',
   [[['C03', 'Mason', 'amy', 0], ['C88', 'Mason', 'Zed', 0], ['C98', 'Strauß', 'Anna', 1]], [['H0', 5, 1]]],
   {'C03': 'H0-A1', 'C88': 'H0-C1', 'C98': 'SEP-1'}),
  ('normal control 7',
   [[['C70', 'Mason', 'Zed', 0], ['C05', 'Mason', 'amy', 0], ['C61', 'Zhou', 'Li', 0]], [['H0', 1, 3]]],
   {'C05': 'H0-A1', 'C70': 'H0-A3', 'C61': 'UNSEATED'}),
  ('normal control 8',
   [[['C46', 'Mason', 'Zed', 0], ['C28', 'strauss', 'Cara', 0], ['C11', 'Zhou', 'Li', 0],
     ['C58', 'Mason', 'Amy', 1], ['C08', 'Strauß', 'Anna', 0], ['C07', 'Mason', 'amy', 0],
     ['C09', 'Öberg', 'Ola', 1]],
    [['H0', 1, 3]]],
   {'C07': 'H0-A1',
    'C46': 'H0-A3',
    'C08': 'UNSEATED',
    'C28': 'UNSEATED',
    'C11': 'UNSEATED',
    'C58': 'SEP-1',
    'C09': 'SEP-2'})],
 [('regression: overflow wraps 1',
   [[['C38', 'Strauß', 'Anna', 0], ['C46', 'Adams', 'eve', 0], ['C83', 'strauss', 'Cara', 0],
     ['C55', 'Zhou', 'Li', 0], ['C21', 'adams', 'Dan', 0], ['C03', 'Mason', 'amy', 0]],
    [['H0', 4, 4]]],
   {'C21': 'H0-A1', 'C46': 'H0-A3', 'C03': 'H0-C1', 'C38': 'H0-C3', 'C83': 'UNSEATED', 'C55': 'UNSEATED'}),
  ('regression variant: overflow wraps 2',
   [[['C56', 'Strauß', 'Anna', 0], ['C61', 'Zhou', 'Li', 0], ['C53', 'Mason', 'Zed', 0],
     ['C95', 'Adams', 'eve', 0]],
    [['H0', 2, 3]]],
   {'C95': 'H0-A1', 'C53': 'H0-A3', 'C56': 'UNSEATED', 'C61': 'UNSEATED'}),
  ('partial repair guard 3',
   [[['C83', 'strauss', 'Cara', 0], ['C89', 'Adams', 'eve', 0], ['C77', 'Strausz', 'Ben', 1],
     ['C59', 'Mason', 'Amy', 0], ['C94', 'adams', 'Dan', 0], ['C90', 'Zhou', 'Li', 0],
     ['C50', 'Mason', 'Zed', 0]],
    [['H0', 3, 4]]],
   {'C94': 'H0-A1',
    'C89': 'H0-A3',
    'C59': 'H0-C1',
    'C50': 'H0-C3',
    'C83': 'UNSEATED',
    'C90': 'UNSEATED',
    'C77': 'SEP-1'}),
  ('boundary control 4', [[['C1', 'Strauß', 'Anna', 0], ['C2', 'Strausz', 'Ben', 0]], [['H1', 1, 3]]],
   {'C1': 'H1-A1', 'C2': 'H1-A3'}),
  ('boundary control 5', [[['C9', 'Mason', 'Amy', 0], ['C1', 'Mason', 'Amy', 0]], [['H1', 2, 3]]],
   {'C1': 'H1-A1', 'C9': 'H1-A3'}),
  ('normal control 6',
   [[['C20', 'Mason', 'Amy', 0], ['C67', 'adams', 'Dan', 0], ['C12', 'strauss', 'Cara', 1],
     ['C40', 'Öberg', 'Ola', 1], ['C46', 'Strausz', 'Ben', 0], ['C00', 'Zhou', 'Li', 0],
     ['C94', 'Strauß', 'Anna', 0], ['C74', 'Mason', 'amy', 0]],
    [['H0', 5, 2], ['H1', 5, 2]]],
   {'C67': 'H0-A1',
    'C20': 'H0-C1',
    'C74': 'H0-E1',
    'C94': 'H1-A1',
    'C46': 'H1-C1',
    'C00': 'H1-E1',
    'C12': 'SEP-1',
    'C40': 'SEP-2'}),
  ('normal control 7',
   [[['C82', 'Öberg', 'Ola', 1], ['C09', 'Mason', 'amy', 0], ['C88', 'Mason', 'Zed', 1],
     ['C24', 'strauss', 'Cara', 0]],
    [['H0', 4, 2]]],
   {'C09': 'H0-A1', 'C24': 'H0-C1', 'C88': 'SEP-1', 'C82': 'SEP-2'}),
  ('normal control 8',
   [[['C46', 'Öberg', 'Ola', 1], ['C81', 'Mason', 'amy', 1], ['C07', 'Strauß', 'Anna', 0],
     ['C30', 'Zhou', 'Li', 0], ['C83', 'adams', 'Dan', 0], ['C99', 'Strausz', 'Ben', 0],
     ['C19', 'Adams', 'eve', 0]],
    [['H0', 5, 4], ['H1', 2, 2]]],
   {'C83': 'H0-A1',
    'C19': 'H0-A3',
    'C07': 'H0-C1',
    'C99': 'H0-C3',
    'C30': 'H0-E1',
    'C81': 'SEP-1',
    'C46': 'SEP-2'})],
 [('regression: overflow wraps 1',
   [[['C18', 'Mason', 'Amy', 0], ['C17', 'strauss', 'Cara', 0], ['C06', 'Mason', 'Zed', 0],
     ['C23', 'Zhou', 'Li', 0], ['C04', 'Strausz', 'Ben', 0]],
    [['H0', 4, 4]]],
   {'C18': 'H0-A1', 'C06': 'H0-A3', 'C17': 'H0-C1', 'C04': 'H0-C3', 'C23': 'UNSEATED'}),
  ('regression variant: overflow wraps 2',
   [[['C42', 'strauss', 'Cara', 0], ['C15', 'Mason', 'Zed', 0], ['C32', 'Zhou', 'Li', 0]], [['H0', 4, 2]]],
   {'C15': 'H0-A1', 'C42': 'H0-C1', 'C32': 'UNSEATED'}),
  ('partial repair guard 3',
   [[['C57', 'Adams', 'eve', 0], ['C46', 'adams', 'Dan', 0], ['C67', 'Strausz', 'Ben', 0],
     ['C05', 'Mason', 'Amy', 0], ['C42', 'Zhou', 'Li', 0], ['C90', 'Öberg', 'Ola', 0]],
    [['H0', 2, 5]]],
   {'C46': 'H0-A1', 'C57': 'H0-A3', 'C05': 'H0-A5', 'C67': 'UNSEATED', 'C42': 'UNSEATED', 'C90': 'UNSEATED'}),
  ('boundary control 4', [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 1]], [['H1', 1, 1]]],
   {'C1': 'H1-A1', 'C2': 'SEP-1'}),
  ('boundary control 5',
   [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 0], ['C3', 'Cole', 'Bo', 0]], [['H1', 3, 3]]],
   {'C1': 'H1-A1', 'C2': 'H1-A3', 'C3': 'H1-C1'}),
  ('normal control 6',
   [[['C37', 'Mason', 'Zed', 0], ['C59', 'Zhou', 'Li', 0], ['C68', 'Öberg', 'Ola', 0],
     ['C30', 'Strauß', 'Anna', 0], ['C48', 'Mason', 'Amy', 0]],
    [['H0', 3, 4], ['H1', 1, 5]]],
   {'C48': 'H0-A1', 'C37': 'H0-A3', 'C30': 'H0-C1', 'C59': 'H0-C3', 'C68': 'H1-A1'}),
  ('normal control 7',
   [[['C63', 'Mason', 'Zed', 0], ['C82', 'Strauß', 'Anna', 0], ['C15', 'Mason', 'amy', 1],
     ['C67', 'strauss', 'Cara', 0], ['C90', 'Strausz', 'Ben', 1]],
    [['H0', 5, 5], ['H1', 3, 4]]],
   {'C63': 'H0-A1', 'C82': 'H0-A3', 'C67': 'H0-A5', 'C15': 'SEP-1', 'C90': 'SEP-2'}),
  ('normal control 8',
   [[['C08', 'Adams', 'eve', 0], ['C37', 'Strauß', 'Anna', 0], ['C55', 'strauss', 'Cara', 0],
     ['C83', 'Öberg', 'Ola', 0], ['C11', 'Strausz', 'Ben', 0], ['C54', 'Mason', 'Amy', 1],
     ['C63', 'Mason', 'amy', 0]],
    [['H0', 2, 1], ['H1', 5, 2]]],
   {'C08': 'H0-A1',
    'C63': 'H1-A1',
    'C37': 'H1-C1',
    'C55': 'H1-E1',
    'C11': 'UNSEATED',
    'C83': 'UNSEATED',
    'C54': 'SEP-1'})]]
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: overflow wraps 1{'C1': 'H1-A1', 'C2': 'H1-A1'}{'C1': 'H1-A1', 'C2': 'UNSEATED'}Failed
regression variant: overflow wraps 2{'C16': 'SEP-1', 'C42': 'H1-A1', 'C72': 'H1-A1', 'C74': 'H0-A1', 'C93': 'H1-A1', 'C96': 'H1-A1'}{'C16': 'SEP-1', 'C42': 'UNSEATED', 'C72': 'H1-A1', 'C74': 'H0-A1', 'C93': 'UNSEATED', 'C96': 'UNSEATED'}Failed
partial repair guard 3{'C30': 'H0-A3', 'C39': 'H0-C3', 'C50': 'H0-C3', 'C53': 'H0-A1', 'C83': 'SEP-1', 'C88': 'H0-C1', 'C96': 'H0-C3'}{'C30': 'H0-A3', 'C39': 'UNSEATED', 'C50': 'UNSEATED', 'C53': 'H0-A1', 'C83': 'SEP-1', 'C88': 'H0-C1', 'C96': 'H0-C3'}Failed
boundary control 4{'C1': 'H1-A1', 'C2': 'SEP-1'}{'C1': 'H1-A1', 'C2': 'SEP-1'}Passed
boundary control 5{'C1': 'H1-A1', 'C2': 'H1-A3', 'C3': 'H1-C1'}{'C1': 'H1-A1', 'C2': 'H1-A3', 'C3': 'H1-C1'}Passed
normal control 6{'C21': 'H0-A3', 'C33': 'H0-A1', 'C76': 'H0-A3'}{'C21': 'H0-A3', 'C33': 'H0-A1', 'C76': 'UNSEATED'}Failed
normal control 7{'C40': 'H0-A1', 'C64': 'H0-A3'}{'C40': 'H0-A1', 'C64': 'H0-A3'}Passed
normal control 8{'C07': 'H0-C3', 'C08': 'H0-A3', 'C32': 'H0-C1', 'C49': 'H0-A1'}{'C07': 'H0-C3', 'C08': 'H0-A3', 'C32': 'H0-C1', 'C49': 'H0-A1'}Passed

SHA-256 / 1cee3ff689369ff0a263bff714bbedcacd4388d6eab9917059182d9e6b9edbca

3 / The verified repair

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

N = 1
observations = []
def solve(cands, rooms):
    def key(c):
        return (c[1].casefold(), c[2].casefold(), c[0])
    main = sorted([c for c in cands if not c[3]], key=key)
    sep = sorted([c for c in cands if c[3]], key=key)
    seats = []
    for room, rows, cols in rooms:
        for r in range(0, rows, 2):
            for c in range(0, cols, 2):
                seats.append('%s-%s%d' % (room, chr(65 + r), c + 1))
    out = {}
    for k, c in enumerate(main):
        out[c[0]] = seats[k] if k < len(seats) else 'UNSEATED'
    for k, c in enumerate(sep):
        out[c[0]] = 'SEP-%d' % (k + 1)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: overflow wraps 1', [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 0]], [['H1', 1, 1]]],
   {'C1': 'H1-A1', 'C2': 'UNSEATED'}),
  ('regression variant: overflow wraps 2',
   [[['C16', 'Mason', 'Zed', 1], ['C72', 'Adams', 'eve', 0], ['C74', 'adams', 'Dan', 0],
     ['C42', 'Mason', 'Amy', 0], ['C96', 'Mason', 'amy', 0], ['C93', 'Zhou', 'Li', 0]],
    [['H0', 1, 2], ['H1', 1, 1]]],
   {'C74': 'H0-A1', 'C72': 'H1-A1', 'C42': 'UNSEATED', 'C96': 'UNSEATED', 'C93': 'UNSEATED', 'C16': 'SEP-1'}),
  ('partial repair guard 3',
   [[['C39', 'Strausz', 'Ben', 0], ['C53', 'Adams', 'eve', 0], ['C30', 'Mason', 'Amy', 0],
     ['C88', 'Strauß', 'Anna', 0], ['C96', 'strauss', 'Cara', 0], ['C83', 'Öberg', 'Ola', 1],
     ['C50', 'Zhou', 'Li', 0]],
    [['H0', 3, 3]]],
   {'C53': 'H0-A1',
    'C30': 'H0-A3',
    'C88': 'H0-C1',
    'C96': 'H0-C3',
    'C39': 'UNSEATED',
    'C50': 'UNSEATED',
    'C83': 'SEP-1'}),
  ('boundary control 4', [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 1]], [['H1', 1, 1]]],
   {'C1': 'H1-A1', 'C2': 'SEP-1'}),
  ('boundary control 5',
   [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 0], ['C3', 'Cole', 'Bo', 0]], [['H1', 3, 3]]],
   {'C1': 'H1-A1', 'C2': 'H1-A3', 'C3': 'H1-C1'}),
  ('normal control 6',
   [[['C76', 'Strausz', 'Ben', 0], ['C33', 'Mason', 'Amy', 0], ['C21', 'strauss', 'Cara', 0]],
    [['H0', 1, 3]]],
   {'C33': 'H0-A1', 'C21': 'H0-A3', 'C76': 'UNSEATED'}),
  ('normal control 7', [[['C64', 'Mason', 'Zed', 0], ['C40', 'Adams', 'eve', 0]], [['H0', 2, 5]]],
   {'C40': 'H0-A1', 'C64': 'H0-A3'}),
  ('normal control 8',
   [[['C49', 'Mason', 'amy', 0], ['C07', 'Strausz', 'Ben', 0], ['C08', 'Strauß', 'Anna', 0],
     ['C32', 'strauss', 'Cara', 0]],
    [['H0', 4, 4], ['H1', 3, 5]]],
   {'C49': 'H0-A1', 'C08': 'H0-A3', 'C32': 'H0-C1', 'C07': 'H0-C3'})],
 [('regression: overflow wraps 1',
   [[['C29', 'Strausz', 'Ben', 0], ['C34', 'Strauß', 'Anna', 1], ['C35', 'Zhou', 'Li', 0],
     ['C31', 'Mason', 'Amy', 0], ['C13', 'Mason', 'Zed', 0], ['C53', 'Öberg', 'Ola', 0],
     ['C48', 'strauss', 'Cara', 0], ['C28', 'Mason', 'amy', 0]],
    [['H0', 2, 4]]],
   {'C28': 'H0-A1',
    'C31': 'H0-A3',
    'C13': 'UNSEATED',
    'C48': 'UNSEATED',
    'C29': 'UNSEATED',
    'C35': 'UNSEATED',
    'C53': 'UNSEATED',
    'C34': 'SEP-1'}),
  ('regression variant: overflow wraps 2',
   [[['C86', 'Adams', 'eve', 0], ['C97', 'strauss', 'Cara', 0], ['C63', 'Strausz', 'Ben', 0],
     ['C05', 'Strauß', 'Anna', 0], ['C99', 'Mason', 'Zed', 0]],
    [['H0', 2, 3]]],
   {'C86': 'H0-A1', 'C99': 'H0-A3', 'C05': 'UNSEATED', 'C97': 'UNSEATED', 'C63': 'UNSEATED'}),
  ('partial repair guard 3',
   [[['C36', 'Strausz', 'Ben', 1], ['C77', 'Mason', 'Amy', 1], ['C37', 'Mason', 'Zed', 0],
     ['C48', 'Zhou', 'Li', 0], ['C68', 'Strauß', 'Anna', 0], ['C53', 'Mason', 'amy', 1],
     ['C47', 'Adams', 'eve', 0], ['C66', 'Öberg', 'Ola', 0]],
    [['H0', 1, 3]]],
   {'C47': 'H0-A1',
    'C37': 'H0-A3',
    'C68': 'UNSEATED',
    'C48': 'UNSEATED',
    'C66': 'UNSEATED',
    'C53': 'SEP-1',
    'C77': 'SEP-2',
    'C36': 'SEP-3'}),
  ('boundary control 4', [[['C1', 'Strauß', 'Anna', 0], ['C2', 'Strausz', 'Ben', 0]], [['H1', 1, 3]]],
   {'C1': 'H1-A1', 'C2': 'H1-A3'}),
  ('boundary control 5', [[['C9', 'Mason', 'Amy', 0], ['C1', 'Mason', 'Amy', 0]], [['H1', 2, 3]]],
   {'C1': 'H1-A1', 'C9': 'H1-A3'}),
  ('normal control 6', [[['C87', 'Strausz', 'Ben', 0], ['C05', 'Öberg', 'Ola', 0]], [['H0', 5, 5]]],
   {'C87': 'H0-A1', 'C05': 'H0-A3'}),
  ('normal control 7',
   [[['C95', 'Strauß', 'Anna', 0], ['C27', 'Zhou', 'Li', 0], ['C02', 'Mason', 'Amy', 0]], [['H0', 5, 1]]],
   {'C02': 'H0-A1', 'C95': 'H0-C1', 'C27': 'H0-E1'}),
  ('normal control 8',
   [[['C94', 'Öberg', 'Ola', 0], ['C23', 'Mason', 'Zed', 0], ['C54', 'Strauß', 'Anna', 0],
     ['C09', 'Mason', 'amy', 0], ['C24', 'Zhou', 'Li', 0]],
    [['H0', 2, 5]]],
   {'C09': 'H0-A1', 'C23': 'H0-A3', 'C54': 'H0-A5', 'C24': 'UNSEATED', 'C94': 'UNSEATED'})],
 [('regression: overflow wraps 1',
   [[['C74', 'Mason', 'amy', 0], ['C73', 'Strausz', 'Ben', 0], ['C01', 'Zhou', 'Li', 0],
     ['C14', 'Strauß', 'Anna', 1], ['C41', 'Mason', 'Amy', 0], ['C37', 'Öberg', 'Ola', 0],
     ['C25', 'strauss', 'Cara', 0], ['C86', 'Mason', 'Zed', 0]],
    [['H0', 5, 4]]],
   {'C41': 'H0-A1',
    'C74': 'H0-A3',
    'C86': 'H0-C1',
    'C25': 'H0-C3',
    'C73': 'H0-E1',
    'C01': 'H0-E3',
    'C37': 'UNSEATED',
    'C14': 'SEP-1'}),
  ('regression variant: overflow wraps 2',
   [[['C49', 'Strauß', 'Anna', 0], ['C46', 'strauss', 'Cara', 1], ['C55', 'Strausz', 'Ben', 0],
     ['C79', 'Mason', 'Zed', 0], ['C74', 'Mason', 'amy', 0], ['C03', 'Zhou', 'Li', 0],
     ['C29', 'Mason', 'Amy', 0], ['C11', 'adams', 'Dan', 0]],
    [['H0', 2, 5]]],
   {'C11': 'H0-A1',
    'C29': 'H0-A3',
    'C74': 'H0-A5',
    'C79': 'UNSEATED',
    'C49': 'UNSEATED',
    'C55': 'UNSEATED',
    'C03': 'UNSEATED',
    'C46': 'SEP-1'}),
  ('partial repair guard 3',
   [[['C95', 'Öberg', 'Ola', 0], ['C52', 'Zhou', 'Li', 0], ['C96', 'Strauß', 'Anna', 0],
     ['C39', 'Strausz', 'Ben', 0], ['C50', 'Adams', 'eve', 0], ['C28', 'strauss', 'Cara', 1]],
    [['H0', 3, 4]]],
   {'C50': 'H0-A1', 'C96': 'H0-A3', 'C39': 'H0-C1', 'C52': 'H0-C3', 'C95': 'UNSEATED', 'C28': 'SEP-1'}),
  ('boundary control 4', [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 1]], [['H1', 1, 1]]],
   {'C1': 'H1-A1', 'C2': 'SEP-1'}),
  ('boundary control 5',
   [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 0], ['C3', 'Cole', 'Bo', 0]], [['H1', 3, 3]]],
   {'C1': 'H1-A1', 'C2': 'H1-A3', 'C3': 'H1-C1'}),
  ('normal control 6',
   [[['C03', 'Mason', 'amy', 0], ['C88', 'Mason', 'Zed', 0], ['C98', 'Strauß', 'Anna', 1]], [['H0', 5, 1]]],
   {'C03': 'H0-A1', 'C88': 'H0-C1', 'C98': 'SEP-1'}),
  ('normal control 7',
   [[['C70', 'Mason', 'Zed', 0], ['C05', 'Mason', 'amy', 0], ['C61', 'Zhou', 'Li', 0]], [['H0', 1, 3]]],
   {'C05': 'H0-A1', 'C70': 'H0-A3', 'C61': 'UNSEATED'}),
  ('normal control 8',
   [[['C46', 'Mason', 'Zed', 0], ['C28', 'strauss', 'Cara', 0], ['C11', 'Zhou', 'Li', 0],
     ['C58', 'Mason', 'Amy', 1], ['C08', 'Strauß', 'Anna', 0], ['C07', 'Mason', 'amy', 0],
     ['C09', 'Öberg', 'Ola', 1]],
    [['H0', 1, 3]]],
   {'C07': 'H0-A1',
    'C46': 'H0-A3',
    'C08': 'UNSEATED',
    'C28': 'UNSEATED',
    'C11': 'UNSEATED',
    'C58': 'SEP-1',
    'C09': 'SEP-2'})],
 [('regression: overflow wraps 1',
   [[['C38', 'Strauß', 'Anna', 0], ['C46', 'Adams', 'eve', 0], ['C83', 'strauss', 'Cara', 0],
     ['C55', 'Zhou', 'Li', 0], ['C21', 'adams', 'Dan', 0], ['C03', 'Mason', 'amy', 0]],
    [['H0', 4, 4]]],
   {'C21': 'H0-A1', 'C46': 'H0-A3', 'C03': 'H0-C1', 'C38': 'H0-C3', 'C83': 'UNSEATED', 'C55': 'UNSEATED'}),
  ('regression variant: overflow wraps 2',
   [[['C56', 'Strauß', 'Anna', 0], ['C61', 'Zhou', 'Li', 0], ['C53', 'Mason', 'Zed', 0],
     ['C95', 'Adams', 'eve', 0]],
    [['H0', 2, 3]]],
   {'C95': 'H0-A1', 'C53': 'H0-A3', 'C56': 'UNSEATED', 'C61': 'UNSEATED'}),
  ('partial repair guard 3',
   [[['C83', 'strauss', 'Cara', 0], ['C89', 'Adams', 'eve', 0], ['C77', 'Strausz', 'Ben', 1],
     ['C59', 'Mason', 'Amy', 0], ['C94', 'adams', 'Dan', 0], ['C90', 'Zhou', 'Li', 0],
     ['C50', 'Mason', 'Zed', 0]],
    [['H0', 3, 4]]],
   {'C94': 'H0-A1',
    'C89': 'H0-A3',
    'C59': 'H0-C1',
    'C50': 'H0-C3',
    'C83': 'UNSEATED',
    'C90': 'UNSEATED',
    'C77': 'SEP-1'}),
  ('boundary control 4', [[['C1', 'Strauß', 'Anna', 0], ['C2', 'Strausz', 'Ben', 0]], [['H1', 1, 3]]],
   {'C1': 'H1-A1', 'C2': 'H1-A3'}),
  ('boundary control 5', [[['C9', 'Mason', 'Amy', 0], ['C1', 'Mason', 'Amy', 0]], [['H1', 2, 3]]],
   {'C1': 'H1-A1', 'C9': 'H1-A3'}),
  ('normal control 6',
   [[['C20', 'Mason', 'Amy', 0], ['C67', 'adams', 'Dan', 0], ['C12', 'strauss', 'Cara', 1],
     ['C40', 'Öberg', 'Ola', 1], ['C46', 'Strausz', 'Ben', 0], ['C00', 'Zhou', 'Li', 0],
     ['C94', 'Strauß', 'Anna', 0], ['C74', 'Mason', 'amy', 0]],
    [['H0', 5, 2], ['H1', 5, 2]]],
   {'C67': 'H0-A1',
    'C20': 'H0-C1',
    'C74': 'H0-E1',
    'C94': 'H1-A1',
    'C46': 'H1-C1',
    'C00': 'H1-E1',
    'C12': 'SEP-1',
    'C40': 'SEP-2'}),
  ('normal control 7',
   [[['C82', 'Öberg', 'Ola', 1], ['C09', 'Mason', 'amy', 0], ['C88', 'Mason', 'Zed', 1],
     ['C24', 'strauss', 'Cara', 0]],
    [['H0', 4, 2]]],
   {'C09': 'H0-A1', 'C24': 'H0-C1', 'C88': 'SEP-1', 'C82': 'SEP-2'}),
  ('normal control 8',
   [[['C46', 'Öberg', 'Ola', 1], ['C81', 'Mason', 'amy', 1], ['C07', 'Strauß', 'Anna', 0],
     ['C30', 'Zhou', 'Li', 0], ['C83', 'adams', 'Dan', 0], ['C99', 'Strausz', 'Ben', 0],
     ['C19', 'Adams', 'eve', 0]],
    [['H0', 5, 4], ['H1', 2, 2]]],
   {'C83': 'H0-A1',
    'C19': 'H0-A3',
    'C07': 'H0-C1',
    'C99': 'H0-C3',
    'C30': 'H0-E1',
    'C81': 'SEP-1',
    'C46': 'SEP-2'})],
 [('regression: overflow wraps 1',
   [[['C18', 'Mason', 'Amy', 0], ['C17', 'strauss', 'Cara', 0], ['C06', 'Mason', 'Zed', 0],
     ['C23', 'Zhou', 'Li', 0], ['C04', 'Strausz', 'Ben', 0]],
    [['H0', 4, 4]]],
   {'C18': 'H0-A1', 'C06': 'H0-A3', 'C17': 'H0-C1', 'C04': 'H0-C3', 'C23': 'UNSEATED'}),
  ('regression variant: overflow wraps 2',
   [[['C42', 'strauss', 'Cara', 0], ['C15', 'Mason', 'Zed', 0], ['C32', 'Zhou', 'Li', 0]], [['H0', 4, 2]]],
   {'C15': 'H0-A1', 'C42': 'H0-C1', 'C32': 'UNSEATED'}),
  ('partial repair guard 3',
   [[['C57', 'Adams', 'eve', 0], ['C46', 'adams', 'Dan', 0], ['C67', 'Strausz', 'Ben', 0],
     ['C05', 'Mason', 'Amy', 0], ['C42', 'Zhou', 'Li', 0], ['C90', 'Öberg', 'Ola', 0]],
    [['H0', 2, 5]]],
   {'C46': 'H0-A1', 'C57': 'H0-A3', 'C05': 'H0-A5', 'C67': 'UNSEATED', 'C42': 'UNSEATED', 'C90': 'UNSEATED'}),
  ('boundary control 4', [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 1]], [['H1', 1, 1]]],
   {'C1': 'H1-A1', 'C2': 'SEP-1'}),
  ('boundary control 5',
   [[['C1', 'Adams', 'Eve', 0], ['C2', 'Baker', 'Al', 0], ['C3', 'Cole', 'Bo', 0]], [['H1', 3, 3]]],
   {'C1': 'H1-A1', 'C2': 'H1-A3', 'C3': 'H1-C1'}),
  ('normal control 6',
   [[['C37', 'Mason', 'Zed', 0], ['C59', 'Zhou', 'Li', 0], ['C68', 'Öberg', 'Ola', 0],
     ['C30', 'Strauß', 'Anna', 0], ['C48', 'Mason', 'Amy', 0]],
    [['H0', 3, 4], ['H1', 1, 5]]],
   {'C48': 'H0-A1', 'C37': 'H0-A3', 'C30': 'H0-C1', 'C59': 'H0-C3', 'C68': 'H1-A1'}),
  ('normal control 7',
   [[['C63', 'Mason', 'Zed', 0], ['C82', 'Strauß', 'Anna', 0], ['C15', 'Mason', 'amy', 1],
     ['C67', 'strauss', 'Cara', 0], ['C90', 'Strausz', 'Ben', 1]],
    [['H0', 5, 5], ['H1', 3, 4]]],
   {'C63': 'H0-A1', 'C82': 'H0-A3', 'C67': 'H0-A5', 'C15': 'SEP-1', 'C90': 'SEP-2'}),
  ('normal control 8',
   [[['C08', 'Adams', 'eve', 0], ['C37', 'Strauß', 'Anna', 0], ['C55', 'strauss', 'Cara', 0],
     ['C83', 'Öberg', 'Ola', 0], ['C11', 'Strausz', 'Ben', 0], ['C54', 'Mason', 'Amy', 1],
     ['C63', 'Mason', 'amy', 0]],
    [['H0', 2, 1], ['H1', 5, 2]]],
   {'C08': 'H0-A1',
    'C63': 'H1-A1',
    'C37': 'H1-C1',
    'C55': 'H1-E1',
    'C11': 'UNSEATED',
    'C83': 'UNSEATED',
    'C54': 'SEP-1'})]]
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: overflow wraps 1{'C1': 'H1-A1', 'C2': 'UNSEATED'}{'C1': 'H1-A1', 'C2': 'UNSEATED'}Passed
regression variant: overflow wraps 2{'C16': 'SEP-1', 'C42': 'UNSEATED', 'C72': 'H1-A1', 'C74': 'H0-A1', 'C93': 'UNSEATED', 'C96': 'UNSEATED'}{'C16': 'SEP-1', 'C42': 'UNSEATED', 'C72': 'H1-A1', 'C74': 'H0-A1', 'C93': 'UNSEATED', 'C96': 'UNSEATED'}Passed
partial repair guard 3{'C30': 'H0-A3', 'C39': 'UNSEATED', 'C50': 'UNSEATED', 'C53': 'H0-A1', 'C83': 'SEP-1', 'C88': 'H0-C1', 'C96': 'H0-C3'}{'C30': 'H0-A3', 'C39': 'UNSEATED', 'C50': 'UNSEATED', 'C53': 'H0-A1', 'C83': 'SEP-1', 'C88': 'H0-C1', 'C96': 'H0-C3'}Passed
boundary control 4{'C1': 'H1-A1', 'C2': 'SEP-1'}{'C1': 'H1-A1', 'C2': 'SEP-1'}Passed
boundary control 5{'C1': 'H1-A1', 'C2': 'H1-A3', 'C3': 'H1-C1'}{'C1': 'H1-A1', 'C2': 'H1-A3', 'C3': 'H1-C1'}Passed
normal control 6{'C21': 'H0-A3', 'C33': 'H0-A1', 'C76': 'UNSEATED'}{'C21': 'H0-A3', 'C33': 'H0-A1', 'C76': 'UNSEATED'}Passed
normal control 7{'C40': 'H0-A1', 'C64': 'H0-A3'}{'C40': 'H0-A1', 'C64': 'H0-A3'}Passed
normal control 8{'C07': 'H0-C3', 'C08': 'H0-A3', 'C32': 'H0-C1', 'C49': 'H0-A1'}{'C07': 'H0-C3', 'C08': 'H0-A3', 'C32': 'H0-C1', 'C49': 'H0-A1'}Passed

SHA-256 / 894e12ef8f035ab0c4de0c6ced93263eb67cfa93adb9bf9dcd12c8ee7cb38c79

Verification & scope

Stipulated toy exam-timetabling rule set for a bounded model; it does not claim conformance with any institution's regulations or a benchmark specification, and it performs no search or optimisation. 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:52:05.253505+00:00.

Case digest / 2339924be24e05c24a4ccf608c14b3685b9b874200af1cd655b1e07ea1cb5510