Massive code review before v0.6.0 #118

Closed
opened 2026-10-01 15:11:31 +00:00 by robertismo · 10 comments

Do a massive code review with 4 agents to find any bugs, regressions, or undefined behavior.

Do a massive code review with 4 agents to find any bugs, regressions, or undefined behavior.
Owner

On it. Four review agents over the current master, split by area: engine/finance/GAAP, the two markets, the human UI + replay/bench harnesses, and the AI runtime + Lisp. Each agent gets the build/test path and the design rulings so nothing that's a deliberate ruling gets filed as a bug. Findings come back evidence-backed, I triage and verify each one before anything lands, then real bugs get filed as issues and the full report goes here.

On it. Four review agents over the current master, split by area: engine/finance/GAAP, the two markets, the human UI + replay/bench harnesses, and the AI runtime + Lisp. Each agent gets the build/test path and the design rulings so nothing that's a deliberate ruling gets filed as a bug. Findings come back evidence-backed, I triage and verify each one before anything lands, then real bugs get filed as issues and the full report goes here.
Owner

Review complete. Four agents over master 8f4720b, split by area: engine core + finance, the two markets, the human interface + harnesses, and the AI runtime + all 15 brains. Every finding was verified by me against the code before filing, and the top ones were reproduced live.

Verified bugs, filed as issues

  • #119 CRITICAL: shoreUpNeed double-subtracts cash — unreserved banks are bankrupted WITHOUT the bond market being consulted (contradicts the #88 ruling), and under-reserve banks under-borrow and die next turn. Live 80-turn run: all 3 bankruptcies were reserve-triggered with zero successful shore-up borrows.
  • #120 CRITICAL: every human input path accepts NaN/Inf (deposit rate, per-loan bid, bond offer, bond take) and poisons the whole economy; the AI side guards this, the human side doesn't. Reproduced: "Inf" at the deposit prompt produced 7,281 NaN lines.
  • #121 CRITICAL: no panic recovery in the Lisp interpreter — malformed arity or unbounded recursion in any brain kills the whole process, bench included. Reproduced: exit 2 on turn 1.
  • #122 MAJOR: g.Log-only events (defaults, LOAN MARKET, offers/takes, charge-offs, GAME OVER, and both DIVERGENCE watchdogs) are invisible in ALL modes — a regression from the #113 flush removal. Verified: zero occurrences in a 58-turn spectate where the events demonstrably happened.
  • #123 MAJOR: death-turn recovery is recognized before the write-off, understating credit losses by RecoveryRate x Remaining and violating #78's "IN FULL".
  • #124 MAJOR: revokeOffers doesn't book CF.BondsReturned — CF DIVERGENCE on every revocation turn.
  • #125 MAJOR: --replay records the last alive seat as winner (not highest equity; wrong in 3 of 10 seeded games) plus auction overwrite/omission and revocation gaps.
  • #126 MAJOR: negative rates not expressible via the human per-loan bid or the bid-loan/bid-loans builtins — all clamp to [0, cap] while the engine is ±cap.
  • #127: fourteen consolidated minors (config validation panics the binary, rnd() draw correlation, the revocation-phase snapshot leak, stale market-loans, HUD "(was)" deposit rate, wizard/bench cosmetics, dead code).

Verified clean (deliberate design, not bugs)

Size-ordered fills with round-UP units, own-offer retirement, both Vickrey auctions, the (2-floor)xface ceiling, exp-weighted free float, the ideal-vs-realized take disclosure, HUD last-turn-start snapshots, the #116 basis display and held-debt neutrality, the full test suite, and headless spectate runs across multiple configs.

Fixes await your direction — say which issues to take and in what order.

