FA-65706 / Ecological population dynamics / Open access
Two-patch source-sink dispersal with ceilings: dispersal conservation · case 01
Dispersal creates individuals.
ROOT CAUSE
Emigrants are added to the destination but not removed from the origin.
THE FAILURE
Emigrants are added to the destination but not removed from the origin.
Unsuccessful approach: Swapping the flows sends emigrants back to their own patch.
Case contract
Each year each patch grows by its lambda and is capped at its own ceiling, then fraction disperse of each post-growth patch moves to the other simultaneously; return yearly [N1, N2] rounded 4.
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(n0s, lambdas, caps, disperse, years):
n = [float(x) for x in n0s]
traj = []
for _ in range(years):
grown = [min(n[j] * lambdas[j], caps[j]) for j in range(2)]
out = [grown[j] * disperse for j in range(2)]
n = [grown[0] + out[1], grown[1] + out[0]]
traj.append([round(x, 4) for x in n])
return traj
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: meadow source woodland sink',
([100, 20], [1.5, 0.7], [200, 200], 0.2, 5),
[[122.8, 41.2], [153.128, 59.912], [168.3877, 73.5507], [170.2971, 81.1884], [171.3664, 85.4655]]),
('regression: ceiling binding in source',
([180, 10], [1.4, 0.8], [200, 50], 0.1, 4),
[[180.8, 27.2], [182.176, 39.584], [183.1667, 48.5005], [183.88, 54.9203]]),
('control: no dispersal',
([50, 50], [1.2, 0.9], [100, 100], 0.0, 3),
[[60.0, 45.0], [72.0, 40.5], [86.4, 36.45]]),
('regression: full exchange',
([60, 0], [1.1, 0.5], [100, 100], 1.0, 3),
[[0.0, 66.0], [33.0, 0.0], [0.0, 36.3]]),
('regression: both sinks',
([100, 100], [0.8, 0.6], [150, 150], 0.3, 4),
[[74.0, 66.0], [53.32, 45.48], [38.0456, 31.8984], [27.0472, 22.5283]]),
('regression: sink ceiling binding',
([10, 120], [1.3, 1.2], [300, 100], 0.25, 4),
[[34.75, 78.25], [57.3563, 81.7188], [80.438, 92.1877], [103.427, 101.1423]]),
('regression: unequal ceilings',
([90, 40], [2.0, 1.5], [120, 60], 0.05, 5),
[[117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0]])],
[('regression: meadow source woodland sink',
([100, 20], [1.5, 0.7], [200, 200], 0.2, 5),
[[122.8, 41.2], [153.128, 59.912], [168.3877, 73.5507], [170.2971, 81.1884], [171.3664, 85.4655]]),
('regression: ceiling binding in source',
([180, 10], [1.4, 0.8], [200, 50], 0.1, 4),
[[180.8, 27.2], [182.176, 39.584], [183.1667, 48.5005], [183.88, 54.9203]]),
('control: no dispersal',
([50, 50], [1.2, 0.9], [100, 100], 0.0, 3),
[[60.0, 45.0], [72.0, 40.5], [86.4, 36.45]]),
('regression: full exchange',
([60, 0], [1.1, 0.5], [100, 100], 1.0, 3),
[[0.0, 66.0], [33.0, 0.0], [0.0, 36.3]]),
('regression: both sinks',
([100, 100], [0.8, 0.6], [150, 150], 0.3, 4),
[[74.0, 66.0], [53.32, 45.48], [38.0456, 31.8984], [27.0472, 22.5283]]),
('regression: sink ceiling binding',
([10, 120], [1.3, 1.2], [300, 100], 0.25, 4),
[[34.75, 78.25], [57.3563, 81.7188], [80.438, 92.1877], [103.427, 101.1423]]),
('regression: unequal ceilings',
([90, 40], [2.0, 1.5], [120, 60], 0.05, 5),
[[117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0]])],
[('regression: meadow source woodland sink',
([100, 20], [1.5, 0.7], [200, 200], 0.2, 5),
[[122.8, 41.2], [153.128, 59.912], [168.3877, 73.5507], [170.2971, 81.1884], [171.3664, 85.4655]]),
('regression: ceiling binding in source',
([180, 10], [1.4, 0.8], [200, 50], 0.1, 4),
[[180.8, 27.2], [182.176, 39.584], [183.1667, 48.5005], [183.88, 54.9203]]),
('control: no dispersal',
([50, 50], [1.2, 0.9], [100, 100], 0.0, 3),
[[60.0, 45.0], [72.0, 40.5], [86.4, 36.45]]),
('regression: full exchange',
([60, 0], [1.1, 0.5], [100, 100], 1.0, 3),
[[0.0, 66.0], [33.0, 0.0], [0.0, 36.3]]),
('regression: both sinks',
([100, 100], [0.8, 0.6], [150, 150], 0.3, 4),
[[74.0, 66.0], [53.32, 45.48], [38.0456, 31.8984], [27.0472, 22.5283]]),
('regression: sink ceiling binding',
([10, 120], [1.3, 1.2], [300, 100], 0.25, 4),
[[34.75, 78.25], [57.3563, 81.7188], [80.438, 92.1877], [103.427, 101.1423]]),
('regression: unequal ceilings',
([90, 40], [2.0, 1.5], [120, 60], 0.05, 5),
[[117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0]])],
[('regression: meadow source woodland sink',
([100, 20], [1.5, 0.7], [200, 200], 0.2, 5),
[[122.8, 41.2], [153.128, 59.912], [168.3877, 73.5507], [170.2971, 81.1884], [171.3664, 85.4655]]),
('regression: ceiling binding in source',
([180, 10], [1.4, 0.8], [200, 50], 0.1, 4),
[[180.8, 27.2], [182.176, 39.584], [183.1667, 48.5005], [183.88, 54.9203]]),
('control: no dispersal',
([50, 50], [1.2, 0.9], [100, 100], 0.0, 3),
[[60.0, 45.0], [72.0, 40.5], [86.4, 36.45]]),
('regression: full exchange',
([60, 0], [1.1, 0.5], [100, 100], 1.0, 3),
[[0.0, 66.0], [33.0, 0.0], [0.0, 36.3]]),
('regression: both sinks',
([100, 100], [0.8, 0.6], [150, 150], 0.3, 4),
[[74.0, 66.0], [53.32, 45.48], [38.0456, 31.8984], [27.0472, 22.5283]]),
('regression: sink ceiling binding',
([10, 120], [1.3, 1.2], [300, 100], 0.25, 4),
[[34.75, 78.25], [57.3563, 81.7188], [80.438, 92.1877], [103.427, 101.1423]]),
('regression: unequal ceilings',
([90, 40], [2.0, 1.5], [120, 60], 0.05, 5),
[[117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0]])],
[('regression: meadow source woodland sink',
([100, 20], [1.5, 0.7], [200, 200], 0.2, 5),
[[122.8, 41.2], [153.128, 59.912], [168.3877, 73.5507], [170.2971, 81.1884], [171.3664, 85.4655]]),
('regression: ceiling binding in source',
([180, 10], [1.4, 0.8], [200, 50], 0.1, 4),
[[180.8, 27.2], [182.176, 39.584], [183.1667, 48.5005], [183.88, 54.9203]]),
('control: no dispersal',
([50, 50], [1.2, 0.9], [100, 100], 0.0, 3),
[[60.0, 45.0], [72.0, 40.5], [86.4, 36.45]]),
('regression: full exchange',
([60, 0], [1.1, 0.5], [100, 100], 1.0, 3),
[[0.0, 66.0], [33.0, 0.0], [0.0, 36.3]]),
('regression: both sinks',
([100, 100], [0.8, 0.6], [150, 150], 0.3, 4),
[[74.0, 66.0], [53.32, 45.48], [38.0456, 31.8984], [27.0472, 22.5283]]),
('regression: sink ceiling binding',
([10, 120], [1.3, 1.2], [300, 100], 0.25, 4),
[[34.75, 78.25], [57.3563, 81.7188], [80.438, 92.1877], [103.427, 101.1423]]),
('regression: unequal ceilings',
([90, 40], [2.0, 1.5], [120, 60], 0.05, 5),
[[117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0]])]]
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: meadow source woodland sink | [[152.8, 44.0], [206.16, 70.8], [209.912, 89.56], [212.5384, 102.692], [214.3769, 111.8844]] | [[122.8, 41.2], [153.128, 59.912], [168.3877, 73.5507], [170.2971, 81.1884], [171.3664, 85.4655]] | Failed |
| regression: ceiling binding in source | [[200.8, 28.0], [202.24, 42.4], [203.392, 53.92], [204.3136, 63.136]] | [[180.8, 27.2], [182.176, 39.584], [183.1667, 48.5005], [183.88, 54.9203]] | Failed |
| control: no dispersal | [[60.0, 45.0], [72.0, 40.5], [86.4, 36.45]] | [[60.0, 45.0], [72.0, 40.5], [86.4, 36.45]] | Passed |
| regression: full exchange | [[66.0, 66.0], [105.6, 105.6], [152.8, 152.8]] | [[0.0, 66.0], [33.0, 0.0], [0.0, 36.3]] | Failed |
| regression: both sinks | [[98.0, 84.0], [93.52, 73.92], [88.1216, 66.7968], [82.5207, 61.2273]] | [[74.0, 66.0], [53.32, 45.48], [38.0456, 31.8984], [27.0472, 22.5283]] | Failed |
| regression: sink ceiling binding | [[38.0, 103.25], [74.4, 112.35], [121.72, 124.18], [183.236, 139.559]] | [[34.75, 78.25], [57.3563, 81.7188], [80.438, 92.1877], [103.427, 101.1423]] | Failed |
| regression: unequal ceilings | [[123.0, 66.0], [123.0, 66.0], [123.0, 66.0], [123.0, 66.0], [123.0, 66.0]] | [[117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0]] | Failed |
SHA-256 / 7f11cebdff53e88612bde8d3690bcfd9cba82cf73ead39908c8481d683164f60
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(n0s, lambdas, caps, disperse, years):
n = [float(x) for x in n0s]
traj = []
for _ in range(years):
grown = [min(n[j] * lambdas[j], caps[j]) for j in range(2)]
out = [grown[j] * disperse for j in range(2)]
n = [grown[0] - out[1] + out[0], grown[1] - out[0] + out[1]]
traj.append([round(x, 4) for x in n])
return traj
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: meadow source woodland sink',
([100, 20], [1.5, 0.7], [200, 200], 0.2, 5),
[[122.8, 41.2], [153.128, 59.912], [168.3877, 73.5507], [170.2971, 81.1884], [171.3664, 85.4655]]),
('regression: ceiling binding in source',
([180, 10], [1.4, 0.8], [200, 50], 0.1, 4),
[[180.8, 27.2], [182.176, 39.584], [183.1667, 48.5005], [183.88, 54.9203]]),
('control: no dispersal',
([50, 50], [1.2, 0.9], [100, 100], 0.0, 3),
[[60.0, 45.0], [72.0, 40.5], [86.4, 36.45]]),
('regression: full exchange',
([60, 0], [1.1, 0.5], [100, 100], 1.0, 3),
[[0.0, 66.0], [33.0, 0.0], [0.0, 36.3]]),
('regression: both sinks',
([100, 100], [0.8, 0.6], [150, 150], 0.3, 4),
[[74.0, 66.0], [53.32, 45.48], [38.0456, 31.8984], [27.0472, 22.5283]]),
('regression: sink ceiling binding',
([10, 120], [1.3, 1.2], [300, 100], 0.25, 4),
[[34.75, 78.25], [57.3563, 81.7188], [80.438, 92.1877], [103.427, 101.1423]]),
('regression: unequal ceilings',
([90, 40], [2.0, 1.5], [120, 60], 0.05, 5),
[[117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0]])],
[('regression: meadow source woodland sink',
([100, 20], [1.5, 0.7], [200, 200], 0.2, 5),
[[122.8, 41.2], [153.128, 59.912], [168.3877, 73.5507], [170.2971, 81.1884], [171.3664, 85.4655]]),
('regression: ceiling binding in source',
([180, 10], [1.4, 0.8], [200, 50], 0.1, 4),
[[180.8, 27.2], [182.176, 39.584], [183.1667, 48.5005], [183.88, 54.9203]]),
('control: no dispersal',
([50, 50], [1.2, 0.9], [100, 100], 0.0, 3),
[[60.0, 45.0], [72.0, 40.5], [86.4, 36.45]]),
('regression: full exchange',
([60, 0], [1.1, 0.5], [100, 100], 1.0, 3),
[[0.0, 66.0], [33.0, 0.0], [0.0, 36.3]]),
('regression: both sinks',
([100, 100], [0.8, 0.6], [150, 150], 0.3, 4),
[[74.0, 66.0], [53.32, 45.48], [38.0456, 31.8984], [27.0472, 22.5283]]),
('regression: sink ceiling binding',
([10, 120], [1.3, 1.2], [300, 100], 0.25, 4),
[[34.75, 78.25], [57.3563, 81.7188], [80.438, 92.1877], [103.427, 101.1423]]),
('regression: unequal ceilings',
([90, 40], [2.0, 1.5], [120, 60], 0.05, 5),
[[117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0]])],
[('regression: meadow source woodland sink',
([100, 20], [1.5, 0.7], [200, 200], 0.2, 5),
[[122.8, 41.2], [153.128, 59.912], [168.3877, 73.5507], [170.2971, 81.1884], [171.3664, 85.4655]]),
('regression: ceiling binding in source',
([180, 10], [1.4, 0.8], [200, 50], 0.1, 4),
[[180.8, 27.2], [182.176, 39.584], [183.1667, 48.5005], [183.88, 54.9203]]),
('control: no dispersal',
([50, 50], [1.2, 0.9], [100, 100], 0.0, 3),
[[60.0, 45.0], [72.0, 40.5], [86.4, 36.45]]),
('regression: full exchange',
([60, 0], [1.1, 0.5], [100, 100], 1.0, 3),
[[0.0, 66.0], [33.0, 0.0], [0.0, 36.3]]),
('regression: both sinks',
([100, 100], [0.8, 0.6], [150, 150], 0.3, 4),
[[74.0, 66.0], [53.32, 45.48], [38.0456, 31.8984], [27.0472, 22.5283]]),
('regression: sink ceiling binding',
([10, 120], [1.3, 1.2], [300, 100], 0.25, 4),
[[34.75, 78.25], [57.3563, 81.7188], [80.438, 92.1877], [103.427, 101.1423]]),
('regression: unequal ceilings',
([90, 40], [2.0, 1.5], [120, 60], 0.05, 5),
[[117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0]])],
[('regression: meadow source woodland sink',
([100, 20], [1.5, 0.7], [200, 200], 0.2, 5),
[[122.8, 41.2], [153.128, 59.912], [168.3877, 73.5507], [170.2971, 81.1884], [171.3664, 85.4655]]),
('regression: ceiling binding in source',
([180, 10], [1.4, 0.8], [200, 50], 0.1, 4),
[[180.8, 27.2], [182.176, 39.584], [183.1667, 48.5005], [183.88, 54.9203]]),
('control: no dispersal',
([50, 50], [1.2, 0.9], [100, 100], 0.0, 3),
[[60.0, 45.0], [72.0, 40.5], [86.4, 36.45]]),
('regression: full exchange',
([60, 0], [1.1, 0.5], [100, 100], 1.0, 3),
[[0.0, 66.0], [33.0, 0.0], [0.0, 36.3]]),
('regression: both sinks',
([100, 100], [0.8, 0.6], [150, 150], 0.3, 4),
[[74.0, 66.0], [53.32, 45.48], [38.0456, 31.8984], [27.0472, 22.5283]]),
('regression: sink ceiling binding',
([10, 120], [1.3, 1.2], [300, 100], 0.25, 4),
[[34.75, 78.25], [57.3563, 81.7188], [80.438, 92.1877], [103.427, 101.1423]]),
('regression: unequal ceilings',
([90, 40], [2.0, 1.5], [120, 60], 0.05, 5),
[[117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0]])],
[('regression: meadow source woodland sink',
([100, 20], [1.5, 0.7], [200, 200], 0.2, 5),
[[122.8, 41.2], [153.128, 59.912], [168.3877, 73.5507], [170.2971, 81.1884], [171.3664, 85.4655]]),
('regression: ceiling binding in source',
([180, 10], [1.4, 0.8], [200, 50], 0.1, 4),
[[180.8, 27.2], [182.176, 39.584], [183.1667, 48.5005], [183.88, 54.9203]]),
('control: no dispersal',
([50, 50], [1.2, 0.9], [100, 100], 0.0, 3),
[[60.0, 45.0], [72.0, 40.5], [86.4, 36.45]]),
('regression: full exchange',
([60, 0], [1.1, 0.5], [100, 100], 1.0, 3),
[[0.0, 66.0], [33.0, 0.0], [0.0, 36.3]]),
('regression: both sinks',
([100, 100], [0.8, 0.6], [150, 150], 0.3, 4),
[[74.0, 66.0], [53.32, 45.48], [38.0456, 31.8984], [27.0472, 22.5283]]),
('regression: sink ceiling binding',
([10, 120], [1.3, 1.2], [300, 100], 0.25, 4),
[[34.75, 78.25], [57.3563, 81.7188], [80.438, 92.1877], [103.427, 101.1423]]),
('regression: unequal ceilings',
([90, 40], [2.0, 1.5], [120, 60], 0.05, 5),
[[117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0]])]]
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: meadow source woodland sink | [[177.2, -13.2], [241.848, -51.088], [247.1523, -82.9139], [251.6079, -109.6477], [255.3507, -132.1041]] | [[122.8, 41.2], [153.128, 59.912], [168.3877, 73.5507], [170.2971, 81.1884], [171.3664, 85.4655]] | Failed |
| regression: ceiling binding in source | [[219.2, -11.2], [220.896, -29.856], [222.3885, -46.2733], [223.7019, -60.7205]] | [[180.8, 27.2], [182.176, 39.584], [183.1667, 48.5005], [183.88, 54.9203]] | Failed |
| control: no dispersal | [[60.0, 45.0], [72.0, 40.5], [86.4, 36.45]] | [[60.0, 45.0], [72.0, 40.5], [86.4, 36.45]] | Passed |
| regression: full exchange | [[132.0, -66.0], [233.0, -166.0], [283.0, -266.0]] | [[0.0, 66.0], [33.0, 0.0], [0.0, 36.3]] | Failed |
| regression: both sinks | [[86.0, 54.0], [79.72, 21.48], [79.0424, -2.3784], [82.6322, -20.8253]] | [[74.0, 66.0], [53.32, 45.48], [38.0456, 31.8984], [27.0472, 22.5283]] | Failed |
| regression: sink ceiling binding | [[-8.75, 121.75], [-39.2188, 127.8438], [-88.7305, 137.7461], [-169.187, 153.8374]] | [[34.75, 78.25], [57.3563, 81.7188], [80.438, 92.1877], [103.427, 101.1423]] | Failed |
| regression: unequal ceilings | [[123.0, 57.0], [123.0, 57.0], [123.0, 57.0], [123.0, 57.0], [123.0, 57.0]] | [[117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0], [117.0, 63.0]] | Failed |
SHA-256 / 1215e592f79a3c8774527a16e5cdb3b96ad87f28b7af0b07cf033c43734088b4
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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:36.598542+00:00.
Case digest / e65ba51e311ace3b1f5b5a999c259d58b0ded5fa5c675dca620664fc511bc966