The Stack Overflow Podcast

Maximum Glitch: How to break Tetris

Episode Summary

The home team is back with a conversation about the 13-year-old who beat Tetris by breaking it; stories from the Mathematics Stack Exchange; and the robot butler that will do your dishes, fold your laundry, and water your plants. Happy New Year!

Episode Notes

Willis Gibson, 13, closed out 2023 by becoming the first person to officially beat the original Nintendo version of Tetris. Here’s how he did it.

Want to understand the code that caused the ultimate killscreen? Watch this great explainer from HydrantDude.

The 2023 film Tetris is based on the true story of the legal battle to license the game.

Is the era of the robot butler upon us? Mobile ALOHA is a low-cost and whole-body teleoperation system for data collection. Check out some of what it can do.

Explore the questions and answers on the Mathematics Stack Exchange.

Episode Transcription

[intro music plays]

Ben Popper Hello, everybody. Welcome back to the Stack Overflow Podcast, a place for all things software and technology. I'm Ben Popper, Director of Content here at Stack Overflow, joined by my colleague and collaborator, my travel advisor, Ryan Thor Donovan. 

Ryan Donovan Hey, Ben. How’re you doing? 

BP Pretty good. So I came across an awesome story this week, it made all the papers. It was a mainstream story, but there's a cool programming and coding element to it. A young kid, I believe he was 13 or 14, became the first person to ever reach the kill screen in Tetris. As it turns out, there's more than one kill screen –we'll get into it– but he reached what seems like the official kill screen. He broke the game, and that was a huge deal within the community, never been done before. Also, it exposed or highlighted how the game was created in terms of how it was written, its programming. Tetris is old. Do you remember playing this on PC or on GameBoy or on NES?

RD Sure, on the OG GameBoy. It was the included game. 

BP Right, it was the included game so you couldn't not play it. It's addictive, it has amazing music. The Tetris movie is actually amazing. If you haven't seen it, I recommend it. 

RD I've seen the previews and it seems amazing. 

BP Yeah, it's very fun. Created in 1985, and then I'm sure the Nintendo version maybe was coded differently. But Ryan, I sent you this story. Did you read it or do you want me to sort of dig into it?

RD No, I read it. It's definitely interesting to see a lot of these old games, people playing it competitively for 40 years almost since the beginning. And to do that, they've modded it a little bit. I remember they said they modded it so there could be another digit of score. 

BP The idea that you could break the game at this level wouldn't have come about without some good old fashioned finger-tapping innovations. There was the hypertapper era, and then now we're in the era of the rollers, and they are able to move much faster. And then they started running these simulations of Tetris, and as people got to higher levels and they ran the simulations, they started to see things break down, for example, the color schemes. Suddenly you'd be on a level and it would be basically black on black, or nearly invisible, and so that was one challenge. And that was because they had never coded it to go up to that level. It had a random procedural generation that broke down at some point.

RD It had a standard color scheme. Every level 1-10 would have the same color scheme and then it would repeat, and it got to some point where it started pulling from different places. The algorithm that it was using no longer drew from the correct sort of memory locations.

BP So that, I thought, was the most interesting part. I don't really understand how it works. Maybe you can walk me through it a little. But basically, as the score gets higher and higher, it's having more and more difficulty executing the code without dipping into or occasionally drawing on the RAM side of things, the memory side of things. Do you have a sense of how that spillover happens? 

RD So I have a little bit of a guess as to how that happens. Basically they get to the kill screen where the programmers did not expect it to go. And they're probably using variables that are 16-bit, 32-bit, whatever. You get to a point where the numbers they're using are too big and you have buffer overflows. There is a video out there that is explaining this in detail and I didn't watch that, but I'm guessing there is some sort of overflow where suddenly it's drawing from random memory locations because all of those values are in memory somewhere, and then they draw from neighboring memory locations like, “Well, this is what the color is now.” The color is using the same memory location as part of the score. 

BP Right. So there were some amazing things discovered about the game, and as you reach this sort of end state, they had a version of Tetris that was run step by step where every move, every drop of the block and every move was entered manually. It was not done in real time and it was not done with controller input. And through that, they discovered these areas where it would glitch out, and there was a level– I forget, it was like 270-something– where if you get three lines in a row at the same time, that'll glitch it. And so people were looking for that. 

