FA-94796 / Exam timetabling constraints / Open access
Student at the daily limit reported · case 01
Students with exactly the allowed exams in a day are flagged.
ROOT CAUSE
The daily limit comparison is inclusive.
THE FAILURE
The daily limit comparison is inclusive.
Unsuccessful approach: Testing the student's total exam count flags every day they sit.
Case contract
sits [student, period] with spd periods per day (day = p // spd). Report ["day", student, day] when a student has more than maxday distinct periods on a day, and ["eve_morn", student, day] when a student sits the last period of a day and the first period of the next day. Rows by student: day findings by day, then evening-morning findings.
Why this case matters
Daily exam limits and evening-then-morning sequences are common student-welfare rules.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(sits, spd, maxday):
by = {}
for st, p in sits:
by.setdefault(st, set()).add(p)
out = []
for st in sorted(by):
ps = by[st]
days = {}
for p in ps:
days[p // spd] = days.get(p // spd, 0) + 1
for d in sorted(days):
if days[d] >= maxday:
out.append(['day', st, d])
for p in sorted(ps):
if p % spd == spd - 1 and p + 1 in ps:
out.append(['eve_morn', st, p // spd])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: day limit boundary 1', [[['s1', 1], ['s1', 2]], 3, 2], []),
('regression variant: day limit boundary 2',
[[['s2', 6], ['s3', 0], ['s2', 5], ['s2', 8], ['s3', 8], ['s1', 3]], 3, 1],
[['day', 's2', 2], ['eve_morn', 's2', 1]]),
('partial repair guard 3', [[['s3', 4], ['s2', 8], ['s3', 1], ['s1', 1], ['s2', 3]], 3, 1], []),
('boundary control 4', [[['s1', 0], ['s1', 1], ['s1', 2]], 3, 2], [['day', 's1', 0]]),
('normal control 5', [[['s1', 4], ['s3', 4], ['s1', 6], ['s3', 6], ['s3', 2], ['s1', 1]], 3, 2], []),
('normal control 6', [[['s3', 3], ['s1', 0], ['s3', 0], ['s2', 4], ['s2', 2]], 2, 1], []),
('normal control 7', [[['s3', 10], ['s2', 5], ['s1', 0]], 4, 1], []),
('normal control 8', [[['s1', 11], ['s1', 5], ['s2', 10], ['s3', 3], ['s2', 0]], 4, 2], [])],
[('regression: day limit boundary 1', [[['s1', 0], ['s1', 1]], 3, 2], []),
('regression variant: day limit boundary 2', [[['s1', 6], ['s3', 5], ['s3', 1], ['s3', 6]], 3, 1],
[['eve_morn', 's3', 1]]),
('boundary control 3', [[['s1', 1], ['s1', 2]], 3, 2], []),
('normal control 4', [[['s3', 10], ['s2', 9]], 4, 2], []),
('normal control 5', [[['s3', 2], ['s2', 5], ['s1', 6], ['s3', 6], ['s1', 1]], 3, 1], []),
('normal control 6',
[[['s3', 8], ['s2', 7], ['s1', 2], ['s3', 6], ['s2', 5], ['s2', 3], ['s2', 8], ['s2', 8]], 3, 1],
[['day', 's2', 1], ['day', 's2', 2], ['day', 's3', 2]]),
('normal control 7',
[[['s1', 2], ['s1', 6], ['s2', 2], ['s2', 5], ['s3', 0], ['s2', 5], ['s1', 7], ['s2', 4]], 4, 1],
[['day', 's1', 1], ['day', 's2', 1]]),
('normal control 8',
[[['s2', 4], ['s3', 0], ['s1', 1], ['s2', 3], ['s2', 2], ['s2', 4], ['s1', 5], ['s1', 0]], 2, 2],
[['eve_morn', 's2', 1]])],
[('regression: day limit boundary 1', [[['s3', 3], ['s1', 1], ['s2', 7], ['s3', 5], ['s3', 8]], 3, 1],
[['day', 's3', 1]]),
('regression variant: day limit boundary 2',
[[['s1', 1], ['s2', 6], ['s1', 4], ['s1', 3], ['s1', 4]], 3, 1], [['day', 's1', 1]]),
('partial repair guard 3', [[['s3', 6], ['s3', 8]], 4, 1], []),
('boundary control 4', [[['s1', 5], ['s1', 6]], 3, 2], [['eve_morn', 's1', 1]]),
('normal control 5', [[['s3', 1], ['s1', 4], ['s1', 3], ['s1', 8]], 3, 2], []),
('normal control 6', [[['s3', 1], ['s2', 5], ['s1', 2], ['s2', 2]], 2, 1], []),
('normal control 7', [[['s1', 4], ['s2', 4], ['s2', 4], ['s3', 5], ['s2', 1]], 4, 2], []),
('normal control 8', [[['s1', 1], ['s3', 2]], 4, 1], [])],
[('regression: day limit boundary 1', [[['s2', 3], ['s3', 11], ['s1', 6], ['s3', 9]], 4, 2], []),
('regression variant: day limit boundary 2',
[[['s1', 3], ['s3', 7], ['s3', 11], ['s3', 9], ['s2', 0], ['s1', 6], ['s3', 7], ['s1', 6]], 4, 2], []),
('partial repair guard 3', [[['s2', 0], ['s3', 4], ['s1', 2], ['s1', 5], ['s2', 4], ['s1', 0]], 2, 2], []),
('boundary control 4', [[['s1', 0], ['s1', 1]], 3, 2], []),
('normal control 5', [[['s1', 2], ['s1', 0], ['s1', 1], ['s1', 2], ['s3', 3], ['s3', 4], ['s3', 0]], 2, 2],
[['eve_morn', 's1', 0], ['eve_morn', 's3', 1]]),
('normal control 6', [[['s2', 4], ['s3', 3]], 2, 2], []),
('normal control 7',
[[['s2', 0], ['s3', 2], ['s1', 3], ['s2', 3], ['s2', 5], ['s3', 0], ['s1', 4], ['s3', 0]], 2, 2],
[['eve_morn', 's1', 1]]),
('normal control 8', [[['s2', 0], ['s1', 3], ['s2', 4], ['s1', 5]], 2, 1], [])],
[('regression: day limit boundary 1', [[['s3', 0], ['s3', 0], ['s1', 1], ['s3', 3], ['s1', 0]], 2, 2], []),
('regression variant: day limit boundary 2',
[[['s2', 3], ['s1', 3], ['s3', 7], ['s3', 7], ['s3', 0]], 3, 1], []),
('partial repair guard 3',
[[['s2', 0], ['s3', 0], ['s2', 7], ['s2', 5], ['s1', 0], ['s3', 1], ['s3', 6]], 3, 2], []),
('boundary control 4', [[['s1', 2], ['s1', 3]], 3, 2], [['eve_morn', 's1', 0]]),
('normal control 5', [[['s2', 2], ['s1', 2], ['s2', 5], ['s2', 5], ['s2', 8], ['s3', 5], ['s3', 2]], 3, 2],
[]),
('normal control 6', [[['s3', 1], ['s2', 3]], 2, 2], []),
('normal control 7',
[[['s2', 5], ['s1', 5], ['s3', 5], ['s1', 3], ['s1', 1], ['s2', 4], ['s2', 2], ['s1', 2]], 2, 1],
[['day', 's1', 1], ['eve_morn', 's1', 0], ['day', 's2', 2]]),
('normal control 8', [[['s1', 0], ['s1', 3], ['s2', 5], ['s1', 2]], 2, 1], [['day', 's1', 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: day limit boundary 1 | [['day', 's1', 0]] | [] | Failed |
| regression variant: day limit boundary 2 | [['day', 's1', 1], ['day', 's2', 1], ['day', 's2', 2], ['eve_morn', 's2', 1], ['day', 's3', 0], ['day', 's3', 2]] | [['day', 's2', 2], ['eve_morn', 's2', 1]] | Failed |
| partial repair guard 3 | [['day', 's1', 0], ['day', 's2', 1], ['day', 's2', 2], ['day', 's3', 0], ['day', 's3', 1]] | [] | Failed |
| boundary control 4 | [['day', 's1', 0]] | [['day', 's1', 0]] | Passed |
| normal control 5 | [] | [] | Passed |
| normal control 6 | [['day', 's1', 0], ['day', 's2', 1], ['day', 's2', 2], ['day', 's3', 0], ['day', 's3', 1]] | [] | Failed |
| normal control 7 | [['day', 's1', 0], ['day', 's2', 1], ['day', 's3', 2]] | [] | Failed |
| normal control 8 | [] | [] | Passed |
SHA-256 / f0335654c28bfc0d77d6012f7854862341cb14a9c1159b1c3d1f366e9df80b87
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(sits, spd, maxday):
by = {}
for st, p in sits:
by.setdefault(st, set()).add(p)
out = []
for st in sorted(by):
ps = by[st]
days = {}
for p in ps:
days[p // spd] = days.get(p // spd, 0) + 1
for d in sorted(days):
if len(ps) > maxday:
out.append(['day', st, d])
for p in sorted(ps):
if p % spd == spd - 1 and p + 1 in ps:
out.append(['eve_morn', st, p // spd])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: day limit boundary 1', [[['s1', 1], ['s1', 2]], 3, 2], []),
('regression variant: day limit boundary 2',
[[['s2', 6], ['s3', 0], ['s2', 5], ['s2', 8], ['s3', 8], ['s1', 3]], 3, 1],
[['day', 's2', 2], ['eve_morn', 's2', 1]]),
('partial repair guard 3', [[['s3', 4], ['s2', 8], ['s3', 1], ['s1', 1], ['s2', 3]], 3, 1], []),
('boundary control 4', [[['s1', 0], ['s1', 1], ['s1', 2]], 3, 2], [['day', 's1', 0]]),
('normal control 5', [[['s1', 4], ['s3', 4], ['s1', 6], ['s3', 6], ['s3', 2], ['s1', 1]], 3, 2], []),
('normal control 6', [[['s3', 3], ['s1', 0], ['s3', 0], ['s2', 4], ['s2', 2]], 2, 1], []),
('normal control 7', [[['s3', 10], ['s2', 5], ['s1', 0]], 4, 1], []),
('normal control 8', [[['s1', 11], ['s1', 5], ['s2', 10], ['s3', 3], ['s2', 0]], 4, 2], [])],
[('regression: day limit boundary 1', [[['s1', 0], ['s1', 1]], 3, 2], []),
('regression variant: day limit boundary 2', [[['s1', 6], ['s3', 5], ['s3', 1], ['s3', 6]], 3, 1],
[['eve_morn', 's3', 1]]),
('boundary control 3', [[['s1', 1], ['s1', 2]], 3, 2], []),
('normal control 4', [[['s3', 10], ['s2', 9]], 4, 2], []),
('normal control 5', [[['s3', 2], ['s2', 5], ['s1', 6], ['s3', 6], ['s1', 1]], 3, 1], []),
('normal control 6',
[[['s3', 8], ['s2', 7], ['s1', 2], ['s3', 6], ['s2', 5], ['s2', 3], ['s2', 8], ['s2', 8]], 3, 1],
[['day', 's2', 1], ['day', 's2', 2], ['day', 's3', 2]]),
('normal control 7',
[[['s1', 2], ['s1', 6], ['s2', 2], ['s2', 5], ['s3', 0], ['s2', 5], ['s1', 7], ['s2', 4]], 4, 1],
[['day', 's1', 1], ['day', 's2', 1]]),
('normal control 8',
[[['s2', 4], ['s3', 0], ['s1', 1], ['s2', 3], ['s2', 2], ['s2', 4], ['s1', 5], ['s1', 0]], 2, 2],
[['eve_morn', 's2', 1]])],
[('regression: day limit boundary 1', [[['s3', 3], ['s1', 1], ['s2', 7], ['s3', 5], ['s3', 8]], 3, 1],
[['day', 's3', 1]]),
('regression variant: day limit boundary 2',
[[['s1', 1], ['s2', 6], ['s1', 4], ['s1', 3], ['s1', 4]], 3, 1], [['day', 's1', 1]]),
('partial repair guard 3', [[['s3', 6], ['s3', 8]], 4, 1], []),
('boundary control 4', [[['s1', 5], ['s1', 6]], 3, 2], [['eve_morn', 's1', 1]]),
('normal control 5', [[['s3', 1], ['s1', 4], ['s1', 3], ['s1', 8]], 3, 2], []),
('normal control 6', [[['s3', 1], ['s2', 5], ['s1', 2], ['s2', 2]], 2, 1], []),
('normal control 7', [[['s1', 4], ['s2', 4], ['s2', 4], ['s3', 5], ['s2', 1]], 4, 2], []),
('normal control 8', [[['s1', 1], ['s3', 2]], 4, 1], [])],
[('regression: day limit boundary 1', [[['s2', 3], ['s3', 11], ['s1', 6], ['s3', 9]], 4, 2], []),
('regression variant: day limit boundary 2',
[[['s1', 3], ['s3', 7], ['s3', 11], ['s3', 9], ['s2', 0], ['s1', 6], ['s3', 7], ['s1', 6]], 4, 2], []),
('partial repair guard 3', [[['s2', 0], ['s3', 4], ['s1', 2], ['s1', 5], ['s2', 4], ['s1', 0]], 2, 2], []),
('boundary control 4', [[['s1', 0], ['s1', 1]], 3, 2], []),
('normal control 5', [[['s1', 2], ['s1', 0], ['s1', 1], ['s1', 2], ['s3', 3], ['s3', 4], ['s3', 0]], 2, 2],
[['eve_morn', 's1', 0], ['eve_morn', 's3', 1]]),
('normal control 6', [[['s2', 4], ['s3', 3]], 2, 2], []),
('normal control 7',
[[['s2', 0], ['s3', 2], ['s1', 3], ['s2', 3], ['s2', 5], ['s3', 0], ['s1', 4], ['s3', 0]], 2, 2],
[['eve_morn', 's1', 1]]),
('normal control 8', [[['s2', 0], ['s1', 3], ['s2', 4], ['s1', 5]], 2, 1], [])],
[('regression: day limit boundary 1', [[['s3', 0], ['s3', 0], ['s1', 1], ['s3', 3], ['s1', 0]], 2, 2], []),
('regression variant: day limit boundary 2',
[[['s2', 3], ['s1', 3], ['s3', 7], ['s3', 7], ['s3', 0]], 3, 1], []),
('partial repair guard 3',
[[['s2', 0], ['s3', 0], ['s2', 7], ['s2', 5], ['s1', 0], ['s3', 1], ['s3', 6]], 3, 2], []),
('boundary control 4', [[['s1', 2], ['s1', 3]], 3, 2], [['eve_morn', 's1', 0]]),
('normal control 5', [[['s2', 2], ['s1', 2], ['s2', 5], ['s2', 5], ['s2', 8], ['s3', 5], ['s3', 2]], 3, 2],
[]),
('normal control 6', [[['s3', 1], ['s2', 3]], 2, 2], []),
('normal control 7',
[[['s2', 5], ['s1', 5], ['s3', 5], ['s1', 3], ['s1', 1], ['s2', 4], ['s2', 2], ['s1', 2]], 2, 1],
[['day', 's1', 1], ['eve_morn', 's1', 0], ['day', 's2', 2]]),
('normal control 8', [[['s1', 0], ['s1', 3], ['s2', 5], ['s1', 2]], 2, 1], [['day', 's1', 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: day limit boundary 1 | [] | [] | Passed |
| regression variant: day limit boundary 2 | [['day', 's2', 1], ['day', 's2', 2], ['eve_morn', 's2', 1], ['day', 's3', 0], ['day', 's3', 2]] | [['day', 's2', 2], ['eve_morn', 's2', 1]] | Failed |
| partial repair guard 3 | [['day', 's2', 1], ['day', 's2', 2], ['day', 's3', 0], ['day', 's3', 1]] | [] | Failed |
| boundary control 4 | [['day', 's1', 0]] | [['day', 's1', 0]] | Passed |
| normal control 5 | [['day', 's1', 0], ['day', 's1', 1], ['day', 's1', 2], ['day', 's3', 0], ['day', 's3', 1], ['day', 's3', 2]] | [] | Failed |
| normal control 6 | [['day', 's2', 1], ['day', 's2', 2], ['day', 's3', 0], ['day', 's3', 1]] | [] | Failed |
| normal control 7 | [] | [] | Passed |
| normal control 8 | [] | [] | Passed |
SHA-256 / 75954e95b15746f3dd02daca8e814d94fd63db281be9d59dfef48376304b5662
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
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:07.788851+00:00.
Case digest / 8bff95a1e615ca8ab35e5bde36830f8188be1385bc3c977759e5d90c1f22955b