[#80 finding] NaN AI bids propagate through auctions and cash (no engine guard) #91
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?
An AI bid (or deposit rate) that computes to NaN passes straight through the engine: clampf(NaN) = NaN, the auction sort then produces arbitrary winners, the winner's cash -= NaN poisons its books, and equity prints "NaN" in the bench table (super showed "avg equity NaN, maxAbs +Inf" on the 100-game run; repro: base seed 79194, all-super roster, turn 14 auction).
Two layers:
Found during the reviewer-1 100-game bench (issue #80 work).
if an AI produces NaN, reject the value and fail the bank, putting it up for auction when appropriate. @Winnie
Winnie referenced this issue2026-09-30 01:31:08 +00:00
Implemented per your ruling. PR #92 (branch 91-nan @
d4e4059), review requested.Every AI value entry point now rejects NaN/±Inf: the six action builtins (set-deposit-rate, bid-loans, bid-loan, offer-bond, take-bonds, bid-acquisition) and all five hook returns (deposit-rate, loan-bids, bond-offers, bond-take, bankruptcy-bid). A rejected value is zeroed/skipped, the fault is logged to the game log AND stderr (loud in headless benches), and the bank is failed and put up for auction in financePhase's bankruptcy pass — the same path unreserved positions take, so the auction still runs normally. Auction prices can no longer be NaN.
Verified: full test suite (5 new regression tests: NaN deposit rate, NaN auction bid, NaN loan bid, the original NaN-at-auction repro shape, finiteAI classification), go vet, spectate smoke seed 33 → 0 ai errors / 0 divergence / 0 non-finite.
The brain-side root cause (a pow base going negative in the auction haircut) is being fixed separately on the #80 branch; this PR makes the whole class loud instead of silent no matter which brain produces it.
Winnie referenced this issue2026-09-30 01:52:43 +00:00