Aristotle Formally Verifies Celeste Speedrun Optimality Aristotle, an AI system, formally verified in Lean that the 2,843-frame Celeste Classic PICO-8 speedrun is optimal, proving no faster run exists. In a separate no-orb category, Aristotle found a new 2,937-frame run, beating the previous 2,941-frame best, and proved it optimal as well. The system used 114 subagents over 63 hours and, in the room with the largest computation, checked only about 224 million states—over 100 orders of magnitude less than brute force—by exploiting a 3-pixels-per-frame climb bound and merging subpixel positions to cut branching. Celeste Classic is a platformer played on the PICO-8 fantasy console. Speedrunners, with computer assistance, programmed a way to beat the game in 2,843 frames. Aristotle showed that no one will ever be able to do better. In a separate speedrun category, Aristotle set a new PICO-8 record time—and also showed this time to be optimal. Celeste Classic consists of 30 almost independent rooms that Madeline the game's main character must climb through. First, Aristotle translated the game into Lean, a language for formal verification.1 This allows it to prove facts about all possible runs of the game, over all possible input sequences. Reasoning logically about the execution of the source code of the game, Aristotle can put together a proof that a particular speedrun is optimal, without actually trying them all. Aristotle started by proving general facts about each room; for example, the "climb bound" shows that, on average over a whole room, Madeline can only climb 3 pixels/frame, which gives us a lower bound on the number of frames required to solve the game. This bound shows we need at least ~1,800 frames—but this is 1,000 frames less than the best known time. It's clear that similarly simple techniques cannot let you prove the optimality of a speedrun. The key problem to solve to show the speedrun is optimal is to work out how to minimize the search space so that not all possible states and sequences of moves need to be considered. There are 36 possible input combinations per frame, and the longest room requires 172 frames—this results in an unfathomably large number of possible runs of the game. Aristotle needed to reduce the number of runs that it explored, and rule out entire families of runs. In the room with the largest required computation, Aristotle only checked ~224 million states—well over 100 orders of magnitude less than brute force. Aristotle needed to pull every trick out of the bag in order to do this—using the climb bound above many times, merging various subpixel positions in order to simplify the state space, carefully analyzing what states were "dominated" by other states, making per-room tables, etc. One interesting trick Aristotle discovered was to collapse some proof obligations together into a "harder" goal to prove, but in a way that is simpler to manage. For example: say we prove that Madeline's position x is such that a < x < b, or c < x < d, or e < x < f. If we prove that for all x such that a < x < f, Madeline requires at least 20 more frames to finish the room, then we also solve it for the more specific cases. The general statement takes slightly more thought to prove—but only proving one statement, instead of three, means the search doesn't have to branch. This technique was used many times by Aristotle with Madeline's subpixel coordinates—this makes the individual proofs a little harder, but it decreases branching by an enormous amount. To do all this work, Aristotle made use of 114 subagents over 63 hours: In the same run, Aristotle also proved that a variant speedrun category, where Madeline does not pick up the power-up orb that allows her to double-dash, has a new and proved optimal solution. The previous best known PICO-8 run was 2,941 frames—Aristotle found a run in 2,937 frames, and proved it optimal. The best known one-dash TAS completes the 2600m level in 149 frames. However, Aristotle showed that it requires 151 frames—how could this be? It comes down to exactly how you model your numbers Most Celeste Classic TASes are generated using Celia, a TAS Tool-Assisted Speedrunning tool for PICO-8 cartridges. As it notes in its README: by default Celia uses floats instead of 16.16 Fixed point numbers These subtly different number representations affect exactly how Madeline moves, and in the most extreme cases, Madeline can be killed under one interpretation and survive under the other. The game's community accepts runs that work either on Celia or on the PICO-8 console itself, as long as you don't change within the run. Gravity in Celeste Classic is the constant 0.21. Depending on what runs the game, it ends up as one of three slightly different numbers: PICO-8 does its arithmetic in "16.16 fixed point": every number is a whole count of 65,536ths. 0.21 is 13,762.56 of those. The PICO-8 documentation says that "numbers written in decimal are rounded to the closest fixed point value," which would give 13763/65536 = 0.2100067. The PICO-8 console does not follow this documentation, and instead truncates 13,762.56 to 13,762. It stores 13762/65536 = 0.2099915, so its gravity is slightly weaker. Celia, by default, uses floating-point numbers: it stores 0.209999999999999992228, which is practically equal to 0.21. At the point where this affects us, Madeline is currently being carried up by a jump she made earlier. Under the weaker gravity setting, she has slightly more upward speed, and her calculated movement comes out to just over 1.5px—after rounding, this means she is due to move up 2px. Celia models her as being able to move up 1px. Due to a quirk of Celeste Classic's movement code, they actually move up one more pixel than that—3px and 2px, respectively. On the next frame, when doing the same calculation, the fixed-point math does not record that she should move up—in the end, she moved up too much last frame. Under Celia, the calculation still works out that we need to move up one pixel; by the same rule, Madeline moves up 2px—and 0px on PICO-8. This means that, despite the gravity being stronger under Celia, Madeline moves up more under Celia. This means Madeline bonks the ceiling, allowing her to set up a dash reset on a precise frame, and changing the length of the run. In Celeste Classic, there are no bugs that help the speedrun—if there were, we would've found them Aristotle must prove that all paths and input combinations don't get us there any faster. In other speedruns, Aristotle will also help to find and quantify these bugs—verifying some speedruns of Super Mario 64, for example, requires reasoning about parallel universes Only 5 years ago, a project like this would've been considered completely impossible. Back then, verifying a property of some software could only be done for the most sensitive of codebases. We are excited by the sheer variety of properties you can prove with Aristotle, across all domains. Try it yourself—the first $500 of credits, valid for 30 days, is on the house We prove the statement about a C port of Celeste Classic, not the original cartridge itself; a separate Aristotle run proves that the C port is runtime-identical to the PICO-8 console executing the cartridge.