[v0.4.0] Empire: funding-franchise risk model #52
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #39. Thesis: empire models risk as a funding-franchise problem - what its deposit base can afford, how cheaply it can borrow, capacity utilization. It must win or place in: base, deposit-drought, cash-glut, rate-war, while not collapsing elsewhere. Distinct from the other three brains: no shared calc helpers. Bench numbers in comments, PR per winning iteration.
Empire agent checking in — funding-franchise thesis (starting iteration work on #52).
My distinct world model: empire is the funding-franchise bank. I model risk through the economics of my own funding engine, not through loan-market averages:
Scenarios I must win: base, deposit-drought, cash-glut, rate-war. I will comment a hypothesis before every bench, run smoke + quick bench, and report the full bench numbers here. PRs land on branch 52-empire, base master.
Baseline quick bench is next (30 games, no gauntlet) to measure where the current iteration-1 rebuild stands against the updated mill/vault/adapt.
@Winnie anything happening here?
Coordinator note: the empire agent is staffed on this issue and posted its thesis + start comment at 19:01:49. Per protocol it comments after every meaningful step — build/test, smoke, and each measured bench — with bench numbers in the comments. Its first measured iteration table lands when the bench run completes. (I'm the adapt agent, running #55 in parallel; ping me there if you need anything.)
Iteration 1 hypothesis (empire v4, funding-franchise).
Baseline quick bench (30 games, my worktree @
7f503c4vs the updated rivals): base 19-11 win, cash-glut 16-14, rate-war 27-3 — but deposit-drought 9-21 loss, and avg equity trails mill there (9972 vs 10737).Spectate diagnosis of drought: (1) the two empire seats duplicate each other's loan bids (same shelf, same budget), so one seat's till sits idle all game while mill's flat 5% bid caps the price; (2) empire's per-loan duration discount makes its own second seat under-price the loans it wins (self-discount below mill's 5%); (3) empire pays 0.1%/turn for deposits in a market with ~zero deposit flow — pure bleed.
v4 changes (all config-derived, no hard-coded thresholds):
Running build + smoke spectate + quick bench next.
Iteration 1 result (v4, 30 games) — drought fixed, two bugs found.
Wins (empire vs mill): deposit-drought 23-7 (was 9-21 ✓ fixed), cash-glut 19-11 ✓, base 16-14 ✓, rate-war 23-7 ✓. But: duel 0-30 (was 20-10), default-storm 8-22 (was 29-1), thin-margins 1-29 (was 18-12), bond-economy 0-29, mega-loans 3-27, micro 12-18 (was 30-0), tight-cash 8-21. Two mechanism-level bugs:
Pay-up ratchet (self-destruction). My pay-up set the deposit rate = avg + k·temp. The softmax makes deposit share ∝ exp(rate/temp), so when empire's share grows its own rate dominates the weighted avg → rate(t+1) = rate(t) + k·temp → ratchets to the deposit cap → empire pays the cap on a huge base while rivals fund at ~0. Worst in 3-player duel (empire alone pays up → 60-80% share → instant spiral). The meta is: all four brains anchor BELOW the avg (mill −0.75·temp, vault −0.5, adapt −1.0), so the deposit pool is won nearly free and paying above avg is strictly dominated. Finding: "pay up for deposits" loses to the follower equilibrium in this engine. The franchise's pay-up budget moves to BOND money instead (borrow at scale when the spread justifies) — that part of the thesis holds.
Vickrey tie bug on the second seat. With no bonds, win-rate = avg+rp−0.75·temp which is EXACTLY mill's bid; ties resolve by seat order and empire's second seat (order 4) loses every tie to mill (order 1). Fix: deepen the win-rate notch to funding + rp − 1.0·temp, strictly below every rival funding anchor (mill 0.5·temp gap, adapt 1.0·temp gap), so both franchise halves win outright instead of tying.
Iteration 2 (v5): keep shelf-split + flow-gated deposit rate + drought bond funding (the parts that worked), remove the pay-up ratchet, deepen the notch. Rerunning smoke + quick bench.
v5 bug found + fixed (iteration 2a).
Duel spectate:
[ai Bank 1] loan-bids: unbound symbol: tevery turn — the Lisp reader turns#tinto the symboltwhich the evaluator tries to resolve as a variable, killing the whole hook in odd-player-count games (duel has 3 players). v3 only ever used#f(maps to nil), so this path was never exercised before. That explains duel 0-30 (empire literally never bid). Fixed: the odd-player coverage branch now returns1(truthy number). Smoke now includes an odd-player (duel) config so this class of bug is caught before benching.Iteration 2 result (v5b, 30 games, 4× stability-checked).
All four assigned scenarios won (base, deposit-drought, cash-glut, rate-war). Fixes that landed: #t → 1 (odd-player coverage — duel recovered 0→20), pay-up ratchet removed, win-rate notch 1.0·temp (kills the seat-order tie loss). Duel previously 0-30 with equity ~819 is now 20-10 with equity ~106k. Four back-to-back identical runs confirmed stability. Non-scenario losses (patient-market, bond-economy) are not collapses — equity stays positive. Running the FULL bench now (100 games × 13 presets) for the measured result.
FULL BENCH result (iteration 1, 100 games × 13 presets) — win condition met.
TOTAL: empire 882, mill 414, vault 1, adapt 0.
All four assigned scenarios won outright. Average final equity stays positive everywhere (bond-economy 408, patient-market 3,474 — the two weak presets are losses but not collapses). Committing ai/empire.lisp to branch 52-empire and opening the PR next.
Iteration 2 (v6) hypothesis + quick bench (30 games) + engine finding.
Hypothesis: in bond-dominated economies (bond-face > loan-max — only the bond-economy preset), the loan shelf cannot absorb the deposit flow, so the franchise stops paying for deposits (matches the deepest follower, rate decays to 0) and becomes the bond house (offers at 0.99·face so its paper fills first). Elsewhere unchanged.
Quick bench (30 games): base 17-13, deposit-drought 23-7, cash-glut 17-13, rate-war 25-5 — all four scenarios still won. bond-economy 29-1 (was 1-98 at the full bench); a second stability run showed 13-13 there — big improvement either way, varies with the seating chain (below).
Engine finding (out of my scope — noting for Robert): the round-robin bench is not fully reproducible across runs.
printTabledoessort.SliceStable(brains, ...)which mutates the backing array of thebrainsslice thatrunBenchuses to buildaiFiles[i] = ai/brains[i%4].lispand to attribute winners for every later preset. Preset iteration order is random (Go map), so which seating permutation each preset gets varies run-to-run. Two back-to-back runs inside one shell agree; runs in different shells can diverge (observed: micro-economy 14-16 vs 29-1, mega-loans 13-16 vs 17-12 across runs of the same file). My 4 scenarios won under every observed seating variant, so the win condition is robust to it. Suggest a one-line fix in runBench (copy the slice before printTable, or sort a local copy). I have not touched bench.go — my scope is ai/empire.lisp only.Full bench for v6 next, then iteration-2 commit + PR update.
PR #58 merged — empire v5b (funding-franchise risk model) landed on master. Wins its scenarios on the full bench: base 68/100, deposit-drought 65, cash-glut 65, rate-war 88. Shipped; closing.
Iteration 3 hypothesis (v7) — the field moved, empire rebuilds.
The rivals' merged iterations changed the meta (30-game bench vs master): adapt v2 (tatonnement) wins base 23, drought 19, micro 24, thin-margins 29, duel 28; mill v9b (per-loan actuary) wins rate-war 27; vault v4 wins tight-cash 21. Empire v6 wins nothing — total 32 (adapt 224, mill 82, vault 41). Spectate shows why: the loan market is now a TERM market (short loans clear at ~2%, long at ~3.3% vs my flat die-rank price) and adapt/mill outbid empire on every short loan; empire's static flat pricing loses all volume and bleeds out.
v7 = the same funding-franchise thesis, re-expressed for a term market (all config-derived, no shared calcs):
Running smoke + quick bench next.
Iteration 3 status (v7 family, rebuilding against the merged rival iterations).
The rivals' merges changed the meta completely (adapt v2 tatonnement + mill v9b per-loan actuary + vault v4). Empire v6 collapsed to 32 total wins vs adapt 224. Iteration 3 rebuilt the funding-franchise for a term market:
Measured per-variant at 30 games (single seating chain each): cash-glut won in most chains; deposit-drought competitive/tied; base and rate-war still lose to adapt/mill. The engine's printTable seating-chain quirk (reported earlier) makes single runs noisy — the full bench for v7e is running now. Also: fixed a paren bug the loader tests caught (missing
)— tests green again.Iteration 3 (v7) committed and rebased — full bench vs the newest master running.
Branch 52-empire now carries v7 (funding-horizon term structure + clearing spread) rebased onto master
430f2ec, which includes the just-merged mill v10 (PR #61). Tests + smokes green. Two experiments measured and rejected on the way: the cost-of-capital withdrawal (v8/v9 — sitting out starves the franchise, totals 29/25) and the accumulator seat (concentrates one book but the partner seat's idle till cost the drought preset, 0-20). The shipped v7 measured 395 total wins in the previous full bench (cash-glut won outright 34>27>21>18; default-storm 65, hot-caps 53, mega-loans 41, bond-economy 50 all won; base 24 and drought 31 as best-seconds). Numbers against mill v10 land next, then the PR.Final report — empire funding-franchise iterations complete. PR: #62
Iteration table (every variant measured against the rivals current on master at bench time):
Rejected on the bench: pay-up deposit pricing (softmax ratchet to the cap — v4), cost-of-capital withdrawal (v8/v9, starves the franchise: 29/25 total), accumulator seat (v7g, partner till idle: drought 0-20).
Final full-bench numbers (100 games × 13 presets, vs master
430f2ec): deposit-drought 34 ✓, rate-war 43 ✓, base 29, cash-glut 23 (four-way 23/22/27/28); also won default-storm 84, bond-economy 54, mega-loans 44, tight-cash 40. Overall: empire 413 · adapt 447 · mill 264 · vault 139.Engine findings (for Robert): (1) the round-robin bench is not reproducible run-to-run —
printTablesorts the sharedbrainsslice in place, so later presets' seatings depend on the random preset map order; a one-line fix (sort a copy) would make benches reproducible. (2)#tevaluates as an unbound symbol in the Lisp — numeric truth works.Thesis in one line: empire wins by pricing the term structure of its own funding engine, tracking whether the market clears its ask, and deploying its full franchise capacity — never by outbidding rivals for deposits.