{"abstract":"Peak days are reported one day early and the run stops one day short in its own numbering.","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":"Starting at day 1 but stopping at days-1 still simulates one day too few.","family":"w2-epidemic-sir-substep-day-indexing","id":"FA-64856","implementations":{"attempt":{"sha256":"f333de954911180167ebd938b173b5d74ff737b0530ef6ac27cc404c1fbe3b61","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):\n        for _ in range(substeps):\n            new_inf = min(beta * s * i / pop * dt, s)\n            new_rec = gamma * i * 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":"9d0eaf7d0694611ce939ab9f11e0df4566dc3a817504aec0bc46055d293fc7ce","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(days):\n        for _ in range(substeps):\n            new_inf = min(beta * s * i / pop * dt, s)\n            new_rec = gamma * i * 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"}},"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-day-indexing","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 day loop is zero-based although day 0 is reserved for the seed state.","sha256":"b2547fdcb3bec8533f515ef4725ee9a9ac7668345b4e1469477417735e36fcd3","title":"SIR Euler integrator with daily sampling: day indexing · 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":41.426,"exit_code":1,"observations":[{"actual":[88.758,303.71,39,800.155],"check":"regression: mild outbreak in 1000","expected":[85.915,303.71,39,810.961],"passed":false},{"actual":[2.436,249.994,10,496.876],"check":"regression: fast outbreak daily steps","expected":[2.433,249.994,10,497.014],"passed":false},{"actual":[984.083,10.0,0,14.986],"check":"regression: subcritical seed decays","expected":[984.011,10.0,0,15.167],"passed":false},{"actual":[0.0,75.0,1,90.625],"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\": [88.758, 303.71, 39, 800.155], \"expected\": [85.915, 303.71, 39, 810.961], \"passed\": false}, {\"check\": \"regression: fast outbreak daily steps\", \"actual\": [2.436, 249.994, 10, 496.876], \"expected\": [2.433, 249.994, 10, 497.014], \"passed\": false}, {\"check\": \"regression: subcritical seed decays\", \"actual\": [984.083, 10.0, 0, 14.986], \"expected\": [984.011, 10.0, 0, 15.167], \"passed\": false}, {\"check\": \"regression: overshoot-prone large beta single step\", \"actual\": [0.0, 75.0, 1, 90.625], \"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":42.55,"exit_code":1,"observations":[{"actual":[85.915,303.71,38,810.961],"check":"regression: mild outbreak in 1000","expected":[85.915,303.71,39,810.961],"passed":false},{"actual":[2.433,249.994,9,497.014],"check":"regression: fast outbreak daily steps","expected":[2.433,249.994,10,497.014],"passed":false},{"actual":[984.011,10.0,0,15.167],"check":"regression: subcritical seed decays","expected":[984.011,10.0,0,15.167],"passed":true},{"actual":[0.0,75.0,0,95.312],"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\": [85.915, 303.71, 38, 810.961], \"expected\": [85.915, 303.71, 39, 810.961], \"passed\": false}, {\"check\": \"regression: fast outbreak daily steps\", \"actual\": [2.433, 249.994, 9, 497.014], \"expected\": [2.433, 249.994, 10, 497.014], \"passed\": false}, {\"check\": \"regression: subcritical seed decays\", \"actual\": [984.011, 10.0, 0, 15.167], \"expected\": [984.011, 10.0, 0, 15.167], \"passed\": true}, {\"check\": \"regression: overshoot-prone large beta single step\", \"actual\": [0.0, 75.0, 0, 95.312], \"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"}},"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."}}