{"abstract":"Recovery runs substeps times too fast whenever the day is subdivided.","category":"Epidemic compartment models","checks":7,"contract":"Frequency-dependent SIR integrated with forward Euler at dt=1/substeps; new infections per substep are beta*S*I/pop*dt capped at S; peak prevalence and its day are sampled at day ends (day 0 is the seed); return [S, peak I, peak day, R] rounded to 3 decimals, or None for invalid input.","contract_signature":"beta, gamma, pop, i0, days, substeps","evaluation_group":"w2-epidemic-sir-substep","failed_approach":"Using the seed prevalence i0 makes recovery independent of current prevalence.","family":"w2-epidemic-sir-substep-recovery-step-size","id":"FA-64851","implementations":{"attempt":{"sha256":"7b8beed9f06bb4979a44ae398fa269e92a333789a97586e10a2fc666cec51a88","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(beta, gamma, pop, i0, days, substeps):\n    if pop <= 0 or i0 < 0 or i0 > pop or substeps < 1:\n        return None\n    dt = 1.0 / substeps\n    s = float(pop - i0)\n    i = float(i0)\n    r = 0.0\n    peak_i = i\n    peak_day = 0\n    for day in range(1, days + 1):\n        for _ in range(substeps):\n            new_inf = min(beta * s * i / pop * dt, s)\n            new_rec = gamma * i0 * dt\n            s -= new_inf\n            i += new_inf - new_rec\n            r += new_rec\n        if i > peak_i:\n            peak_i = i\n            peak_day = day\n    return [round(s, 3), round(peak_i, 3), peak_day, round(r, 3)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: mild outbreak in 1000', (0.3, 0.1, 1000, 1, 60, 4), [85.915, 303.71, 39, 810.961]),\n  ('regression: fast outbreak daily steps', (0.9, 0.2, 500, 5, 40, 1), [2.433, 249.994, 10, 497.014]),\n  ('regression: subcritical seed decays', (0.08, 0.2, 1000, 10, 20, 2), [984.011, 10.0, 0, 15.167]),\n  ('regression: overshoot-prone large beta single step', (3.0, 0.5, 100, 50, 5, 1), [0.0, 75.0, 1, 95.312]),\n  ('control: boundary zero days', (0.5, 0.1, 100, 3, 0, 2), [97.0, 3.0, 0, 0.0]),\n  ('control: boundary no seed', (0.5, 0.1, 100, 0, 10, 2), [100.0, 0.0, 0, 0.0]),\n  ('control: invalid seed above population', (0.5, 0.1, 100, 150, 10, 2), None)],\n [('regression: overshoot-prone large beta single step', (3.0, 0.5, 100, 50, 5, 1), [0.0, 75.0, 1, 95.312]),\n  ('regression: overshoot-prone large beta two steps', (2.5, 0.3, 200, 80, 6, 2), [0.0, 156.8, 1, 166.339]),\n  ('control: boundary zero days', (0.5, 0.1, 100, 3, 0, 2), [97.0, 3.0, 0, 0.0]),\n  ('control: boundary no seed', (0.5, 0.1, 100, 0, 10, 2), [100.0, 0.0, 0, 0.0]),\n  ('control: invalid seed above population', (0.5, 0.1, 100, 150, 10, 2), None),\n  ('control: invalid zero substeps', (0.5, 0.1, 100, 1, 10, 0), None),\n  ('regression: slow recovery long run', (0.25, 0.05, 2000, 2, 90, 3), [19.331, 965.817, 43, 1829.639])],\n [('control: boundary no seed', (0.5, 0.1, 100, 0, 10, 2), [100.0, 0.0, 0, 0.0]),\n  ('control: invalid seed above population', (0.5, 0.1, 100, 150, 10, 2), None),\n  ('control: invalid zero substeps', (0.5, 0.1, 100, 1, 10, 0), None),\n  ('regression: slow recovery long run', (0.25, 0.05, 2000, 2, 90, 3), [19.331, 965.817, 43, 1829.639]),\n  ('regression: large city fine steps',\n   (0.4, 0.15, 100000, 20, 50, 8),\n   [13105.196, 25867.476, 37, 75829.968]),\n  ('regression: small village', (0.6, 0.25, 50, 1, 30, 2), [5.845, 11.78, 12, 43.206]),\n  ('regression: whole population seeded', (0.5, 0.2, 40, 40, 5, 2), [0.0, 40.0, 0, 26.053])],\n [('control: boundary zero days', (0.5, 0.1, 100, 3, 0, 2), [97.0, 3.0, 0, 0.0]),\n  ('control: boundary no seed', (0.5, 0.1, 100, 0, 10, 2), [100.0, 0.0, 0, 0.0]),\n  ('control: invalid seed above population', (0.5, 0.1, 100, 150, 10, 2), None),\n  ('regression: slow recovery long run', (0.25, 0.05, 2000, 2, 90, 3), [19.331, 965.817, 43, 1829.639]),\n  ('regression: large city fine steps',\n   (0.4, 0.15, 100000, 20, 50, 8),\n   [13105.196, 25867.476, 37, 75829.968]),\n  ('regression: small village', (0.6, 0.25, 50, 1, 30, 2), [5.845, 11.78, 12, 43.206]),\n  ('regression: whole population seeded', (0.5, 0.2, 40, 40, 5, 2), [0.0, 40.0, 0, 26.053])],\n [('regression: mild outbreak in 1000', (0.3, 0.1, 1000, 1, 60, 4), [85.915, 303.71, 39, 810.961]),\n  ('regression: fast outbreak daily steps', (0.9, 0.2, 500, 5, 40, 1), [2.433, 249.994, 10, 497.014]),\n  ('regression: subcritical seed decays', (0.08, 0.2, 1000, 10, 20, 2), [984.011, 10.0, 0, 15.167]),\n  ('control: boundary zero days', (0.5, 0.1, 100, 3, 0, 2), [97.0, 3.0, 0, 0.0]),\n  ('control: boundary no seed', (0.5, 0.1, 100, 0, 10, 2), [100.0, 0.0, 0, 0.0]),\n  ('control: invalid seed above population', (0.5, 0.1, 100, 150, 10, 2), None),\n  ('regression: whole population seeded', (0.5, 0.2, 40, 40, 5, 2), [0.0, 40.0, 0, 26.053])]]\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":"5fbd4abfc8bbd8b37575741dd6d92572cd36ce533e486f648ff20a5f4c4a16b7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(beta, gamma, pop, i0, days, substeps):\n    if pop <= 0 or i0 < 0 or i0 > pop or substeps < 1:\n        return None\n    dt = 1.0 / substeps\n    s = float(pop - i0)\n    i = float(i0)\n    r = 0.0\n    peak_i = i\n    peak_day = 0\n    for day in range(1, days + 1):\n        for _ in range(substeps):\n            new_inf = min(beta * s * i / pop * dt, s)\n            new_rec = gamma * i\n            s -= new_inf\n            i += new_inf - new_rec\n            r += new_rec\n        if i > peak_i:\n            peak_i = i\n            peak_day = day\n    return [round(s, 3), round(peak_i, 3), peak_day, round(r, 3)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: mild outbreak in 1000', (0.3, 0.1, 1000, 1, 60, 4), [85.915, 303.71, 39, 810.961]),\n  ('regression: fast outbreak daily steps', (0.9, 0.2, 500, 5, 40, 1), [2.433, 249.994, 10, 497.014]),\n  ('regression: subcritical seed decays', (0.08, 0.2, 1000, 10, 20, 2), [984.011, 10.0, 0, 15.167]),\n  ('regression: overshoot-prone large beta single step', (3.0, 0.5, 100, 50, 5, 1), [0.0, 75.0, 1, 95.312]),\n  ('control: boundary zero days', (0.5, 0.1, 100, 3, 0, 2), [97.0, 3.0, 0, 0.0]),\n  ('control: boundary no seed', (0.5, 0.1, 100, 0, 10, 2), [100.0, 0.0, 0, 0.0]),\n  ('control: invalid seed above population', (0.5, 0.1, 100, 150, 10, 2), None)],\n [('regression: overshoot-prone large beta single step', (3.0, 0.5, 100, 50, 5, 1), [0.0, 75.0, 1, 95.312]),\n  ('regression: overshoot-prone large beta two steps', (2.5, 0.3, 200, 80, 6, 2), [0.0, 156.8, 1, 166.339]),\n  ('control: boundary zero days', (0.5, 0.1, 100, 3, 0, 2), [97.0, 3.0, 0, 0.0]),\n  ('control: boundary no seed', (0.5, 0.1, 100, 0, 10, 2), [100.0, 0.0, 0, 0.0]),\n  ('control: invalid seed above population', (0.5, 0.1, 100, 150, 10, 2), None),\n  ('control: invalid zero substeps', (0.5, 0.1, 100, 1, 10, 0), None),\n  ('regression: slow recovery long run', (0.25, 0.05, 2000, 2, 90, 3), [19.331, 965.817, 43, 1829.639])],\n [('control: boundary no seed', (0.5, 0.1, 100, 0, 10, 2), [100.0, 0.0, 0, 0.0]),\n  ('control: invalid seed above population', (0.5, 0.1, 100, 150, 10, 2), None),\n  ('control: invalid zero substeps', (0.5, 0.1, 100, 1, 10, 0), None),\n  ('regression: slow recovery long run', (0.25, 0.05, 2000, 2, 90, 3), [19.331, 965.817, 43, 1829.639]),\n  ('regression: large city fine steps',\n   (0.4, 0.15, 100000, 20, 50, 8),\n   [13105.196, 25867.476, 37, 75829.968]),\n  ('regression: small village', (0.6, 0.25, 50, 1, 30, 2), [5.845, 11.78, 12, 43.206]),\n  ('regression: whole population seeded', (0.5, 0.2, 40, 40, 5, 2), [0.0, 40.0, 0, 26.053])],\n [('control: boundary zero days', (0.5, 0.1, 100, 3, 0, 2), [97.0, 3.0, 0, 0.0]),\n  ('control: boundary no seed', (0.5, 0.1, 100, 0, 10, 2), [100.0, 0.0, 0, 0.0]),\n  ('control: invalid seed above population', (0.5, 0.1, 100, 150, 10, 2), None),\n  ('regression: slow recovery long run', (0.25, 0.05, 2000, 2, 90, 3), [19.331, 965.817, 43, 1829.639]),\n  ('regression: large city fine steps',\n   (0.4, 0.15, 100000, 20, 50, 8),\n   [13105.196, 25867.476, 37, 75829.968]),\n  ('regression: small village', (0.6, 0.25, 50, 1, 30, 2), [5.845, 11.78, 12, 43.206]),\n  ('regression: whole population seeded', (0.5, 0.2, 40, 40, 5, 2), [0.0, 40.0, 0, 26.053])],\n [('regression: mild outbreak in 1000', (0.3, 0.1, 1000, 1, 60, 4), [85.915, 303.71, 39, 810.961]),\n  ('regression: fast outbreak daily steps', (0.9, 0.2, 500, 5, 40, 1), [2.433, 249.994, 10, 497.014]),\n  ('regression: subcritical seed decays', (0.08, 0.2, 1000, 10, 20, 2), [984.011, 10.0, 0, 15.167]),\n  ('control: boundary zero days', (0.5, 0.1, 100, 3, 0, 2), [97.0, 3.0, 0, 0.0]),\n  ('control: boundary no seed', (0.5, 0.1, 100, 0, 10, 2), [100.0, 0.0, 0, 0.0]),\n  ('control: invalid seed above population', (0.5, 0.1, 100, 150, 10, 2), None),\n  ('regression: whole population seeded', (0.5, 0.2, 40, 40, 5, 2), [0.0, 40.0, 0, 26.053])]]\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-sir-substep-recovery-step-size","generated_at":"2026-09-29T14:47:28.691005+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.","root_cause":"The recovery flow omits the dt factor while infection applies it.","sha256":"436d5964ba9a4a7a0ce10e384345e421dbcab3ed095f785227166692b5253e9c","title":"SIR Euler integrator with daily sampling: recovery step size · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":43.94,"exit_code":1,"observations":[{"actual":[0.021,994.557,51,6.0],"check":"regression: mild outbreak in 1000","expected":[85.915,303.71,39,810.961],"passed":false},{"actual":[0.0,487.812,12,40.0],"check":"regression: fast outbreak daily steps","expected":[2.433,249.994,10,497.014],"passed":false},{"actual":[1007.013,10.0,0,40.0],"check":"regression: subcritical seed decays","expected":[984.011,10.0,0,15.167],"passed":false},{"actual":[0.0,75.0,1,125.0],"check":"regression: overshoot-prone large beta single step","expected":[0.0,75.0,1,95.312],"passed":false},{"actual":[97.0,3.0,0,0.0],"check":"control: boundary zero days","expected":[97.0,3.0,0,0.0],"passed":true},{"actual":[100.0,0.0,0,0.0],"check":"control: boundary no seed","expected":[100.0,0.0,0,0.0],"passed":true},{"actual":null,"check":"control: invalid seed above population","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: mild outbreak in 1000\", \"actual\": [0.021, 994.557, 51, 6.0], \"expected\": [85.915, 303.71, 39, 810.961], \"passed\": false}, {\"check\": \"regression: fast outbreak daily steps\", \"actual\": [0.0, 487.812, 12, 40.0], \"expected\": [2.433, 249.994, 10, 497.014], \"passed\": false}, {\"check\": \"regression: subcritical seed decays\", \"actual\": [1007.013, 10.0, 0, 40.0], \"expected\": [984.011, 10.0, 0, 15.167], \"passed\": false}, {\"check\": \"regression: overshoot-prone large beta single step\", \"actual\": [0.0, 75.0, 1, 125.0], \"expected\": [0.0, 75.0, 1, 95.312], \"passed\": false}, {\"check\": \"control: boundary zero days\", \"actual\": [97.0, 3.0, 0, 0.0], \"expected\": [97.0, 3.0, 0, 0.0], \"passed\": true}, {\"check\": \"control: boundary no seed\", \"actual\": [100.0, 0.0, 0, 0.0], \"expected\": [100.0, 0.0, 0, 0.0], \"passed\": true}, {\"check\": \"control: invalid seed above population\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.207,"exit_code":1,"observations":[{"actual":[996.036,1.0,0,3.962],"check":"regression: mild outbreak in 1000","expected":[85.915,303.71,39,810.961],"passed":false},{"actual":[2.433,249.994,10,497.014],"check":"regression: fast outbreak daily steps","expected":[2.433,249.994,10,497.014],"passed":true},{"actual":[987.537,10.0,0,12.454],"check":"regression: subcritical seed decays","expected":[984.011,10.0,0,15.167],"passed":false},{"actual":[0.0,75.0,1,95.312],"check":"regression: overshoot-prone large beta single step","expected":[0.0,75.0,1,95.312],"passed":true},{"actual":[97.0,3.0,0,0.0],"check":"control: boundary zero days","expected":[97.0,3.0,0,0.0],"passed":true},{"actual":[100.0,0.0,0,0.0],"check":"control: boundary no seed","expected":[100.0,0.0,0,0.0],"passed":true},{"actual":null,"check":"control: invalid seed above population","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: mild outbreak in 1000\", \"actual\": [996.036, 1.0, 0, 3.962], \"expected\": [85.915, 303.71, 39, 810.961], \"passed\": false}, {\"check\": \"regression: fast outbreak daily steps\", \"actual\": [2.433, 249.994, 10, 497.014], \"expected\": [2.433, 249.994, 10, 497.014], \"passed\": true}, {\"check\": \"regression: subcritical seed decays\", \"actual\": [987.537, 10.0, 0, 12.454], \"expected\": [984.011, 10.0, 0, 15.167], \"passed\": false}, {\"check\": \"regression: overshoot-prone large beta single step\", \"actual\": [0.0, 75.0, 1, 95.312], \"expected\": [0.0, 75.0, 1, 95.312], \"passed\": true}, {\"check\": \"control: boundary zero days\", \"actual\": [97.0, 3.0, 0, 0.0], \"expected\": [97.0, 3.0, 0, 0.0], \"passed\": true}, {\"check\": \"control: boundary no seed\", \"actual\": [100.0, 0.0, 0, 0.0], \"expected\": [100.0, 0.0, 0, 0.0], \"passed\": true}, {\"check\": \"control: invalid seed above population\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}