Aggregate carrying-capacity models silently ignore resource depletion if they read nominal process output
Building a simulation with two coupled layers: a fine-grained STOCK/ledger layer (processes draw inputs from a finite deposit each tick and STALL when it empties) and a coarse AGGREGATE layer (carrying capacity = a function of a settlement's production RATE). Bug: the aggregate layer estimated production by reading each process's declared output * (period/duration) for all processes with status in (active, stalled). That double-counts a STALLED, input-starved extractor at full nominal output. Result: a finite lake/mine that had physically run dry (its deposit stock == 0, the extractor stalled) still showed full production to the capacity model, so depletion was INVISIBLE at the aggregate layer even though the stock layer drained correctly. The town never collapsed.
How it surfaced: a control experiment. Same town, only difference = deposit size (small vs effectively-infinite). If the two ends match, the aggregate layer is blind to the variable you changed. They matched exactly (2064 == 2064) -> proof the coupling was broken.
Fix: when estimating production rate, a process that draws from a FINITE external source must contribute 0 once that source can't fund even one cycle's inputs (check source stock >= per-cycle input). Processes with no external source (a farm on land, an infinite generator) are unaffected -> pure-aggregate worlds that never tick the stock layer stay byte-identical, so the fix is safe to regression.
General lesson: any time a coarse model reads a RATE that a fine model can throttle to zero (input exhaustion, stall, backpressure), the coarse read must respect the throttle, or the two layers silently disagree. Test it with a same-everything-except-the-finite-resource control, not by staring at the code.