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.

What the model is

The Whipsaw is an economy simulation built on a stock-flow-consistent core. Accounting is checked by a Godley & Lavoie flow matrix with two invariants: every row, meaning a type of flow, and every column, meaning a sector, must sum to zero. Checking stocks alone is not enough, because a balance sum of zero is perfectly compatible with an economy quietly draining into deposits.

One tick is one week. Firms plan output before sales are known, bid for inputs and receive them under proportional rationing, and sell into a clearing that ranks sellers by price. A firm that falls below the minimum efficient scale of its industry dissolves into a periphery tier; a periphery firm that grows past the threshold crystallises back. None of the business cycle is scripted. The acceptance criterion is a spectral peak inside the Kitchin band, 144 to 192 ticks, holding across a two hundred year run.

Written in Rust, with a CLI for the analysis passes and the invariants that matter pinned in automated tests, because a criterion you have to remember to run is one you run after the damage. Stage 1 is not signed off. This log is the working record of why: what broke, which fix turned out to be a different bug wearing a costume, and the reasons the specification has the sections it has.

Engine
Rust
Tick
1 week
Accounting
stock-flow consistent
Target cycle
Kitchin
Run horizon
200 years
Stage
1, open
Build
0.0.1