RD That happens at I think level 155 was the first time that it’s possible. If you clear one row at a time, it has a 100% chance of hitting the glitch. But the first person who glitched out, they missed that and they actually had to go to level 157. And somebody came up with a whole spreadsheet with all of the possible places, all of the possible things that would cause it to glitch out. And I think what you're talking about is that they stepped through to get to a point where it beyond all glitches. It was just like, “That's the end of the game.”

BP Well, I thought the coolest thing was that this story went full circle. So at first in the original Tetris, you can play the game, but it gets to a point where you just can't go fast enough, physically fast enough, and so the game ends and the game kind of beats you, but it feels bad because it's not something where it was a lack of skills so much as just a limit. And then they got to this idea of, “All right, well, we're going to break the game,” and that was pretty cool. 

RD They also figured out different techniques for you playing the game. 

BP Right, they came up with these different techniques that kind of extended human capability which was cool. And then the next level is the sort of happy resolution. I forget what they called it. 

RD Well, there's the kill screen where you defeat the computer, and then there was the rebirth. 

BP The rebirth. Yes, the rebirth where you get back to zero. 

RD It just starts over. 

BP It just starts over. The game is relieved, it knows what to do. Its code works in this area. I thought that was really cool. 

RD I look forward to the religion people come up with around this. 

BP Exactly. Let me see if I can find the name– HydrantDude apparently has made a bunch of videos exploring this. There's a Liquipedia. I guess he's a competitive player in the Tetris scene and he's got some amazing explainers, animated explainers, stepping through the code and explaining why and where the colors glitch out and why around level 155 you can get the entire game to crash. 

RD I always think it's so interesting when people play these games so much where they start to figure out what the algorithms are. I don't know if you've ever seen The King of Kong talking about Pac-Man where they figured out what movements make the ghost move. So it wasn't even playing the game, you were just running through a set algorithm. And somebody did that with the show– what was it? It wasn't Let's Make a Deal. It was the one with the whammies– Press Your Luck. Somebody figured out the algorithm and broke the game and basically won everything. 

BP That's amazing. 

RD For these early programming things, they didn't have the sort of memory capacity or even the variable capacity that we have now. So you keep playing it on our level and something's going to break. 

BP All right, well that's very cool. We will leave links in the show notes to a great 16-minute little documentary about how this all happened and then I will definitely leave some links to the HydrantDude explainers because they very much dig into the software side of stuff and the VRAM and the ROM and everything that happened. All right, well I wanted to get onto another topic here that I thought was super fun. This was shared in the break room in Stack Overflow. Somebody asked a question, as folks like to do, and it was asked over a decade ago, this question. And in it, the person is asked on the math Stack Exchange, which is a sort of unique Stack Exchange, it's always had a special place. And so they were sort of saying, “I've read a couple of these books. I'm looking to up my game. Does anybody have ideas of the next place I should check out?” And then the person's username is available there and so, lo and behold, 12 years later, this person has written the textbook on this subject. So they no longer need to ask where they can go to find this. They just have to head on over to their own book. 

RD They just made their own textbook.

BP Yeah. And then this got me thinking that we could do a whole series on this. Somebody responds in a similar vein, 12-year-old question on Stack Overflow, someone asking baby programming language implementation questions who has since gone on to work at Instagram's high performance Python fork. Can see them grow up. They grow up so fast. 

RD Let me find this one. I think something happened with the creator of Zig. I think they early on asked a very basic programming question on Stack Overflow and then went on to create their own programming language. 

BP That's great. We have one here about the mathematician Peter Schlosser. It says, “Peter Schlosser answered a question in 2011 about perfectoid spaces and seven years later would go on to win the Fields Medal.” So if you want to know about it, his answer has since been updated with his lecture notes and other things like that. So fun to see people sharing. 

RD Like you said, the math Overflow is a very special place. I remember there was another famous question there that was this really difficult problem where they're just like, “Oh, how do I solve this?” and people are like, “Well, it's sort of unsolvable on these ones. Here's sort of the way to work through it.” And somebody came through and just posted the answer. They were like, “Here's the right answer.” Didn't show their work. 

