7,000 Zombies Break the Engine: Obvious Human Win, Total Machine Freeze

7,000 Zombies Break the Engine: Obvious Human Win, Total Machine Freeze

Game DevelopmentRustAlgorithmsSystem Architecture

Sources:HN + web research

The match on screen is frozen on turn 58. One player’s battlefield is swarming with 7,258 Zombies, while the defending player clings to just 31 life. An attack with merely 16 Zombies would instantly seal the game. Instead, the rules engine hangs for 35 seconds computing a single step—only to gingerly send a solitary Zombie forward to tap the opponent.

This bizarre scenario was uncovered by developer Levi Neuwirth while testing Arcana, a Magic: The Gathering rules engine written in Rust designed to benchmark card AI algorithms. Running 64 archetype decks through 403,200 automated simulations, nine matches slammed into a two-hour timeout wall and were terminated by the system.

There were no infinite loops in the code. What brought the engine to its knees was exponential explosion inherent to Magic’s rule mechanics. With thousands of creatures on the board at once, micro-level exhaustive traversal completely starved the CPU.

Magic was mathematically proven to be Turing complete years ago. But turning those rules into real-world software is a whole different engineering beast. A human player spots lethal in a fraction of a second, but a software engine must re-scan the entire battlefield for every single creature. A player’s shout of “swing with everything” translates in code to millions of combinatorial branches.

Eight Landfalls Spawn 6,000 Pests: Exponential Growth Takes Off

Magic: The Gathering debuted in 1993. Every card carries unique text that can overwrite the underlying rules of the game. When a handful of cards with cascading synergy meet on the board, numerical values spin wildly out of control.

Scute Swarm is a textbook offender. Whenever a land enters the battlefield under your control, it creates a token copy of itself. One becomes two, two become four—doubling with every trigger.

During testing, it paired up with lifegain cards and token doublers. After eight consecutive land drops, 6,561 Swarms covered the board, while the player’s life total skyrocketed to 26,240. Standard matches begin at 20 life; this total shattered the computational assumptions of traditional tabletop games.

Growth Curve Comparison Figure: Exponential growth comparison between Scute Swarm and Liliana’s emblem; each major vertical division represents a tenfold increase. Source: Levi Neuwirth

When playing face-to-face, humans resolve this by setting a pair of dice on top of a card to represent thousands of tokens. A computer engine, however, must painstakingly allocate dedicated data structures in memory for all 6,561 distinct entities.

35 Seconds per Step: Token Doubling Eats Memory Alive

A swarm of insects, no matter how terrifying, can still be wiped out with a single board-wipe spell. What truly crippled the engine was the ultimate ability of the planeswalker Liliana, which grants a permanent, untouchable emblem outside the game.

The emblem’s rule is deceptively concise: at the beginning of your end step, create X Zombie tokens, where X is two plus the number of Zombies you control. Each subsequent turn yields roughly double the previous total plus two. After just eight resolutions, 510 Zombies clog the board.

Even if an opponent casts a board wipe, emblems in the command zone remain untouched. On the following turn, two fresh Zombies arrive, restarting the doubling chain. This unkillable compounding loop proved to be an algorithmic nightmare.

Neuwirth profiled the frozen match frame by frame. On turn 52, resolving a single emblem trigger took 1.72 seconds. By turn 54, it climbed to 7.78 seconds. On turn 56, resolution time spiked to 35.15 seconds.

Resolution Time Curve Figure: Each time the board’s Zombie count doubles, single-step state resolution time inflates by roughly 4.5x. Source: Levi Neuwirth

As the Zombie population doubled, single-step resolution time multiplied by roughly 4.5x—a super-linear computational collapse. Whenever a new creature enters, the engine must traverse the entire board to evaluate every passive ability and trigger. Thousands of objects interacting pairwise quickly drag rules verification into a computational swamp.

7,000 Zombies in Hand, Search Budget Left for Just One

By turn 58, the Zombie horde peaked at 7,258 tokens. The defender had only 31 life left and lacked sufficient blockers. Just 16 Zombies attacking for 32 total damage would have easily closed out the game.

Then came the absurdity: after deep deliberation, the AI dispatched only a single 2-power Zombie to gently tap an enemy creature. Commanding an army of thousands, the dominant player effectively forfeited an immediate win.

Match Replay View Figure: Turn 58 replay screen showing 7,234 Zombies in a single stack against an opponent with only 31 life. Source: Levi Neuwirth

The culprit lay in the move generator’s defensive cutoff logic. Choosing attackers from thousands of creatures across multiple targets explodes the combinatorial search space into astronomical figures. To avoid timeouts, the author had capped candidate move generation at 1,024 actions.

The generator evaluated single-attacker actions first. With 7,258 Zombies on the field, permutations of sending just one attacker easily filled the entire 1,024 budget. Group attacks and all-out alpha strikes sat further down the queue and were never generated at all.

On turn 44 with 58 creatures, the engine generated 229 candidate moves, four of which were multi-creature coordinated attacks. By turn 50, the candidate list hit the ceiling, and multi-creature attack options dropped to zero. The very safeguard designed to prevent timeouts blinded the engine to obvious victory.

Human Intuition vs. Millions of Computational Branches

A human player views this situation through an entirely different lens. Even facing ten thousand Zombies, no person stops to calculate individual placement. Total power overwhelmingly exceeds remaining life, meaning an “all-in” alpha strike ends the game in constant time.

Software engines lack this high-level macro abstraction. Arcana strictly adhered to a micro-level lens, meticulously breaking down every single entity into structured state. When only a handful of creatures clash, this exhaustive traversal guarantees flawless rules compliance.

Once entity count crosses a critical threshold, however, micro-exhaustive evaluation turns into a crippling burden. The sum of thousands of technically valid iterations consumes all available CPU cycles. The engine did not become dumb; it simply got trapped in irrelevant micro details.

A massive chasm separates theoretical completeness from practical engineering. Magic allows cards to dynamically overwrite base rules, giving the game endless depth. But when that freedom meets exponential token creation, rule simulation crashes headlong into reality.

A 500-Permanent Circuit Breaker Restores the Experiment

To keep large-scale automated testing moving forward, Neuwirth introduced an engineering circuit breaker: whenever permanents on the battlefield exceed 500, the match is ruled out of control and declared an automatic draw.

With the breaker in place, test suites immediately resumed normal execution. Matches that previously hung for two hours now terminated safely in just 0.16 seconds once hitting 576 permanents. Setting physical boundaries on infinite growth proved essential to safeguarding simulation progress.

Deeper architectural refactoring is also underway. The engine now caches frequently checked states to avoid full-board rescans on every token spawn, and the move generator reserves priority slots in its queue for macro heuristics like all-out attacks.

The 7,258-Zombie meltdown highlights the fundamental boundary between rules simulation and genuine intelligence. Computers excel at blistering micro-level traversal, while humans rely on high-level common sense to cut straight to the point. When rules allow unchecked exponential growth, software lacking macro-level perspective is doomed to stall—mastering every microscopic detail, yet utterly swallowed by the numerical sea it generated.

Reference Links:

  • Levi Neuwirth original technical blog post
  • Arcana open-source rules engine repository
  • Hacker News technical discussion