FA-65176 / Epidemic compartment models / Open access
SIQR testing and isolation model: competing exits cap · case 01
With aggressive testing prevalence becomes negative.
ROOT CAUSE
Combined exits exceeding I are not scaled back.
VERIFIED REPAIR
Restore the competing exits cap rule: `scale = i / (rec + iso) / rec *= scale / iso *= scale`.
Unsuccessful approach: Giving recovery priority can make detections negative when gamma alone exceeds one.
Case contract
Daily Euler SIQR: infectives recover (gamma*I) or are detected (detect*I), both exits scaled down proportionally if they exceed I; isolated Q do not transmit and are released to R at Q/isolation_days; report daily detections, final Q and final R rounded to 3.
Why this case matters
Compartmental epidemic calculations drive outbreak forecasts, vaccine targets and hospital planning; a single wrong flow, rate conversion or boundary silently changes every downstream number.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(beta, gamma, detect, pop, i0, days, isolation_days):
s, i, q, r = float(pop - i0), float(i0), 0.0, 0.0
detected = []
for _ in range(days):
inf = beta * s * i / pop
rec = gamma * i
iso = detect * i
if rec + iso > i:
rec = rec
release = q / isolation_days
s -= inf
i += inf - rec - iso
q += iso - release
r += rec + release
detected.append(round(iso, 3))
return [detected, round(q, 3), round(r, 3)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control: moderate testing',
(0.5, 0.2, 0.1, 1000, 10, 8, 10),
[[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079]),
('regression: aggressive testing saturates exits',
(0.6, 0.7, 0.6, 500, 20, 5, 7),
[[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703]),
('control: no testing', (0.4, 0.2, 0.0, 800, 5, 6, 10), [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826]),
('control: short isolation',
(0.5, 0.25, 0.3, 600, 15, 7, 2),
[[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676]),
('control: boundary zero days', (0.5, 0.2, 0.1, 100, 5, 0, 5), [[], 0.0, 0.0]),
('control: long run',
(0.35, 0.1, 0.05, 2000, 8, 12, 14),
[[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018]),
('control: exits exactly I', (0.3, 0.5, 0.5, 200, 40, 4, 5), [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828])],
[('control: moderate testing',
(0.5, 0.2, 0.1, 1000, 10, 8, 10),
[[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079]),
('regression: aggressive testing saturates exits',
(0.6, 0.7, 0.6, 500, 20, 5, 7),
[[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703]),
('control: short isolation',
(0.5, 0.25, 0.3, 600, 15, 7, 2),
[[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676]),
('control: boundary zero days', (0.5, 0.2, 0.1, 100, 5, 0, 5), [[], 0.0, 0.0]),
('control: long run',
(0.35, 0.1, 0.05, 2000, 8, 12, 14),
[[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018]),
('control: exits exactly I', (0.3, 0.5, 0.5, 200, 40, 4, 5), [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828]),
('control: high transmission',
(1.2, 0.3, 0.2, 400, 4, 6, 10),
[[0.8, 1.35, 2.26, 3.729, 6.008, 9.305], 20.739, 37.893])],
[('control: moderate testing',
(0.5, 0.2, 0.1, 1000, 10, 8, 10),
[[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079]),
('regression: aggressive testing saturates exits',
(0.6, 0.7, 0.6, 500, 20, 5, 7),
[[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703]),
('control: no testing', (0.4, 0.2, 0.0, 800, 5, 6, 10), [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826]),
('control: short isolation',
(0.5, 0.25, 0.3, 600, 15, 7, 2),
[[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676]),
('control: boundary zero days', (0.5, 0.2, 0.1, 100, 5, 0, 5), [[], 0.0, 0.0]),
('control: exits exactly I', (0.3, 0.5, 0.5, 200, 40, 4, 5), [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828]),
('control: high transmission',
(1.2, 0.3, 0.2, 400, 4, 6, 10),
[[0.8, 1.35, 2.26, 3.729, 6.008, 9.305], 20.739, 37.893])],
[('regression: aggressive testing saturates exits',
(0.6, 0.7, 0.6, 500, 20, 5, 7),
[[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703]),
('control: no testing', (0.4, 0.2, 0.0, 800, 5, 6, 10), [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826]),
('control: short isolation',
(0.5, 0.25, 0.3, 600, 15, 7, 2),
[[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676]),
('control: boundary zero days', (0.5, 0.2, 0.1, 100, 5, 0, 5), [[], 0.0, 0.0]),
('control: long run',
(0.35, 0.1, 0.05, 2000, 8, 12, 14),
[[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018]),
('control: exits exactly I', (0.3, 0.5, 0.5, 200, 40, 4, 5), [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828]),
('control: high transmission',
(1.2, 0.3, 0.2, 400, 4, 6, 10),
[[0.8, 1.35, 2.26, 3.729, 6.008, 9.305], 20.739, 37.893])],
[('control: moderate testing',
(0.5, 0.2, 0.1, 1000, 10, 8, 10),
[[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079]),
('regression: aggressive testing saturates exits',
(0.6, 0.7, 0.6, 500, 20, 5, 7),
[[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703]),
('control: no testing', (0.4, 0.2, 0.0, 800, 5, 6, 10), [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826]),
('control: boundary zero days', (0.5, 0.2, 0.1, 100, 5, 0, 5), [[], 0.0, 0.0]),
('control: long run',
(0.35, 0.1, 0.05, 2000, 8, 12, 14),
[[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018]),
('control: exits exactly I', (0.3, 0.5, 0.5, 200, 40, 4, 5), [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828]),
('control: high transmission',
(1.2, 0.3, 0.2, 400, 4, 6, 10),
[[0.8, 1.35, 2.26, 3.729, 6.008, 9.305], 20.739, 37.893])]]
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 |
|---|---|---|---|
| control: moderate testing | [[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079] | [[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079] | Passed |
| regression: aggressive testing saturates exits | [[12.0, 3.312, 0.868, 0.224, 0.058], 9.451, 26.218] | [[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703] | Failed |
| control: no testing | [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826] | [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826] | Passed |
| control: short isolation | [[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676] | [[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676] | Passed |
| control: boundary zero days | [[], 0.0, 0.0] | [[], 0.0, 0.0] | Passed |
| control: long run | [[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018] | [[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018] | Passed |
| control: exits exactly I | [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828] | [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828] | Passed |
SHA-256 / 63616b4feaa8e5cf1f2a9d8a2f86e8305f677015e067a6411d5373e9fdace24c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(beta, gamma, detect, pop, i0, days, isolation_days):
s, i, q, r = float(pop - i0), float(i0), 0.0, 0.0
detected = []
for _ in range(days):
inf = beta * s * i / pop
rec = gamma * i
iso = detect * i
if rec + iso > i:
iso = i - rec
release = q / isolation_days
s -= inf
i += inf - rec - iso
q += iso - release
r += rec + release
detected.append(round(iso, 3))
return [detected, round(q, 3), round(r, 3)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control: moderate testing',
(0.5, 0.2, 0.1, 1000, 10, 8, 10),
[[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079]),
('regression: aggressive testing saturates exits',
(0.6, 0.7, 0.6, 500, 20, 5, 7),
[[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703]),
('control: no testing', (0.4, 0.2, 0.0, 800, 5, 6, 10), [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826]),
('control: short isolation',
(0.5, 0.25, 0.3, 600, 15, 7, 2),
[[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676]),
('control: boundary zero days', (0.5, 0.2, 0.1, 100, 5, 0, 5), [[], 0.0, 0.0]),
('control: long run',
(0.35, 0.1, 0.05, 2000, 8, 12, 14),
[[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018]),
('control: exits exactly I', (0.3, 0.5, 0.5, 200, 40, 4, 5), [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828])],
[('control: moderate testing',
(0.5, 0.2, 0.1, 1000, 10, 8, 10),
[[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079]),
('regression: aggressive testing saturates exits',
(0.6, 0.7, 0.6, 500, 20, 5, 7),
[[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703]),
('control: short isolation',
(0.5, 0.25, 0.3, 600, 15, 7, 2),
[[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676]),
('control: boundary zero days', (0.5, 0.2, 0.1, 100, 5, 0, 5), [[], 0.0, 0.0]),
('control: long run',
(0.35, 0.1, 0.05, 2000, 8, 12, 14),
[[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018]),
('control: exits exactly I', (0.3, 0.5, 0.5, 200, 40, 4, 5), [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828]),
('control: high transmission',
(1.2, 0.3, 0.2, 400, 4, 6, 10),
[[0.8, 1.35, 2.26, 3.729, 6.008, 9.305], 20.739, 37.893])],
[('control: moderate testing',
(0.5, 0.2, 0.1, 1000, 10, 8, 10),
[[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079]),
('regression: aggressive testing saturates exits',
(0.6, 0.7, 0.6, 500, 20, 5, 7),
[[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703]),
('control: no testing', (0.4, 0.2, 0.0, 800, 5, 6, 10), [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826]),
('control: short isolation',
(0.5, 0.25, 0.3, 600, 15, 7, 2),
[[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676]),
('control: boundary zero days', (0.5, 0.2, 0.1, 100, 5, 0, 5), [[], 0.0, 0.0]),
('control: exits exactly I', (0.3, 0.5, 0.5, 200, 40, 4, 5), [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828]),
('control: high transmission',
(1.2, 0.3, 0.2, 400, 4, 6, 10),
[[0.8, 1.35, 2.26, 3.729, 6.008, 9.305], 20.739, 37.893])],
[('regression: aggressive testing saturates exits',
(0.6, 0.7, 0.6, 500, 20, 5, 7),
[[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703]),
('control: no testing', (0.4, 0.2, 0.0, 800, 5, 6, 10), [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826]),
('control: short isolation',
(0.5, 0.25, 0.3, 600, 15, 7, 2),
[[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676]),
('control: boundary zero days', (0.5, 0.2, 0.1, 100, 5, 0, 5), [[], 0.0, 0.0]),
('control: long run',
(0.35, 0.1, 0.05, 2000, 8, 12, 14),
[[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018]),
('control: exits exactly I', (0.3, 0.5, 0.5, 200, 40, 4, 5), [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828]),
('control: high transmission',
(1.2, 0.3, 0.2, 400, 4, 6, 10),
[[0.8, 1.35, 2.26, 3.729, 6.008, 9.305], 20.739, 37.893])],
[('control: moderate testing',
(0.5, 0.2, 0.1, 1000, 10, 8, 10),
[[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079]),
('regression: aggressive testing saturates exits',
(0.6, 0.7, 0.6, 500, 20, 5, 7),
[[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703]),
('control: no testing', (0.4, 0.2, 0.0, 800, 5, 6, 10), [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826]),
('control: boundary zero days', (0.5, 0.2, 0.1, 100, 5, 0, 5), [[], 0.0, 0.0]),
('control: long run',
(0.35, 0.1, 0.05, 2000, 8, 12, 14),
[[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018]),
('control: exits exactly I', (0.3, 0.5, 0.5, 200, 40, 4, 5), [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828]),
('control: high transmission',
(1.2, 0.3, 0.2, 400, 4, 6, 10),
[[0.8, 1.35, 2.26, 3.729, 6.008, 9.305], 20.739, 37.893])]]
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 |
|---|---|---|---|
| control: moderate testing | [[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079] | [[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079] | Passed |
| regression: aggressive testing saturates exits | [[6.0, 3.456, 1.943, 1.077, 0.593], 8.358, 35.204] | [[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703] | Failed |
| control: no testing | [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826] | [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826] | Passed |
| control: short isolation | [[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676] | [[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676] | Passed |
| control: boundary zero days | [[], 0.0, 0.0] | [[], 0.0, 0.0] | Passed |
| control: long run | [[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018] | [[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018] | Passed |
| control: exits exactly I | [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828] | [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828] | Passed |
SHA-256 / 51dcfe92cd5bbc9462fab8e7969e4e91a94dcbab9375fdb15aa8096f7667ca6a
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(beta, gamma, detect, pop, i0, days, isolation_days):
s, i, q, r = float(pop - i0), float(i0), 0.0, 0.0
detected = []
for _ in range(days):
inf = beta * s * i / pop
rec = gamma * i
iso = detect * i
if rec + iso > i:
scale = i / (rec + iso)
rec *= scale
iso *= scale
release = q / isolation_days
s -= inf
i += inf - rec - iso
q += iso - release
r += rec + release
detected.append(round(iso, 3))
return [detected, round(q, 3), round(r, 3)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control: moderate testing',
(0.5, 0.2, 0.1, 1000, 10, 8, 10),
[[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079]),
('regression: aggressive testing saturates exits',
(0.6, 0.7, 0.6, 500, 20, 5, 7),
[[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703]),
('control: no testing', (0.4, 0.2, 0.0, 800, 5, 6, 10), [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826]),
('control: short isolation',
(0.5, 0.25, 0.3, 600, 15, 7, 2),
[[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676]),
('control: boundary zero days', (0.5, 0.2, 0.1, 100, 5, 0, 5), [[], 0.0, 0.0]),
('control: long run',
(0.35, 0.1, 0.05, 2000, 8, 12, 14),
[[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018]),
('control: exits exactly I', (0.3, 0.5, 0.5, 200, 40, 4, 5), [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828])],
[('control: moderate testing',
(0.5, 0.2, 0.1, 1000, 10, 8, 10),
[[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079]),
('regression: aggressive testing saturates exits',
(0.6, 0.7, 0.6, 500, 20, 5, 7),
[[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703]),
('control: short isolation',
(0.5, 0.25, 0.3, 600, 15, 7, 2),
[[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676]),
('control: boundary zero days', (0.5, 0.2, 0.1, 100, 5, 0, 5), [[], 0.0, 0.0]),
('control: long run',
(0.35, 0.1, 0.05, 2000, 8, 12, 14),
[[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018]),
('control: exits exactly I', (0.3, 0.5, 0.5, 200, 40, 4, 5), [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828]),
('control: high transmission',
(1.2, 0.3, 0.2, 400, 4, 6, 10),
[[0.8, 1.35, 2.26, 3.729, 6.008, 9.305], 20.739, 37.893])],
[('control: moderate testing',
(0.5, 0.2, 0.1, 1000, 10, 8, 10),
[[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079]),
('regression: aggressive testing saturates exits',
(0.6, 0.7, 0.6, 500, 20, 5, 7),
[[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703]),
('control: no testing', (0.4, 0.2, 0.0, 800, 5, 6, 10), [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826]),
('control: short isolation',
(0.5, 0.25, 0.3, 600, 15, 7, 2),
[[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676]),
('control: boundary zero days', (0.5, 0.2, 0.1, 100, 5, 0, 5), [[], 0.0, 0.0]),
('control: exits exactly I', (0.3, 0.5, 0.5, 200, 40, 4, 5), [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828]),
('control: high transmission',
(1.2, 0.3, 0.2, 400, 4, 6, 10),
[[0.8, 1.35, 2.26, 3.729, 6.008, 9.305], 20.739, 37.893])],
[('regression: aggressive testing saturates exits',
(0.6, 0.7, 0.6, 500, 20, 5, 7),
[[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703]),
('control: no testing', (0.4, 0.2, 0.0, 800, 5, 6, 10), [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826]),
('control: short isolation',
(0.5, 0.25, 0.3, 600, 15, 7, 2),
[[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676]),
('control: boundary zero days', (0.5, 0.2, 0.1, 100, 5, 0, 5), [[], 0.0, 0.0]),
('control: long run',
(0.35, 0.1, 0.05, 2000, 8, 12, 14),
[[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018]),
('control: exits exactly I', (0.3, 0.5, 0.5, 200, 40, 4, 5), [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828]),
('control: high transmission',
(1.2, 0.3, 0.2, 400, 4, 6, 10),
[[0.8, 1.35, 2.26, 3.729, 6.008, 9.305], 20.739, 37.893])],
[('control: moderate testing',
(0.5, 0.2, 0.1, 1000, 10, 8, 10),
[[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079]),
('regression: aggressive testing saturates exits',
(0.6, 0.7, 0.6, 500, 20, 5, 7),
[[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703]),
('control: no testing', (0.4, 0.2, 0.0, 800, 5, 6, 10), [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826]),
('control: boundary zero days', (0.5, 0.2, 0.1, 100, 5, 0, 5), [[], 0.0, 0.0]),
('control: long run',
(0.35, 0.1, 0.05, 2000, 8, 12, 14),
[[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018]),
('control: exits exactly I', (0.3, 0.5, 0.5, 200, 40, 4, 5), [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828]),
('control: high transmission',
(1.2, 0.3, 0.2, 400, 4, 6, 10),
[[0.8, 1.35, 2.26, 3.729, 6.008, 9.305], 20.739, 37.893])]]
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 |
|---|---|---|---|
| control: moderate testing | [[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079] | [[1.0, 1.195, 1.425, 1.695, 2.011, 2.377, 2.798, 3.277], 12.253, 35.079] | Passed |
| regression: aggressive testing saturates exits | [[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703] | [[9.231, 5.317, 2.989, 1.657, 0.912], 12.859, 30.703] | Passed |
| control: no testing | [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826] | [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0.0, 9.826] | Passed |
| control: short isolation | [[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676] | [[4.5, 4.219, 3.929, 3.638, 3.349, 3.067, 2.795], 6.068, 40.676] | Passed |
| control: boundary zero days | [[], 0.0, 0.0] | [[], 0.0, 0.0] | Passed |
| control: long run | [[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018] | [[0.4, 0.479, 0.574, 0.688, 0.823, 0.985, 1.177, 1.405, 1.675, 1.994, 2.371, 2.813], 12.133, 34.018] | Passed |
| control: exits exactly I | [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828] | [[20.0, 4.8, 1.083, 0.241], 14.419, 37.828] | Passed |
SHA-256 / a8f6c7ad6ea775dd6c47ceb183d260d99829dda52338a521dcde05a9a22fab1f
Verification & scope
Deterministic bounded teaching model with a stipulated contract; not a validated scientific or public-health modelling library. 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:47:31.440988+00:00.
Case digest / 8053ed4c80a22b3b8817568e2c468a2e62bb5793a8ae002dae6960f2e59d18b0