Spielerando

The Bugs Our Proofs Found in Our Own Code

On 25 and 26 November 2026 we wrote a TLA+ model, a Z3 file and a Lean proof for every one of the 113 blueprints on this site. They found 17 bugs in the reference code of 16 blueprints: code that already had tests, and passed them. Every bug is fixed, each with a new test that failed before the fix. Below is each one in plain words: what went wrong, which check caught it and how, and what we changed. At the end: what these checks do not cover.

The bugs a player could see on screen have a page of their own in Fixes, named after what you would see, with a test you can run on your own game.

How the three checks caught them

  • TLA+ describes the rules as states and steps, and its checker TLC walks through every state a small version of the game can reach. When a rule breaks, it prints the shortest path there, step by step. The TLA+ guide
  • Z3 looks at all settings in the allowed ranges at once and either proves that no setting breaks a rule or shows one that does. It can count in the same 64-bit numbers a game uses, which is how it found the rounding bugs. The Z3 guide
  • Lean proves a rule for every possible input, however long the game runs, and ends with a small worked case that shows the old mistake. The Lean guide

Each check was also given a mistake on purpose, a "planted" one, and only counted once it caught it. A check that cannot fail proves nothing. The results on every blueprint page are written by the script that ran the tools, never by hand.

Numbers a hair short

A computer stores decimals in binary, and most of them, 0.1 among them, are stored a tiny bit off. Four bugs came from that.

Season track: a full tier stayed locked

Experience awarded in fractions, 0.1 + 64.1 + 35.8, is 100 on paper but 99.99999999999999 in the computer, so a tier of 100 counted with a plain round-down stayed locked. Z3 found it by adding the three numbers the way the code does. The season track now allows a billionth of a tier before rounding down. Symptom page: the XP bar is full, but the level will not unlock.

Currency wallet: a sale paid one coin short

Selling for 100 at a share of 0.29 paid 28 coins, because 100 × 0.29 is 28.999999999999996, and earning 100 with a bonus of 1.15 paid 114. It was fixed in the same round of checks; our notes do not say which of the three tools pointed at it. The currency wallet now rounds with the same tiny allowance. It is on the same symptom page as the season track.

Item upgrades: a certain try could still miss

After three misses at a first chance of 0.1 and help of 0.3 per miss, the next try should be certain. The sum is 0.9999999999999999, which is exactly the highest roll a game can draw, so that one roll still missed. Z3 found it in 64-bit numbers. The item upgrades now count a chance within 0.000000001 of 1 as 1. No symptom page: only that single highest roll misses, which a player will practically never meet.

Charge jump: full charge came one tick late

Twelve ticks of 1/60 of a second add up to a hair under 0.2, so a charge of 0.2 seconds became full on the 13th tick. Z3 found it the same way. The charge jump now counts a charge that close to full as full. No symptom page: one tick, a sixtieth of a second at 60 frames a second, is hard for a player to notice.

Timing in frames

A game runs in frames, and a frame can be long or short. Four bugs were about where in a frame something happens.

Ammo and reload: a held trigger fired a frame late

The code looked at the wait since the last shot before it took the frame's time off, so every held shot came one frame late: 38 shots in ten seconds at 60 frames a second instead of 40. TLC found the frame in which a shot should have come. The ammo and reload blueprint now counts down first. Symptom page: the gun fires slower than its fire rate.

Oxygen meter: the first drowning hit came late

The beat of the drowning hits started at the end of the frame in which the air ran out, not at the moment it ran out, so after a long frame the first hit came up to a frame late, and the hits no longer matched the time spent under water. TLC found it. The oxygen meter now starts the beat at the moment the air is gone. No symptom page: the delay is at most one frame.

Grappling hook: a long frame caught a different anchor

The hook ranked the anchors near its path by where it passed closest to each, not by which one it reached first. Z3 found two anchors, A at (5, 0) on the path and B at (4.8, 1.99) beside it, with a reach of 2, for which one long step caught B and many short steps caught A. The grappling hook now takes the anchor it reaches first. Symptom page: the grappling hook grabs the wrong point when the game stutters.

Weather system: the sky changed before its fade was done

A spell cut short to the length of the fade ended on the step in which the fade would have finished, so the next change came with the fade at 19 of 20. Lean caught it with a worked case of exactly that. The weather system now waits one step for the fade. No symptom page: one step of fading was left, the same amount the sky moves in any step, so on screen it hardly shows.

Counting that went wrong

Autosave: a change could wait past the longest wait