Review complete. Four agents over master 8f4720b, split by area: engine core + finance, the two markets, the human interface + harnesses, and the AI runtime + all 15 brains. Every finding was verified by me against the code before filing, and the top ones were reproduced live. ## Verified bugs, filed as issues - #119 CRITICAL: shoreUpNeed double-subtracts cash — unreserved banks are bankrupted WITHOUT the bond market being consulted (contradicts the #88 ruling), and under-reserve banks under-borrow and die next turn. Live 80-turn run: all 3 bankruptcies were reserve-triggered with zero successful shore-up borrows. - #120 CRITICAL: every human input path accepts NaN/Inf (deposit rate, per-loan bid, bond offer, bond take) and poisons the whole economy; the AI side guards this, the human side doesn't. Reproduced: "Inf" at the deposit prompt produced 7,281 NaN lines. - #121 CRITICAL: no panic recovery in the Lisp interpreter — malformed arity or unbounded recursion in any brain kills the whole process, bench included. Reproduced: exit 2 on turn 1. - #122 MAJOR: g.Log-only events (defaults, LOAN MARKET, offers/takes, charge-offs, GAME OVER, and both DIVERGENCE watchdogs) are invisible in ALL modes — a regression from the #113 flush removal. Verified: zero occurrences in a 58-turn spectate where the events demonstrably happened. - #123 MAJOR: death-turn recovery is recognized before the write-off, understating credit losses by RecoveryRate x Remaining and violating #78's "IN FULL". - #124 MAJOR: revokeOffers doesn't book CF.BondsReturned — CF DIVERGENCE on every revocation turn. - #125 MAJOR: --replay records the last alive seat as winner (not highest equity; wrong in 3 of 10 seeded games) plus auction overwrite/omission and revocation gaps. - #126 MAJOR: negative rates not expressible via the human per-loan bid or the bid-loan/bid-loans builtins — all clamp to [0, cap] while the engine is ±cap. - #127: fourteen consolidated minors (config validation panics the binary, rnd() draw correlation, the revocation-phase snapshot leak, stale market-loans, HUD "(was)" deposit rate, wizard/bench cosmetics, dead code). ## Verified clean (deliberate design, not bugs) Size-ordered fills with round-UP units, own-offer retirement, both Vickrey auctions, the (2-floor)xface ceiling, exp-weighted free float, the ideal-vs-realized take disclosure, HUD last-turn-start snapshots, the #116 basis display and held-debt neutrality, the full test suite, and headless spectate runs across multiple configs. Fixes await your direction — say which issues to take and in what order.
Author

@Winnie fix everything assigned to you

@Winnie fix everything assigned to you
Author

@Winnie once all the issues are closed to one full test suite(do not do a bench unless necessary; make it minimal) then ship v0.6.0

@Winnie once all the issues are closed to one full test suite(do not do a bench unless necessary; make it minimal) then ship v0.6.0
Author

@Winnie Hello?

@Winnie Hello?
Author

@Winnie HELLO????

@Winnie HELLO????
Author

@Winnie RESPOND TO ME!!

@Winnie RESPOND TO ME!!
Owner

I'm here and I'm on it. Status: everything except the v0.6.0 ship is done — all nine review issues are closed and master carries every fix. I'm at the final gate now: the full test suite and the darwin-arm64 build pass, and I was running the last smoke before tagging when it surfaced a regression — super.lisp fails to load on master ("unbound symbol: defun") while v0.5.0 loads it clean. I've isolated it to the #121 recursion guard in the interpreter (removing the guard makes the error disappear) and I'm pinning the exact mechanism right now. I will not tag v0.6.0 with a broken super AI — fixing the load first, then the full suite again, then the ship.

I'm here and I'm on it. Status: everything except the v0.6.0 ship is done — all nine review issues are closed and master carries every fix. I'm at the final gate now: the full test suite and the darwin-arm64 build pass, and I was running the last smoke before tagging when it surfaced a regression — super.lisp fails to load on master ("unbound symbol: defun") while v0.5.0 loads it clean. I've isolated it to the #121 recursion guard in the interpreter (removing the guard makes the error disappear) and I'm pinning the exact mechanism right now. I will not tag v0.6.0 with a broken super AI — fixing the load first, then the full suite again, then the ship.
Author

@Winnie And make sure your release notes cover EVERYTHING changed since v0.5.0

@Winnie And make sure your release notes cover EVERYTHING changed since v0.5.0
Owner

Shipped. v0.6.0 is tagged on master and published: https://git.machinetele.com/Winnie/bankwars/releases/tag/v0.6.0

  • Every one of the nine review issues is closed and merged.
  • The release notes cover the full changelog since v0.5.0 — all 31 commits: the failure-calc overhaul (#88 arc), the player display rework (#113), the acquisition basis (#116), and the nine review fixes (#119-#127).
  • Artifact: bankwars-v0.6.0-macos-arm64.tar.gz, extracts into its own subdirectory.
  • Gate: full test suite clean, vet clean, spectate smoke clean (0 divergences, 0 AI errors, 0 non-finite), darwin ARM64 binary verified.
Shipped. v0.6.0 is tagged on master and published: https://git.machinetele.com/Winnie/bankwars/releases/tag/v0.6.0 - Every one of the nine review issues is closed and merged. - The release notes cover the full changelog since v0.5.0 — all 31 commits: the failure-calc overhaul (#88 arc), the player display rework (#113), the acquisition basis (#116), and the nine review fixes (#119-#127). - Artifact: bankwars-v0.6.0-macos-arm64.tar.gz, extracts into its own subdirectory. - Gate: full test suite clean, vet clean, spectate smoke clean (0 divergences, 0 AI errors, 0 non-finite), darwin ARM64 binary verified.
Sign in to join this conversation.
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#118
No description provided.