{"abstract":"Cross-group transmission is ignored when computing R0.","category":"Epidemic compartment models","checks":7,"contract":"K[i][j] = contact[i][j]*sizes[i]/sum(sizes)/gamma[j] (infections in group i caused by one infective in j); R0 is the dominant eigenvalue of the 2x2 K; lead group is the larger component of its eigenvector (ties and decoupled ties to group 0); return [flattened K rounded 6, R0 rounded 6, lead] or None for empty population or non-positive gamma.","evaluation_group":"w2-epidemic-two-group-ngm","failed_approach":"The maximum row sum is an upper bound, not the eigenvalue.","family":"w2-epidemic-two-group-ngm-spectral-radius","id":"FA-65011","implementations":{"attempt":{"sha256":"58e08a1bb6eda7256d0371917813a89377483188320888b5d73d1d2a595bcebc","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(contact, sizes, gamma):\n    total = sum(sizes)\n    if total <= 0 or min(gamma) <= 0:\n        return None\n    k = [[contact[i][j] * sizes[i] / total / gamma[j] for j in range(2)] for i in range(2)]\n    tr = k[0][0] + k[1][1]\n    det = k[0][0] * k[1][1] - k[0][1] * k[1][0]\n    disc = max(tr * tr - 4 * det, 0.0)\n    r0 = max(sum(k[0]), sum(k[1]))\n    if abs(k[0][1]) > 1e-12:\n        v = [k[0][1], r0 - k[0][0]]\n    elif abs(k[1][0]) > 1e-12:\n        v = [r0 - k[1][1], k[1][0]]\n    else:\n        v = [1.0, 0.0] if k[0][0] >= k[1][1] else [0.0, 1.0]\n    lead = 0 if abs(v[0]) >= abs(v[1]) else 1\n    return [[round(x, 6) for row in k for x in row], round(r0, 6), lead]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: children and adults',\n   ([[2.0, 0.5], [0.5, 1.0]], [300, 700], [0.25, 0.2]),\n   [[2.4, 0.75, 1.4, 3.5], 4.11297, 1]),\n  ('regression: asymmetric core group',\n   ([[4.0, 0.2], [1.0, 0.3]], [100, 900], [0.3, 0.2]),\n   [[1.333333, 0.1, 3.0, 1.35], 1.889453, 1]),\n  ('control: decoupled equal groups tie',\n   ([[1.0, 0.0], [0.0, 1.0]], [500, 500], [0.5, 0.5]),\n   [[1.0, 0.0, 0.0, 1.0], 1.0, 0]),\n  ('control: decoupled first dominant smaller group',\n   ([[3.0, 0.0], [0.0, 0.5]], [300, 700], [0.5, 0.5]),\n   [[1.8, 0.0, 0.0, 0.7], 1.8, 0]),\n  ('control: decoupled second dominant',\n   ([[0.5, 0.0], [0.0, 3.0]], [400, 600], [0.5, 0.5]),\n   [[0.4, 0.0, 0.0, 3.6], 3.6, 1]),\n  ('regression: one-way coupling',\n   ([[1.0, 0.0], [2.0, 1.5]], [200, 800], [0.2, 0.4]),\n   [[1.0, 0.0, 8.0, 3.0], 3.0, 1]),\n  ('control: empty population', ([[1.0, 1.0], [1.0, 1.0]], [0, 0], [0.2, 0.2]), None)],\n [('control: decoupled first dominant smaller group',\n   ([[3.0, 0.0], [0.0, 0.5]], [300, 700], [0.5, 0.5]),\n   [[1.8, 0.0, 0.0, 0.7], 1.8, 0]),\n  ('control: decoupled second dominant',\n   ([[0.5, 0.0], [0.0, 3.0]], [400, 600], [0.5, 0.5]),\n   [[0.4, 0.0, 0.0, 3.6], 3.6, 1]),\n  ('regression: one-way coupling',\n   ([[1.0, 0.0], [2.0, 1.5]], [200, 800], [0.2, 0.4]),\n   [[1.0, 0.0, 8.0, 3.0], 3.0, 1]),\n  ('control: empty population', ([[1.0, 1.0], [1.0, 1.0]], [0, 0], [0.2, 0.2]), None),\n  ('control: invalid gamma', ([[1.0, 1.0], [1.0, 1.0]], [10, 10], [0.0, 0.2]), None),\n  ('regression: homogeneous mixing',\n   ([[1.2, 1.2], [1.2, 1.2]], [250, 750], [0.4, 0.4]),\n   [[0.75, 0.75, 2.25, 2.25], 3.0, 1]),\n  ('regression: unequal recovery',\n   ([[0.8, 0.6], [0.3, 0.9]], [600, 400], [0.1, 0.5]),\n   [[4.8, 0.72, 1.2, 0.72], 5.001785, 0])],\n [('regression: children and adults',\n   ([[2.0, 0.5], [0.5, 1.0]], [300, 700], [0.25, 0.2]),\n   [[2.4, 0.75, 1.4, 3.5], 4.11297, 1]),\n  ('control: decoupled equal groups tie',\n   ([[1.0, 0.0], [0.0, 1.0]], [500, 500], [0.5, 0.5]),\n   [[1.0, 0.0, 0.0, 1.0], 1.0, 0]),\n  ('control: empty population', ([[1.0, 1.0], [1.0, 1.0]], [0, 0], [0.2, 0.2]), None),\n  ('control: invalid gamma', ([[1.0, 1.0], [1.0, 1.0]], [10, 10], [0.0, 0.2]), None),\n  ('regression: homogeneous mixing',\n   ([[1.2, 1.2], [1.2, 1.2]], [250, 750], [0.4, 0.4]),\n   [[0.75, 0.75, 2.25, 2.25], 3.0, 1]),\n  ('regression: unequal recovery',\n   ([[0.8, 0.6], [0.3, 0.9]], [600, 400], [0.1, 0.5]),\n   [[4.8, 0.72, 1.2, 0.72], 5.001785, 0]),\n  ('regression: only cross contacts',\n   ([[0.0, 2.0], [1.0, 0.0]], [300, 300], [0.25, 0.5]),\n   [[0.0, 2.0, 2.0, 0.0], 2.0, 0])],\n [('regression: children and adults',\n   ([[2.0, 0.5], [0.5, 1.0]], [300, 700], [0.25, 0.2]),\n   [[2.4, 0.75, 1.4, 3.5], 4.11297, 1]),\n  ('regression: asymmetric core group',\n   ([[4.0, 0.2], [1.0, 0.3]], [100, 900], [0.3, 0.2]),\n   [[1.333333, 0.1, 3.0, 1.35], 1.889453, 1]),\n  ('control: decoupled equal groups tie',\n   ([[1.0, 0.0], [0.0, 1.0]], [500, 500], [0.5, 0.5]),\n   [[1.0, 0.0, 0.0, 1.0], 1.0, 0]),\n  ('control: decoupled first dominant smaller group',\n   ([[3.0, 0.0], [0.0, 0.5]], [300, 700], [0.5, 0.5]),\n   [[1.8, 0.0, 0.0, 0.7], 1.8, 0]),\n  ('control: decoupled second dominant',\n   ([[0.5, 0.0], [0.0, 3.0]], [400, 600], [0.5, 0.5]),\n   [[0.4, 0.0, 0.0, 3.6], 3.6, 1]),\n  ('regression: unequal recovery',\n   ([[0.8, 0.6], [0.3, 0.9]], [600, 400], [0.1, 0.5]),\n   [[4.8, 0.72, 1.2, 0.72], 5.001785, 0]),\n  ('regression: only cross contacts',\n   ([[0.0, 2.0], [1.0, 0.0]], [300, 300], [0.25, 0.5]),\n   [[0.0, 2.0, 2.0, 0.0], 2.0, 0])],\n [('regression: asymmetric core group',\n   ([[4.0, 0.2], [1.0, 0.3]], [100, 900], [0.3, 0.2]),\n   [[1.333333, 0.1, 3.0, 1.35], 1.889453, 1]),\n  ('control: decoupled equal groups tie',\n   ([[1.0, 0.0], [0.0, 1.0]], [500, 500], [0.5, 0.5]),\n   [[1.0, 0.0, 0.0, 1.0], 1.0, 0]),\n  ('control: decoupled first dominant smaller group',\n   ([[3.0, 0.0], [0.0, 0.5]], [300, 700], [0.5, 0.5]),\n   [[1.8, 0.0, 0.0, 0.7], 1.8, 0]),\n  ('control: decoupled second dominant',\n   ([[0.5, 0.0], [0.0, 3.0]], [400, 600], [0.5, 0.5]),\n   [[0.4, 0.0, 0.0, 3.6], 3.6, 1]),\n  ('regression: one-way coupling',\n   ([[1.0, 0.0], [2.0, 1.5]], [200, 800], [0.2, 0.4]),\n   [[1.0, 0.0, 8.0, 3.0], 3.0, 1]),\n  ('control: empty population', ([[1.0, 1.0], [1.0, 1.0]], [0, 0], [0.2, 0.2]), None),\n  ('regression: homogeneous mixing',\n   ([[1.2, 1.2], [1.2, 1.2]], [250, 750], [0.4, 0.4]),\n   [[0.75, 0.75, 2.25, 2.25], 3.0, 1])]]\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":"594ede963c21327da03d04ab7b00caa2163e6cc9fdb8bef2af9d30eb5d64673e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(contact, sizes, gamma):\n    total = sum(sizes)\n    if total <= 0 or min(gamma) <= 0:\n        return None\n    k = [[contact[i][j] * sizes[i] / total / gamma[j] for j in range(2)] for i in range(2)]\n    tr = k[0][0] + k[1][1]\n    det = k[0][0] * k[1][1] - k[0][1] * k[1][0]\n    disc = max(tr * tr - 4 * det, 0.0)\n    r0 = max(k[0][0], k[1][1])\n    if abs(k[0][1]) > 1e-12:\n        v = [k[0][1], r0 - k[0][0]]\n    elif abs(k[1][0]) > 1e-12:\n        v = [r0 - k[1][1], k[1][0]]\n    else:\n        v = [1.0, 0.0] if k[0][0] >= k[1][1] else [0.0, 1.0]\n    lead = 0 if abs(v[0]) >= abs(v[1]) else 1\n    return [[round(x, 6) for row in k for x in row], round(r0, 6), lead]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: children and adults',\n   ([[2.0, 0.5], [0.5, 1.0]], [300, 700], [0.25, 0.2]),\n   [[2.4, 0.75, 1.4, 3.5], 4.11297, 1]),\n  ('regression: asymmetric core group',\n   ([[4.0, 0.2], [1.0, 0.3]], [100, 900], [0.3, 0.2]),\n   [[1.333333, 0.1, 3.0, 1.35], 1.889453, 1]),\n  ('control: decoupled equal groups tie',\n   ([[1.0, 0.0], [0.0, 1.0]], [500, 500], [0.5, 0.5]),\n   [[1.0, 0.0, 0.0, 1.0], 1.0, 0]),\n  ('control: decoupled first dominant smaller group',\n   ([[3.0, 0.0], [0.0, 0.5]], [300, 700], [0.5, 0.5]),\n   [[1.8, 0.0, 0.0, 0.7], 1.8, 0]),\n  ('control: decoupled second dominant',\n   ([[0.5, 0.0], [0.0, 3.0]], [400, 600], [0.5, 0.5]),\n   [[0.4, 0.0, 0.0, 3.6], 3.6, 1]),\n  ('regression: one-way coupling',\n   ([[1.0, 0.0], [2.0, 1.5]], [200, 800], [0.2, 0.4]),\n   [[1.0, 0.0, 8.0, 3.0], 3.0, 1]),\n  ('control: empty population', ([[1.0, 1.0], [1.0, 1.0]], [0, 0], [0.2, 0.2]), None)],\n [('control: decoupled first dominant smaller group',\n   ([[3.0, 0.0], [0.0, 0.5]], [300, 700], [0.5, 0.5]),\n   [[1.8, 0.0, 0.0, 0.7], 1.8, 0]),\n  ('control: decoupled second dominant',\n   ([[0.5, 0.0], [0.0, 3.0]], [400, 600], [0.5, 0.5]),\n   [[0.4, 0.0, 0.0, 3.6], 3.6, 1]),\n  ('regression: one-way coupling',\n   ([[1.0, 0.0], [2.0, 1.5]], [200, 800], [0.2, 0.4]),\n   [[1.0, 0.0, 8.0, 3.0], 3.0, 1]),\n  ('control: empty population', ([[1.0, 1.0], [1.0, 1.0]], [0, 0], [0.2, 0.2]), None),\n  ('control: invalid gamma', ([[1.0, 1.0], [1.0, 1.0]], [10, 10], [0.0, 0.2]), None),\n  ('regression: homogeneous mixing',\n   ([[1.2, 1.2], [1.2, 1.2]], [250, 750], [0.4, 0.4]),\n   [[0.75, 0.75, 2.25, 2.25], 3.0, 1]),\n  ('regression: unequal recovery',\n   ([[0.8, 0.6], [0.3, 0.9]], [600, 400], [0.1, 0.5]),\n   [[4.8, 0.72, 1.2, 0.72], 5.001785, 0])],\n [('regression: children and adults',\n   ([[2.0, 0.5], [0.5, 1.0]], [300, 700], [0.25, 0.2]),\n   [[2.4, 0.75, 1.4, 3.5], 4.11297, 1]),\n  ('control: decoupled equal groups tie',\n   ([[1.0, 0.0], [0.0, 1.0]], [500, 500], [0.5, 0.5]),\n   [[1.0, 0.0, 0.0, 1.0], 1.0, 0]),\n  ('control: empty population', ([[1.0, 1.0], [1.0, 1.0]], [0, 0], [0.2, 0.2]), None),\n  ('control: invalid gamma', ([[1.0, 1.0], [1.0, 1.0]], [10, 10], [0.0, 0.2]), None),\n  ('regression: homogeneous mixing',\n   ([[1.2, 1.2], [1.2, 1.2]], [250, 750], [0.4, 0.4]),\n   [[0.75, 0.75, 2.25, 2.25], 3.0, 1]),\n  ('regression: unequal recovery',\n   ([[0.8, 0.6], [0.3, 0.9]], [600, 400], [0.1, 0.5]),\n   [[4.8, 0.72, 1.2, 0.72], 5.001785, 0]),\n  ('regression: only cross contacts',\n   ([[0.0, 2.0], [1.0, 0.0]], [300, 300], [0.25, 0.5]),\n   [[0.0, 2.0, 2.0, 0.0], 2.0, 0])],\n [('regression: children and adults',\n   ([[2.0, 0.5], [0.5, 1.0]], [300, 700], [0.25, 0.2]),\n   [[2.4, 0.75, 1.4, 3.5], 4.11297, 1]),\n  ('regression: asymmetric core group',\n   ([[4.0, 0.2], [1.0, 0.3]], [100, 900], [0.3, 0.2]),\n   [[1.333333, 0.1, 3.0, 1.35], 1.889453, 1]),\n  ('control: decoupled equal groups tie',\n   ([[1.0, 0.0], [0.0, 1.0]], [500, 500], [0.5, 0.5]),\n   [[1.0, 0.0, 0.0, 1.0], 1.0, 0]),\n  ('control: decoupled first dominant smaller group',\n   ([[3.0, 0.0], [0.0, 0.5]], [300, 700], [0.5, 0.5]),\n   [[1.8, 0.0, 0.0, 0.7], 1.8, 0]),\n  ('control: decoupled second dominant',\n   ([[0.5, 0.0], [0.0, 3.0]], [400, 600], [0.5, 0.5]),\n   [[0.4, 0.0, 0.0, 3.6], 3.6, 1]),\n  ('regression: unequal recovery',\n   ([[0.8, 0.6], [0.3, 0.9]], [600, 400], [0.1, 0.5]),\n   [[4.8, 0.72, 1.2, 0.72], 5.001785, 0]),\n  ('regression: only cross contacts',\n   ([[0.0, 2.0], [1.0, 0.0]], [300, 300], [0.25, 0.5]),\n   [[0.0, 2.0, 2.0, 0.0], 2.0, 0])],\n [('regression: asymmetric core group',\n   ([[4.0, 0.2], [1.0, 0.3]], [100, 900], [0.3, 0.2]),\n   [[1.333333, 0.1, 3.0, 1.35], 1.889453, 1]),\n  ('control: decoupled equal groups tie',\n   ([[1.0, 0.0], [0.0, 1.0]], [500, 500], [0.5, 0.5]),\n   [[1.0, 0.0, 0.0, 1.0], 1.0, 0]),\n  ('control: decoupled first dominant smaller group',\n   ([[3.0, 0.0], [0.0, 0.5]], [300, 700], [0.5, 0.5]),\n   [[1.8, 0.0, 0.0, 0.7], 1.8, 0]),\n  ('control: decoupled second dominant',\n   ([[0.5, 0.0], [0.0, 3.0]], [400, 600], [0.5, 0.5]),\n   [[0.4, 0.0, 0.0, 3.6], 3.6, 1]),\n  ('regression: one-way coupling',\n   ([[1.0, 0.0], [2.0, 1.5]], [200, 800], [0.2, 0.4]),\n   [[1.0, 0.0, 8.0, 3.0], 3.0, 1]),\n  ('control: empty population', ([[1.0, 1.0], [1.0, 1.0]], [0, 0], [0.2, 0.2]), None),\n  ('regression: homogeneous mixing',\n   ([[1.2, 1.2], [1.2, 1.2]], [250, 750], [0.4, 0.4]),\n   [[0.75, 0.75, 2.25, 2.25], 3.0, 1])]]\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":"cf93d78217c39ad1dbc6a7943f9ae9cb8f23e4b1b6b4f1bca4a13cdb20a23eb5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(contact, sizes, gamma):\n    total = sum(sizes)\n    if total <= 0 or min(gamma) <= 0:\n        return None\n    k = [[contact[i][j] * sizes[i] / total / gamma[j] for j in range(2)] for i in range(2)]\n    tr = k[0][0] + k[1][1]\n    det = k[0][0] * k[1][1] - k[0][1] * k[1][0]\n    disc = max(tr * tr - 4 * det, 0.0)\n    r0 = (tr + math.sqrt(disc)) / 2\n    if abs(k[0][1]) > 1e-12:\n        v = [k[0][1], r0 - k[0][0]]\n    elif abs(k[1][0]) > 1e-12:\n        v = [r0 - k[1][1], k[1][0]]\n    else:\n        v = [1.0, 0.0] if k[0][0] >= k[1][1] else [0.0, 1.0]\n    lead = 0 if abs(v[0]) >= abs(v[1]) else 1\n    return [[round(x, 6) for row in k for x in row], round(r0, 6), lead]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: children and adults',\n   ([[2.0, 0.5], [0.5, 1.0]], [300, 700], [0.25, 0.2]),\n   [[2.4, 0.75, 1.4, 3.5], 4.11297, 1]),\n  ('regression: asymmetric core group',\n   ([[4.0, 0.2], [1.0, 0.3]], [100, 900], [0.3, 0.2]),\n   [[1.333333, 0.1, 3.0, 1.35], 1.889453, 1]),\n  ('control: decoupled equal groups tie',\n   ([[1.0, 0.0], [0.0, 1.0]], [500, 500], [0.5, 0.5]),\n   [[1.0, 0.0, 0.0, 1.0], 1.0, 0]),\n  ('control: decoupled first dominant smaller group',\n   ([[3.0, 0.0], [0.0, 0.5]], [300, 700], [0.5, 0.5]),\n   [[1.8, 0.0, 0.0, 0.7], 1.8, 0]),\n  ('control: decoupled second dominant',\n   ([[0.5, 0.0], [0.0, 3.0]], [400, 600], [0.5, 0.5]),\n   [[0.4, 0.0, 0.0, 3.6], 3.6, 1]),\n  ('regression: one-way coupling',\n   ([[1.0, 0.0], [2.0, 1.5]], [200, 800], [0.2, 0.4]),\n   [[1.0, 0.0, 8.0, 3.0], 3.0, 1]),\n  ('control: empty population', ([[1.0, 1.0], [1.0, 1.0]], [0, 0], [0.2, 0.2]), None)],\n [('control: decoupled first dominant smaller group',\n   ([[3.0, 0.0], [0.0, 0.5]], [300, 700], [0.5, 0.5]),\n   [[1.8, 0.0, 0.0, 0.7], 1.8, 0]),\n  ('control: decoupled second dominant',\n   ([[0.5, 0.0], [0.0, 3.0]], [400, 600], [0.5, 0.5]),\n   [[0.4, 0.0, 0.0, 3.6], 3.6, 1]),\n  ('regression: one-way coupling',\n   ([[1.0, 0.0], [2.0, 1.5]], [200, 800], [0.2, 0.4]),\n   [[1.0, 0.0, 8.0, 3.0], 3.0, 1]),\n  ('control: empty population', ([[1.0, 1.0], [1.0, 1.0]], [0, 0], [0.2, 0.2]), None),\n  ('control: invalid gamma', ([[1.0, 1.0], [1.0, 1.0]], [10, 10], [0.0, 0.2]), None),\n  ('regression: homogeneous mixing',\n   ([[1.2, 1.2], [1.2, 1.2]], [250, 750], [0.4, 0.4]),\n   [[0.75, 0.75, 2.25, 2.25], 3.0, 1]),\n  ('regression: unequal recovery',\n   ([[0.8, 0.6], [0.3, 0.9]], [600, 400], [0.1, 0.5]),\n   [[4.8, 0.72, 1.2, 0.72], 5.001785, 0])],\n [('regression: children and adults',\n   ([[2.0, 0.5], [0.5, 1.0]], [300, 700], [0.25, 0.2]),\n   [[2.4, 0.75, 1.4, 3.5], 4.11297, 1]),\n  ('control: decoupled equal groups tie',\n   ([[1.0, 0.0], [0.0, 1.0]], [500, 500], [0.5, 0.5]),\n   [[1.0, 0.0, 0.0, 1.0], 1.0, 0]),\n  ('control: empty population', ([[1.0, 1.0], [1.0, 1.0]], [0, 0], [0.2, 0.2]), None),\n  ('control: invalid gamma', ([[1.0, 1.0], [1.0, 1.0]], [10, 10], [0.0, 0.2]), None),\n  ('regression: homogeneous mixing',\n   ([[1.2, 1.2], [1.2, 1.2]], [250, 750], [0.4, 0.4]),\n   [[0.75, 0.75, 2.25, 2.25], 3.0, 1]),\n  ('regression: unequal recovery',\n   ([[0.8, 0.6], [0.3, 0.9]], [600, 400], [0.1, 0.5]),\n   [[4.8, 0.72, 1.2, 0.72], 5.001785, 0]),\n  ('regression: only cross contacts',\n   ([[0.0, 2.0], [1.0, 0.0]], [300, 300], [0.25, 0.5]),\n   [[0.0, 2.0, 2.0, 0.0], 2.0, 0])],\n [('regression: children and adults',\n   ([[2.0, 0.5], [0.5, 1.0]], [300, 700], [0.25, 0.2]),\n   [[2.4, 0.75, 1.4, 3.5], 4.11297, 1]),\n  ('regression: asymmetric core group',\n   ([[4.0, 0.2], [1.0, 0.3]], [100, 900], [0.3, 0.2]),\n   [[1.333333, 0.1, 3.0, 1.35], 1.889453, 1]),\n  ('control: decoupled equal groups tie',\n   ([[1.0, 0.0], [0.0, 1.0]], [500, 500], [0.5, 0.5]),\n   [[1.0, 0.0, 0.0, 1.0], 1.0, 0]),\n  ('control: decoupled first dominant smaller group',\n   ([[3.0, 0.0], [0.0, 0.5]], [300, 700], [0.5, 0.5]),\n   [[1.8, 0.0, 0.0, 0.7], 1.8, 0]),\n  ('control: decoupled second dominant',\n   ([[0.5, 0.0], [0.0, 3.0]], [400, 600], [0.5, 0.5]),\n   [[0.4, 0.0, 0.0, 3.6], 3.6, 1]),\n  ('regression: unequal recovery',\n   ([[0.8, 0.6], [0.3, 0.9]], [600, 400], [0.1, 0.5]),\n   [[4.8, 0.72, 1.2, 0.72], 5.001785, 0]),\n  ('regression: only cross contacts',\n   ([[0.0, 2.0], [1.0, 0.0]], [300, 300], [0.25, 0.5]),\n   [[0.0, 2.0, 2.0, 0.0], 2.0, 0])],\n [('regression: asymmetric core group',\n   ([[4.0, 0.2], [1.0, 0.3]], [100, 900], [0.3, 0.2]),\n   [[1.333333, 0.1, 3.0, 1.35], 1.889453, 1]),\n  ('control: decoupled equal groups tie',\n   ([[1.0, 0.0], [0.0, 1.0]], [500, 500], [0.5, 0.5]),\n   [[1.0, 0.0, 0.0, 1.0], 1.0, 0]),\n  ('control: decoupled first dominant smaller group',\n   ([[3.0, 0.0], [0.0, 0.5]], [300, 700], [0.5, 0.5]),\n   [[1.8, 0.0, 0.0, 0.7], 1.8, 0]),\n  ('control: decoupled second dominant',\n   ([[0.5, 0.0], [0.0, 3.0]], [400, 600], [0.5, 0.5]),\n   [[0.4, 0.0, 0.0, 3.6], 3.6, 1]),\n  ('regression: one-way coupling',\n   ([[1.0, 0.0], [2.0, 1.5]], [200, 800], [0.2, 0.4]),\n   [[1.0, 0.0, 8.0, 3.0], 3.0, 1]),\n  ('control: empty population', ([[1.0, 1.0], [1.0, 1.0]], [0, 0], [0.2, 0.2]), None),\n  ('regression: homogeneous mixing',\n   ([[1.2, 1.2], [1.2, 1.2]], [250, 750], [0.4, 0.4]),\n   [[0.75, 0.75, 2.25, 2.25], 3.0, 1])]]\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-group-ngm-spectral-radius","generated_at":"2026-09-29T14:47:30.088809+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 spectral radius rule: `r0 = (tr + math.sqrt(disc)) / 2`.","root_cause":"The largest diagonal entry is used instead of the dominant eigenvalue.","sha256":"40603aeaf7031aec1a6ad57de65c67d42ccd7782211f625a7fbc146922f34306","title":"Two-group next-generation matrix R0: spectral radius · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":38.842,"exit_code":1,"observations":[{"actual":[[2.4,0.75,1.4,3.5],4.9,1],"check":"regression: children and adults","expected":[[2.4,0.75,1.4,3.5],4.11297,1],"passed":false},{"actual":[[1.333333,0.1,3.0,1.35],4.35,1],"check":"regression: asymmetric core group","expected":[[1.333333,0.1,3.0,1.35],1.889453,1],"passed":false},{"actual":[[1.0,0.0,0.0,1.0],1.0,0],"check":"control: decoupled equal groups tie","expected":[[1.0,0.0,0.0,1.0],1.0,0],"passed":true},{"actual":[[1.8,0.0,0.0,0.7],1.8,0],"check":"control: decoupled first dominant smaller group","expected":[[1.8,0.0,0.0,0.7],1.8,0],"passed":true},{"actual":[[0.4,0.0,0.0,3.6],3.6,1],"check":"control: decoupled second dominant","expected":[[0.4,0.0,0.0,3.6],3.6,1],"passed":true},{"actual":[[1.0,0.0,8.0,3.0],11.0,0],"check":"regression: one-way coupling","expected":[[1.0,0.0,8.0,3.0],3.0,1],"passed":false},{"actual":null,"check":"control: empty population","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: children and adults\", \"actual\": [[2.4, 0.75, 1.4, 3.5], 4.9, 1], \"expected\": [[2.4, 0.75, 1.4, 3.5], 4.11297, 1], \"passed\": false}, {\"check\": \"regression: asymmetric core group\", \"actual\": [[1.333333, 0.1, 3.0, 1.35], 4.35, 1], \"expected\": [[1.333333, 0.1, 3.0, 1.35], 1.889453, 1], \"passed\": false}, {\"check\": \"control: decoupled equal groups tie\", \"actual\": [[1.0, 0.0, 0.0, 1.0], 1.0, 0], \"expected\": [[1.0, 0.0, 0.0, 1.0], 1.0, 0], \"passed\": true}, {\"check\": \"control: decoupled first dominant smaller group\", \"actual\": [[1.8, 0.0, 0.0, 0.7], 1.8, 0], \"expected\": [[1.8, 0.0, 0.0, 0.7], 1.8, 0], \"passed\": true}, {\"check\": \"control: decoupled second dominant\", \"actual\": [[0.4, 0.0, 0.0, 3.6], 3.6, 1], \"expected\": [[0.4, 0.0, 0.0, 3.6], 3.6, 1], \"passed\": true}, {\"check\": \"regression: one-way coupling\", \"actual\": [[1.0, 0.0, 8.0, 3.0], 11.0, 0], \"expected\": [[1.0, 0.0, 8.0, 3.0], 3.0, 1], \"passed\": false}, {\"check\": \"control: empty population\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.224,"exit_code":1,"observations":[{"actual":[[2.4,0.75,1.4,3.5],3.5,1],"check":"regression: children and adults","expected":[[2.4,0.75,1.4,3.5],4.11297,1],"passed":false},{"actual":[[1.333333,0.1,3.0,1.35],1.35,0],"check":"regression: asymmetric core group","expected":[[1.333333,0.1,3.0,1.35],1.889453,1],"passed":false},{"actual":[[1.0,0.0,0.0,1.0],1.0,0],"check":"control: decoupled equal groups tie","expected":[[1.0,0.0,0.0,1.0],1.0,0],"passed":true},{"actual":[[1.8,0.0,0.0,0.7],1.8,0],"check":"control: decoupled first dominant smaller group","expected":[[1.8,0.0,0.0,0.7],1.8,0],"passed":true},{"actual":[[0.4,0.0,0.0,3.6],3.6,1],"check":"control: decoupled second dominant","expected":[[0.4,0.0,0.0,3.6],3.6,1],"passed":true},{"actual":[[1.0,0.0,8.0,3.0],3.0,1],"check":"regression: one-way coupling","expected":[[1.0,0.0,8.0,3.0],3.0,1],"passed":true},{"actual":null,"check":"control: empty population","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: children and adults\", \"actual\": [[2.4, 0.75, 1.4, 3.5], 3.5, 1], \"expected\": [[2.4, 0.75, 1.4, 3.5], 4.11297, 1], \"passed\": false}, {\"check\": \"regression: asymmetric core group\", \"actual\": [[1.333333, 0.1, 3.0, 1.35], 1.35, 0], \"expected\": [[1.333333, 0.1, 3.0, 1.35], 1.889453, 1], \"passed\": false}, {\"check\": \"control: decoupled equal groups tie\", \"actual\": [[1.0, 0.0, 0.0, 1.0], 1.0, 0], \"expected\": [[1.0, 0.0, 0.0, 1.0], 1.0, 0], \"passed\": true}, {\"check\": \"control: decoupled first dominant smaller group\", \"actual\": [[1.8, 0.0, 0.0, 0.7], 1.8, 0], \"expected\": [[1.8, 0.0, 0.0, 0.7], 1.8, 0], \"passed\": true}, {\"check\": \"control: decoupled second dominant\", \"actual\": [[0.4, 0.0, 0.0, 3.6], 3.6, 1], \"expected\": [[0.4, 0.0, 0.0, 3.6], 3.6, 1], \"passed\": true}, {\"check\": \"regression: one-way coupling\", \"actual\": [[1.0, 0.0, 8.0, 3.0], 3.0, 1], \"expected\": [[1.0, 0.0, 8.0, 3.0], 3.0, 1], \"passed\": true}, {\"check\": \"control: empty population\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.061,"exit_code":0,"observations":[{"actual":[[2.4,0.75,1.4,3.5],4.11297,1],"check":"regression: children and adults","expected":[[2.4,0.75,1.4,3.5],4.11297,1],"passed":true},{"actual":[[1.333333,0.1,3.0,1.35],1.889453,1],"check":"regression: asymmetric core group","expected":[[1.333333,0.1,3.0,1.35],1.889453,1],"passed":true},{"actual":[[1.0,0.0,0.0,1.0],1.0,0],"check":"control: decoupled equal groups tie","expected":[[1.0,0.0,0.0,1.0],1.0,0],"passed":true},{"actual":[[1.8,0.0,0.0,0.7],1.8,0],"check":"control: decoupled first dominant smaller group","expected":[[1.8,0.0,0.0,0.7],1.8,0],"passed":true},{"actual":[[0.4,0.0,0.0,3.6],3.6,1],"check":"control: decoupled second dominant","expected":[[0.4,0.0,0.0,3.6],3.6,1],"passed":true},{"actual":[[1.0,0.0,8.0,3.0],3.0,1],"check":"regression: one-way coupling","expected":[[1.0,0.0,8.0,3.0],3.0,1],"passed":true},{"actual":null,"check":"control: empty population","expected":null,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: children and adults\", \"actual\": [[2.4, 0.75, 1.4, 3.5], 4.11297, 1], \"expected\": [[2.4, 0.75, 1.4, 3.5], 4.11297, 1], \"passed\": true}, {\"check\": \"regression: asymmetric core group\", \"actual\": [[1.333333, 0.1, 3.0, 1.35], 1.889453, 1], \"expected\": [[1.333333, 0.1, 3.0, 1.35], 1.889453, 1], \"passed\": true}, {\"check\": \"control: decoupled equal groups tie\", \"actual\": [[1.0, 0.0, 0.0, 1.0], 1.0, 0], \"expected\": [[1.0, 0.0, 0.0, 1.0], 1.0, 0], \"passed\": true}, {\"check\": \"control: decoupled first dominant smaller group\", \"actual\": [[1.8, 0.0, 0.0, 0.7], 1.8, 0], \"expected\": [[1.8, 0.0, 0.0, 0.7], 1.8, 0], \"passed\": true}, {\"check\": \"control: decoupled second dominant\", \"actual\": [[0.4, 0.0, 0.0, 3.6], 3.6, 1], \"expected\": [[0.4, 0.0, 0.0, 3.6], 3.6, 1], \"passed\": true}, {\"check\": \"regression: one-way coupling\", \"actual\": [[1.0, 0.0, 8.0, 3.0], 3.0, 1], \"expected\": [[1.0, 0.0, 8.0, 3.0], 3.0, 1], \"passed\": true}, {\"check\": \"control: empty population\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}