Documentation
¶
Overview ¶
Command cardfuzz plays bot-vs-bot games between randomly generated mono-colour decks drawn from the whole supported corpus, to surface engine panics, livelocks, submit errors and replay divergences that the curated repo decks never reach.
Each deck is 60 cards: 20 lands (basics of its colour, up to 3 of them swapped for sampled non-basic lands: the ~1/3 mana share), and 40 distinct non-land cards sampled from the supported cards whose colour identity is that colour or colourless. Sampling is weighted toward cards the accumulated coverage state has seen least, so repeated runs walk the whole pool.
Runs go in batches: every deck of a batch is generated sequentially from (-seed, game index) and the coverage snapshot taken at the batch's start, then the batch plays on -workers goroutines.
A game whose live object count passes -max-objects (a runaway token engine) is ended by the harness and recorded as kind "bigboard", distinct from an engine "hang" or "livelock". Every failure is appended to -failures as one JSON line carrying both full deck lists, the game seed and the diagnostic, and `cardfuzz -repro <file> -line N` replays it.
-autopay off|all|mixed arms production-bot seats with the hosted bot's payment-plan wrapper (heuristic.Bot.EnableAutoPayMana), so they cast through the engine's offered PaymentActions instead of floating mana by hand; off is byte-identical to the fuzzer before the flag. The failure record carries the mode, and the run summary (and -stats) counts planned casts, reversed planned casts, PaymentFallback windows, priority decisions with a plan and the casts an auto-pay seat still paid by hand. See autopay.go.
-measure-manual-seat-plans is a diagnostic-only opt-in for -autopay off: an off run has no payment-plan consumer, so no seat's extension is built and the manual_seat_priority_with_plan counter stays zero. Setting the flag forces the planner at every priority window to restore that counter at the cost of runtime; it changes no game, intent, replay signature or failure record. See autoPay.measureManualSeatPlans.
-manabrew replaces every seat's bot policy with the ManaBrew wire: each seat is an mbtest.TranslatingSeat answering a seeded-random mbtest.MockClient, so every decision crosses server/manabrew's Translator as a wire prompt and back. A game fails on any unmapped decision, rejected response, translator panic or replay divergence, and its failure record carries "manabrew": true so -repro rebuilds the same seats. One census (posed/enumerated/rejected/unmapped counts) is shared across every game of the run and printed at the end. The bot-only knobs -autopay and -explore-autopay are rejected (there is no bot policy to wrap); -explore is ignored (-explore=false is honoured by the lane wholesale). See the lane branch in playGame.