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.
Climbing to the top of the proof
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:
Dash (once) resolution
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.
Floating around
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.21is 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 give13763/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.
- Frame 72: before Both Madelines are rising through the same pixel. PICO-8's weaker gravity means that its Madeline is 0.0014 px higher inside the pixel; the game tracks this, adjusting future movement updates when it adds up to enough.
- Frame 73: rounding strikes This makes a difference in this frame—Celia says we should move −1.4993, which gets rounded to −1 (and the .4993 is saved for later). Meanwhile, PICO-8, being slightly higher (−1.5008), rounds to −2. Celeste Classic's move loop (
for i=0,abs(amount)) then takes one step more than requested—whenever the amount isn't 0. Celia's Madeline moves 2 px and PICO-8's 3 px. - Frame 74: PICO-8 falls in comparison PICO-8 is now calculated to move −0.4508, which rounds to 0. Celia's −1.4493 (with the amount carried over from the last frame!) rounds to −1, which means she moves 2 px. Over two frames PICO-8's Madeline has moved 3 px and Celia's 4, so now Celia's is a pixel higher(!) despite her gravity being stronger.
- Frame 75 Both move 2 px. Celia's Madeline stays a pixel higher (y 62 against 63), just under the ledge.
- Frame 76: Celia bonks the ceiling Both Madelines get two steps of upward movement this frame. Celia's starts a pixel higher, so her second step runs into the ledge: she bonks, and the game stops her rising. PICO-8's two steps take her to the pixel just under the ledge without touching it, so she keeps her upward speed, even though she can't go any higher.
- Frames 77–81: PICO-8's Madeline hangs under the ledge With her speed cancelled, Celia's Madeline starts falling at frame 79. PICO-8's leftover upward speed keeps her at y=61 until frame 82, 3 frames longer, so she falls later and stays higher.
- Frame 85: the up-dash A dash straight up is input—Celia's Madeline from y=75 and PICO-8's from y=67, 8 pixels higher.
- Frame 97: Celia's Madeline catches the ledge's corner Still rising after her dash, Celia's Madeline passes with her feet just over the top-left corner of the ledge for one frame. The game counts that as standing on the ground and gives her dash back (filled box). PICO-8's never touches the corner.
- Frames 99–100: one dashes, one can't Celia's Madeline jumps at frame 99 (a jump still works for a few frames after leaving the ground) and dashes up at frame 100. PICO-8's gets the same buttons, but with no dash left the dash does nothing, and the jump waits in the input buffer.
- Frame 102: PICO-8's Madeline bounces off the wall PICO-8's buffered jump goes off as a wall jump from the wall behind the spike column, which throws her back to the left.
- Frame 126: PICO-8's Madeline lands on the ledge She falls back onto the ledge, which refills her dash, and a jump pressed at frame 124 goes off from there. Celia's Madeline is far ahead, dashing toward the exit.
- Frame 130: spikes Holding right, PICO-8's jump carries her into the spike column, and she dies. Celia's Madeline is on her way to the exit at the top right.
- Frame 149: Celia's Madeline leaves the room She leaves through the top of the room after 149 frames, the time in the database, and so does the PICO-8 documentation replay. On PICO-8 the file plays out as the blue run does, and it never finishes the room.
- Celia
- PICO-8 console
- PICO-8 documentation
Some thoughts
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.
Press inquiries: pr@harmonic.fun




