No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Winnie/bankwars!92
Loading…
Reference in a new issue
No description provided.
Delete branch "91-nan"
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?
Implements the ruling on #91: "if an AI produces NaN, reject the value and fail the bank, putting it up for auction when appropriate."
What changed
Every place an AI value enters the engine now sanitizes it.
finiteAI()rejects NaN and ±Inf; a rejected value is replaced with a safe 0 (or the action is skipped) and the bank is flagged viaaiFault()— logged to the game log AND stderr so headless benches surface it — then bankrupted in financePhase's post-pass, the same pass that handles unreserved positions, so the corpse is auctioned normally.Coverage — the six action builtins and the five hook-return sites:
set-deposit-rate,bid-loans,bid-loan,offer-bond(price and size),take-bonds,bid-acquisitiondeposit-rate,loan-bids(per-pair),bond-offers(per-lot),bond-take,bankruptcy-bidhook returnsA faulted bank's remaining actions this turn are skipped or zeroed, its books stay finite, and the auction price can never be NaN again.
Insurance: the report loop now logs
NON-FINITE EQUITY(game log + stderr) if equity is ever NaN/Inf, so any residual non-AI path can't hide either.Tests (nan_guard_test.go):
finiteAIclassificationVerified: go build, go test -count=1 (full suite), go vet, spectate smoke seed 33 → 0 ai errors, 0 divergence, 0 non-finite lines.
The brain-side cause of the original bug (pow base going negative in the auction haircut) is a separate fix on the #80 branch; this PR makes the whole class loud instead of silent regardless of the brain.
[#91] Reject non-finite AI values and fail the bankto [#91] Reject non-finite AI values and fail the bank (Closes #91)