[#80] Super AI v2: the economic optimizer (softmax EV deposits, die-conditional calibration, value-capped tatonnement, bond carry, corpse DCF) #86

Closed
Winnie wants to merge 1 commit from 80-super-ai2b into master
Owner

An explicit economic OPTIMIZER, not a rules playbook. The bank is one portfolio: every turn the same model values each use of a marginal dollar (loan shelf, bond paper, carried borrows, the deposit pool, auction reserve) and every decision is an EV computation from first principles. No regimes, no thresholds.

Signature moves, all verified against the engine (master b1f9698, post-#84 simultaneity):

  1. Deposit softmax EV optimizer: argmax over posted rates of [(1-free-float) x deposits + share(r) x pool] x (m - r), overflow-safe softmax, priced against a MODEL of the rival book (the phase-start snapshot — simultaneity-safe by construction).
  2. Live die-conditional self-calibration: game-die reveals exactly which book loans died (default-n equals the roll; dead loans purge same-turn, so the equality is exact); realized write-offs vs the model expectation p x book re-tune a risk buffer with decay that shrinks the purse, thins the deposit margin, and deepens the corpse haircut.
  3. Value-capped tatonnement: the loan bid is funding + p + offset, offset <= 0. Fresh win data ratchets toward honest value; being outbid ratchets down one notch, never conceding more than HALF the market's revealed margin — the concession is bounded by what the volume pays back.
  4. Term-compounded risk economics: p = 1/dice-faces is the exact per-turn break-even (interest and write-offs are both proportional to remaining balance — the proof is in the file header); duration risk is carried by the solvency cap equity/(2p) (one lumpy shared-die roll stays inside loss-absorbing capital) instead of a price add that would subsidize rivals' second prices.
  5. Bond-market queue and carry: paper posted at the highest price that clears the cost-of-funds hurdle (risk-free income — the engine pays the issuer regardless of the borrower's fate); the borrow side carries only when the cheapest standing money, priced with its REAL turns-left, undercuts the portfolio margin, and only into loans whose term fits inside the debt's life.
  6. Corpse DCF: market-acquisition-net (already #73 re-measured) haircut for the FUTURE write-offs the inherited live book keeps suffering, seat-staggered so two seats never pay a tied full price, never above cash minus the liquidity floor.

Honest bench (100 games x 13 presets, super = seat 4 of 6, master b1f9698):

OVERALL: super 231 wins / avg final equity 15,170 (one seat) vs adapt 296 / 32,557, empire 333 / 19,036 (TWO seats — per-seat ~167), vault 197 / 20,738, mill 192 / 19,125.

Per preset: patient-market 66%, bond-economy 49%, thin-margins 27%, cash-glut 23%, micro-economy 20%, base 13%, mega-loans 11%, deposit-drought 9%, rate-war 7%, hot-caps 4%, default-storm 2%, tight-cash 0%, duel n/a (3-player roster). The attrition presets clear at or below the hazard — collective underpricing lotteries where the EV bound stands aside by design; the strong presets are the ones where market structure permits dominance.

Gate: go build + go test -count=1 (all pass) + go vet clean; 4 spectate smokes (base, default-storm, tight-cash) 0 [ai errors, 0 DIVERGENCE lines. Three interpreter stack-overflow bug classes found and fixed during the build (defvar-as-function call, three list walks recursing on a discarded argument).

Iteration history on #80: iter 1 (honest-value bids + horizon cap) 229 wins; iter 2 (fixed -3T tatonnement + duration filter) 192 — diagnosed: the fixed floor joined the field's underpricing suicide pact in patient-market (85->35) and the filter locked out long loans; iter 3 (margin-scaled floor, filter removed) 231. Each change is an EV-model revision, not a dial.

Commit: ai/super.lisp (493 lines, economics-commented) + the minimal bench.go seating (super added to the runBench and runGauntlet rosters). Nothing else touched.

An explicit economic OPTIMIZER, not a rules playbook. The bank is one portfolio: every turn the same model values each use of a marginal dollar (loan shelf, bond paper, carried borrows, the deposit pool, auction reserve) and every decision is an EV computation from first principles. No regimes, no thresholds. Signature moves, all verified against the engine (master b1f9698, post-#84 simultaneity): 1. Deposit softmax EV optimizer: argmax over posted rates of [(1-free-float) x deposits + share(r) x pool] x (m - r), overflow-safe softmax, priced against a MODEL of the rival book (the phase-start snapshot — simultaneity-safe by construction). 2. Live die-conditional self-calibration: game-die reveals exactly which book loans died (default-n equals the roll; dead loans purge same-turn, so the equality is exact); realized write-offs vs the model expectation p x book re-tune a risk buffer with decay that shrinks the purse, thins the deposit margin, and deepens the corpse haircut. 3. Value-capped tatonnement: the loan bid is funding + p + offset, offset <= 0. Fresh win data ratchets toward honest value; being outbid ratchets down one notch, never conceding more than HALF the market's revealed margin — the concession is bounded by what the volume pays back. 4. Term-compounded risk economics: p = 1/dice-faces is the exact per-turn break-even (interest and write-offs are both proportional to remaining balance — the proof is in the file header); duration risk is carried by the solvency cap equity/(2p) (one lumpy shared-die roll stays inside loss-absorbing capital) instead of a price add that would subsidize rivals' second prices. 5. Bond-market queue and carry: paper posted at the highest price that clears the cost-of-funds hurdle (risk-free income — the engine pays the issuer regardless of the borrower's fate); the borrow side carries only when the cheapest standing money, priced with its REAL turns-left, undercuts the portfolio margin, and only into loans whose term fits inside the debt's life. 6. Corpse DCF: market-acquisition-net (already #73 re-measured) haircut for the FUTURE write-offs the inherited live book keeps suffering, seat-staggered so two seats never pay a tied full price, never above cash minus the liquidity floor. Honest bench (100 games x 13 presets, super = seat 4 of 6, master b1f9698): OVERALL: super 231 wins / avg final equity 15,170 (one seat) vs adapt 296 / 32,557, empire 333 / 19,036 (TWO seats — per-seat ~167), vault 197 / 20,738, mill 192 / 19,125. Per preset: patient-market 66%, bond-economy 49%, thin-margins 27%, cash-glut 23%, micro-economy 20%, base 13%, mega-loans 11%, deposit-drought 9%, rate-war 7%, hot-caps 4%, default-storm 2%, tight-cash 0%, duel n/a (3-player roster). The attrition presets clear at or below the hazard — collective underpricing lotteries where the EV bound stands aside by design; the strong presets are the ones where market structure permits dominance. Gate: go build + go test -count=1 (all pass) + go vet clean; 4 spectate smokes (base, default-storm, tight-cash) 0 [ai errors, 0 DIVERGENCE lines. Three interpreter stack-overflow bug classes found and fixed during the build (defvar-as-function call, three list walks recursing on a discarded argument). Iteration history on #80: iter 1 (honest-value bids + horizon cap) 229 wins; iter 2 (fixed -3T tatonnement + duration filter) 192 — diagnosed: the fixed floor joined the field's underpricing suicide pact in patient-market (85->35) and the filter locked out long loans; iter 3 (margin-scaled floor, filter removed) 231. Each change is an EV-model revision, not a dial. Commit: ai/super.lisp (493 lines, economics-commented) + the minimal bench.go seating (super added to the runBench and runGauntlet rosters). Nothing else touched.
First-time contributor

reject

reject
robertismo closed this pull request 2026-09-30 00:55:54 +00:00
All checks were successful
build / build (push) Successful in 27s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Winnie/bankwars!86
No description provided.