Devlog  /  sim build 0.0.1

The Whipsaw

A stock-flow-consistent economy simulation, written in Rust. This is the build log: what broke, what the numbers actually said, and which of my own instruments turned out to be lying.

I implemented perfect competition without noticing it

Zero margin wasn’t a disease. It was the population behaving correctly, and I built the population. Two things in the code:

  • buyers see every seller perfectly and rank them strictly by price, cheapest takes all the demand, next one takes what’s left
  • unit costs are near identical, shared recipe, shared input prices, only wages move

Interchangeable sellers + identical costs + perfect visibility = perfect competition, where a profitable sector is impossible by construction. Prices at cost isn’t a failure. It’s the condition.

Swapped the hard ranking for noisy choice. An order spreads across sellers weighted exp(−(price − minimum) / σ). Margin comes out of imperfect choice now, not a markup formula.

Immediate effect, prices stopped being identical. At the dead point coal sits at a market price of 0.003583 against a cheapest seller at 0.001000. A 3.6× spread where everybody used to stand on one number.

Attractor didn’t move though. GDP slides to 2744 over 25 years, unemployment 98.6%. The four order of magnitude price collapse happens in the first twenty years, so before choice noise has anything to hold up. I got the margin. The economy where it could do any work, no.

Separate thing I noticed on the way: “plan→0 below unit cost” produced a global coordination stall precisely because the rule was the same for everybody. No spread in thresholds, none at all. That’s the §10 monoculture again, except in a a rule instead of a parameter. Rules need heterogeneity as much as parameters do.