While a save was being written, the player kept playing. When the save finished, the clock of the oldest unsaved change started at zero again, so a change made during the save could wait 8 seconds against a longest wait of 5. TLC found the path; Z3 then showed a change waiting 10 seconds with a longest wait of 5. The autosave now keeps a second clock for changes made during a save. Symptom page: autosave is on, but a crash loses more than it should.

Achievements: six unlocks were announced as nine

A summary pop-up ("and 3 more") kept its count after it ended while another pop-up was waiting, so the next summary told the same unlocks again. TLC found a path through six states on which one unlock was set to be told twice, and Lean replayed the busy moment: six unlocks, nine announced. The achievements blueprint now clears the count when a summary ends. Symptom page: the achievement pop-up tells the same unlocks twice.

Currency wallet: coins vanished without a word

When the wallet's limit was lowered below the coins held, the coins over it were cut, and the code reported a change of 0 and nothing lost. TLC caught it with the rule that no coin may vanish unseen. The currency wallet now reports such coins as lost. No symptom page: cutting the coins is the rule, only the report was missing.

The edges of a range

Ladder climbing: hanging in the air below the ladder

The climb started from wherever the body touched the ladder, so a body touching it 2 units below its foot climbed on, 1 unit below the ladder's end. TLC found it; Z3 showed the first frame from half a unit below ending at -0.45, and Lean proved the fixed rule. The ladder climbing blueprint now holds the start between the ladder's ends. Symptom page: the character hangs in the air below the ladder.

Clue journal: a case closed before any clue was found

A case that asks for no deductions could be closed with an empty journal, because "every deduction is made" is true of an empty list. The blueprint's own pitfalls said it should not. TLC found the close straight from the start, and Lean shows the old rule closing the empty case. The clue journal now needs the first clue, and its diagram gained the arrow for such a case. Symptom page: the quest is done before the player did anything.

Loot table: a table that froze the game

The roll draws again until a number fits, and a table whose weights add up to more than 4,294,967,296 keeps no number at all, so the redraw would never end. Z3 found such a total, and the loot table now refuses the table when it loads. Symptom page: the game freezes when loot drops.

Names and numbers that are not what they seem

World state flags: "constructor" was taken for a counter

Every JavaScript object already answers to a few names, such as "toString" and "constructor". The code took those for counters the game had listed, and a counter that was not a number crept in. It came up in the same round of checks; our notes do not say which tool. The world state flags now count only the list's own names. Symptom page: health shows NaN and the enemy will not die.

Damage types: an endless hit made health not a number

An endless amount, which is what a division by zero gives, times an absorb share of 0 is not a number, and health became not a number with it. Our notes do not say which tool found it either. The damage types blueprint now counts only finite amounts above zero. It is on the same symptom page as the world state flags.

Ability gates: a misspelled ability slipped through

The dead-end check missed a misspelled ability on a gate that takes any one of its abilities, because the gate still opened through the right one. Z3 found such a world. The ability gates check now also lists every name a gate asks for that no ability has. Symptom page: the door will not open, although the player has the ability.

What these checks do not cover

  • They check models, not the code itself. Every TLA+, Z3 and Lean file describes a blueprint's rules again, by hand, in its own language, and a model can leave something out. What shows a bug was real, and is gone, is the test in the real TypeScript that failed before the fix and passes after it.
  • TLC walks small worlds. A few units of time, two or three items, small numbers. Inside those bounds it misses no path; outside them it says nothing.
  • Z3 answers about what its file says. Where a file uses real numbers it cannot see rounding at all; the rounding bugs were found only where a file counted in a game's 64-bit numbers.
  • Lean proves the rules of its model for every input, not the TypeScript.
  • None of them looks at fun or feel, or at the Godot versions of the code.
  • 17 is what these checks found, not all there is. While writing the symptom pages we found two more gaps by reading the fixed code: the loot roll still froze when a game skipped the table check, and the ability check took "constructor" for an ability. Both are fixed with tests.

The same checks also found many places where a page's text or its allowed settings break the page's own promise, such as an autosave that can cost 70 seconds of play where its longest wait says 60. Those are not bugs in the code and are not counted above; we are fixing them page by page, in both languages.

Doing the same for your game

You do not need to write TLA+, Z3 or Lean yourself. Ask your AI to write down the rules of the part that worries you as a model first, to break one rule on purpose and show you the checker catching it, and to paste you the checker's real output. The guides above have texts to paste for each tool, and the check page runs our checkers in your browser, with nothing sent anywhere.

Play the mechanics on this page

Was this page helpful?

One click, no account. It shows us which pages help.

Next step

Guide

My Game Keeps Breaking: Why, and What to Tell Your AI

Your game breaks when you add something because new code touches parts that worked. Change one thing at a time and list what must keep working.

Last updated: 2026-11-26