{"abstract":"Force of infection uses stale census sizes as migration reshapes the patches.","category":"Epidemic compartment models","checks":7,"contract":"Each day: local frequency-dependent SIR in each patch using the current patch size, then every compartment exchanges fraction travel of each patch simultaneously; return [S pair, I pair, R pair] rounded 3.","evaluation_group":"w2-epidemic-two-patch-sir","failed_approach":"Pooling both patches in the denominator dilutes local transmission.","family":"w2-epidemic-two-patch-sir-local-mixing-denominator","id":"FA-65301","implementations":{"attempt":{"sha256":"125a2b1904361d582ca96946177e0caac272303cec58cf3e0d0c60b06baae693","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(beta, gamma, pops, i0s, travel, days):\n    s = [float(pops[k] - i0s[k]) for k in range(2)]\n    i = [float(x) for x in i0s]\n    r = [0.0, 0.0]\n    for _ in range(days):\n        n = [s[k] + i[k] + r[k] for k in range(2)]\n        inf = [beta * s[k] * i[k] / (n[0] + n[1]) if n[k] > 0 else 0.0 for k in range(2)]\n        rec = [gamma * i[k] for k in range(2)]\n        for k in range(2):\n            s[k] -= inf[k]\n            i[k] += inf[k] - rec[k]\n            r[k] += rec[k]\n        for comp in (s, i, r):\n            a, b = comp[0] * travel, comp[1] * travel\n            comp[0] += b - a\n            comp[1] += a - b\n    return [[round(x, 3) for x in s], [round(x, 3) for x in i], [round(x, 3) for x in r]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('regression: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('regression: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('regression: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('regression: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('regression: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"9845fcf3533d0a17605d130d949fc97346395e5b2419ed7ec4a5cf664d472bd8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(beta, gamma, pops, i0s, travel, days):\n    s = [float(pops[k] - i0s[k]) for k in range(2)]\n    i = [float(x) for x in i0s]\n    r = [0.0, 0.0]\n    for _ in range(days):\n        n = [s[k] + i[k] + r[k] for k in range(2)]\n        inf = [beta * s[k] * i[k] / pops[k] if n[k] > 0 else 0.0 for k in range(2)]\n        rec = [gamma * i[k] for k in range(2)]\n        for k in range(2):\n            s[k] -= inf[k]\n            i[k] += inf[k] - rec[k]\n            r[k] += rec[k]\n        for comp in (s, i, r):\n            a, b = comp[0] * travel, comp[1] * travel\n            comp[0] += b - a\n            comp[1] += a - b\n    return [[round(x, 3) for x in s], [round(x, 3) for x in i], [round(x, 3) for x in r]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('regression: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('regression: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('regression: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('regression: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('regression: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"51a896a1cb28b1f0d3684691da7e86c9e86b63e9720f8c4963f702f1372f0643","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(beta, gamma, pops, i0s, travel, days):\n    s = [float(pops[k] - i0s[k]) for k in range(2)]\n    i = [float(x) for x in i0s]\n    r = [0.0, 0.0]\n    for _ in range(days):\n        n = [s[k] + i[k] + r[k] for k in range(2)]\n        inf = [beta * s[k] * i[k] / n[k] if n[k] > 0 else 0.0 for k in range(2)]\n        rec = [gamma * i[k] for k in range(2)]\n        for k in range(2):\n            s[k] -= inf[k]\n            i[k] += inf[k] - rec[k]\n            r[k] += rec[k]\n        for comp in (s, i, r):\n            a, b = comp[0] * travel, comp[1] * travel\n            comp[0] += b - a\n            comp[1] += a - b\n    return [[round(x, 3) for x in s], [round(x, 3) for x in i], [round(x, 3) for x in r]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('regression: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('regression: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('regression: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('regression: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('regression: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-epidemic-two-patch-sir-local-mixing-denominator","generated_at":"2026-09-29T14:47:32.653065+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Compartmental epidemic calculations drive outbreak forecasts, vaccine targets and hospital planning; a single wrong flow, rate conversion or boundary silently changes every downstream number.","repair":"Restore the local mixing denominator rule: `i[k] / n[k] if n[k] > 0`.","root_cause":"The mixing denominator is the initial census size rather than the current patch size.","sha256":"bd68dcc79b489e605f06e380a4c937c97cdaa290066b6d2def88cec42b6c8378","title":"Two-patch SIR with daily migration: local mixing denominator · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.459,"exit_code":1,"observations":[{"actual":[[685.738,442.177],[25.06,7.088],[28.673,11.264]],"check":"regression: city and town","expected":[[611.99,397.105],[74.874,37.65],[52.607,25.773]],"passed":false},{"actual":[[487.211,500.0],[4.867,0.0],[7.922,0.0]],"check":"regression: isolated patches","expected":[[464.204,500.0],[19.812,0.0],[15.984,0.0]],"passed":false},{"actual":[[583.322,585.599],[6.841,6.934],[8.608,8.696]],"check":"regression: high mobility","expected":[[557.673,559.801],[25.331,25.533],[15.766,15.895]],"passed":false},{"actual":[[599.894,573.207],[7.374,6.823],[6.476,6.226]],"check":"regression: both seeded","expected":[[565.74,538.406],[32.741,32.614],[15.262,15.237]],"passed":false},{"actual":[[99.0,99.0],[1.0,1.0],[0.0,0.0]],"check":"control: boundary zero days","expected":[[99.0,99.0],[1.0,1.0],[0.0,0.0]],"passed":true},{"actual":[[389.905,391.349],[5.376,4.61],[4.72,4.041]],"check":"regression: equal patches","expected":[[377.224,380.426],[15.15,13.039],[7.625,6.535]],"passed":false},{"actual":[[1355.465,320.18],[167.906,9.405],[176.85,20.195]],"check":"regression: tiny second patch","expected":[[1241.271,264.206],[242.617,45.744],[216.332,39.829]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: city and town\", \"actual\": [[685.738, 442.177], [25.06, 7.088], [28.673, 11.264]], \"expected\": [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]], \"passed\": false}, {\"check\": \"regression: isolated patches\", \"actual\": [[487.211, 500.0], [4.867, 0.0], [7.922, 0.0]], \"expected\": [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]], \"passed\": false}, {\"check\": \"regression: high mobility\", \"actual\": [[583.322, 585.599], [6.841, 6.934], [8.608, 8.696]], \"expected\": [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]], \"passed\": false}, {\"check\": \"regression: both seeded\", \"actual\": [[599.894, 573.207], [7.374, 6.823], [6.476, 6.226]], \"expected\": [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]], \"passed\": false}, {\"check\": \"control: boundary zero days\", \"actual\": [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]], \"expected\": [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]], \"passed\": true}, {\"check\": \"regression: equal patches\", \"actual\": [[389.905, 391.349], [5.376, 4.61], [4.72, 4.041]], \"expected\": [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]], \"passed\": false}, {\"check\": \"regression: tiny second patch\", \"actual\": [[1355.465, 320.18], [167.906, 9.405], [176.85, 20.195]], \"expected\": [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.26,"exit_code":1,"observations":[{"actual":[[632.516,277.348],[60.019,136.977],[46.937,46.203]],"check":"regression: city and town","expected":[[611.99,397.105],[74.874,37.65],[52.607,25.773]],"passed":false},{"actual":[[464.204,500.0],[19.812,0.0],[15.984,0.0]],"check":"regression: isolated patches","expected":[[464.204,500.0],[19.812,0.0],[15.984,0.0]],"passed":true},{"actual":[[527.582,544.189],[51.089,37.902],[20.101,19.138]],"check":"regression: high mobility","expected":[[557.673,559.801],[25.331,25.533],[15.766,15.895]],"passed":false},{"actual":[[564.251,513.365],[33.436,53.757],[16.057,19.134]],"check":"regression: both seeded","expected":[[565.74,538.406],[32.741,32.614],[15.262,15.237]],"passed":false},{"actual":[[99.0,99.0],[1.0,1.0],[0.0,0.0]],"check":"control: boundary zero days","expected":[[99.0,99.0],[1.0,1.0],[0.0,0.0]],"passed":true},{"actual":[[377.224,380.426],[15.15,13.039],[7.625,6.535]],"check":"regression: equal patches","expected":[[377.224,380.426],[15.15,13.039],[7.625,6.535]],"passed":true},{"actual":[[1303.081,328.726],[193.226,-127.086],[203.914,148.139]],"check":"regression: tiny second patch","expected":[[1241.271,264.206],[242.617,45.744],[216.332,39.829]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: city and town\", \"actual\": [[632.516, 277.348], [60.019, 136.977], [46.937, 46.203]], \"expected\": [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]], \"passed\": false}, {\"check\": \"regression: isolated patches\", \"actual\": [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]], \"expected\": [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]], \"passed\": true}, {\"check\": \"regression: high mobility\", \"actual\": [[527.582, 544.189], [51.089, 37.902], [20.101, 19.138]], \"expected\": [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]], \"passed\": false}, {\"check\": \"regression: both seeded\", \"actual\": [[564.251, 513.365], [33.436, 53.757], [16.057, 19.134]], \"expected\": [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]], \"passed\": false}, {\"check\": \"control: boundary zero days\", \"actual\": [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]], \"expected\": [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]], \"passed\": true}, {\"check\": \"regression: equal patches\", \"actual\": [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]], \"expected\": [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]], \"passed\": true}, {\"check\": \"regression: tiny second patch\", \"actual\": [[1303.081, 328.726], [193.226, -127.086], [203.914, 148.139]], \"expected\": [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.647,"exit_code":0,"observations":[{"actual":[[611.99,397.105],[74.874,37.65],[52.607,25.773]],"check":"regression: city and town","expected":[[611.99,397.105],[74.874,37.65],[52.607,25.773]],"passed":true},{"actual":[[464.204,500.0],[19.812,0.0],[15.984,0.0]],"check":"regression: isolated patches","expected":[[464.204,500.0],[19.812,0.0],[15.984,0.0]],"passed":true},{"actual":[[557.673,559.801],[25.331,25.533],[15.766,15.895]],"check":"regression: high mobility","expected":[[557.673,559.801],[25.331,25.533],[15.766,15.895]],"passed":true},{"actual":[[565.74,538.406],[32.741,32.614],[15.262,15.237]],"check":"regression: both seeded","expected":[[565.74,538.406],[32.741,32.614],[15.262,15.237]],"passed":true},{"actual":[[99.0,99.0],[1.0,1.0],[0.0,0.0]],"check":"control: boundary zero days","expected":[[99.0,99.0],[1.0,1.0],[0.0,0.0]],"passed":true},{"actual":[[377.224,380.426],[15.15,13.039],[7.625,6.535]],"check":"regression: equal patches","expected":[[377.224,380.426],[15.15,13.039],[7.625,6.535]],"passed":true},{"actual":[[1241.271,264.206],[242.617,45.744],[216.332,39.829]],"check":"regression: tiny second patch","expected":[[1241.271,264.206],[242.617,45.744],[216.332,39.829]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: city and town\", \"actual\": [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]], \"expected\": [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]], \"passed\": true}, {\"check\": \"regression: isolated patches\", \"actual\": [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]], \"expected\": [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]], \"passed\": true}, {\"check\": \"regression: high mobility\", \"actual\": [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]], \"expected\": [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]], \"passed\": true}, {\"check\": \"regression: both seeded\", \"actual\": [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]], \"expected\": [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]], \"passed\": true}, {\"check\": \"control: boundary zero days\", \"actual\": [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]], \"expected\": [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]], \"passed\": true}, {\"check\": \"regression: equal patches\", \"actual\": [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]], \"expected\": [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]], \"passed\": true}, {\"check\": \"regression: tiny second patch\", \"actual\": [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]], \"expected\": [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}