FA-65386 / Ecological population dynamics / Open access
Beverton-Holt recruitment convergence: equilibrium branch · case 01
Declining stocks are judged against carrying capacity and never converge.
ROOT CAUSE
The equilibrium ignores the r0<=1 extinction branch.
VERIFIED REPAIR
Restore the equilibrium branch rule: `eq = float(k) if r0 > 1 else 0.0`.
Unsuccessful approach: Including r0=1 in the persistence branch contradicts the stipulated extinction equilibrium.
Case contract
N[t+1] = r0*N/(1+(r0-1)*N/K); equilibrium K if r0>1 else 0; band = 0.01*K; hit = first year (0 = start) with |N-eq|<=band, else None; return [trajectory rounded 4, equilibrium, hit]; None for invalid inputs.
Why this case matters
Population projections set harvest quotas, conservation status and pest-control timing; a wrong update order, boundary or rate conversion silently changes management advice.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(n0, r0, k, years):
if k <= 0 or r0 <= 0 or n0 < 0:
return None
eq = float(k)
band = 0.01 * k
n = float(n0)
traj = []
hit = 0 if abs(n - eq) <= band else None
for year in range(1, years + 1):
n = r0 * n / (1 + (r0 - 1) * n / k)
traj.append(round(n, 4))
if hit is None and abs(n - eq) <= band:
hit = year
return [traj, eq, hit]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control: herring recruitment',
(50, 3.0, 1000, 10),
[[136.3636, 321.4286, 586.9565, 810.0, 927.4809, 974.5989, 991.3871, 997.1125, 999.0356, 999.6783],
1000.0,
7]),
('control: slow approach',
(10, 1.5, 500, 12),
[[14.8515,
21.9512,
32.2196,
46.8208,
67.09,
94.3079,
129.2706,
171.709,
219.8186,
270.309,
319.1849,
362.9343],
500.0,
None]),
('control: start at capacity', (1000, 2.0, 1000, 4), [[1000.0, 1000.0, 1000.0, 1000.0], 1000.0, 0]),
('control: start within band', (995, 2.0, 1000, 3), [[997.4937, 998.7453, 999.3723], 1000.0, 0]),
('regression: replacement r0 one', (200, 1.0, 1000, 4), [[200.0, 200.0, 200.0, 200.0], 0.0, None]),
('regression: declining r0 half',
(400, 0.5, 1000, 8),
[[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7]),
('control: above capacity',
(3000, 2.5, 1000, 6),
[[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5])],
[('control: start within band', (995, 2.0, 1000, 3), [[997.4937, 998.7453, 999.3723], 1000.0, 0]),
('regression: replacement r0 one', (200, 1.0, 1000, 4), [[200.0, 200.0, 200.0, 200.0], 0.0, None]),
('regression: declining r0 half',
(400, 0.5, 1000, 8),
[[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7]),
('control: above capacity',
(3000, 2.5, 1000, 6),
[[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5]),
('control: invalid r0', (100, 0.0, 1000, 5), None),
('control: never reaches band', (1, 1.2, 10000, 5), [[1.2, 1.4399, 1.7279, 2.0734, 2.4879], 10000.0, None]),
('control: one year from band',
(985, 2.0, 1000, 4),
[[992.4433, 996.2073, 998.1001, 999.0491], 1000.0, 1])],
[('regression: replacement r0 one', (200, 1.0, 1000, 4), [[200.0, 200.0, 200.0, 200.0], 0.0, None]),
('regression: declining r0 half',
(400, 0.5, 1000, 8),
[[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7]),
('control: above capacity',
(3000, 2.5, 1000, 6),
[[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5]),
('control: invalid r0', (100, 0.0, 1000, 5), None),
('control: never reaches band', (1, 1.2, 10000, 5), [[1.2, 1.4399, 1.7279, 2.0734, 2.4879], 10000.0, None]),
('control: one year from band', (985, 2.0, 1000, 4), [[992.4433, 996.2073, 998.1001, 999.0491], 1000.0, 1]),
('control: small capacity',
(2, 4.0, 20, 6),
[[6.1538, 12.8, 17.5342, 19.3208, 19.8258, 19.9562], 20.0, 5])],
[('control: herring recruitment',
(50, 3.0, 1000, 10),
[[136.3636, 321.4286, 586.9565, 810.0, 927.4809, 974.5989, 991.3871, 997.1125, 999.0356, 999.6783],
1000.0,
7]),
('control: slow approach',
(10, 1.5, 500, 12),
[[14.8515,
21.9512,
32.2196,
46.8208,
67.09,
94.3079,
129.2706,
171.709,
219.8186,
270.309,
319.1849,
362.9343],
500.0,
None]),
('control: start at capacity', (1000, 2.0, 1000, 4), [[1000.0, 1000.0, 1000.0, 1000.0], 1000.0, 0]),
('regression: replacement r0 one', (200, 1.0, 1000, 4), [[200.0, 200.0, 200.0, 200.0], 0.0, None]),
('regression: declining r0 half',
(400, 0.5, 1000, 8),
[[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7]),
('control: one year from band', (985, 2.0, 1000, 4), [[992.4433, 996.2073, 998.1001, 999.0491], 1000.0, 1]),
('control: small capacity',
(2, 4.0, 20, 6),
[[6.1538, 12.8, 17.5342, 19.3208, 19.8258, 19.9562], 20.0, 5])],
[('control: slow approach',
(10, 1.5, 500, 12),
[[14.8515,
21.9512,
32.2196,
46.8208,
67.09,
94.3079,
129.2706,
171.709,
219.8186,
270.309,
319.1849,
362.9343],
500.0,
None]),
('control: start at capacity', (1000, 2.0, 1000, 4), [[1000.0, 1000.0, 1000.0, 1000.0], 1000.0, 0]),
('control: start within band', (995, 2.0, 1000, 3), [[997.4937, 998.7453, 999.3723], 1000.0, 0]),
('regression: replacement r0 one', (200, 1.0, 1000, 4), [[200.0, 200.0, 200.0, 200.0], 0.0, None]),
('regression: declining r0 half',
(400, 0.5, 1000, 8),
[[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7]),
('control: above capacity',
(3000, 2.5, 1000, 6),
[[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5]),
('control: invalid r0', (100, 0.0, 1000, 5), None)]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| control: herring recruitment | [[136.3636, 321.4286, 586.9565, 810.0, 927.4809, 974.5989, 991.3871, 997.1125, 999.0356, 999.6783], 1000.0, 7] | [[136.3636, 321.4286, 586.9565, 810.0, 927.4809, 974.5989, 991.3871, 997.1125, 999.0356, 999.6783], 1000.0, 7] | Passed |
| control: slow approach | [[14.8515, 21.9512, 32.2196, 46.8208, 67.09, 94.3079, 129.2706, 171.709, 219.8186, 270.309, 319.1849, 362.9343], 500.0, None] | [[14.8515, 21.9512, 32.2196, 46.8208, 67.09, 94.3079, 129.2706, 171.709, 219.8186, 270.309, 319.1849, 362.9343], 500.0, None] | Passed |
| control: start at capacity | [[1000.0, 1000.0, 1000.0, 1000.0], 1000.0, 0] | [[1000.0, 1000.0, 1000.0, 1000.0], 1000.0, 0] | Passed |
| control: start within band | [[997.4937, 998.7453, 999.3723], 1000.0, 0] | [[997.4937, 998.7453, 999.3723], 1000.0, 0] | Passed |
| regression: replacement r0 one | [[200.0, 200.0, 200.0, 200.0], 1000.0, None] | [[200.0, 200.0, 200.0, 200.0], 0.0, None] | Failed |
| regression: declining r0 half | [[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 1000.0, None] | [[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7] | Failed |
| control: above capacity | [[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5] | [[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5] | Passed |
SHA-256 / 158e04dce781f59ab7097027da0428ffcf3be802c0660da04b25e06a918962ee
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(n0, r0, k, years):
if k <= 0 or r0 <= 0 or n0 < 0:
return None
eq = float(k) if r0 >= 1 else 0.0
band = 0.01 * k
n = float(n0)
traj = []
hit = 0 if abs(n - eq) <= band else None
for year in range(1, years + 1):
n = r0 * n / (1 + (r0 - 1) * n / k)
traj.append(round(n, 4))
if hit is None and abs(n - eq) <= band:
hit = year
return [traj, eq, hit]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control: herring recruitment',
(50, 3.0, 1000, 10),
[[136.3636, 321.4286, 586.9565, 810.0, 927.4809, 974.5989, 991.3871, 997.1125, 999.0356, 999.6783],
1000.0,
7]),
('control: slow approach',
(10, 1.5, 500, 12),
[[14.8515,
21.9512,
32.2196,
46.8208,
67.09,
94.3079,
129.2706,
171.709,
219.8186,
270.309,
319.1849,
362.9343],
500.0,
None]),
('control: start at capacity', (1000, 2.0, 1000, 4), [[1000.0, 1000.0, 1000.0, 1000.0], 1000.0, 0]),
('control: start within band', (995, 2.0, 1000, 3), [[997.4937, 998.7453, 999.3723], 1000.0, 0]),
('regression: replacement r0 one', (200, 1.0, 1000, 4), [[200.0, 200.0, 200.0, 200.0], 0.0, None]),
('regression: declining r0 half',
(400, 0.5, 1000, 8),
[[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7]),
('control: above capacity',
(3000, 2.5, 1000, 6),
[[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5])],
[('control: start within band', (995, 2.0, 1000, 3), [[997.4937, 998.7453, 999.3723], 1000.0, 0]),
('regression: replacement r0 one', (200, 1.0, 1000, 4), [[200.0, 200.0, 200.0, 200.0], 0.0, None]),
('regression: declining r0 half',
(400, 0.5, 1000, 8),
[[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7]),
('control: above capacity',
(3000, 2.5, 1000, 6),
[[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5]),
('control: invalid r0', (100, 0.0, 1000, 5), None),
('control: never reaches band', (1, 1.2, 10000, 5), [[1.2, 1.4399, 1.7279, 2.0734, 2.4879], 10000.0, None]),
('control: one year from band',
(985, 2.0, 1000, 4),
[[992.4433, 996.2073, 998.1001, 999.0491], 1000.0, 1])],
[('regression: replacement r0 one', (200, 1.0, 1000, 4), [[200.0, 200.0, 200.0, 200.0], 0.0, None]),
('regression: declining r0 half',
(400, 0.5, 1000, 8),
[[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7]),
('control: above capacity',
(3000, 2.5, 1000, 6),
[[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5]),
('control: invalid r0', (100, 0.0, 1000, 5), None),
('control: never reaches band', (1, 1.2, 10000, 5), [[1.2, 1.4399, 1.7279, 2.0734, 2.4879], 10000.0, None]),
('control: one year from band', (985, 2.0, 1000, 4), [[992.4433, 996.2073, 998.1001, 999.0491], 1000.0, 1]),
('control: small capacity',
(2, 4.0, 20, 6),
[[6.1538, 12.8, 17.5342, 19.3208, 19.8258, 19.9562], 20.0, 5])],
[('control: herring recruitment',
(50, 3.0, 1000, 10),
[[136.3636, 321.4286, 586.9565, 810.0, 927.4809, 974.5989, 991.3871, 997.1125, 999.0356, 999.6783],
1000.0,
7]),
('control: slow approach',
(10, 1.5, 500, 12),
[[14.8515,
21.9512,
32.2196,
46.8208,
67.09,
94.3079,
129.2706,
171.709,
219.8186,
270.309,
319.1849,
362.9343],
500.0,
None]),
('control: start at capacity', (1000, 2.0, 1000, 4), [[1000.0, 1000.0, 1000.0, 1000.0], 1000.0, 0]),
('regression: replacement r0 one', (200, 1.0, 1000, 4), [[200.0, 200.0, 200.0, 200.0], 0.0, None]),
('regression: declining r0 half',
(400, 0.5, 1000, 8),
[[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7]),
('control: one year from band', (985, 2.0, 1000, 4), [[992.4433, 996.2073, 998.1001, 999.0491], 1000.0, 1]),
('control: small capacity',
(2, 4.0, 20, 6),
[[6.1538, 12.8, 17.5342, 19.3208, 19.8258, 19.9562], 20.0, 5])],
[('control: slow approach',
(10, 1.5, 500, 12),
[[14.8515,
21.9512,
32.2196,
46.8208,
67.09,
94.3079,
129.2706,
171.709,
219.8186,
270.309,
319.1849,
362.9343],
500.0,
None]),
('control: start at capacity', (1000, 2.0, 1000, 4), [[1000.0, 1000.0, 1000.0, 1000.0], 1000.0, 0]),
('control: start within band', (995, 2.0, 1000, 3), [[997.4937, 998.7453, 999.3723], 1000.0, 0]),
('regression: replacement r0 one', (200, 1.0, 1000, 4), [[200.0, 200.0, 200.0, 200.0], 0.0, None]),
('regression: declining r0 half',
(400, 0.5, 1000, 8),
[[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7]),
('control: above capacity',
(3000, 2.5, 1000, 6),
[[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5]),
('control: invalid r0', (100, 0.0, 1000, 5), None)]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| control: herring recruitment | [[136.3636, 321.4286, 586.9565, 810.0, 927.4809, 974.5989, 991.3871, 997.1125, 999.0356, 999.6783], 1000.0, 7] | [[136.3636, 321.4286, 586.9565, 810.0, 927.4809, 974.5989, 991.3871, 997.1125, 999.0356, 999.6783], 1000.0, 7] | Passed |
| control: slow approach | [[14.8515, 21.9512, 32.2196, 46.8208, 67.09, 94.3079, 129.2706, 171.709, 219.8186, 270.309, 319.1849, 362.9343], 500.0, None] | [[14.8515, 21.9512, 32.2196, 46.8208, 67.09, 94.3079, 129.2706, 171.709, 219.8186, 270.309, 319.1849, 362.9343], 500.0, None] | Passed |
| control: start at capacity | [[1000.0, 1000.0, 1000.0, 1000.0], 1000.0, 0] | [[1000.0, 1000.0, 1000.0, 1000.0], 1000.0, 0] | Passed |
| control: start within band | [[997.4937, 998.7453, 999.3723], 1000.0, 0] | [[997.4937, 998.7453, 999.3723], 1000.0, 0] | Passed |
| regression: replacement r0 one | [[200.0, 200.0, 200.0, 200.0], 1000.0, None] | [[200.0, 200.0, 200.0, 200.0], 0.0, None] | Failed |
| regression: declining r0 half | [[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7] | [[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7] | Passed |
| control: above capacity | [[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5] | [[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5] | Passed |
SHA-256 / 7282fc16e4dfa06f08a52dab173a08e454eead16c947d0f16370fefcf30f3300
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(n0, r0, k, years):
if k <= 0 or r0 <= 0 or n0 < 0:
return None
eq = float(k) if r0 > 1 else 0.0
band = 0.01 * k
n = float(n0)
traj = []
hit = 0 if abs(n - eq) <= band else None
for year in range(1, years + 1):
n = r0 * n / (1 + (r0 - 1) * n / k)
traj.append(round(n, 4))
if hit is None and abs(n - eq) <= band:
hit = year
return [traj, eq, hit]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control: herring recruitment',
(50, 3.0, 1000, 10),
[[136.3636, 321.4286, 586.9565, 810.0, 927.4809, 974.5989, 991.3871, 997.1125, 999.0356, 999.6783],
1000.0,
7]),
('control: slow approach',
(10, 1.5, 500, 12),
[[14.8515,
21.9512,
32.2196,
46.8208,
67.09,
94.3079,
129.2706,
171.709,
219.8186,
270.309,
319.1849,
362.9343],
500.0,
None]),
('control: start at capacity', (1000, 2.0, 1000, 4), [[1000.0, 1000.0, 1000.0, 1000.0], 1000.0, 0]),
('control: start within band', (995, 2.0, 1000, 3), [[997.4937, 998.7453, 999.3723], 1000.0, 0]),
('regression: replacement r0 one', (200, 1.0, 1000, 4), [[200.0, 200.0, 200.0, 200.0], 0.0, None]),
('regression: declining r0 half',
(400, 0.5, 1000, 8),
[[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7]),
('control: above capacity',
(3000, 2.5, 1000, 6),
[[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5])],
[('control: start within band', (995, 2.0, 1000, 3), [[997.4937, 998.7453, 999.3723], 1000.0, 0]),
('regression: replacement r0 one', (200, 1.0, 1000, 4), [[200.0, 200.0, 200.0, 200.0], 0.0, None]),
('regression: declining r0 half',
(400, 0.5, 1000, 8),
[[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7]),
('control: above capacity',
(3000, 2.5, 1000, 6),
[[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5]),
('control: invalid r0', (100, 0.0, 1000, 5), None),
('control: never reaches band', (1, 1.2, 10000, 5), [[1.2, 1.4399, 1.7279, 2.0734, 2.4879], 10000.0, None]),
('control: one year from band',
(985, 2.0, 1000, 4),
[[992.4433, 996.2073, 998.1001, 999.0491], 1000.0, 1])],
[('regression: replacement r0 one', (200, 1.0, 1000, 4), [[200.0, 200.0, 200.0, 200.0], 0.0, None]),
('regression: declining r0 half',
(400, 0.5, 1000, 8),
[[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7]),
('control: above capacity',
(3000, 2.5, 1000, 6),
[[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5]),
('control: invalid r0', (100, 0.0, 1000, 5), None),
('control: never reaches band', (1, 1.2, 10000, 5), [[1.2, 1.4399, 1.7279, 2.0734, 2.4879], 10000.0, None]),
('control: one year from band', (985, 2.0, 1000, 4), [[992.4433, 996.2073, 998.1001, 999.0491], 1000.0, 1]),
('control: small capacity',
(2, 4.0, 20, 6),
[[6.1538, 12.8, 17.5342, 19.3208, 19.8258, 19.9562], 20.0, 5])],
[('control: herring recruitment',
(50, 3.0, 1000, 10),
[[136.3636, 321.4286, 586.9565, 810.0, 927.4809, 974.5989, 991.3871, 997.1125, 999.0356, 999.6783],
1000.0,
7]),
('control: slow approach',
(10, 1.5, 500, 12),
[[14.8515,
21.9512,
32.2196,
46.8208,
67.09,
94.3079,
129.2706,
171.709,
219.8186,
270.309,
319.1849,
362.9343],
500.0,
None]),
('control: start at capacity', (1000, 2.0, 1000, 4), [[1000.0, 1000.0, 1000.0, 1000.0], 1000.0, 0]),
('regression: replacement r0 one', (200, 1.0, 1000, 4), [[200.0, 200.0, 200.0, 200.0], 0.0, None]),
('regression: declining r0 half',
(400, 0.5, 1000, 8),
[[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7]),
('control: one year from band', (985, 2.0, 1000, 4), [[992.4433, 996.2073, 998.1001, 999.0491], 1000.0, 1]),
('control: small capacity',
(2, 4.0, 20, 6),
[[6.1538, 12.8, 17.5342, 19.3208, 19.8258, 19.9562], 20.0, 5])],
[('control: slow approach',
(10, 1.5, 500, 12),
[[14.8515,
21.9512,
32.2196,
46.8208,
67.09,
94.3079,
129.2706,
171.709,
219.8186,
270.309,
319.1849,
362.9343],
500.0,
None]),
('control: start at capacity', (1000, 2.0, 1000, 4), [[1000.0, 1000.0, 1000.0, 1000.0], 1000.0, 0]),
('control: start within band', (995, 2.0, 1000, 3), [[997.4937, 998.7453, 999.3723], 1000.0, 0]),
('regression: replacement r0 one', (200, 1.0, 1000, 4), [[200.0, 200.0, 200.0, 200.0], 0.0, None]),
('regression: declining r0 half',
(400, 0.5, 1000, 8),
[[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7]),
('control: above capacity',
(3000, 2.5, 1000, 6),
[[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5]),
('control: invalid r0', (100, 0.0, 1000, 5), None)]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| control: herring recruitment | [[136.3636, 321.4286, 586.9565, 810.0, 927.4809, 974.5989, 991.3871, 997.1125, 999.0356, 999.6783], 1000.0, 7] | [[136.3636, 321.4286, 586.9565, 810.0, 927.4809, 974.5989, 991.3871, 997.1125, 999.0356, 999.6783], 1000.0, 7] | Passed |
| control: slow approach | [[14.8515, 21.9512, 32.2196, 46.8208, 67.09, 94.3079, 129.2706, 171.709, 219.8186, 270.309, 319.1849, 362.9343], 500.0, None] | [[14.8515, 21.9512, 32.2196, 46.8208, 67.09, 94.3079, 129.2706, 171.709, 219.8186, 270.309, 319.1849, 362.9343], 500.0, None] | Passed |
| control: start at capacity | [[1000.0, 1000.0, 1000.0, 1000.0], 1000.0, 0] | [[1000.0, 1000.0, 1000.0, 1000.0], 1000.0, 0] | Passed |
| control: start within band | [[997.4937, 998.7453, 999.3723], 1000.0, 0] | [[997.4937, 998.7453, 999.3723], 1000.0, 0] | Passed |
| regression: replacement r0 one | [[200.0, 200.0, 200.0, 200.0], 0.0, None] | [[200.0, 200.0, 200.0, 200.0], 0.0, None] | Passed |
| regression: declining r0 half | [[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7] | [[250.0, 142.8571, 76.9231, 40.0, 20.4082, 10.3093, 5.1813, 2.5974], 0.0, 7] | Passed |
| control: above capacity | [[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5] | [[1363.6364, 1119.403, 1044.5682, 1017.363, 1006.8736, 1002.7381], 1000.0, 5] | Passed |
SHA-256 / b3072720de340a939b6eec88db56cd71b80dc439ba02ac2644eee6e0997d816f
Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:47:33.397401+00:00.
Case digest / d6759f48c3550a2f468393ae72c1433e3fb7348005311eb7a069e9fecddcd861