FA-65461 / Ecological population dynamics / Open access
Leslie matrix projection with optional plus group: plus group retention · case 01
The plus group loses all incoming recruits from the previous class.
ROOT CAUSE
Plus-group survivors overwrite the individuals ageing into the last class.
VERIFIED REPAIR
Restore the plus group retention rule: `new[m - 1] += survival[m - 1] * n[m - 1]`.
Unsuccessful approach: Retaining the plus group without mortality makes old animals immortal.
Case contract
Births new[0] = sum f_i*n_i; survivors new[i+1] = s_i*n_i; with plus_group the last class also retains s_last*n_last; ratio is total(t)/total(t-1) of the final year (None if the previous total was 0 or no years); return [final vector rounded 4, total rounded 4, ratio rounded 6].
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(fecundity, survival, n0, years, plus_group):
m = len(n0)
n = [float(x) for x in n0]
ratio = None
prev_total = sum(n)
for _ in range(years):
new = [0.0] * m
new[0] = sum(fecundity[i] * n[i] for i in range(m))
for i in range(m - 1):
new[i + 1] = survival[i] * n[i]
if plus_group:
new[m - 1] = survival[m - 1] * n[m - 1]
prev_total = sum(n)
n = new
ratio = sum(n) / prev_total if prev_total > 0 else None
return [[round(x, 4) for x in n], round(sum(n), 4), None if ratio is None else round(ratio, 6)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control: three-class bird',
([0.0, 1.2, 1.8], [0.4, 0.7], [100, 50, 20], 3, False),
[[96.48, 44.4, 26.88], 167.76, 0.94566]),
('regression: plus group fish',
([0.0, 0.5, 2.0], [0.5, 0.6, 0.8], [200, 80, 40], 4, True),
[[322.9, 139.0, 171.16], 633.06, 1.221652]),
('control: extinct population', ([0.0, 1.0], [0.5], [0, 0], 2, False), [[0.0, 0.0], 0.0, None]),
('control: zero years', ([0.0, 1.0], [0.5], [10, 10], 0, False), [[10.0, 10.0], 20.0, None]),
('regression: juvenile breeders',
([0.3, 0.9, 1.1], [0.6, 0.5, 0.2], [50, 30, 10], 3, True),
[[67.34, 36.96, 19.58], 123.88, 1.10805]),
('control: single step',
([0.2, 1.5, 0.0], [0.8, 0.3], [10, 20, 30], 1, False),
[[32.0, 8.0, 6.0], 46.0, 0.766667]),
('regression: senescent plus group',
([0.0, 0.0, 3.0], [0.9, 0.9, 0.5], [0, 0, 10], 3, True),
[[7.5, 13.5, 25.55], 46.55, 1.046067])],
[('control: three-class bird',
([0.0, 1.2, 1.8], [0.4, 0.7], [100, 50, 20], 3, False),
[[96.48, 44.4, 26.88], 167.76, 0.94566]),
('regression: plus group fish',
([0.0, 0.5, 2.0], [0.5, 0.6, 0.8], [200, 80, 40], 4, True),
[[322.9, 139.0, 171.16], 633.06, 1.221652]),
('control: zero years', ([0.0, 1.0], [0.5], [10, 10], 0, False), [[10.0, 10.0], 20.0, None]),
('regression: juvenile breeders',
([0.3, 0.9, 1.1], [0.6, 0.5, 0.2], [50, 30, 10], 3, True),
[[67.34, 36.96, 19.58], 123.88, 1.10805]),
('control: single step',
([0.2, 1.5, 0.0], [0.8, 0.3], [10, 20, 30], 1, False),
[[32.0, 8.0, 6.0], 46.0, 0.766667]),
('regression: senescent plus group',
([0.0, 0.0, 3.0], [0.9, 0.9, 0.5], [0, 0, 10], 3, True),
[[7.5, 13.5, 25.55], 46.55, 1.046067]),
('control: four classes',
([0.0, 0.0, 1.0, 2.0], [0.5, 0.6, 0.7], [40, 30, 20, 10], 5, False),
[[30.6, 14.4, 11.16, 9.66], 65.82, 0.94569])],
[('control: three-class bird',
([0.0, 1.2, 1.8], [0.4, 0.7], [100, 50, 20], 3, False),
[[96.48, 44.4, 26.88], 167.76, 0.94566]),
('regression: plus group fish',
([0.0, 0.5, 2.0], [0.5, 0.6, 0.8], [200, 80, 40], 4, True),
[[322.9, 139.0, 171.16], 633.06, 1.221652]),
('control: extinct population', ([0.0, 1.0], [0.5], [0, 0], 2, False), [[0.0, 0.0], 0.0, None]),
('control: zero years', ([0.0, 1.0], [0.5], [10, 10], 0, False), [[10.0, 10.0], 20.0, None]),
('regression: juvenile breeders',
([0.3, 0.9, 1.1], [0.6, 0.5, 0.2], [50, 30, 10], 3, True),
[[67.34, 36.96, 19.58], 123.88, 1.10805]),
('regression: senescent plus group',
([0.0, 0.0, 3.0], [0.9, 0.9, 0.5], [0, 0, 10], 3, True),
[[7.5, 13.5, 25.55], 46.55, 1.046067]),
('control: four classes',
([0.0, 0.0, 1.0, 2.0], [0.5, 0.6, 0.7], [40, 30, 20, 10], 5, False),
[[30.6, 14.4, 11.16, 9.66], 65.82, 0.94569])],
[('regression: plus group fish',
([0.0, 0.5, 2.0], [0.5, 0.6, 0.8], [200, 80, 40], 4, True),
[[322.9, 139.0, 171.16], 633.06, 1.221652]),
('control: extinct population', ([0.0, 1.0], [0.5], [0, 0], 2, False), [[0.0, 0.0], 0.0, None]),
('control: zero years', ([0.0, 1.0], [0.5], [10, 10], 0, False), [[10.0, 10.0], 20.0, None]),
('regression: juvenile breeders',
([0.3, 0.9, 1.1], [0.6, 0.5, 0.2], [50, 30, 10], 3, True),
[[67.34, 36.96, 19.58], 123.88, 1.10805]),
('control: single step',
([0.2, 1.5, 0.0], [0.8, 0.3], [10, 20, 30], 1, False),
[[32.0, 8.0, 6.0], 46.0, 0.766667]),
('regression: senescent plus group',
([0.0, 0.0, 3.0], [0.9, 0.9, 0.5], [0, 0, 10], 3, True),
[[7.5, 13.5, 25.55], 46.55, 1.046067]),
('control: four classes',
([0.0, 0.0, 1.0, 2.0], [0.5, 0.6, 0.7], [40, 30, 20, 10], 5, False),
[[30.6, 14.4, 11.16, 9.66], 65.82, 0.94569])],
[('control: three-class bird',
([0.0, 1.2, 1.8], [0.4, 0.7], [100, 50, 20], 3, False),
[[96.48, 44.4, 26.88], 167.76, 0.94566]),
('regression: plus group fish',
([0.0, 0.5, 2.0], [0.5, 0.6, 0.8], [200, 80, 40], 4, True),
[[322.9, 139.0, 171.16], 633.06, 1.221652]),
('control: extinct population', ([0.0, 1.0], [0.5], [0, 0], 2, False), [[0.0, 0.0], 0.0, None]),
('regression: juvenile breeders',
([0.3, 0.9, 1.1], [0.6, 0.5, 0.2], [50, 30, 10], 3, True),
[[67.34, 36.96, 19.58], 123.88, 1.10805]),
('control: single step',
([0.2, 1.5, 0.0], [0.8, 0.3], [10, 20, 30], 1, False),
[[32.0, 8.0, 6.0], 46.0, 0.766667]),
('regression: senescent plus group',
([0.0, 0.0, 3.0], [0.9, 0.9, 0.5], [0, 0, 10], 3, True),
[[7.5, 13.5, 25.55], 46.55, 1.046067]),
('control: four classes',
([0.0, 0.0, 1.0, 2.0], [0.5, 0.6, 0.7], [40, 30, 20, 10], 5, False),
[[30.6, 14.4, 11.16, 9.66], 65.82, 0.94569])]]
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: three-class bird | [[96.48, 44.4, 26.88], 167.76, 0.94566] | [[96.48, 44.4, 26.88], 167.76, 0.94566] | Passed |
| regression: plus group fish | [[69.46, 40.6, 16.384], 126.444, 0.796849] | [[322.9, 139.0, 171.16], 633.06, 1.221652] | Failed |
| control: extinct population | [[0.0, 0.0], 0.0, None] | [[0.0, 0.0], 0.0, None] | Passed |
| control: zero years | [[10.0, 10.0], 20.0, None] | [[10.0, 10.0], 20.0, None] | Passed |
| regression: juvenile breeders | [[42.59, 27.06, 0.08], 69.73, 0.90207] | [[67.34, 36.96, 19.58], 123.88, 1.10805] | Failed |
| control: single step | [[32.0, 8.0, 6.0], 46.0, 0.766667] | [[32.0, 8.0, 6.0], 46.0, 0.766667] | Passed |
| regression: senescent plus group | [[7.5, 13.5, 1.25], 22.25, 0.5] | [[7.5, 13.5, 25.55], 46.55, 1.046067] | Failed |
SHA-256 / be97f7c93e2fbdbdd601c5752832468a332b01d4210045eca9aaa1a5783671d6
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(fecundity, survival, n0, years, plus_group):
m = len(n0)
n = [float(x) for x in n0]
ratio = None
prev_total = sum(n)
for _ in range(years):
new = [0.0] * m
new[0] = sum(fecundity[i] * n[i] for i in range(m))
for i in range(m - 1):
new[i + 1] = survival[i] * n[i]
if plus_group:
new[m - 1] += n[m - 1]
prev_total = sum(n)
n = new
ratio = sum(n) / prev_total if prev_total > 0 else None
return [[round(x, 4) for x in n], round(sum(n), 4), None if ratio is None else round(ratio, 6)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control: three-class bird',
([0.0, 1.2, 1.8], [0.4, 0.7], [100, 50, 20], 3, False),
[[96.48, 44.4, 26.88], 167.76, 0.94566]),
('regression: plus group fish',
([0.0, 0.5, 2.0], [0.5, 0.6, 0.8], [200, 80, 40], 4, True),
[[322.9, 139.0, 171.16], 633.06, 1.221652]),
('control: extinct population', ([0.0, 1.0], [0.5], [0, 0], 2, False), [[0.0, 0.0], 0.0, None]),
('control: zero years', ([0.0, 1.0], [0.5], [10, 10], 0, False), [[10.0, 10.0], 20.0, None]),
('regression: juvenile breeders',
([0.3, 0.9, 1.1], [0.6, 0.5, 0.2], [50, 30, 10], 3, True),
[[67.34, 36.96, 19.58], 123.88, 1.10805]),
('control: single step',
([0.2, 1.5, 0.0], [0.8, 0.3], [10, 20, 30], 1, False),
[[32.0, 8.0, 6.0], 46.0, 0.766667]),
('regression: senescent plus group',
([0.0, 0.0, 3.0], [0.9, 0.9, 0.5], [0, 0, 10], 3, True),
[[7.5, 13.5, 25.55], 46.55, 1.046067])],
[('control: three-class bird',
([0.0, 1.2, 1.8], [0.4, 0.7], [100, 50, 20], 3, False),
[[96.48, 44.4, 26.88], 167.76, 0.94566]),
('regression: plus group fish',
([0.0, 0.5, 2.0], [0.5, 0.6, 0.8], [200, 80, 40], 4, True),
[[322.9, 139.0, 171.16], 633.06, 1.221652]),
('control: zero years', ([0.0, 1.0], [0.5], [10, 10], 0, False), [[10.0, 10.0], 20.0, None]),
('regression: juvenile breeders',
([0.3, 0.9, 1.1], [0.6, 0.5, 0.2], [50, 30, 10], 3, True),
[[67.34, 36.96, 19.58], 123.88, 1.10805]),
('control: single step',
([0.2, 1.5, 0.0], [0.8, 0.3], [10, 20, 30], 1, False),
[[32.0, 8.0, 6.0], 46.0, 0.766667]),
('regression: senescent plus group',
([0.0, 0.0, 3.0], [0.9, 0.9, 0.5], [0, 0, 10], 3, True),
[[7.5, 13.5, 25.55], 46.55, 1.046067]),
('control: four classes',
([0.0, 0.0, 1.0, 2.0], [0.5, 0.6, 0.7], [40, 30, 20, 10], 5, False),
[[30.6, 14.4, 11.16, 9.66], 65.82, 0.94569])],
[('control: three-class bird',
([0.0, 1.2, 1.8], [0.4, 0.7], [100, 50, 20], 3, False),
[[96.48, 44.4, 26.88], 167.76, 0.94566]),
('regression: plus group fish',
([0.0, 0.5, 2.0], [0.5, 0.6, 0.8], [200, 80, 40], 4, True),
[[322.9, 139.0, 171.16], 633.06, 1.221652]),
('control: extinct population', ([0.0, 1.0], [0.5], [0, 0], 2, False), [[0.0, 0.0], 0.0, None]),
('control: zero years', ([0.0, 1.0], [0.5], [10, 10], 0, False), [[10.0, 10.0], 20.0, None]),
('regression: juvenile breeders',
([0.3, 0.9, 1.1], [0.6, 0.5, 0.2], [50, 30, 10], 3, True),
[[67.34, 36.96, 19.58], 123.88, 1.10805]),
('regression: senescent plus group',
([0.0, 0.0, 3.0], [0.9, 0.9, 0.5], [0, 0, 10], 3, True),
[[7.5, 13.5, 25.55], 46.55, 1.046067]),
('control: four classes',
([0.0, 0.0, 1.0, 2.0], [0.5, 0.6, 0.7], [40, 30, 20, 10], 5, False),
[[30.6, 14.4, 11.16, 9.66], 65.82, 0.94569])],
[('regression: plus group fish',
([0.0, 0.5, 2.0], [0.5, 0.6, 0.8], [200, 80, 40], 4, True),
[[322.9, 139.0, 171.16], 633.06, 1.221652]),
('control: extinct population', ([0.0, 1.0], [0.5], [0, 0], 2, False), [[0.0, 0.0], 0.0, None]),
('control: zero years', ([0.0, 1.0], [0.5], [10, 10], 0, False), [[10.0, 10.0], 20.0, None]),
('regression: juvenile breeders',
([0.3, 0.9, 1.1], [0.6, 0.5, 0.2], [50, 30, 10], 3, True),
[[67.34, 36.96, 19.58], 123.88, 1.10805]),
('control: single step',
([0.2, 1.5, 0.0], [0.8, 0.3], [10, 20, 30], 1, False),
[[32.0, 8.0, 6.0], 46.0, 0.766667]),
('regression: senescent plus group',
([0.0, 0.0, 3.0], [0.9, 0.9, 0.5], [0, 0, 10], 3, True),
[[7.5, 13.5, 25.55], 46.55, 1.046067]),
('control: four classes',
([0.0, 0.0, 1.0, 2.0], [0.5, 0.6, 0.7], [40, 30, 20, 10], 5, False),
[[30.6, 14.4, 11.16, 9.66], 65.82, 0.94569])],
[('control: three-class bird',
([0.0, 1.2, 1.8], [0.4, 0.7], [100, 50, 20], 3, False),
[[96.48, 44.4, 26.88], 167.76, 0.94566]),
('regression: plus group fish',
([0.0, 0.5, 2.0], [0.5, 0.6, 0.8], [200, 80, 40], 4, True),
[[322.9, 139.0, 171.16], 633.06, 1.221652]),
('control: extinct population', ([0.0, 1.0], [0.5], [0, 0], 2, False), [[0.0, 0.0], 0.0, None]),
('regression: juvenile breeders',
([0.3, 0.9, 1.1], [0.6, 0.5, 0.2], [50, 30, 10], 3, True),
[[67.34, 36.96, 19.58], 123.88, 1.10805]),
('control: single step',
([0.2, 1.5, 0.0], [0.8, 0.3], [10, 20, 30], 1, False),
[[32.0, 8.0, 6.0], 46.0, 0.766667]),
('regression: senescent plus group',
([0.0, 0.0, 3.0], [0.9, 0.9, 0.5], [0, 0, 10], 3, True),
[[7.5, 13.5, 25.55], 46.55, 1.046067]),
('control: four classes',
([0.0, 0.0, 1.0, 2.0], [0.5, 0.6, 0.7], [40, 30, 20, 10], 5, False),
[[30.6, 14.4, 11.16, 9.66], 65.82, 0.94569])]]
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: three-class bird | [[96.48, 44.4, 26.88], 167.76, 0.94566] | [[96.48, 44.4, 26.88], 167.76, 0.94566] | Passed |
| regression: plus group fish | [[424.5, 163.0, 251.8], 839.3, 1.347191] | [[322.9, 139.0, 171.16], 633.06, 1.221652] | Failed |
| control: extinct population | [[0.0, 0.0], 0.0, None] | [[0.0, 0.0], 0.0, None] | Passed |
| control: zero years | [[10.0, 10.0], 20.0, None] | [[10.0, 10.0], 20.0, None] | Passed |
| regression: juvenile breeders | [[93.74, 42.24, 55.9], 191.88, 1.349367] | [[67.34, 36.96, 19.58], 123.88, 1.10805] | Failed |
| control: single step | [[32.0, 8.0, 6.0], 46.0, 0.766667] | [[32.0, 8.0, 6.0], 46.0, 0.766667] | Passed |
| regression: senescent plus group | [[30.0, 27.0, 34.3], 91.3, 1.362687] | [[7.5, 13.5, 25.55], 46.55, 1.046067] | Failed |
SHA-256 / 40d0489042d09fa0490caad50533fede65a5a10d4f4364e923386a6546c20b6d
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(fecundity, survival, n0, years, plus_group):
m = len(n0)
n = [float(x) for x in n0]
ratio = None
prev_total = sum(n)
for _ in range(years):
new = [0.0] * m
new[0] = sum(fecundity[i] * n[i] for i in range(m))
for i in range(m - 1):
new[i + 1] = survival[i] * n[i]
if plus_group:
new[m - 1] += survival[m - 1] * n[m - 1]
prev_total = sum(n)
n = new
ratio = sum(n) / prev_total if prev_total > 0 else None
return [[round(x, 4) for x in n], round(sum(n), 4), None if ratio is None else round(ratio, 6)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control: three-class bird',
([0.0, 1.2, 1.8], [0.4, 0.7], [100, 50, 20], 3, False),
[[96.48, 44.4, 26.88], 167.76, 0.94566]),
('regression: plus group fish',
([0.0, 0.5, 2.0], [0.5, 0.6, 0.8], [200, 80, 40], 4, True),
[[322.9, 139.0, 171.16], 633.06, 1.221652]),
('control: extinct population', ([0.0, 1.0], [0.5], [0, 0], 2, False), [[0.0, 0.0], 0.0, None]),
('control: zero years', ([0.0, 1.0], [0.5], [10, 10], 0, False), [[10.0, 10.0], 20.0, None]),
('regression: juvenile breeders',
([0.3, 0.9, 1.1], [0.6, 0.5, 0.2], [50, 30, 10], 3, True),
[[67.34, 36.96, 19.58], 123.88, 1.10805]),
('control: single step',
([0.2, 1.5, 0.0], [0.8, 0.3], [10, 20, 30], 1, False),
[[32.0, 8.0, 6.0], 46.0, 0.766667]),
('regression: senescent plus group',
([0.0, 0.0, 3.0], [0.9, 0.9, 0.5], [0, 0, 10], 3, True),
[[7.5, 13.5, 25.55], 46.55, 1.046067])],
[('control: three-class bird',
([0.0, 1.2, 1.8], [0.4, 0.7], [100, 50, 20], 3, False),
[[96.48, 44.4, 26.88], 167.76, 0.94566]),
('regression: plus group fish',
([0.0, 0.5, 2.0], [0.5, 0.6, 0.8], [200, 80, 40], 4, True),
[[322.9, 139.0, 171.16], 633.06, 1.221652]),
('control: zero years', ([0.0, 1.0], [0.5], [10, 10], 0, False), [[10.0, 10.0], 20.0, None]),
('regression: juvenile breeders',
([0.3, 0.9, 1.1], [0.6, 0.5, 0.2], [50, 30, 10], 3, True),
[[67.34, 36.96, 19.58], 123.88, 1.10805]),
('control: single step',
([0.2, 1.5, 0.0], [0.8, 0.3], [10, 20, 30], 1, False),
[[32.0, 8.0, 6.0], 46.0, 0.766667]),
('regression: senescent plus group',
([0.0, 0.0, 3.0], [0.9, 0.9, 0.5], [0, 0, 10], 3, True),
[[7.5, 13.5, 25.55], 46.55, 1.046067]),
('control: four classes',
([0.0, 0.0, 1.0, 2.0], [0.5, 0.6, 0.7], [40, 30, 20, 10], 5, False),
[[30.6, 14.4, 11.16, 9.66], 65.82, 0.94569])],
[('control: three-class bird',
([0.0, 1.2, 1.8], [0.4, 0.7], [100, 50, 20], 3, False),
[[96.48, 44.4, 26.88], 167.76, 0.94566]),
('regression: plus group fish',
([0.0, 0.5, 2.0], [0.5, 0.6, 0.8], [200, 80, 40], 4, True),
[[322.9, 139.0, 171.16], 633.06, 1.221652]),
('control: extinct population', ([0.0, 1.0], [0.5], [0, 0], 2, False), [[0.0, 0.0], 0.0, None]),
('control: zero years', ([0.0, 1.0], [0.5], [10, 10], 0, False), [[10.0, 10.0], 20.0, None]),
('regression: juvenile breeders',
([0.3, 0.9, 1.1], [0.6, 0.5, 0.2], [50, 30, 10], 3, True),
[[67.34, 36.96, 19.58], 123.88, 1.10805]),
('regression: senescent plus group',
([0.0, 0.0, 3.0], [0.9, 0.9, 0.5], [0, 0, 10], 3, True),
[[7.5, 13.5, 25.55], 46.55, 1.046067]),
('control: four classes',
([0.0, 0.0, 1.0, 2.0], [0.5, 0.6, 0.7], [40, 30, 20, 10], 5, False),
[[30.6, 14.4, 11.16, 9.66], 65.82, 0.94569])],
[('regression: plus group fish',
([0.0, 0.5, 2.0], [0.5, 0.6, 0.8], [200, 80, 40], 4, True),
[[322.9, 139.0, 171.16], 633.06, 1.221652]),
('control: extinct population', ([0.0, 1.0], [0.5], [0, 0], 2, False), [[0.0, 0.0], 0.0, None]),
('control: zero years', ([0.0, 1.0], [0.5], [10, 10], 0, False), [[10.0, 10.0], 20.0, None]),
('regression: juvenile breeders',
([0.3, 0.9, 1.1], [0.6, 0.5, 0.2], [50, 30, 10], 3, True),
[[67.34, 36.96, 19.58], 123.88, 1.10805]),
('control: single step',
([0.2, 1.5, 0.0], [0.8, 0.3], [10, 20, 30], 1, False),
[[32.0, 8.0, 6.0], 46.0, 0.766667]),
('regression: senescent plus group',
([0.0, 0.0, 3.0], [0.9, 0.9, 0.5], [0, 0, 10], 3, True),
[[7.5, 13.5, 25.55], 46.55, 1.046067]),
('control: four classes',
([0.0, 0.0, 1.0, 2.0], [0.5, 0.6, 0.7], [40, 30, 20, 10], 5, False),
[[30.6, 14.4, 11.16, 9.66], 65.82, 0.94569])],
[('control: three-class bird',
([0.0, 1.2, 1.8], [0.4, 0.7], [100, 50, 20], 3, False),
[[96.48, 44.4, 26.88], 167.76, 0.94566]),
('regression: plus group fish',
([0.0, 0.5, 2.0], [0.5, 0.6, 0.8], [200, 80, 40], 4, True),
[[322.9, 139.0, 171.16], 633.06, 1.221652]),
('control: extinct population', ([0.0, 1.0], [0.5], [0, 0], 2, False), [[0.0, 0.0], 0.0, None]),
('regression: juvenile breeders',
([0.3, 0.9, 1.1], [0.6, 0.5, 0.2], [50, 30, 10], 3, True),
[[67.34, 36.96, 19.58], 123.88, 1.10805]),
('control: single step',
([0.2, 1.5, 0.0], [0.8, 0.3], [10, 20, 30], 1, False),
[[32.0, 8.0, 6.0], 46.0, 0.766667]),
('regression: senescent plus group',
([0.0, 0.0, 3.0], [0.9, 0.9, 0.5], [0, 0, 10], 3, True),
[[7.5, 13.5, 25.55], 46.55, 1.046067]),
('control: four classes',
([0.0, 0.0, 1.0, 2.0], [0.5, 0.6, 0.7], [40, 30, 20, 10], 5, False),
[[30.6, 14.4, 11.16, 9.66], 65.82, 0.94569])]]
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: three-class bird | [[96.48, 44.4, 26.88], 167.76, 0.94566] | [[96.48, 44.4, 26.88], 167.76, 0.94566] | Passed |
| regression: plus group fish | [[322.9, 139.0, 171.16], 633.06, 1.221652] | [[322.9, 139.0, 171.16], 633.06, 1.221652] | Passed |
| control: extinct population | [[0.0, 0.0], 0.0, None] | [[0.0, 0.0], 0.0, None] | Passed |
| control: zero years | [[10.0, 10.0], 20.0, None] | [[10.0, 10.0], 20.0, None] | Passed |
| regression: juvenile breeders | [[67.34, 36.96, 19.58], 123.88, 1.10805] | [[67.34, 36.96, 19.58], 123.88, 1.10805] | Passed |
| control: single step | [[32.0, 8.0, 6.0], 46.0, 0.766667] | [[32.0, 8.0, 6.0], 46.0, 0.766667] | Passed |
| regression: senescent plus group | [[7.5, 13.5, 25.55], 46.55, 1.046067] | [[7.5, 13.5, 25.55], 46.55, 1.046067] | Passed |
SHA-256 / ba2a54874deb2b8d9c0482c561c0fc6c11194fdaf712bffdcf671387ada35eb3
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:34.055030+00:00.
Case digest / 4eac1b740c1e12220a5cfa6541a30c6760616890df80e995bb6b8566a977057e