{"abstract":"Strong cross-coupling lowers R0 instead of raising it.","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":"Assuming a symmetric K squares one off-diagonal entry.","family":"w2-epidemic-two-group-ngm-determinant-sign","id":"FA-65016","implementations":{"attempt":{"sha256":"5dea4a66ee3f5f2b2f063d8cc0c6718709a47daca2d6bcafb08d4caae2ca8c07","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[0][1]\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  ('control: 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  ('control: 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  ('control: 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":"349a7cfad3d4349e6c61d4f842b265fbe89ba580b7f3eb208b9534f8bcbcc813","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  ('control: 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  ('control: 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  ('control: 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":"9a50640595744f3552f66b7e2b1927445d01446031d7b5a5b142b87aef69ab02","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  ('control: 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  ('control: 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  ('control: 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-determinant-sign","generated_at":"2026-09-29T14:47:30.089316+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 determinant sign rule: `det = k[0][0] * k[1][1] - k[0][1] * k[1][0]`.","root_cause":"The off-diagonal product is added to the determinant.","sha256":"e24eb23b9cb02099fd472513bf2c3fc726b6ca671baace64cb0ac5adea683dfa","title":"Two-group next-generation matrix R0: determinant sign · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.969,"exit_code":1,"observations":[{"actual":[[2.4,0.75,1.4,3.5],3.880054,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.442013,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],3.0,1],"check":"control: 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.880054, 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.442013, 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\": \"control: 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"},"broken":{"elapsed_ms":42.235,"exit_code":1,"observations":[{"actual":[[2.4,0.75,1.4,3.5],2.95,0],"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.341667,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":"control: 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], 2.95, 0], \"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.341667, 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\": \"control: 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":38.343,"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":"control: 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\": \"control: 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"}