BP I love it. Closed, but accurate. Still providing a lot of value. Very cool. All right, the last thing I wanted to mention before we hop off: Gen AI took up most of the conversation in 2023; we'll see what happens in 2024. You and I are recording this first week of January. And the transformer architecture really defined the progress that has been made since it was released in 2017/2018, and there are new ideas now. There's something called Mamba that's out there that people are saying maybe could be a way to step forward. But I listened to some talks by the creator of Mamba and somebody who is working at Microsoft– the guy who wrote the “Sparks of AGI” paper which was very influential, and one of the cofounders of Mistral which produced some of the highest, most cutting edge open source AI models, and they all said the same thing which is that you can squeeze out some fun gains by optimizing your algorithm. You can squeeze out some fun gains by coming up with better hardware. But if you feed the model better data –better quality data– you can get 1000X gain. The model is as good with 1000X less parameters. And so I thought that was really interesting. That was a big prediction from my favorite AI prognosticator, this channel “AI Explained,” and pretty meaningful for us at Stack Overflow because that's what we're all about with both our community side and our Teams. It’s like, “How do we organize information and knowledge, and how do we get to, as you said, the best answer?”

RD I think we're seeing a lot of folks come to realize that data is the key. We’re working on something now that talks about if you're doing your own LLM it's basically all about fine-tuning. You just have the good data, you verify it, make sure it's good data, and then you fine-tune whatever existing LLM out there and you'll have great results for pretty cheap, pretty fast. Certainly cheaper than retraining your own foundation model. 

BP It's kind of interesting. We arrived at some breakthrough results that caught the world's attention on the LLM side almost in a brute force manner. Let's read 10 terabytes of internet text and use a bajillion GPUs, but even that was then fine-tuned for months on reinforcement learning and human feedback so that it was better, and then even that would hallucinate a little bit. But you say, “How do we educate people?” Well, we don't force them to read the entire internet, half of which is probably wrong. If you want somebody to be well educated, let's try to agree on some facts and read some textbooks and listen to the best lectures and all of that stuff.

RD Would we give them the canon? Just give them the greats, great courses, and then you're done.

BP And that will immediately raise issues of bias and politics. Not everybody agrees on what happened in history or what's happening with current events or whether the Earth is round or flat, but it certainly, I think, could produce LLMs that are far more efficient and maybe useful for folks, so that's a cool thing. 

RD And I think to the point of what's the data that's sort of wrong, like Earth is flat sort of stuff, everybody's going to bias towards the results. If you ask it, “Is the Earth round or flat?” and it says it's flat and you go back and you change your data. So whether the things are true or not is almost irrelevant to the LLM. It's just whatever the data says. 

BP Yeah, exactly. The LLM doesn't know if the data you're feeding it is accurate or completely false, so you’ve got to be very careful. There's no way for it to distinguish when it's being trained. All right, last thing. We can save the discussion of this for another day, but I really recommend that you check out this link in the show notes for something called mobile ALOHA. It is a little robot with four wheels and two hands, and there are the most amazing videos of it doing laundry, using a vacuum. The guy let it shave his face, which I thought was pretty brave of him. Using a coffee machine, opening doors, playing with pets. It has all of the assistant from The Jetsons’s capabilities. It's not cheap. Who knows? 

RD Are we finally getting robot butlers? 

BP I'm telling you, Ryan, you’ve got to look at these videos. They're unbelievable. It's making the bed, it's doing everything. When will this become something that's commercially available? I don't know, but its ability to do a wide array of tasks and to do delicate tasks– they're like, “Cook this dish,” and it cracks eggs, puts in a bowl, boils some water, throws in the shrimp. It's wild.

RD I'm excited to have AI finally take on the boring stuff, but I do remember this old cheesy Tom Selleck movie called Runaway where the robot butlers are infected by AI, some virus or whatever. They go around just murdering people, so sci-fi has shown us that there are always going to be dangerous, especially if Gene Simmons is involved.

BP We need to make them just strong enough to do interesting chores, but weak enough to be easily defeated in hand to hand combat.

RD That’s right.

[music plays]

BP All right, everybody. Thank you so much for listening. A happy new year to folks. Hope you're having a great 2024. As always, if you have questions or suggestions for me, I am Ben Popper, Director of Content here at Stack Overflow. Hit me up on X @BenPopper. Just throw some stuff in my DMs. I read through them today and saw two cool invites for folks who want to come on the podcast. If you want to chat with Ryan and I about stuff we should talk about or the show or the blog, podcast@stackoverflow.com. And if you got some laughs out of today's episode, leave us a rating and a review. It really helps. 

RD I'm Ryan Donovan. I edit the blog here at Stack Overflow– stackoverflow.blog. If you want to watch the movie Runaway, I believe it's on Tubi or one of them. And you can hit me up on X @RThorDonovan. 

BP Awesome. All right, everybody. Thanks for listening, and we will talk to you soon.

[outro music plays]