FA-65431 / Ecological population dynamics / Open access
Holling functional response consumption: type I satiation cap · case 01
Filter feeders are capped at the handling time instead of the maximum intake rate.
ROOT CAUSE
The cap uses h rather than 1/h.
VERIFIED REPAIR
Restore the type I satiation cap rule: `min(a * prey, 1 / h)`.
Unsuccessful approach: Dividing by 1+h is a smooth discount, not the linear-then-flat type I response.
Case contract
Per-predator intake f: type 1 = a*N capped at 1/h (uncapped when h==0), type 2 = aN/(1+ahN), type 3 = aN^2/(1+ahN^2); eaten = min(f*predators*duration, N); return [f rounded 6, eaten rounded 4]; None for negative parameters or unknown kind.
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(kind, a, h, prey, predators, duration):
if a < 0 or h < 0 or prey < 0:
return None
if kind == 1:
f = a * prey if h == 0 else min(a * prey, h)
elif kind == 2:
f = a * prey / (1 + a * h * prey)
elif kind == 3:
f = a * prey ** 2 / (1 + a * h * prey ** 2)
else:
return None
eaten = min(f * predators * duration, prey)
return [round(f, 6), round(eaten, 4)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
('regression: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
('control: type 1 no handling', (1, 0.3, 0.0, 40, 1, 1), [12.0, 12.0]),
('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
('control: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
('control: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752])],
[('regression: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
('regression: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
('control: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
('control: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752]),
('control: depletion cap', (2, 2.0, 0.05, 10, 20, 5), [10.0, 10])],
[('regression: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
('regression: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
('control: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752]),
('control: depletion cap', (2, 2.0, 0.05, 10, 20, 5), [10.0, 10]),
('control: unknown kind', (4, 0.1, 0.1, 10, 1, 1), None),
('control: no prey', (2, 0.5, 0.5, 0, 2, 1), [0.0, 0.0]),
('control: invalid negative handling', (2, 0.5, -0.1, 10, 1, 1), None)],
[('regression: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
('regression: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
('control: type 1 no handling', (1, 0.3, 0.0, 40, 1, 1), [12.0, 12.0]),
('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
('control: no prey', (2, 0.5, 0.5, 0, 2, 1), [0.0, 0.0]),
('control: invalid negative handling', (2, 0.5, -0.1, 10, 1, 1), None)],
[('regression: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
('regression: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
('control: type 1 no handling', (1, 0.3, 0.0, 40, 1, 1), [12.0, 12.0]),
('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
('control: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
('control: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752])]]
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 |
|---|---|---|---|
| regression: type 1 saturated filter feeder | [0.25, 0.5] | [4.0, 8.0] | Failed |
| regression: type 1 unsaturated | [0.5, 1.0] | [1.0, 2.0] | Failed |
| control: type 1 no handling | [12.0, 12.0] | [12.0, 12.0] | Passed |
| control: type 2 wolves on moose | [1.846154, 11.0769] | [1.846154, 11.0769] | Passed |
| control: type 2 low density | [0.566038, 0.566] | [0.566038, 0.566] | Passed |
| control: type 3 prey switching | [2.95082, 12] | [2.95082, 12] | Passed |
| control: type 3 high density | [2.475248, 2.4752] | [2.475248, 2.4752] | Passed |
SHA-256 / 8c54faa457b8a572433f186696c8a6c523cb2df82f430566451105f2f1d0f959
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(kind, a, h, prey, predators, duration):
if a < 0 or h < 0 or prey < 0:
return None
if kind == 1:
f = a * prey if h == 0 else a * prey / (1 + h)
elif kind == 2:
f = a * prey / (1 + a * h * prey)
elif kind == 3:
f = a * prey ** 2 / (1 + a * h * prey ** 2)
else:
return None
eaten = min(f * predators * duration, prey)
return [round(f, 6), round(eaten, 4)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
('regression: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
('control: type 1 no handling', (1, 0.3, 0.0, 40, 1, 1), [12.0, 12.0]),
('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
('control: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
('control: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752])],
[('regression: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
('regression: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
('control: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
('control: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752]),
('control: depletion cap', (2, 2.0, 0.05, 10, 20, 5), [10.0, 10])],
[('regression: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
('regression: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
('control: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752]),
('control: depletion cap', (2, 2.0, 0.05, 10, 20, 5), [10.0, 10]),
('control: unknown kind', (4, 0.1, 0.1, 10, 1, 1), None),
('control: no prey', (2, 0.5, 0.5, 0, 2, 1), [0.0, 0.0]),
('control: invalid negative handling', (2, 0.5, -0.1, 10, 1, 1), None)],
[('regression: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
('regression: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
('control: type 1 no handling', (1, 0.3, 0.0, 40, 1, 1), [12.0, 12.0]),
('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
('control: no prey', (2, 0.5, 0.5, 0, 2, 1), [0.0, 0.0]),
('control: invalid negative handling', (2, 0.5, -0.1, 10, 1, 1), None)],
[('regression: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
('regression: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
('control: type 1 no handling', (1, 0.3, 0.0, 40, 1, 1), [12.0, 12.0]),
('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
('control: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
('control: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752])]]
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 |
|---|---|---|---|
| regression: type 1 saturated filter feeder | [8.0, 16.0] | [4.0, 8.0] | Failed |
| regression: type 1 unsaturated | [0.666667, 1.3333] | [1.0, 2.0] | Failed |
| control: type 1 no handling | [12.0, 12.0] | [12.0, 12.0] | Passed |
| control: type 2 wolves on moose | [1.846154, 11.0769] | [1.846154, 11.0769] | Passed |
| control: type 2 low density | [0.566038, 0.566] | [0.566038, 0.566] | Passed |
| control: type 3 prey switching | [2.95082, 12] | [2.95082, 12] | Passed |
| control: type 3 high density | [2.475248, 2.4752] | [2.475248, 2.4752] | Passed |
SHA-256 / 0a155fe98447f257bfe5fa3667a8d367e5bc7b1916d7b17d0460b3ccc6260242
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(kind, a, h, prey, predators, duration):
if a < 0 or h < 0 or prey < 0:
return None
if kind == 1:
f = a * prey if h == 0 else min(a * prey, 1 / h)
elif kind == 2:
f = a * prey / (1 + a * h * prey)
elif kind == 3:
f = a * prey ** 2 / (1 + a * h * prey ** 2)
else:
return None
eaten = min(f * predators * duration, prey)
return [round(f, 6), round(eaten, 4)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
('regression: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
('control: type 1 no handling', (1, 0.3, 0.0, 40, 1, 1), [12.0, 12.0]),
('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
('control: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
('control: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752])],
[('regression: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
('regression: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
('control: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
('control: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752]),
('control: depletion cap', (2, 2.0, 0.05, 10, 20, 5), [10.0, 10])],
[('regression: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
('regression: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
('control: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752]),
('control: depletion cap', (2, 2.0, 0.05, 10, 20, 5), [10.0, 10]),
('control: unknown kind', (4, 0.1, 0.1, 10, 1, 1), None),
('control: no prey', (2, 0.5, 0.5, 0, 2, 1), [0.0, 0.0]),
('control: invalid negative handling', (2, 0.5, -0.1, 10, 1, 1), None)],
[('regression: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
('regression: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
('control: type 1 no handling', (1, 0.3, 0.0, 40, 1, 1), [12.0, 12.0]),
('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
('control: no prey', (2, 0.5, 0.5, 0, 2, 1), [0.0, 0.0]),
('control: invalid negative handling', (2, 0.5, -0.1, 10, 1, 1), None)],
[('regression: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
('regression: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
('control: type 1 no handling', (1, 0.3, 0.0, 40, 1, 1), [12.0, 12.0]),
('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
('control: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
('control: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752])]]
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 |
|---|---|---|---|
| regression: type 1 saturated filter feeder | [4.0, 8.0] | [4.0, 8.0] | Passed |
| regression: type 1 unsaturated | [1.0, 2.0] | [1.0, 2.0] | Passed |
| control: type 1 no handling | [12.0, 12.0] | [12.0, 12.0] | Passed |
| control: type 2 wolves on moose | [1.846154, 11.0769] | [1.846154, 11.0769] | Passed |
| control: type 2 low density | [0.566038, 0.566] | [0.566038, 0.566] | Passed |
| control: type 3 prey switching | [2.95082, 12] | [2.95082, 12] | Passed |
| control: type 3 high density | [2.475248, 2.4752] | [2.475248, 2.4752] | Passed |
SHA-256 / c090f746fb3606d6469b54a9965a337521df31431e1f6437c502b41dab19dacd
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.992921+00:00.
Case digest / 18c383f0b1c897d9aad76c66da87db073649930d41b6f65eb8d39cea9c79d90e