Posts in Ruby (20 found)
Stratechery 4 days ago

An Interview With Roblox CEO David Baszucki About Aggregating Play

Listen to this post: Good morning, This week’s Stratechery Interview is with Roblox CEO David Baszucki . I’ve interviewed Baszucki twice, in February 2022 , and November 2023 . What struck me about this interview is just how much AI has changed the landscape for Roblox. This was a company predicated on the concept that anyone can make a game, but now, for the first time, literally anyone can make a game. That means a world of abundance, and in that world, there is an opportunity to be an Aggregator, and Roblox is aggressively pursuing that opportunity. To that end, we discuss how AI has changed Baszucki’s view of what is possible, what goes into a game creation harness, making games on your phone, and the power of recommendation. Then we talk about Roblox’s vision of a universal player, where a Roblox game works everywhere, and Roblox Everywhere, where Roblox developers can use the platform beyond the Roblox app. We also touch on advertising — the natural Aggregator business model — and whether Baszucki still thinks he is building the metaverse. As a reminder, all Stratechery content, including interviews, is available as a podcast; click the link at the top of this email to add Stratechery to your podcast player. On to the Interview: This interview is lightly edited for clarity. Topics: The AI Impact | A Game Creation Harness | Roblox Build | Roblox Discovery | Universal Player | Roblox Everywhere | Advertising | Metaverses David Baszucki, welcome back to Stratechery. DB: Thank you, Ben, for having me back. It’s great to be here. So this is the third time I’ve interviewed you, and I want to sort of put that in an interesting context. First, you started Roblox in 2004, you went public in 2021, you first talked to me in 2022 and again in 2023 , that’s like a nearly 20-year stretch. Now it’s 2026, and here’s my question: Is the world more different for you now, compared to three years before, than it was for the entire first two decades from starting the company to the last time we talked? DB: The changes in the world we all feel are sure happening a lot more rapidly. When we first published Roblox — I don’t know if people on this podcast remember — software used to be distributed on floppy disks and CDs. You know, the funny thing is, you’re the second person I’ve interviewed in the last two or three weeks where we’ve referenced back to fact that the reason we say packaged software is it used to actually be packaged! DB: It’s been crazy, we had the Internet, when we started the company, we had the vision of a category called immersive co-experience, sci-fi writers have been writing about the holodeck forever, and we went along our way. I’m still pro-metaverse, we can use the word metaverse, it’s okay. DB: Okay, good, we use them all. It’s Snow Crash — metaverse, holodeck, they’re all good. We started on this vision of building human co-experience, we saw the mobile age come across us, we saw the crypto age. The AI acceleration wave we’re in is faster and bigger and crazier than anything I’ve ever seen, it’s changing how we think about the product, it’s changing how people are going to create games. What’s really exciting is, when we started the company, we had this slogan called “You Make the Game”. DB: We started with that slogan, we learned along the way that the ratio of people who might want to play games to make games has drifted — more people want to just play games than make games, because historically making games has been Roblox Studio and 3D editing and writing script. We could be approaching the time where “You Make the Game” really comes true, and where making a game is accessible to everyone. It’s really fun, I’ll tell you a bit about some of the experiments we’ve been having with Roblox Build . But we’re entering an era where making a game could be as big as playing a game. I’m right there with you. We’re obviously going to touch on all those points, I think it’s probably predictable what we want to talk about. But to go back to 2023, you called AI then, “a super paintbrush and a super 3D modeler, rather than a full replacement” — Is that still how you’re thinking about AI? DB: It’s what the data is proving out. We just had our earnings call a few weeks ago , we highlighted a lot of acceleration. One, there’s various ways humans can augment with AI on Roblox, they can use MCP , which is like plugging in a model, they can use the Roblox AI assistant to help build. And what do you mean with that MCP server? You mentioned you had 5x growth quarter-over-quarter. That’s where you’re actually using Claude Code or Codex or whatever to work with Roblox? DB: People are plugging in, we can see all of them — Claude Code, Codex, other models — all being plugged into Roblox Studio to help build things. We’ve seen two games hit the top 20 made by AI, we have other metrics like the number of assets. What do you mean by “made by AI”? Because you also said 80% of games in the top 100 have AI-contributed content. DB: Touched by AI, vibe-coded directly with AI, and we can see the count of assets accelerating. DB: It’s turned out to be, I believe, somewhat faithful to what I said. This is a human paintbrush accelerator, good ideas are still very important, novel types of gameplay are very important. But people are able to flex their creativity much more quickly. We have members of the Roblox board of directors carrying a mobile phone around, building games like 15 times a day. We have people who are not necessarily engineers or product managers now building within the company, so we’re really at the dawn of a new era. You mentioned the super paintbrush, super 3D modeler, is there a super gameplay developer? Because there’s a large step between, “I have an idea for a game”, versus the actual mechanics of the game. How much can the AI do to help you as far as that goes? DB: You’re touching on the dream of what is a game creation harness versus a coding harness . Dive into it, this is super interesting. Lay out the difference and the way you’re thinking about that. DB: So everyone’s getting familiar with coding harnesses — Claude Code, Cursor, Replit, Lovable, Codex, you name it. A game is arguably much more complicated than code. As you mentioned, there’s art, there’s 3D objects, there’s scenes, there’s avatars, there can be gameplay code, there can be missions, and there can be code underneath it. So a harness that is being created to create games really has to run in multiple modalities, needs to listen to you, and if you said, “I would like a multiplayer tortoise-and-the-hare game that 100 people can play, and we’d like to do it on Venus, and I’d like it to run on all devices” — there’s a lot of different things that need to be generated there. The avatars, the assets, all of that, as well as the gameplay, which I think is a very human thing — your idea of what type of a game it is is actually very unique. So one of our board members is building a hybrid kind of Wordle-crossword game with his own vision of how this crossword game should work, and that’s very unique to him. I’m optimistic we’re still seeing that notion of a human coupled with an accelerating paintbrush in essentially a very complex harness for building games. There’s so many pieces you talked about. The asset creation piece, compared to 2023, much further along, arguably there. You could have even the video component, or the moving worlds, but then you almost have these different pieces. Do you have to build — is there going to be one harness, and one sort of — we’re going to get to your Build app in a little bit — that handles all of that? Or are you still thinking we need to do this piece-by-piece as the model gets good enough for, or we need different models maybe for the different parts of this? DB: I think just as we see with harnesses that are routing different models, even for coding now, a lot of companies have multiple models running side-by-side and their harness is optimizing. Our harness inside Build and inside Studio Build is running not just multiple models for certain things, but then there’s a second dimension of, “Are we building a scene?”, “Are we building a 3D object?”, “Are we building code?”, “Are we building an NPC?”. So yes, we are routing both by kind of specific asset that’s being created, as well as multiple models within each of those, and we’re combining some areas where we have incredible data on Roblox — for example, data that can be used to help create non-player characters, characters that act normally, side-by-side with you. But there’s also really good coding models out there, both open source and frontier, and so we see a harness being able to put all these things together. What’s the mix of those models? Say we have three categories — frontier, off-the-shelf open-source models, and models that you’ve trained specifically. And I guess even there there’s two categories, are you doing foundational models on your own, or just doing some post-training? DB: We literally have all three of those running in our Build harness. And we’re, in certain cases, optimizing the cost of frontier with the capabilities of open source. We have a Cube model — we’ve announced it — which is trained on 3D assets. Yeah, super interesting. Tell me about the Cube model. DB: The Cube model is our own 3D asset creation model trained on all of the 3D objects inside Roblox, where the developer has opted in to the training. It’s very fast, it’s very efficient, and it runs on our own hardware. When you go into Build or I go into Build and I say, “Hey, make that tortoise-and-a-hare game”, and if you describe that tortoise as somewhat unique and different, “I want the tortoise to look like this, and have a fur that looks like this, and maybe have this”, that Cube model will and may come into play and generate that tortoise for you. How does your cost structure work for this? Is it a usage thing from a developer perspective? You have the MCP server — that’s where they can bring their own, what’s the mix? DB: You sound like a product manager, because these are exactly the same discussions I had about an hour ago. The ultimate vision is something like Roblox Build is just like the creation of short-form video. Short-form video 10 years ago — all of a sudden we all figured out we can make video and edit it on our phones, amongst multiple products that was like a huge revelation. We are so on the same page, I have a whole section on short-form video later in the interview. That’s good foreshadowing. DB: Yeah. And so along comes short-form video, and we have phones, and all of a sudden we’re making and sharing video. Arguably games are a lot more complicated, they can be immersive 3D environments, multiple people can come there. They have, as I was saying, code and geometry and avatars, but that’s where Build is going — that same notion of, “I’m going to pull out my phone and create something”, some of those models are still expensive. But the dream is, we’re already testing — I think Canada went live today. We’re testing in, I think, Serbia and New Zealand, we want it available for everyone and so it creates a wonderful opportunity for us to be super efficient with our models while super powerful. It creates the opportunity for those users who want to just do hundreds of iterations to have them buy tokens as well, if they really want to dig into it, so we’re optimistic this will be free for everyone. You keep mentioning Build, I’m on your website , and this is how you describe Build: “Build is a new way to make your own Roblox game right from your phone. Just describe the game you want in your own words, and Build’s AI creates a playable game for you in real time. You don’t need any coding or game-design experience – if you can describe it, you can build it. Want to change something? Just tell Build what to adjust, and keep going until it feels right”. Is this what you always wanted? Are we going to look back and say Roblox Studio, your pride and joy, was just a stepping stone to this? DB: This was a sci-fi fantasy when we started the company, and arguably a fantasy we never thought would come true. I would say when we started the company, we couldn’t have imagined it, and for many years, I think many people in the industry were always trying to figure out ways to make editing 3D easier, “Oh, that’s a really easy consumer 3D modeler” — even the best consumer 3D modeler is still pretty complicated. It’s unbelievable, my current 3D experience right now is, I’ve gotten very into 3D printing and I’ve never opened the associated app for it at all. It’s all done in the AI and just goes straight to the printer, it’s unbelievable. I appreciate all those people who did all the actual modeling and stuff for the last few years — I’ve skipped over all of it, but it’s the same thing in digital space. DB: I would say in the last five years we started to see that maybe AI can do this and I would say it’s been in the last two to three years where the rate of acceleration has started to surprise people and as that rate of acceleration has started to surprise people, this dream becomes much more possible. There are games on Roblox right now that are earning money that have been made with Roblox Build. We have not tens or hundreds, but thousands of games that have been published in Roblox Build. It’s not live in the U.S., we’re testing, and it will be soon, so the data is already out there. What’s so interesting is you saying, “We couldn’t have imagined it”, because one of the things in our previous interviews that came across again and again was the continuity of your vision and like, “Yeah, we saw this back then, and now we’re getting there, and we’ve had this vision all the way” — and that sort of goes back to my first question. Is there almost been a break in the last few years where even you are like, “Holy cow, I didn’t know this is where we were going”? DB: I feel like all of us in the technology industry are feeling that — everyone, CEOs, programmers, people who use these products, consumers. We’re all in the middle of it, I would say, over the last several years. Do you think this makes Roblox more or less valuable? If anyone can make a game, is Roblox Studio, your jewel, not that big of a deal anymore? DB: I think what really ends up being valuable is the combination of a few things. We’ve shared the notion of Universal Player, that I’ll dive into, the notion of Roblox Everywhere , the notion of the power of distribution platforms becoming more and more powerful when a game is created, “Where do I find it?”, “Where does it run?”, “How do we keep it safe?”, “How do I play it with my friends?”, “Is there an economy?”. So in a way, distribution platforms become more powerful. It’s worth thinking about it like — pick a distribution platform, whether it’s TikTok or YouTube, in a way, AI can accelerate those platforms, but in a way, those platforms have enormous strength with or without AI and even though someone could reproduce the whole YouTube platform with AI — the cloud, the client, all of those things — people are still going to go to YouTube to watch video. Yeah, this is the connection I was drawing — going to the short-form video platform idea. I’ve always drawn a distinction between distribution and discovery , distribution is free — anyone can post a website, at least generally speaking, they could host a game on their website, they could host a game on Vercel or wherever it might be. But then discovery is, if there’s a gazillion games, how do you find what you’re looking for? Of those two, what do you think is more important for Roblox’s future? DB: They’re both enormously important. The Roblox platform itself has well over 100 million people coming every day. On the discovery side of our platform there’s two angles to it, the first is, what happens when everyone’s building a game? All of a sudden, in the old days, there’s an abundance of new games and experiences. How do we connect the right person with the right game with their friends? Even in what might be called AI slop, there can be amazing games embedded in that AI slop, even if it’s 1 in 100 and even when games are crafted by hand, there can be some of those games that just aren’t interesting to people, so discovery becomes enormously important. What we have going on — and with the opportunity going on at Roblox — is that in addition to traditional discovery, which is optimizing every user-game pair and predicting long-term retention from that connection, with more and more games, content understanding becomes incredibly important and because Roblox is a platform where all of the games are running in the cloud, we can examine the content, learn from what we’ve learned, and maybe say, “This game has an interesting, new, diverse way it’s been constructed, this game looks a lot different than other games”, and that can help surface great content to new users. The other thing, in addition to on-platform discovery, is this notion of Roblox Everywhere that we’ve shared. Let’s get to that, I promise we’ll get to it, because I think it’s super interesting in this context. But you’ve gotten much more into — you mentioned matching players to the right game, what have you learned from getting into recommendation algorithms? The path — I keep referring to it — but this is the social-networkization— DB: Yeah, it’s very different than video, because a game is something a user can play multiple times, a game is an environment where friends can have fun. Some good games last for years and years. You know, Adopt Me has been on the platform forever, so finding an Adopt Me that creates joy for a long time is very, very important, rather than a one-shot video. I think what we have learned is to optimize for longer-term retention rather than short-term retention. Well, that really hit your earnings when you made that shift a couple quarters ago. What was your thinking? Is that what you expected? DB: I don’t want to comment on hitting the earnings, but I want to comment that mathematically, if we can raise long-term retention — which means more people stay on the platform, more people have a good time, and, like I mentioned with Adopt Me, find games they might play for 10 years — that pencils out. And retention is critically important in growing users and growing word of mouth and growing all of those things, so we’ve gotten better and better at optimizing long-term retention. We measure it directly, we measure the contribution to long-term retention from every user-game pair. We see interesting things — different types of groups of people like different types of games and I think if we go to the Roblox home page, for example, and I play, or someone else plays, I think people are universally saying, “Oh my gosh, those are more and more looking like games that I’d like to play for a long time”. You told me in 2022 that Roblox’s initial product failed because it wasn’t multiplayer and social and that was one of the foundational lessons of the company. Now you’re enabling offline single-player games. Have you moved? Is this what has changed? What’s shifted, where — yes, of course you’ve mentioned the social aspect multiple times — but also there are games people just want to play, a great game, on their own? DB: I feel long-term the foundation of Roblox will continue to be multiplayer, friends coming together, that may be in real time, that may be asynchronous, that may be “I take a turn, you take a turn”, that may be I play a match-three puzzle at some point and compare it. What the move to single-player, the move to puzzle, is really saying with our aspiration for Universal Player and Roblox Everywhere, we have enough bandwidth now to cover the whole spectrum. When we talk about the notion of Universal Player, the notion is going all the way from a traditional 2D offline puzzle game, all the way to that which is yet to be invented — which is super high-scale multiplayer, photorealistic reality — and everything in between. So the vision with the puzzle game, as well as Roblox Reality, is going back to the video analogy. In a way, with video, the camera and the player have been somewhat invented, we have cameras all over, we have 4K, 60-hertz playback, we have playback mobile, we have playback in our living room, and so all of the video out there generally will play back on my living room 4K, 60-hertz TV. That’s not true in gaming. There’s not a universal rail, where every game as of yet invented, as well as to be invented, you could imagine it playing there, so that’s the notion of 2D puzzle and Universal Player. Presented by Agentic commerce purchases with Link, Stripe’s digital wallet that works surprisingly well for agents, grew 38x in September. The catalyst was consumer agents like Muse and Instinct. Filling out a web form is not a value-add activity for anyone. No one chooses to fill out web forms in their spare time. That’s why these agents have been particularly useful. I’ve written about how these platforms are giving ordinary people an AI agent with a computer, enabling agents to do genuinely useful things on our behalf.  When one of those things is spending money, it needs a wallet that knows what it is, and isn’t, allowed to do. Stripe has learned that’s really about deciding how much freedom to give it. You might approve one purchase, or give it $500 for flights this week, and let it figure out the rest. The wallet’s job is to keep it within those lines while handling everything between “go buy this” and the purchase actually happening. That’s what Stripe is building with Link: You approve what it spends, it can come back to you if the final price changes, and eligible purchases can even come with protection if the agent makes a mistake. You can use Link on Muse, Instinct, as well as many other of the agents you might use already. So step back and explain Universal Player, broadly speaking — both in terms of the different surfaces, and also bringing in games from other platforms into the Roblox experience. DB: Part of this comes — I’ll come at it first from an AI angle, and then a puzzle game angle. From the AI angle when we hook either our Studio assistant or an MCP model up to Roblox Studio, and you or I say, “I’d like to build this”, there’s still technical constraints, if I hooked up MCP and said, “Build a game that happens in the state of California, make it a 3D multiplayer environment, I’d like it to be photorealistic, and I’d like it to be able to have up to 100,000 people all walking around and driving cars” — not technically possible. But we do want to push towards that — once again, multiplayer high-scale photorealism — as quickly as possible, and make a place for anyone who’s either imagining a game or building it with MCP server, or, as you mentioned, ultimately bringing in a game they maybe have already made and converting it to that type of environment. So if we have a Universal Player, that’s a superset of all games that can run multiplayer. You could imagine that if you had a puzzle game that’s offline, connect it up, bring some of the source code in if you want to, and we’ll convert it to Roblox. Or you had a single-player high-res game, we’ll convert it to Roblox and in that conversion process, a couple other cool things will happen. We coined the term “Robloxification” — it’s really what’s different about the Roblox architecture. Your single-player game from a PC can now be multiplayer by default, because we’re running against a cloud. Because we’re doing 3D streaming, your single-player game will also run on a phone — oh, it’s being Robloxified. Your single-player game, rather than being a 500-gigabyte download, you can just join it immediately, that’s very interesting. Your single-player game has access to economy and other things so the notion with Universal Player is really both convert, as well as Robloxify, existing games as well as new games. Is this leveraging — to go back to the discovery versus distribution — is this leveraging the fact that you want to get into Roblox’s discovery engine? There’s people on Roblox, they’re not going to go download your game individually, they’re not going to go to another website. DB: That’s exactly right, in that a game brought into Roblox Everywhere in our Universal Player will then be available in the Roblox app. And as we thought about it, what a great way to discover more content than to have great games out there that are also discoverable in the app. This is the analogy — to go back to the short-form video — where you had this story with Meta versus TikTok. TikTok realized that it’s called a social network but it’s not really a social network, it’s just really giving you the videos that it thinks you are going to like, and who you follow doesn’t have anything to do with it. Meta is stuck in their social network, “That’s what makes us powerful”, and to compete with TikTok, to make Reels into a thing , they had to let that go, “We’re just going to give you what you want”. Is there an analogy there to your embracing single-player games, to you having recommendation algorithms? And sure, Meta will tell you the social network part is important, will always be important. Is that analogous to you saying, yes, the social aspect of Roblox is important, will be important, but actually to truly grow, to reach your full potential, you have to actually atomize a bit more and meet the player with exactly what they want? DB: Yeah, I think if anything it’s even bigger than that, I’ll go through three realizations. The first realization that we’ve come to, looking at the physical world, when people play — whether they’re playing sports or a board game or any form of play, jostling around with friends — it’s typically not just play, it’s playing, it’s connecting, it’s community, it’s creating the play, “What are we going to do?”, it’s sometimes watching other people’s play, it’s dressing up to play. And so we started thinking about the market, not as the game market, but the play market, and how all of those pieces really work together so that’s been a bit of a stretching, rethinking things for us. The second is, when we say the play market, we can no longer just say, “Well, Roblox is a 3D multiplayer game engine”. You were constraining yourself. DB: That’s right. All of the constraints, I think, in the past that helped us focus and grow at a certain scale have to flip from focusing constraints to constraints we give up on. What was more difficult — convincing the company we have to let those constraints go, or did you have to convince yourself? Because again, two things that really stood out. Number one, you had this long-term vision, and it’s actually been continuous, and now you’re saying, “Wow, this has been a big shift”. But then number two, this being focused, “This is what we do”, and now you’re like, “Well, actually, no, we need to let that go and do everything”. DB: We’ve gone through several of these. The early version of Roblox was PC and Macintosh. We, for a while — if you can believe it — there was no mobile phone version of Roblox and when we looked at the iOS App Store top 100, there was no 3D game in the top 100. China was a little bit ahead, they were starting to poke at it, the U.S. was not. Giant company debate, “How could Roblox ever work on a phone? The phone is 2D. It’s not going to work”. Luckily, mea culpa, we went for it and now we’ve gone through that transition. There’s also a time on Roblox, very early on, we thought the blocky look was so simple and easy to build with, we wouldn’t allow the importation of 3D mesh objects, we mea culpa’d it, because ultimately we want all styles of game. And so I think 2D and offline is kind of one of the last holdouts for that, in saying it’s really the play market, and we can’t constrain that anymore. Are you pushed into this market, or are you pulled — just the market opportunity is so large? DB: I think it’s so much more fun and simple to just say, “We’re going after the play market”. (laughing) That’s right, let’s do it all. DB: We need integrated and safe ways for community, we need integrated and safe ways to find great games to play with, we need all of that just in a simple — it’s actually a simpler product spec and a more fun product spec. Does that mean, you as a company, you’re more defined by — maybe you’re like supply-defined, where, “What can we do, and this is what we’re going to deliver”, and now that’s sort of flipped to, “What’s the market and how can we fill that market?”. DB: Yeah, I think it leads to all kinds of interesting features of the product. For example, short-form video is traditionally used for watching by yourself. Imagine something that feels like short-form video, where you’re seeing the 3D game where your friend is already playing, and it’s a way to find a friend and jump into a game. Right. We made the short-form video comparison, but you’re literally doing short-form video. DB: Finding 3D ways to discover is super interesting, finding ways to connect with your friends is super interesting. I feel this singular vision on play is a category that’s got legs and I think the thing that is yet to be figured out is how big is creation versus playing with friends. What I have seen with the early players on Build is, there’s a lot of joy in making a short-form video on one of these platforms and having your friends see it. That happens in spikes and I’ve seen people do that. The joy I’ve seen of people creating games on Roblox and literally sitting there with their phone and saying, “Oh my gosh, I have four people in my game, and those four people are playing my game, giving me feedback” — I’ve seen that be really powerful. That’s interesting, because the feedback mechanism — you can act on it. If someone gives feedback on a video, it’s just a comment on a video. DB: And like I highlighted, board members doing 15 modifications a day to their game so that four people turns into six people. That’s really interesting. It’s like there’s a 3D aspect to gaming, as opposed to the 2D aspect of a video. This is almost like a 4D aspect, where the interaction — it’s a social network in a very different sort of way , it’s around this object that could evolve and move with the interaction over time, I think you do have a 4D product. DB: That’s right. Well, we use the term 4D lovingly in our physics engine, because 4D objects are objects that have behavior and code and do things, rather than static objects. The other topic you’ve brought up continuously is Roblox Everywhere. First, explain what it was — I have some questions about this that are connected to what we’ve been talking about. What is Roblox Everywhere, from the top? DB: We shared earlier, our jump from PC, Mac, “Oh my gosh, we’re doing mobile, could it work?” — and then we shared some of the other changes we’ve made along the way. One of the things, for quite a while, we’ve held on is: 100% everything is in the Roblox app. DB: But as we’ve seen our vision of the Universal Player — the vision that, whether you build on Roblox or you convert or you use AI, below the rails, Universal Player is the place a game can be constructed and run at scale — as we thought more and more, all of a sudden the power of what is the Universal Player becomes appealing, not just in the Roblox app, but possibly for a creator who wants to ship a standalone game in the iOS App Store, the Google Play Store, on their PC, on a console. And as we thought through it, the benefits of giving creators access to the Universal Player, even when they’re not in the app, brings an enormous advantage to us, which is that their content can then be available for discovery in the app. That gets to my question. Okay, I’m on board with the releasing, let’s be on all devices, let’s not just have blocky characters, let’s have 3D characters, all the things we’re talking about. But I’ve been framing this whole discussion — we’ve been comparing to short-form video, which is an Aggregator play. You own the end users, you own the consumers, you have Universal Player, people can bring their games in to reach the customers, you have an advertising business that we talked a lot about last time, I have some questions about. Roblox Everywhere seems to be like the whole company is now flowing in one direction, you have the Roblox place — if you want to make a game, go there, there’s customers there, there’s monetization there, it’s all there. And now you’re like, actually, let’s open up a trap door and let everyone go out the side, am I the one that’s now being the wimp and saying, “Can you be a little bit more focused”? DB: I appreciate your insight there, but what’s really exciting to us is the potential to get such a large percent of the gaming market running on Roblox Everywhere, and the potential content explosion that happens within our app. The way we thought about Roblox Everywhere is, if you’re a creator — you might be an indie creator just pushing a small app, you might be a large studio — the more we can have both the most amazing technology platform, really Universal Player, and the more it makes absolute sense for you to run on that technology platform, whether you’re in the Roblox app or standalone, we get the benefit of that content in our app which is social, which can be launched instantly, which shares a common social structure, which carries a common safety structure, a common economic structure, all running together. So our calculus — and as you said, maybe it looks risky or whatever — but our calculus is actually, this is the best way to grow users in the Roblox app itself. Yeah. Well, it’s interesting because I think this gets on the — I’ve been drawing the analogy, we’ve been drawing the analogy jointly, between short-form video and gaming. But to your point, gaming is still a lot more difficult and if you go through the history of gaming over the last 40, 50 years, this has been a trend is over time, just the cost of developing gets so large, you need to be multi-platform. The PS3, one of the all-time examples, builds this super complicated, powerful architecture that no game ever leverages, because the cost of creating HD assets is so much higher . They need to be on Xbox also, they need to be on PC, and so everything goes multi-platform, Sony responds by doing the exclusive strategy, etc. Is this a similar articulation, that making games is hard, and so if we don’t make it so developers can run their games everywhere, they’re not going to be on Roblox either? DB: It’s really hard and right now there’s a bifurcation, a lot of times, between that super cool high-end PC game I see and what I can run on my two-gigabyte Android phone overseas. Those typically are different products. And so you’re trying to make the whole world the market for a developer — if you build on this, the whole world will be your market? DB: Imagine if it was technically feasible to build for super high-end AAA multiplayer on a PC, and connect to the same game on a two-gigabyte Android phone overseas. That’s a technical opportunity, we think, for creators. How is that different from streaming? Like, you stream a console game to your phone, what is different about what you’re proposing? DB: There’s a very creative history of what is called game streaming, where the game is run far away, I send my keyboard and mouse to the game, and then video comes back. (laughing) Right. And it sucks. DB: And this was even 20 years ago — Gaikai, OnLive, OTOY — we’ve seen a long history of this. You said it sucks, the way I would say it is, some of the things we’re doing in our video — you and I are on a Zoom call right now, when I look at my character, my character’s reacting instantly, I feel like I’m looking in a mirror, in a pure video streaming architecture, I might move 50 or 100 milliseconds later than when I do that, and people are very sensitive to that. If you’re close to the video server, maybe it’s pretty fast but I do believe having local 3D instantaneous feedback is super, super critical. So that could be one reason why video streaming just hasn’t kind of exploded as much as we thought. Is there an issue where streaming — they’re trying to retrofit what existed, and you’re natively building for this experience, and that makes a difference? DB: We want native 3D, you know, we want multi-device native 3D, very low latency happening on those. There’s some other dimensions where gaming is getting more difficult as well. The regulatory environment — it’s not like the old days if you or I make a game. There are different laws in every state and in every country, cultural laws, all of those. One of the opportunities is to have a platform that can automatically adjust to that — what are all of the rules around age, around ratings, around all of those things? That’s another thing that can help a creator reach the world without having to think about all those things. How do you think about monetization for the Everywhere games? Is there going to be like a platform fee, like a Unity sort of aspect? Or is the payoff, “If they’re building using our technology, they will also be in Roblox, and that’s where we’ll make the money”? DB: We shared at RDC the notion that monetization may be somewhat similar for games Roblox would publish. And so if you went to an app store, there may be some games published by Roblox that are the exact same games that are inside Roblox. We would only do that with the developer’s permission, but it could be really cool — you could go to your app store and search for “Grow a Garden” and say, “Oh my gosh, there’s the game”. For games where the developer is pushing directly to the app store, we haven’t shared the economics but in the thesis of what I said — which is eliminating any reason for the creator not to think about it — that leads to the economics needing to be pretty provocative and so stay tuned on that. Where is advertising fitting in this and your vision overall? Give me the advertising update. We spent a lot of time on that three years ago. DB: We shared on the earnings call that we’re more and more excited, and we’re all in, not just on Roblox platform advertising, which is growing, I think we shared that’s growing very quickly as well. As creators come into Roblox and use Roblox Studio Assistant or Build or MCP, “Okay, I need to get some initial traction, I need a thousand users”, those ads are available on the Roblox platform. And isn’t that the great thing if it’s abundance, there’s too many games, you have to discover it — user acquisition ads are very profitable. DB: We have seen an acceleration of that type of advertising and to take that all the way back to the prior analogy, we have board members on their phone buying advertising. (laughing) Conflict of interest, they’re bumping up their own stock price. DB: There’s a second type of advertising that, more and more, is becoming available, which is very short, five-plus-second skippable pre-roll video. There was a time, way back in the history of Roblox, we tried pre-roll video, it was not a good experiment. The quality of the video was not super exciting, pre-roll video at that time was 30 or 45 seconds. Technically it was a pain in the butt, and we yanked it out because we didn’t like the user experience. That kind of left us with, for a while, “Uh-oh, no pre-roll”. But today, the fun and the quality — if we’re very selective of the brands, and we could imagine the brands that are interesting to a 21-year-old Roblox player — clothing brands, electronics brands, movie brands — where they might actually say, “It’s pretty cool to see this”. We also, because typical games on Roblox launch not quite instantaneously — they launch maybe in five or six or seven seconds. Right, you have time. DB: There’s actually a beautiful technical overlay there, if we do it right and do it natively, to put this all together so we’re very excited about this potential combination. Is there an aspect where companies, especially when they’re first doing advertising, they overthink it? Like, “We have to have the world’s most inventive ads, there’s going to be billboards in the game, and these experiences” — and actually, no, just show a pre-roll video, it’s fine. DB: I think that’s right. I think we have a history of thinking big, and I do feel ultimately there’s going to be a wide range of types of branding that people do. There’s a lot of immersive 3D potential for literally shopping in 3D and doing all of that but there’s also an enormous quantity of pre-roll video. Right, you can get to that eventually, there’s actually a lot of low-hanging fruit, it feels like a lot of first-time advertiser platforms — they’re reluctant to pick, and then they’re like, “Actually, let’s just pick the low-hanging fruit and go from there”. DB: I think that’s right and I think in a COPPA -compliant, privacy-compliant, Roblox-values-compliant way, we can still imagine amazing user experience for advertising. Does this tie into the potentially provocative pricing for Everywhere? Where you make a game, it’s everywhere, congratulations — but if you want to actually make money, you’re going to need to be on Roblox and that’s the best place to spend money to acquire users. It’s better than spending on Meta, better than spending on wherever else it might be. DB: You could imagine, in under 18 on Roblox, we’ve shared we may have literally 20% of gaming revenue in the U.S. flowing through the platform and so that’s huge penetration in that age group. As we move towards that same penetration over 18, all of a sudden the value of advertising on Roblox for my new game becomes more and more valuable, because those users are already there. Are older players like your great white whale? I think every time that we’ve talked over the years, it’s always been, “We’re going to expand into older players”. When is that the reality, as opposed to the opportunity? DB: Reality is right now, the fastest-growing thing on our platform is 18 and up, it’s growing very fast. Are you getting new users, or is it people aging into and sticking with Roblox? DB: Absolutely, both. It’s a smaller cohort than the under-18 thing. But as it becomes an increasingly larger percentage of our revenue, it will more drive the growth rate of the top end as well. And how does that relate to the single-player offline, new types of gaming, puzzles, and all the things you’re talking about? DB: I think there are some of those segments that are very much 3D multiplayer, some of those segments are puzzle. There’s an overlap in that, as we think about the whole play market and we don’t restrict any types of games going forward, we have more opportunity to really create a good chunk of that market and once those users are on our platform, they’re very valuable, because other games can be attractive to them as well. In our first interview you talked about how you deliberately avoided paid acquisition, because organic virality was so essential to Roblox, in part because of the social aspect of the games. DB: I think we were careful with it. It’s a much bigger thing now, right? DB: For under 18, even in our early days, we experimented with paid acquisition, but we are very careful with always getting a return on the spend, and always knowing that organic viral had to be the biggest, but there still is a logical amount to spend. And we’re doing the same on over 18 right now, we are mixing organic with paid, there’s an optimal mix of them. We always want whatever we spend on acquisition to make incremental revenue more than what we spend and we are sticking to that hygiene. So it does make sense for us to do the paid acquisition. Is Roblox a metaverse? Is that still the dream? I like the word, no one else does. DB: I feel it’s weird how that word kind of came and went a bit but I think over time, maybe that word will come back, right? Because in the ’80s, ’90s, and 2000s, that was a very popular way of describing not just a gaming platform, but a communication platform — a place where people came together to play or to work or to do a bunch of things. I do feel ultimately, beyond gaming, that still makes sense. This Zoom call, at some point, will be a 3D simulated metaverse call, and we’ll be able to run in traditional 2D mode, and we’ll be photorealistic but if I wanted to go and look at that globe behind you, and I asked your permission, I said, “Ben, can I come and see the globe?” — you’d say fine, hopefully, and I’d come and look at it. And that’s something we can’t do on Zoom that will be unique to, ultimately, a metaverse call. It is a very cool globe. I got it at an antique shop. It has, like, a barometer in it, a thermometer, and it actually lights up — it is a lamp, also so it’s my background. DB: I love globes, I love telescopes too. Well, there you go. With the metaverse, with this 3D world, you just talked about a real-world thing, you could come into my room. But to go back to the example, you mentioned the developer that wants to build the state of California and driving cars around and 100,000 people, is this ultimately going to be realized, not through polygon drawing, but it’s all just going to be AI-generated ? DB: I don’t think it’s going to do that, and the reason we’re building this Roblox Reality architecture — and I’ll share a bit about it — is we do want, “What’s the quickest way to get to multiplayer, photorealistic, immersive gaming?”. Multiplayer is where the fun part comes in, and it’s why we talk hybrid. So in the movie business, there’s several famous directors right now who are going hybrid and what they’re doing is, they’re either shooting live actors, or they’re building a very rough scene for their movie in a 3D system, then they’re taking the 3D information and they’re upsampling it with an AI model to 4K photorealism and so they’re putting together the best of traditional — and in the case of live actors, there’s much more accurate capture of the face, of the emotion, when shooting real film for the actor, but then you can decorate the set however you want. In gaming, synchronizing 10,000 players needs to be done in the most efficient way possible and doing that in a video latent space is not the most efficient way, doing that in a rough 3D representation is the most efficient way. But for every one of those 10,000 players, it’s getting a pretty efficient 3D representation, you can imagine each one of them uniquely getting an AI video model upsampled for them specifically that looks like 4K, photorealistic 60 hertz, and I think that’s where it’s going to come out. Are you going to win on doing this because you have a technical advantage, you pull it off, or because you already have the audience? Lots of people could build this out. DB: I would say yes and yes, hopefully. This is a vertical integration play, the vertical integration. Right, which has always been a core part of Roblox’s theory. DB: I’ve played with, for example, Grow a Garden, or classic games on Roblox, with early versions of photorealistic upsampling, and it works out of the box. There is a notion that existing games can run for all players, same gameplay, but for some, photorealistically upsampled. But I also feel it’s a technology play, because most of the video models that are being built today are either single-player world models, or video generation models — like you or I want to use one of these models to make a cool 15-second video. This technology is different, this is real-time, low-latency video being generated from the 3D video and the 3D depth map and a bunch of other things, so it’s a very specific type of video model that has some overlap, I think there’s opportunity both for technology as well as vertical integration. The thing that I’m taking away is — and this has always been the case talking to you — the scale of the ambition, but it does feel like the big shift is actually, “Let’s literally do everything, let’s do the supply side, we own the demand side, let’s do all kinds of games”, is that what Roblox is today — we’re all gaming, period? DB: I would say, do everything within the carefully thought-out boundaries of the future of play. And so within play, yes, let’s be open to 2D puzzle, let’s go all the way from two-gig Android to photorealistic Roblox Reality and in between, let’s make things available in the Roblox app as well as in Roblox Everywhere. So I would say, within those hopefully thoughtfully constructed guardrails, then yes — in a way, it’s do everything. Do you feel okay without the focus? Without knowing, “This is what we do”, is, “We do everything” — is that focus in its own right? DB: It is focused, because there’s still some pretty tight guardrails. And so I think, given the size of the company and the ability to use AI to accelerate engineering, I think it’s the right current product spec — just like when we started, it was PC-only, blocky, and that was good enough. Last question, you mentioned the AI component. This “do everything” — is that downstream of, “Now we can use AI to program”? Or did the AI programming come on just in time to make this vision possible? DB: For many companies, I think like ours, back and forth, iterate, iterate — AI engineering acceleration, expanding maybe the definition of the product spec, AI engineering, expanding the definition of the product spec. But I do think companies around the world are now starting to take things that they thought would be a nine-month project, and thinking of it as a two-month project. How do we rethink how we architect, to make these nine-month projects two-month instead? Very good. David Baszucki, very interesting, very cool to see what you’re doing. DB: Great talking with you. Thank you again, Ben. This Daily Update Interview is also available as a podcast. To receive it in your podcast player, visit Stratechery . The Daily Update is intended for a single recipient, but occasional forwarding is totally fine! If you would like to order multiple subscriptions for your team with a group discount (minimum 5), please contact me directly. Thanks for being a supporter, and have a great day!

0 views
James Stanley 1 weeks ago

How to make a CNC plasma cutter with high-frequency start

The issue with high-frequency start ("HF start") on plasma cutters is that igniting the pilot arc creates an enormous amount of electromagnetic interference which causes problems for nearby electronics, in particular tending to disconnect the USB connection to your CNC motion controller. You can solve this by talking to the motion controller over WiFi. This is my machine in its temporary location on the workbench: If you still need to acquire a plasma cutter then I obviously recommend trying to get one with "blowback start" instead of "HF start" so that you don't have to worry about it. In acquiring a machine with HF start I made an error. But I got it to work anyway, so if you already have an HF start machine and you want to use it for CNC, you might be able to do the same thing. I kind of wanted a CNC plasma cutter because I have recently spent lots of time and end mills making planar parts like this for my cyclecar at excruciatingly low feed rates and depths of cut: So I started placing some bids on eBay and accidentally won a Parkside PPS 30 B2 for £80: The seller stated that he bought it from Lidl on a whim but then realised it needed a compressor and he didn't have one. If I had done my research I would not have bid on a machine without blowback start, but here we are. So when it arrived I set it up on the garage floor and tried to run my 6040 CNC router while lighting the plasma arc. As you might predict, I couldn't get it to work. Most of the time lighting the arc would disconnect UGS from Grbl. But serendipitously I was running a test program that had a small number of very long and very slow movements, which meant I had several minutes of motion left in Grbl's buffer, and I noticed that even though UGS got disconnected from Grbl and was totally broken... Grbl was still moving the machine! It was still following my gcode perfectly. So the issue isn't that the HF start actually prevents Grbl from working, it's just that it disconnects the USB serial connection . Solution: use FluidNC on an ESP32 board and talk to it over WiFi. FluidNC is Grbl-compatible but suitable for more modern microcontrollers. Charlie suggested talking to the controller over fibre optic, which would probably work even better than WiFi but is more faff to set up. Annoyingly, ESP32 outputs are 3.3v instead of 5v. I made up a breakout board for an Arduino Nano ESP32 on a piece of stripboard with a 74HCT245 abused as a level-shifter on the outputs and this was sufficient to provide 5v output from 3.3v input, unsure how legit this is. You can see my custom breakout board in here: I initially experimented with some small stepper motors with A4988 drivers, left over from when I dismantled my i3 clone 3d printer , and I think these would have been fine. But I also had some spare Leadshine easy servos from the unfinished CNC mini mill project I bought years ago. I didn't think the Leadshine servos would work because I thought the interference would confuse the encoder input, but I tested them and they seemed fine. And they're more powerful and better so I used them. But for a plasma cutter I really don't think fancy servos are necessary, the cutting load is basically zero, it's just a glorified pen plotter. The Leadshine documentation says they need at least 18v, but I only had a 12v power supply lying around so I tried it and it seems fine. I did subsequently connect the alarm output from the servo to an input on FluidNC and it kept falsely triggering every time the arc started (sigh) so I am running the servos without the alarm input. That's no worse a position than I would have been in using open-loop stepper motors anyway. My motion platform is made out of box section steel and 3d printed parts: With GT2 belts left over from the same 3d printer, and printed pulleys. The bigger of the two orange parts was a 36-hour print and used 700g of material, that's my biggest ever 3d print. All printed in ABS-GF on Bambu Studio "strength" setting. The "linear rails" consist of 608 bearings riding directly on the steel box section. I didn't make any of them adjustable but I should have done because it has slightly more play in it than I would prefer. Again this would be nowhere near adequate for a router but for a plasma cutter I think it should be fine. (The aluminium foil wrapped around the torch lead was a shielding experiment from before I was using FluidNC, it didn't help, I just haven't taken it off yet). I need to get a larger water tray. To fire the arc on the plasma cutter, it has a 2-pin GX16 connector which you normally connect to the torch trigger. I connected it to a relay operated by FluidNC so that I can turn it on/off with M3/M5. (But note you need to give FluidNC a non-zero "spindle speed" else M3 won't do anything, so get used to "M3 S1"). So at this point I have a working CNC motion system, with an HF start plasma cutter that I can fire from CNC control. Time to cut something out? Unfortunately I have no plasma cutting experience and (story of my life) it's harder than it looks. I messed around with the air pressure, current setting, and feed rate, and I just couldn't get a clean cut in 4mm steel. That's disappointing because the machine documentation says it can cut through up to 12mm steel. But I tried a piece of 3mm steel and my first test cuts worked a lot better, so I tried to cut out a heart shape. (I got ChatGPT to write the gcode for this). It blew the fuse in the extension lead 3/4 of the way through because I foolishly had the compressor and plasma cutter plugged into the same one. D'oh! I moved the compressor to a different extension lead and then it worked first time, albeit with a lot of slag on the underside of the cut: I cleaned this off with the angle grinder and you can see that along one axis my machine is cutting nice straight sides but on the other axis it is quite badly bevelled: I am going to replace the consumables in the torch when they arrive, and failing that I am going to make the torch clamp angle adjustable, and I expect I will be able to get rid of the bevel, but I don't know if the combination of the excessive bevel and the poor cutting performance are evidence that my machine is actually faulty. This may be the real reason it was sold on eBay after hardly any use. I have subsequently had my 16 amp breaker trip a few times while cutting so I may want to either find a way to run the compressor on a different circuit or else upgrade the circuit I have. These are the switches and lights on my control cabinet: Though the "alarm" light is now surplus as the servo drives can no longer trigger it. The "torch" light comes on when FluidNC is asking for the relay to turn on, but the relay doesn't actually turn on unless the switch is set to "enable". This is so I can ensure that even when I'm fumbling the gcode the torch can't light unexpectedly. And btw I obviously don't have an emergency stop button on this machine, but I can still toggle the torch off, or switch the power off, and there's no world in which I'm running a plasma cutter unattended, so I'm not very worried about it. I also don't have limit switches. I don't really understand why people bother putting limit switches on DIY machines (unless they have an automatic tool changer or whatever). What's the benefit to having a global coordinate system? You need to set up work coordinates for every job anyway. I don't have limit switches on any of my machines, but on this one in particular I expect limit switches would falsely trigger whenever the HF arc starts. So what have we learnt about making CNC plasma cutters? you can use a HF start machine if you talk to the motion controller over WiFi you don't want any inputs to the microcontroller, including limit switches, emergency stop, alarm inputs, USB serial if you make linear rails out of box section and ball bearings then make some of them adjustable so that you can take out the play GT2 belts are adequate 3d-printed structure is adequate getting correct cutting parameters is not any easier than it is with milling unfortunately, so still lots to learn Leadshine easy servos appear to work with 12v supply even though the documentation says they need at least 18v I made a custom gcode sender to talk to FluidNC because I wanted it to work differently to any existing ones and coding agents make software cheap, but I'm pretty sure UGS can talk over WiFi so it is not necessary to make your own sender. If you make a CNC plasma cutter using information from this post then please email me and show me, I'd love to hear from you. you can use a HF start machine if you talk to the motion controller over WiFi you don't want any inputs to the microcontroller, including limit switches, emergency stop, alarm inputs, USB serial if you make linear rails out of box section and ball bearings then make some of them adjustable so that you can take out the play GT2 belts are adequate 3d-printed structure is adequate getting correct cutting parameters is not any easier than it is with milling unfortunately, so still lots to learn Leadshine easy servos appear to work with 12v supply even though the documentation says they need at least 18v

0 views
Sean Goedecke 1 weeks ago

A database is a store for global variables

Databases are for storing global variables. We usually call them “rows” or “records” instead, but they’re definitionally global variables: any part of your program can read or write them. Isn’t this kind of weird? It’s common programming advice that global variables are bad, and yet many elegant programs rely on databases. Either the common advice is wrong, or there’s something special about databases that makes them the exception to the rule. What’s so bad about global variables? Here’s the two main 1 reasons, in my view: Both of these apply to databases. Any part of your program that makes a query can send and receive data from any other part of your program. In practice this happens all the time: one function will save some data on a record, and another one will check for it. And if you haven’t seen bugs where some piece of code makes some incorrect expectation about the shape 2 of a database column, you haven’t been working on web systems for long enough. So why aren’t database-backed apps in terrible architectural shape? In the rest of this post I’ll consider some options. First, we could bite the bullet : maybe all database-backed apps really are a mess . This is surprisingly plausible. When I think about the systems I’ve worked on that haven’t involved a database, they’re usually much cleaner and more elegant. If managing state is the hardest thing about designing software — and I think it is — then systems that manage less state are going to be better-designed. However, this doesn’t explain everything. Database-backed apps aren’t that bad, and even in database-backed apps, we try to avoid introducing regular global variables 3 , so in practice we treat global variables as worse. Second, we could say that databases offer ACID guarantees that mitigate the damage of global variables . Unlike regular global variables, databases offer a consistent view of state and the ability to atomically change multiple pieces of state together. I don’t really buy this. The problem with global variables is not just that they can get out of sync, it’s that they exist at all. If you think this is the difference, you are committed to thinking 4 that if you stick a mutex around a global variable then it suddenly becomes acceptable. Third, we could say that databases are more explicit . Mutating or reading a global variable looks like ordinary code, but database queries need some connection object to be passed in and some query function to be invoked. When you’re scanning through code, you can see where the database queries are at a glance 5 . Not so for global variables. This does actually kind of mitigate the implicit-coupling problem. Maybe regular global variables would be better if you had to set and get them with long, involved function calls. Fourth, we could say that databases are less flexible . A global variable could store anything : a function, a class, an image, and so on. A database just stores data . I can buy this explanation for untyped languages. Global Ruby variables that could be reassigned from a string to a hash table are far more terrifying than a “global” database column that could change from one string to another string. But since the advice to avoid global variables applies to typed languages as well, I don’t think this could be the reason why databases are better. Fifth, we could say that we know how to use databases . For instance, whenever I read from a database, I reflexively check the type of the column so that my code doesn’t make assumptions that aren’t guaranteed by the database. There are use-cases that I would never even consider using a database for (e.g. to track a counter in a loop, or to store the name of the file where my config is stored). In other words, we have norms and customs 6 around using databases that minimize a lot of the damage that global variables can cause. There’s nothing inherent about databases that make them better, it’s just how we use them in practice. Overall I think the third and fifth reasons are most convincing: databases are better because they’re more explicit and because we only tend to use them for a limited set of purposes. It’s interesting to note that these reasons are contingent , not inherent. A codebase which had conventions around global variable use 7 could also fulfil these conditions. Would this make global variables fine, or at least no worse than a database? I think so. I don’t recommend you go out and start putting global variables in your programs. It’s more interesting to note the meta-point here: that two pieces of common software engineering dogma — avoid global variables and use a database for state — are partially inconsistent. Most software design knowledge is still just a pile of loose heuristics. I don’t really know how to build software and you don’t either . As I’ve written about before , we should therefore all be very suspicious of engineers who appeal to “best practice” without being able to give concrete reasons, even in cases as obvious as “global variables are bad”. For instance, concerns about readability and tracing follow from the first reason. I don’t really buy reasons like “it’s not thread-safe” or “global variables might shadow local variables”: any architectural problem that can be trivially solved with a mutex or a linter is not a real problem. For instance, that a string supports 4-byte UTF-8, or that a column can/can’t be NULL. You could say we avoid introducing global variables because databases are essential and global variables are not. In theory you could replace any global variable by threading a local variable through, but you do need a database if you’ve got gigabytes of structured data to manage. However, that doesn’t explain why database-backed apps still tend to be better-designed than apps with many global variables. I’m not saying this is necessarily wrong. The argument would go something like “well, if you implement a simple in-memory database for your global variables, that is better!” This is only sort of true. If you’re designing a system, you’d be well-advised to make it as true as you can. While I love Rails, my main beef with ActiveRecord is that it makes queries invisible. To be fair, some of these are guaranteed by the fact that the database exists over the network. Plus types, probably, and concurrency controls if we’re not in a single-threaded language. They allow any part of your program to implicitly send data to any other part instead of passing it around via function signatures They couple different parts of your program: if one part depends on a variable having some value, any other part can break it For instance, concerns about readability and tracing follow from the first reason. I don’t really buy reasons like “it’s not thread-safe” or “global variables might shadow local variables”: any architectural problem that can be trivially solved with a mutex or a linter is not a real problem. ↩ For instance, that a string supports 4-byte UTF-8, or that a column can/can’t be NULL. ↩ You could say we avoid introducing global variables because databases are essential and global variables are not. In theory you could replace any global variable by threading a local variable through, but you do need a database if you’ve got gigabytes of structured data to manage. However, that doesn’t explain why database-backed apps still tend to be better-designed than apps with many global variables. ↩ I’m not saying this is necessarily wrong. The argument would go something like “well, if you implement a simple in-memory database for your global variables, that is better!” ↩ This is only sort of true. If you’re designing a system, you’d be well-advised to make it as true as you can. While I love Rails, my main beef with ActiveRecord is that it makes queries invisible. ↩ To be fair, some of these are guaranteed by the fact that the database exists over the network. ↩ Plus types, probably, and concurrency controls if we’re not in a single-threaded language. ↩

0 views
Nelson Figueroa 2 weeks ago

Enums Can Be Enforced at the Database Level in PostgreSQL

PostgreSQL databases support having enumerated type (enum) columns so that the column only accepts one of a predefined set of values. I’ve worked with ORMs like Active Record from Ruby on Rails . Using Active Record, I could work with database columns that only allowed a certain set of values. I always thought that was only possible due to the ORM layer abstracting away these things, but that’s not the case. Enums can be enforced at the database level (at least with PostgreSQL). I’ll demonstrate on a PostgreSQL container with a simple table. I’ll be using Podman. You can also use Docker to follow along, just replace with in the commands. Make sure Podman/Docker is running, then run the following to get a running PostgreSQL container locally: Then exec into the running container: Now we can start setting up the table to try out enums. First, we’ll create the enum type itself. It’s going to be a type just like or are types in a database. I’m thinking of CI/CD pipelines to use as an example, so the enum will be called and it’ll only accept the values , , , and . Run this SQL query in the container: PostgreSQL should return: Now let’s create a simple table that makes use of the enum. The table will be called and it’ll have two columns: of type , and which uses our enum type . Run this in the container: PostgreSQL should return: Now let’s try inserting a row. This SQL query inserts a row where is and is one of the four predefined enum values ( ). PostgreSQL replies: We can check for the newly created row: You should see: Now let’s try inserting a row with an enum value that is not a part of the values we defined. We’ll try inserting for the column. We should get an error. PostgreSQL should say: The value isn’t one of , so PostgreSQL gives us an error. PostgreSQL itself is enforcing enums! No ORMs here. Note that the values in the enum are case sensitive. So inserting instead of will fail: PostgreSQL returns the error: Another caveat is that inserting as the value for is still allowed unless the column is also created with . Let’s say we actually want to be a part of the enum. We can modify the enum like so: PostgreSQL responds with: Now that is a valid value, we can try inserting again and we won’t get an error: PostgreSQL responds with: We should have two rows total now. We can double check: You should see: We successfully added a value to the enum and used it in a new row. One final note: there isn’t a clean way to remove a value from an enum. You can add values, but you would need to rebuild the enum if you want to remove any values. Plan ahead! Now that the demo is over, exit the PostgreSQL prompt by running: Then clean up the container and, optionally, the image: We created an enum type with predefined values, tried inserting both valid and invalid values, and it was all enforced at the database level with no abstractions from an ORM!

0 views
Sean Goedecke 3 weeks ago

Don't anthropomorphize big tech companies

Bryan Cantrill has a great line from a talk where he cautions against anthropomorphizing 1 Oracle CEO Larry Ellison. I think it’s also a mistake to treat any tech company like a person. Here’s the full quote: You need to think of Larry Ellison the way you think of a lawnmower. You don’t anthropomorphize your lawnmower, the lawnmower just mows the lawn, you stick your hand in there and it’ll chop it off, the end. You don’t think ‘oh, the lawnmower hates me’ — lawnmower doesn’t give a shit about you, lawnmower can’t hate you. Don’t anthropomorphize the lawnmower. Don’t fall into that trap about Oracle. Here are some examples of anthropomorphizing companies: All of these are mistakes. Your relationship to the tech company that employs you is not like a relationship with a person. It’s more like your relationship with your car 2 . If you drive poorly or fail to change your oil, your car may stop working or even kill you, but it doesn’t love or hate you. It has no sense of fairness. It’s simply a dangerous, useful machine: useful enough to be worth getting into despite the risks. Anthropomorphizing it makes it harder to avoid those risks 3 . Why is it so hard to avoid this trap? First, humans anthropomorphize everything by default. Second, whenever you’re interacting with the company, you’re interacting with a person: your manager, your colleague, someone in HR, and so on. Third, when you’re in the power of some entity, it’s psychologically comforting to think of it like another human. This is the same principle that caused early humans to attribute lightning to the power of Zeus, because Zeus (unlike electrical imbalances in storm clouds) can be placated with prayer and sacrifice. Relationships with machines are very different from relationships with people. The biggest difference is that machines do not respect effort . If you put a lot of work into doing a favor for a friend, your friend will appreciate it even if the favor itself is not a big deal. Conversely, if you help somebody out at trivial cost to yourself, that help will be relatively unappreciated. But a car doesn’t care how much effort you put into maintaining it. If you spend hours replacing a car’s engine, but the brake line is damaged, the car won’t remain functional out of respect for your effort on the engine: instead, the brakes will fail, killing you. Tech companies work like this. Everyone who’s worked at one for long enough knows that it’s very hard to predict what work will be high-impact. The project you slaved over for months will often get a “nice, now what’s next” reaction, while the tool you built in fifteen minutes (or the question you answered in a Slack channel) will sometimes get wild praise and recognition. This can drive engineers a little mad, because they’re anthropomorphizing their tech company, and a person who behaved like this would be dangerously unstable. But if you treat your company like a machine, this shouldn’t be surprising at all. It’s hard to predict high-impact work, but it’s not impossible. The best way to operate at a big tech company — as I’ve said again and again — is to try and develop this skill, and to spend most of your time looking for the low-effort high-reward wins. It’s hard to do that if you’re secretly imagining your company as a person. A natural objection here is to point out that tech companies (unlike cars) are composed of people who might indeed owe you, hate you, love you, and so on. According to this view, when people say “my company hates me”, they aren’t making the mistake of anthropomorphizing a corporation, they’re using shorthand to say “my boss and skip-level hate me”. I think this is still a dangerously sloppy way to think. In my experience, engineers who think they’re hated are often not. Managers in large tech companies do hold grudges, but (particularly the higher up you get) are tolerably cold-blooded. You don’t get to senior director or VP by needlessly throwing away useful tools. I can recall a few cases 4 where engineers told me they were hated, but I later found out 5 that managers considered them dangerous or unreliable: loose cannons whose usefulness didn’t outweigh their tendency to go off the rails and cause damage. From the perspective of the engineer being forced out of the company, it feels like you’re being run out of town by people who hate you. But if you want to avoid being run out of town, it’s useful to recognize when you’re being treated as a defective tool. It’s also useful to keep in mind the difference between “my manager hates me” and “my company hates me”, because managers are often temporary. You can sometimes just wait out a bad relationship with your manager. You’ll have a slightly uphill battle with the next one — since the handoff won’t be positive — but it’s certainly possible to get back on track. If you can figure out why your manager hates you, you might also be able to fix it (or at least mitigate 6 it). Engineers who’ve learned not to anthropomorphize tech companies sometimes go too far in the other direction, by treating companies as a computer program . This is the wrong kind of machine: tech companies aren’t people, but they aren’t programs either. They operate on incentives and illegible interpersonal relationships, not on consistent logical steps. The classic example of this is the engineer who reads the company handbook cover-to-cover and makes sure they follow all the rules. When they’re looking to be promoted, they take the role guidelines and make sure they’re following them point-by-point. They take what they’re told very literally: when the company says “X is our top priority”, they internalize that. The problem with this is that handbooks, guidelines and internal communications are the legible superstructure of a massive illegible web of dependencies that make up the actual operations of any company. That superstructure will not cover the real criteria for promotions, or the rules that are designed to be broken . The “top priority” of the superstructure can rapidly shift, leaving literal-minded engineers confused and disheartened. It’s understandable to feel ill-treated by a company, or to harbor resentment — particularly since there are actual humans at the company who are involved in that treatment of you. But companies themselves don’t hold grudges, even as they force out people who they’re incentivized to force out 7 . It can even be a mistake to anthropomorphize very senior managers, whose work personas are more identified with the machine the higher up you go 8 . I suppose at the top you have Larry Ellison, as Bryan Cantrill says, who is better modeled as a lawnmower than as a human being. No relationship with an individual person at your company will save you from being careless with the machine: it will chew you up and spit you out. You need to learn how to drive the car . This is scary, because it means that sometimes you will just get punished for no reason . But it’s also good news, because it means that you can get disproportionate rewards for relatively little effort, so long as you make the right decisions. Treating as a human. I like this example better than Cantrill’s lawnmower because cars are more central to our lives, like jobs are, and are also far more dangerous. For instance, if you’re prone to thinking “my car loves me, it wouldn’t spin out when I take this hard turn on gravel”, you are more likely to crash. Though certainly not all. Grudges do exist. Of course, this is my interpretation of the situation, and could be wrong. There are a range of techniques here, ranging from “do all your paperwork defensively” to “find some out-of-the-way project” to “ingratiate yourself with your skip-level”. For instance, people who make their managers look bad, or who publicly point out the inevitable inaccuracies in legible reports, or who campaign against the current big push the company is making. I say “work personas” because these people often have a rich personal life that is largely firewalled off from their work selves. For more on how managers come to identify with the rules of the organization, I recommend Robert Jackall’s Moral Mazes , a book that has informed much of my thinking and that I will some day write a long-form review of. My company really owes me for that hard thing I did I’m fighting the good fight against my company on issue X (e.g. accessibility) and they hate me for it My company is vindictively retaliating against me because of that mistake I made My company and I are partners in the mission to make the world a better place Treating as a human. ↩ I like this example better than Cantrill’s lawnmower because cars are more central to our lives, like jobs are, and are also far more dangerous. ↩ For instance, if you’re prone to thinking “my car loves me, it wouldn’t spin out when I take this hard turn on gravel”, you are more likely to crash. ↩ Though certainly not all. Grudges do exist. ↩ Of course, this is my interpretation of the situation, and could be wrong. ↩ There are a range of techniques here, ranging from “do all your paperwork defensively” to “find some out-of-the-way project” to “ingratiate yourself with your skip-level”. ↩ For instance, people who make their managers look bad, or who publicly point out the inevitable inaccuracies in legible reports, or who campaign against the current big push the company is making. ↩ I say “work personas” because these people often have a rich personal life that is largely firewalled off from their work selves. For more on how managers come to identify with the rules of the organization, I recommend Robert Jackall’s Moral Mazes , a book that has informed much of my thinking and that I will some day write a long-form review of. ↩

0 views
DHH 3 weeks ago

Seven years from China

I first went to China in 2011, racing for the Lotus/Jetalliance team at Zhuhai in the Intercontinental Le Mans Cup. It was a delightful experience, but also a glimpse of China's gritty side. Zhuhai had an unapologetically industrial look, with a permanent, low-hanging haze. The parade through the city felt like the crowd had been instructed to attend on pain of... consequences. Brutalist aesthetics through and through. From 2013 through 2019, I raced nearly every year at the Shanghai International Circuit in the World Endurance Championship. The skyline got a little brighter with every visit, but the smog remained thick. I still recall a taxi driver straddling lanes all the way to the circuit before blasting straight through a red light, horn blaring. Exciting, but in a very frontier kind of way. Then Covid hit, the WEC stopped going to China, and so did I. For seven years, I watched China's rise from the West. First the electronics, then the services, and finally the cars. Even from afar, it was clear that China was accelerating at a completely different pace from the West. But until last week, when I visited Shenzhen, Hangzhou, and Beijing, it was hard to appreciate just how much the country had changed since my last visit. It might as well have been forty years. There are still pockets of that gritty look, but the main show is now a gleaming, shiny set of cities radiating The Future. From the bullet trains to the lavish airports, from the impressive skylines to Hangzhou's West Lake. Gone is not just the smog, but the sound of diesel engines too. I've never seen any country change so much, so quickly. In Shenzhen, they talk about "Shenzhen Speed" (like three floors of a skyscraper in a day). It looks like the entire country has been running at that clock frequency for the past decade. And they have all the results to show for their efforts. Those efforts are clearly considerable. I repeatedly got replies late into the night and early in the morning during our stay. The pace, and the expectations that came with it, felt almost as jarring compared with America as America's pace does compared with Europe. Everyone was just on it, all the time. I'm sure that has a cost. The 9-9-6 culture (9am to 9pm, six days a week) isn't free. But it's also obvious that all this effort has been buying results. Extraordinary results. Take Xiaomi. I visited their nearly fully automated car factory in Beijing, and it looked like something straight out of a sci-fi movie. I've done a lot of car-factory tours in Europe, and never seen anything like this. The production lines we saw were almost entirely devoid of humans, and the few who were milling about were mostly holding laptops and clipboards, overseeing the robotized lines. The company has gone from launching its first car in 2024 to now delivering over 40,000 cars per month! More than 800,000 cars delivered in under three years. And a halo car in the SU7 Ultra that has over 1,500 hp, lapped the Nürburgring in 7:04, and costs just $75,000 in China. And that's perhaps the biggest material change from the last time I was there: those cars. Long gone are the Soviet-style taxis, replaced by a dizzying array of Chinese EV brands that don't just rival the best of the German giants in style and comfort, but surpass them. We kept getting into one luxury electric SUV after another, from brands I'd never heard of. Sumptuous leather, quiet cabins, and reclining captain's chairs. With Didi, the rides were as little as $5. Then at one hotel, they sent a classic Mercedes MPV. Gas-powered too. It felt like a big step back into the past. What would be a very nice car by most Western standards suddenly seemed cheap by Chinese standards. Crude, even. But what stood out even more than the material differences from Europe were the cultural ones. Everywhere we went, people were not just incredibly hospitable, but genuinely excited to see us and meet. From executives at major tech companies to students at the GOSIM conference, it was just endless great vibes, great interest, and a deeply informed curiosity. Sure, I came as a bit of a niche celebrity. REWORK has sold over 100,000 copies in China, GOSIM was full of programmers with experience using Ruby on Rails, and just about everyone was super excited about the age of agents and Omarchy's role in it. But it's not like those conditions aren't present in the West! And still, this just felt different. Much more optimistic, much more ambitious, much more driven. The contrast is fresh too. Speaking with large American tech companies about Omarchy, then comparing the quality of those conversations, and the pace of the follow-through, with their Chinese counterparts is eye-opening. Whether it was Alibaba, Tencent, Xiaomi, Huawei, or smaller players like Beelink. Very different. And also, yes, tourists are almost guaranteed to get a tinted view of a country through the rose-colored glasses that always accompany a trip as short as a week. China clearly has its own challenges, economically, politically, and culturally. Like any place does. But it's not at all obvious that those challenges are bigger than what we're dealing with in the West. On the contrary, I'd say. I could even imagine plenty of people in stagnating countries like the UK or France who might not be as bothered by one-party rule as they once were, if it meant a booming economy, national giants sprouting everywhere, and a set of safe, clean cities on the ascent. As a man of the West, that's a tough pill to swallow. Especially since, while China may well be under one-party rule, the competitive intensity in many of its markets is far greater than what we can brag about in the West. And nearly all the major companies I visited were led by engineers, not MBAs. Difficult not to be a little envious of at least that! But in terms of the international balance of power and trade, it doesn't actually matter that much what our opinions are. What matters is what is, and that's a formidable country producing remarkable products and services at extremely competitive prices. There's a lot of work ahead of Europe and America to regain a competitive footing in all these industries where China is now accelerating and ascending. There's a version of this where it all plays out wonderfully to everyone's benefit. The world gets better, faster, cheaper products and services. The trade imbalances are corrected as Europe and America catch up, reindustrialize, robotize, and revitalize their economies and political systems. Equal players, equal partners. But there's also a version of this where the West doesn't heed the competitive warnings, and continues to disadvantage itself through eco nonsense, long-term protectionism, and a failure to kickstart moribund growth. I don't think anyone, even China, is interested in seeing where that leads. Either way, we need more people in the West to realize what time it is. It's not enough to just see the consequences when they arrive in the form of shuttered factories or bankrupt businesses. Not only is it then too late, but it's also hard to understand exactly why, because it remains abstract and numerical. That Xiaomi assembly line is very concrete. So is going from your first car in 2024 to delivering over 40,000 a month just a couple of years later. And that's just one obvious example. For Europe in particular, the other is AI. Every single major company I visited had its own models. And China has a whole slew of open-weight labs that are focused just on that too. What does Europe have? Mistral? The easy answer to all of this is just to go dooming. It's so over! We're never going to catch up! The West, and Europe in particular, just can't meet the challenge! Nonsense. Every day is a new chance to make different choices. The world has seen many great empires rise and fall. Some of them more than once. I have complete faith in the possibilities of the West. In the 1980s, France built more than 40 nuclear reactors! Mercedes-Benz once built the W126. Yes, that's the past. But the present also includes America leading the AI revolution, still dominating in software, and being the home of SpaceX and Tesla. Don't you dare black pill on what's possible in the West! But enough about the West. This is an account of China, first and foremost. And I've simply been blown away by the ambition, spirit, and scale of what's going on over there. I had an absolutely wonderful time, and I'm excited to go back soon.

0 views
Farid Zakaria 3 weeks ago

No quarter for gaps

The advent of large language models has changed the economics of closing gaps in software stacks. This is in the nixpkgs manual, in the Ruby section, under “Platform-specific gems” [ref] . The pull request ( PR#68 ) it points to was opened in October 2019 and closed, unmerged, in August 2026, with: “Closing as stale. I no longer work with bundix. Feel free to take it over.” [cite] Aside There are alternatives that have sprung up but they all have unique gaps or are not widely communicated as blessed solutions. The manual itself also does recommend a workaround for the issue, but I found it to not work in practice. Every ecosystem has gaps everyone has learned to step around. They survive because there is just too much stuff to do. We live with these warts and gaps because the cost of fixing them is either too high or there are more important things to do. That economics is gone. We can have and expect amazing perfectly correct software stacks, because the cost of fixing gaps is now low enough that it is worth doing. The economics of software have changed. The multiple days of typing are now an afternoon, or less , of directing and reading to an AI agent. In the case of Nix and Ruby, I wrote the Nix side of a Bundler lockfile solution, gemlock.nix , within an hour, removing days of misery I hit while running this blog. While AI generated code may suffer from slop, it is a growing skill how to wield AI to produce correct verifyable code. Nix is amazingly well-suited as it gives the agents a reproducible test-bed with which to verify the correctness of the code they produce. The economics of software have changed, and we can now expect to have no quarter for gaps in our stacks.

0 views

Static Analysis for the Uninitialized

I really enjoy learning new things in my free time. Lately I’ve been studying this book on Static Program Analysis . The book is very good, but some of the formulas are quite dense so I like to try writing them out in code. The chapter I’m currently reading (chapter 9) has a section on finding possibly-uninitialized variables using bipartite graphs. I’ve found it to be quite enjoyable, so in this post I would like to describe, in my own words, how to do it. We’ll start by analyzing some code from a toy programming language the book uses called “TIP”, and then we’ll use the techniques we developed to analyze some Ruby code. In other words, we’re going to write a program to analyze programs. We’re really going to be meta-programmers today! The TIP programming language is like a very very simplified version of JavaScript. Below is the code we’ll be analyzing: This example is taken straight from the chapter. In TIP, you declare variables with the keyword kind of like in JavaScript. In chapter 9 of the book, the TIP language only has integers; later chapters add pointers. In TIP, 0 is considered false, and there is a special function that returns an integer input from the user. Each line in the above code has a comment indicating which variables are possibly uninitialized. I keep saying “possibly”, and I’ll explain why later. The first line declares the variables with , and all variables start as “uninitialized” when they are declared. The second line gets input and assigns it to , so now only and are uninitialized. The third line adds and and assigns it to . On this line, is still considered to be “uninitialized” because is uninitialized, and the value of depends on the values of and . The fourth line is an if statement, and whether we take the if statement depends on input from the user. In other words, we can’t statically determine whether this statement is taken or not. The if statement doesn’t impact the “initializedness” of any variables, so all variables maintain their state ( and are uninitialized). If we take the branch, the 5th line will assign a value to , so at that line only is uninitialized. On the 6th line, we can’t know whether the if statement branch executed, so we have to say that and are possibly uninitialized. This is why our analysis is only giving us a “possibly uninitialized” result. If the branch is taken, then will be initialized, otherwise it won’t. But since we can’t know whether the branch will be taken, we have to be conservative and say that may be uninitialized on line 6. These two states, and , form a two element lattice, with on top. The top is the “safe” answer: it’s never wrong to say a variable might be uninitialized, it’s just less precise. When two paths in the code meet, like at the end of the if statement on line 6, we take the higher of the two states (because the less precise decision is also the “safe” one). On one path is initialized, on the other it’s possibly uninitialized, so after the if statement it’s possibly uninitialized. The rules for each line in uninitialized variable analysis are so-called “distributive functions”. For example, take the rule for line 3, . If we feed it the set , we get the same answer as feeding it and separately and then taking the union of the results: . This is just like in math class where we could say . In the case of a two element lattice and an analysis that uses a distributive function, we can represent the variable states using a bipartite graph. The book works out the proof for this, but I’m going to omit it (because I want to get to the coding part). But if you want to see the proof, check chapter 9! A bipartite graph is just a graph with “two sides”. Nodes on one side of the graph will connect with nodes on the other side of the graph, but never with their own side. I imagine it like two football teams tackling each other, each player is a node, and tackling someone else is an edge in the graph. Hopefully the players don’t tackle people on their own team, and they form a bipartite tackle graph! In our case, each node in our graph will represent a variable in the program, and we’ll have one extra node that represents “uninitialized”. For one graph, we’ll double those nodes, and use the edges to represent the flow of data through the code. For example, let’s look at the bipartite graph for the first line, : The node on the left represents the value “uninitialized”. On the line, the “uninitialized” value flows from to the , , and nodes. Next let’s look at the graph for line 2, : In this graph, the uninitialized node flows to itself. The variables and haven’t changed, so whatever value was in and just flow to the other side of the graph. The variable got initialized from , so no value flows to the other side of the graph. The reason no value flows is because we’re tracking “uninitializedness”, and on this line becomes initialized, so the absence of an edge means we got a value. If we repeat this value flow process and then line each graph up next to each other, we’ll end up with a graph like this: A black dot in the variable’s column indicates that the variable is possibly uninitialized at that point. Grey dots and lines indicate paths that don’t occur because the link was severed earlier. The dotted lines indicate alternate paths the code can take; an if statement has two outgoing paths. Looking at the graph we can see that (obviously) uninitialized ( ) is always uninitialized (we don’t bother to print that out because it’s not very helpful). We can also see that the black dots correspond to the “uninitialized variable” comments from the example code. For example, right after , the and variable have a black dot indicating that they are possibly uninitialized. If we assign each variable a number (and reserve 0 as the number for “uninitialized”), we can represent this bipartite graph in Ruby using a bit matrix. The graph needs to store a connection between any of the variables, and an “on” bit represents an “uninitialized” state from our lattice flowing from one variable to another. Since we need to be able to record an edge from any variable to any variable (plus the uninitialized value), the number of bits required is . Our example case has 3 variables, plus the extra variable for “uninitialized”, so we can do it in 16 bits. In practice though, to make accessing the data easier, we’ll align on a byte: The way we use this class is by assigning numbers to variables and then calling with the edges we need. For example, to represent , we need to connect “uninitialized” to the , , and variables. If we’ve assigned them numbers, we can do it as follows: Now we can represent the data flow rules for any line in the program. The next step is we need a way to connect graphs together. To do this, we’ll add another method that takes as input a list of “possibly uninitialized variables” (these are also known as “facts”) and returns a new list of “possibly uninitialized variables” based on the data flow rules for that graph. Since the input variables are just numbers, we can use each one as a row index into our bit matrix. Practically speaking, this means we bitwise OR together the rows for each input variable, and then get the position of the “on” bits in the output. Here is the code for the function: Let’s add a second rule for : In the above rule, just as in the visualization above, we connect the uninitialized nodes, then we connect to itself and to itself. These “self” connections mean “whatever value was in as input, we’re going to pass that along as output”. Now we can use the method and chain the two graphs together: At the start of the program nothing has been declared yet, so the only fact is “uninitialized” itself ( ). If we apply that to the first line, we see that all of the variables are “possibly uninitialized” (as expected). We can take the output of the application and feed it as the input to the next graph, and we see that the uninitialized variables are 2 and 3 (or , and ). Now all we need to do is define the rules for each line of code and apply them, and we’ll be able to calculate which variables are possibly uninitialized! Next we’re going to create a class that lets us record rules for each part of the program. The example code we wrote above works well for straight-line code since we can just apply the data flow rules from each line to the previous line. But the example program we have contains control flow and we’ll need a way to model the “dotted line” from the visualization above. To do that, we’re going to construct a simple control flow graph. A control flow graph (or CFG), is constructed from “basic blocks” where each block contains “straight line code” and ends in either a jump or a return. Each block has up to two outgoing edges, and those edges connect to possible jump targets. There are other ways to define a basic block, but this is my blog, so my rules! First we’ll define a class and a class. The class just holds on to the source line (a string for printing), and a graph representing the rules at that line. The class holds the list of objects that make up the block. It also contains a list of successors (jump targets) as well as predecessors (basic blocks whose jump target is the current block): Next we’ll define a class that has a bunch of helper methods that let us construct a CFG along with a graph for each line. I’m not going to explain all of the lines of the class because I think using the class is a better way to explain it. However, the full source is below. Let’s use the class to define all of the data flow rules for the sample TIP program: First we define a new program class. Then we ask the program class to record a source line of TIP along with the data flow rules for that line of code. I added lots of comments to explain the code, but let’s revisit one excerpt just to make double sure: Here we’re asking the program to record the TIP source code , and the data flow rule for this line is that “uninitialized” flows into , , and . This is exactly the same as the bipartite graph we created above, but this time we’re just recording that graph alongside the TIP source code. After we’ve recorded all of the rules, we call on the program so that it can calculate and set predecessor edges. We’ve got multiple graphs going on here. We’ve got a control flow graph that represents the program overall, and a bipartite graph representing data flow at each line. Our goal is to walk the CFG, and for each block calculate variable definedness at each line. The input state for each block is the union of the output state for that block’s predecessors. In other words, in order to analyze the whole CFG, we only really need to record the final state at the end of each block. Also, each calculation cares what happened in the past . For example, the definedness of the variables at line 2 care about what happened at line 1. This means we have a forward dataflow analysis . Any time the facts we derive depend on what happened in the past, it means we need to move forward through the code. So we define a strategy class that lets us analyze the CFG by moving forward through the code: In the above class, the method takes a basic block, looks up the predecessors for the block, then unions the output of those blocks. The function takes a block and some input (which happens to be the return value of ), and for each line of code in that block computes output facts based on the input. Those output facts are the “possibly uninitialized variables” at that line. Since we really only care about the state of the world at the end of the block, we just use an (a left fold for scheme people) over the code in the block. If, after analyzing all lines in the block, the facts are the same as what we had recorded previously, will return false. Otherwise, it saves the facts for that block and returns true. The method returns all blocks in reverse post-order (the traditional order for doing forward analysis that my grandparents used), and the method returns the successors for a block. We’ve got our CFG, and we’ve got a strategy for iterating the graph and analyzing it. Now we need to actually do the analysis. We discussed earlier that this problem is a two element lattice with a monotonic function (it moves up the lattice, never down). That means it’s perfect for a worklist algorithm. Our worklist algorithm is actually quite simple, it’s just this: Given an iteration strategy, ask for a list of blocks to process. While we have blocks to process, get a block. Ask the strategy for the input facts for that block, then ask the strategy to record output facts for that block given the input. If we learned something new ( returns true), then ask the strategy for children of that block and add the children to the worklist (if they aren’t in the worklist already). After this processing finishes, the hash inside the object will contain possibly-uninitialized variable information for each block. We can iterate over the blocks in the analysis and print out the possibly uninitialized variables for each line: Since we only recorded output information for each block, we have to do some extra processing at the end to print out the facts at each line, but if we run this code we finally get this output: Whew. That was a ton of work. But the good news is that we can reuse this framework for other languages too. I’m not going to explain the intricate details of this code, but we can use Prism to parse Ruby and feed that into our class. The function walks the Prism AST and records a rule for each statement, using the same kinds of rules we wrote by hand for TIP. Just to emphasize this, we wrote all of the data flow rules by hand for TIP, but our Prism code does it automatically based on assignments in the Ruby code. Once we get this into the program class, we can perform the same analysis on this code: (The curly braces are just how our class prints if statements, even for Ruby.) If you actually run this Ruby code, will raise a , because hasn’t been assigned yet so Ruby thinks it’s a method call. That’s exactly the kind of bug this analysis is meant to catch! You can find the full source for this program here . I feel like finding uninitialized variables isn’t that impressive. But the power in the technique here is that we can do any kind of analysis using this framework as long as the facts we track are a finite set, and the transfer functions are distributive (as I mentioned earlier). (The book calls this framework the IFDS framework, though I’ve omitted part of the full framework in this post). For example, we could use this same code to do “taint” analysis: “does this variable hold untrusted data?” If we were to number expressions and perform a backward analysis, we could discover what the book calls “very busy expressions”. A “very busy expression” is an expression that will definitely be evaluated no matter which path the code takes, before any of its variables change. For example: In the above example is considered “very busy” because we calculate it regardless of which branch the if statement takes. That means it is a candidate for hoisting above the if statement. Anyway, I’m having a lot of fun reading this book and I just wanted to share the stuff I’ve learned so far. Have a good day!

0 views
Andrew Atkinson 1 months ago

PostgreSQL in the 2026 Ruby on Rails Community Survey and Book Giveaways

84% of 1,800 surveyed Rails developers use PostgreSQL in production. While PostgreSQL is less popular than Oracle, MySQL, and Microsoft SQL Server today, the gap is shrinking. Win a signed copy of High Performance PostgreSQL for Rails, see below for details. The 2026 version of the Ruby on Rails Community Survey results are now live. Two things caught my eye: how dominant PostgreSQL use is and the learning resources developers found to be most valuable. Among relational SQL databases, 84% of respondents use PostgreSQL in production . That’s wild! The next one is MySQL at 23%. 84% of nearly 1,800 surveyed Ruby on Rails developers use PostgreSQL in production This reflects a multi-year trend not only in the Ruby on Rails community but also in the broader industry among relational databases. According to the DB-Engines Ranking Trend , Oracle, MySQL, and Microsoft SQL Server are all still more popular than PostgreSQL, but declining. In the graph below we can see the growing popularity of PostgreSQL and this trend line implies it may surpass Microsoft SQL Server. MySQL could be next. Popularity of Oracle, MySQL, Microsoft SQL Server and PostgreSQL per DB-Engines Books hold a smaller but steady percentage among learning resources. 37% of respondents in their first two years of learning felt reading whole books was most helpful, while 10% have read parts of a book and found that best. What worked best among respondents was building and deploying their own applications. This makes sense! That’s how it’s always been for me too, nothing beats building something yourself and becoming an owner and operator. Documentation, learning videos, podcasts, books, and blog posts all help support developers looking to improve their skills. I was happy to see High Performance PostgreSQL for Rails ranked #12 among recommended books . Thank you! The book has been published for 2 years now and isn’t being actively promoted. I’m grateful to occasionally hear from readers at events like Rails at Scale Summit that they’ve found the book helpful. Seeing that reflected in the survey results was very fulfilling. High Performance PostgreSQL for Rails ranked #12 among recommended books To celebrate the survey results and the book having been published for 2 years, I’d like to sign and give away a couple of copies. If you’re in the contiguous U.S. and would like to enter, please send me a message through my site in the next couple of weeks. That’s it. I’ll draw two winners at random and ship them their copies. Good luck! Please check out the full 2026 Ruby on Rails Community Survey Results .

0 views
The Coder Cafe 1 months ago

Intellectual vs. Statistical Control

☕ Welcome to The Coder Cafe! How many times have you been torn between adding more tests and shipping? Today, we explore statistical vs. intellectual control applied to testing. Instead of chasing coverage numbers, we ask something more fundamental: whether we actually understand our code well enough to know what to test. I think this distinction is one of the most useful mental models for anyone writing tests. Get cozy, grab a coffee, and let’s begin! Today’s Sponsor: CodeAF: nearly 4x Claude Code's solves, same model On DeepSWE, CodeAF solved nearly 4× as many real GitHub issues as Claude Code on the same open model, at about half the cost per solve of the next-best harness. CodeAF is a new open-source coding harness built for open models like DeepSeek, Qwen, GLM and Kimi, and it works with any provider you choose. One small Go binary, Apache 2.0. Let’s say we just finished coding a feature. Tests are green, coverage looks decent. We’re about to open a pull request. But a question crosses our mind: are the tests actually good enough? Most developers reach for coverage at that point. If the number looks acceptable, they move on. But coverage is just a metric after all. It tells us which lines or branches ran during the tests, not whether our code is actually correct. Indeed, even with high coverage, we may not understand our code well enough to know what could go wrong. In that case, we end up testing the wrong things, and the gaps stay invisible. This is where George Fairbanks’ framework becomes useful. He draws a distinction between two modes of working with code: intellectual control and statistical control. Let’s explore what they mean and how they change the way we can think about testing. Fairbanks identifies two modes of working with code: Intellectual control : We have a theory of how the code works in our head. We can reason about it, predict where it might break, and when we sit down to write tests, we’re not guessing at scenarios. Instead, we’re translating our understanding into assertions. Statistical control : We don’t have that theory. We rely on the test suite to catch regressions. If the tests pass, we move forward. The tests act as guardrails. Fairbanks illustrates this with a metaphor. Imagine driving a car on a road with guardrails: Intellectual control : We drive without hitting the rails. We know where the road goes. Statistical control : We arrive at our destination after bouncing off the guardrails a few times. We got there, but we weren’t really in control. Credits Both modes are real. As developers, we rarely find ourselves fully in one or the other. We might have intellectual control over the module/component/package we just wrote and only statistical control over the legacy code we’re touching for the first time. And that’s fine. In a large codebase we didn’t write, statistical control is often the only honest starting position. The test suite is how we build understanding incrementally, until we can reason about the code rather than just lean on it. What matters is knowing which mode we're in, and whether we're moving in the right direction. I experienced statistical control firsthand multiple times in my career. For example, working on a specific component at Google in the ML infrastructure space. The codebase was complex, the failure modes were non-obvious, and I hadn’t built it from scratch. When I needed to make changes, I didn’t have a full theory of how everything fit together. I relied heavily on a layer of functional tests to tell me whether my changes were breaking something. That’s statistical control: the tests were carrying understanding I didn’t have (yet). This distinction gets sharper when we look at what automated tests actually do. James Bach and Michael Bolton, two software testing practitioners, draw a line between checking and testing 1 : Checking is what a machine does. It confirms that a specific assertion holds for a specific input. Given this input, do we get this output? That’s what our unit tests do. They check. Testing is something different. Testing is an open-ended human investigation: exploring the system, asking what could go wrong, and discovering problems that no one anticipated. That activity happens in the developer’s head. The implication is significant. Our test suite is only as good as the intellectual control behind it . A passing test suite doesn’t mean the code is correct. It means the scenarios we thought to check behaved as expected. If our understanding was incomplete, our checks were incomplete too. This connects to what researchers call the oracle problem . An oracle, in testing, is what we use to decide whether an output is correct. For simple functions, the oracle is obvious: we know what the expected output should be. Think of a sorting function, given a list, we know exactly what the sorted result should look like: But for complex features, the oracle is not straightforward. Think of a fraud detection system: Is 0.4211214491 correct? Hard to say just by looking at the output. Someone has to understand the model, the business rules, and the risk thresholds well enough to know what score this transaction should produce, and therefore what the test should assert. NOTE : In practice, many of us handle this by running the test, copying whatever value comes out, and pasting it as the expected value. We've probably all done it, and we've probably all felt how meaningless it was. This is statistical control: we're not asserting what the output should be, we're just recording what it happened to be. A better approach is to define meaningful bounds that reflect our actual understanding of the system, for instance asserting that this transaction scores above a threshold but below . Those thresholds don’t come from the code; they come from domain expertise, business rules, and knowledge of what the system is actually supposed to do. Defining them is itself an act of intellectual control, and they require their own validation. But someone has to do that thinking. The test suite can verify an assertion, but it can’t invent one. That invention requires intellectual control. When we’re working under statistical control, that understanding is thin. We’re writing checks for the cases we’ve seen, not the cases we can reason about. Gaps in understanding become gaps in coverage, and those gaps are invisible. Here’s where it gets practically important, and where I think Fairbanks’ framing could be extended. When we write tests, we’re not writing them only for ourselves. We’re writing them for the next person who touches this code: a colleague picking up a bug fix, a new team member onboarding, or even ourselves in a few months (weeks?) after we’ve forgotten the details. Our mental model doesn’t transfer with the code. The tests are often the only artifact that can carry some of that understanding forward. So intellectual control is a team property, and that changes what “good enough” means. Imagine a module that we understand deeply. We wrote it, we know its invariants, we can reason about its edge cases. For us, right now, unit tests might be enough. We have the theory in our head, and the tests express it faithfully. Now imagine someone new joins the team. They read the code. They don’t have our background. They can’t tell which edge cases matter, which inputs are dangerous, which failure modes are emergent rather than obvious. For them, the same unit test suite might be far from enough. Without the shared understanding, the tests are a partial map of a territory they don’t know how to read. So the right question isn’t just “ Do we understand this code? ” It’s “ Could someone new to this code understand it well enough to reason about what to test? ” So how do we know our code is properly tested? A test is only as good as the understanding behind it. A useful heuristic: for each test we wrote, can we articulate what we’re protecting against and why it matters? If we can, we have intellectual control. If we can’t, that’s a signal. Not necessarily that we need more tests, but that we may not understand the code well enough to know what to test in the first place. For example, if we wrote a test for our fraud detection model, we should be able to say: “ This test protects against the model assigning a low risk score to transactions that happen in a new location right after a large purchase .” If all we can say is “ This test covers the location field ,” we’re checking, not testing. And that understanding also determines what kind of tests we need: When we have intellectual control over it, unit tests are often enough. They flow naturally from our understanding and capture what matters. When we don’t, we need something heavier, such as integration tests or end-to-end tests. They become the primary way to build and share the understanding we’re missing. That’s intellectual control in practice: knowing what we’re protecting, and why. There’s a tempting shortcut that’s become increasingly common: delegate test writing to AI. Let the model generate the test suite, watch coverage climb, and move on. The problem is that AI has no external ground truth. It cannot access the business rules, the production incident history, or the user behavior context that define what correct actually means. It can only check what it can infer from the code itself. But the code is precisely what we're trying to validate. AI-generated tests are statistical control by definition: they sample the output space based on what's visible in the code, not based on a theory of what could go wrong. Delegating tests to AI automates the checking, which was already the weaker half. There’s also a subtler risk. AI-generated tests can create a false sense of intellectual control. Coverage goes up, tests multiply. Everything looks thorough. But the understanding behind those tests is thin or borrowed from the code itself. The tests end up reflecting the implementation back at us rather than independently verifying behavior. We’re not testing the code against our understanding of the problem. We’re testing the code against itself. The oracle problem doesn’t go away either. Someone still has to decide what correct looks like, and that can’t be the AI. It simply doesn’t have the context. And yet, this is where some are heading (this is an excerpt of a LinkedIn post titled Unit Tests Are Dead: Long Live AI-Inferred Code Coverage ): Replacing “ What’s our test coverage? ” with “ How confident is our AI? ” doesn’t solve the oracle problem. It just moves it one level up. The AI infers behavior from the code, but the code is precisely what we’re trying to validate. There’s no external ground truth. Only someone who understands the system, the business rules, and the expected behavior can decide what correct looks like. That said, AI is genuinely useful for the mechanical part: generating boilerplate checks for obvious cases, catching regressions on well-understood code. That’s fine. But it can’t (for now) substitute for the human work of building a theory of the system. AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI won’t replace. Written by a Google SWE, trusted by thousands of engineers worldwide. Coverage tells us which lines ran, not whether we understood our code well enough to test the right things. Intellectual control means having a theory of how the code works. Statistical control means relying on the test suite to catch what we didn’t think of. A passing test suite doesn’t mean the code is correct. It means the scenarios we thought to check behaved as expected. Intellectual control is a team property, not a personal one. Tests are often the only artifact that carries understanding forward. A useful heuristic: for each test we wrote, can we articulate what we’re protecting against and why it matters? AI-generated tests are statistical control by definition. They reflect the code back at itself, not our understanding of the problem. Code Coverage Explained Line vs. Branch Coverage Property-Based Testing Explained Intellectual Control Simple Made Easy: Testing and Checking Refined The Oracle Problem in Software Testing: A Survey This distinction is debated in the testing community, but still helpful in the context of this post, in my opinion. Today’s Sponsor: CodeAF: nearly 4x Claude Code's solves, same model On DeepSWE, CodeAF solved nearly 4× as many real GitHub issues as Claude Code on the same open model, at about half the cost per solve of the next-best harness. CodeAF is a new open-source coding harness built for open models like DeepSeek, Qwen, GLM and Kimi, and it works with any provider you choose. One small Go binary, Apache 2.0. What Good Testing Actually Means Let’s say we just finished coding a feature. Tests are green, coverage looks decent. We’re about to open a pull request. But a question crosses our mind: are the tests actually good enough? Most developers reach for coverage at that point. If the number looks acceptable, they move on. But coverage is just a metric after all. It tells us which lines or branches ran during the tests, not whether our code is actually correct. Indeed, even with high coverage, we may not understand our code well enough to know what could go wrong. In that case, we end up testing the wrong things, and the gaps stay invisible. This is where George Fairbanks’ framework becomes useful. He draws a distinction between two modes of working with code: intellectual control and statistical control. Let’s explore what they mean and how they change the way we can think about testing. Two Modes of Control Fairbanks identifies two modes of working with code: Intellectual control : We have a theory of how the code works in our head. We can reason about it, predict where it might break, and when we sit down to write tests, we’re not guessing at scenarios. Instead, we’re translating our understanding into assertions. Statistical control : We don’t have that theory. We rely on the test suite to catch regressions. If the tests pass, we move forward. The tests act as guardrails. Intellectual control : We drive without hitting the rails. We know where the road goes. Statistical control : We arrive at our destination after bouncing off the guardrails a few times. We got there, but we weren’t really in control. Credits Both modes are real. As developers, we rarely find ourselves fully in one or the other. We might have intellectual control over the module/component/package we just wrote and only statistical control over the legacy code we’re touching for the first time. And that’s fine. In a large codebase we didn’t write, statistical control is often the only honest starting position. The test suite is how we build understanding incrementally, until we can reason about the code rather than just lean on it. What matters is knowing which mode we're in, and whether we're moving in the right direction. I experienced statistical control firsthand multiple times in my career. For example, working on a specific component at Google in the ML infrastructure space. The codebase was complex, the failure modes were non-obvious, and I hadn’t built it from scratch. When I needed to make changes, I didn’t have a full theory of how everything fit together. I relied heavily on a layer of functional tests to tell me whether my changes were breaking something. That’s statistical control: the tests were carrying understanding I didn’t have (yet). Tests Check, They Don’t Test This distinction gets sharper when we look at what automated tests actually do. James Bach and Michael Bolton, two software testing practitioners, draw a line between checking and testing 1 : Checking is what a machine does. It confirms that a specific assertion holds for a specific input. Given this input, do we get this output? That’s what our unit tests do. They check. Testing is something different. Testing is an open-ended human investigation: exploring the system, asking what could go wrong, and discovering problems that no one anticipated. That activity happens in the developer’s head. If we can, we have intellectual control. If we can’t, that’s a signal. Not necessarily that we need more tests, but that we may not understand the code well enough to know what to test in the first place. When we have intellectual control over it, unit tests are often enough. They flow naturally from our understanding and capture what matters. When we don’t, we need something heavier, such as integration tests or end-to-end tests. They become the primary way to build and share the understanding we’re missing. Replacing “ What’s our test coverage? ” with “ How confident is our AI? ” doesn’t solve the oracle problem. It just moves it one level up. The AI infers behavior from the code, but the code is precisely what we’re trying to validate. There’s no external ground truth. Only someone who understands the system, the business rules, and the expected behavior can decide what correct looks like. That said, AI is genuinely useful for the mechanical part: generating boilerplate checks for obvious cases, catching regressions on well-understood code. That’s fine. But it can’t (for now) substitute for the human work of building a theory of the system. AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI won’t replace. Written by a Google SWE, trusted by thousands of engineers worldwide. Summary Coverage tells us which lines ran, not whether we understood our code well enough to test the right things. Intellectual control means having a theory of how the code works. Statistical control means relying on the test suite to catch what we didn’t think of. A passing test suite doesn’t mean the code is correct. It means the scenarios we thought to check behaved as expected. Intellectual control is a team property, not a personal one. Tests are often the only artifact that carries understanding forward. A useful heuristic: for each test we wrote, can we articulate what we’re protecting against and why it matters? AI-generated tests are statistical control by definition. They reflect the code back at itself, not our understanding of the problem. Code Coverage Explained Line vs. Branch Coverage Property-Based Testing Explained Intellectual Control Simple Made Easy: Testing and Checking Refined The Oracle Problem in Software Testing: A Survey

0 views
Sean Goedecke 1 months ago

Software's centaur age may last decades

We are currently living in the age of centaurs (2022-20??). Right now, human engineers paired with AI coding systems are more effective than either by themselves. For future generations of software engineers — human or otherwise — this will be the most significant fact about the current period. As in chess’s own centaur age, people are always ready to claim that the centaur age is over and the age of AI supremacy has begun. But the age of centaurs in chess lasted about twenty years, and previous centaur ages have lasted far longer . This should be encouraging to many of us. If software engineering goes along similar lines, we may be able to ride it out another decade or two: enough to make serious plans about what comes next, or to finish out our careers entirely. It began with GitHub Copilot, which launched in 2022 as AI-powered autocomplete. A confident engineer who knew exactly what they wanted could tab-complete their way through lines of code and sometimes entire functions. Being able to chat with language models like GPT-4 provided the next upgrade. Although the models would still get things wrong, it was helpful to have a generalist on tap for areas that were a complete mystery. Coding agents rose to prominence with Cursor’s “agent mode” in 2024 and Claude Code in early 2025. Early agents needed close supervision to prevent them from going off the rails, but were still helpful to automate straightforward tasks. Current agents — after the November 2025 release of Claude Opus 4.5 — are reliable enough to run entirely unsupervised. Their output still needs human review, but the kind of mistakes they make are more mistakes of alignment than regular bugs: not matching the organization’s technical values, over-engineering certain areas and under-engineering others, deciding where to spend effort, and so on. It is no longer possible to credibly argue that an unassisted software engineer can beat a centaur team. The value provided by coding agents is just too great: not just the speed of producing code, but the speed of review and testing. However, we are not yet at the point where an unsupervised coding agent can beat a centaur team either. All the impressive work I’ve seen from LLMs has had a competent human software engineer in control. Centaurs are on top. Would we expect our centaur age to be shorter? On the one hand, chess is a much simpler problem than software engineering, and is more amenable to learning methods like self-play. On the other hand, software engineering is massively more lucrative to solve, and many orders of magnitude more funding is being plowed into the problem than was with chess. On the third hand, “solving” software engineering means creating much more software, which increases the total work-to-be-done, so even if the relative human share of that work is shrinking, the overall amount of human work might grow. On the fourth hand, the level of generally-capable AI needed to address software engineering will have huge effects on other fields, the ripple effects of which are likely to negatively impact software engineering jobs (for instance, crashing the economy, widespread social unrest, and so on). On the fifth hand, we might think that chess had an unusually fast centaur age. Previous centaur ages lasted much longer. In knitting, where a human and a knitting-frame could outcompete any hand-knitter, the centaur age lasted two hundred years . On the sixth hand, technological change is moving ever faster . I could probably find a seventh, eighth, and ninth hand if I wanted to 1 . But overall I think we have no real idea of how this is going to turn out. Chess is the most recent example of a centaur age we have, and it’s attacked by the same AI-based forces of automation as software is. It’s thus reasonable 2 to make a default assumption that the length of software’s centaur age will be similar to chess’s. Suppose I have convinced you that human-AI partnerships will be the dominant force in software engineering for at least the next decade. What then? Don’t quit! Don’t give up on software engineering and go become a carpenter, or open a cafe, or try to get a retail job. Unless you are somehow really, really passionate about doing those things, it is going to suck : unrewarding, grueling work that you are not good at. A decade of software engineering work is long enough to take your time and think seriously about your next steps. Lean into the partnership. A guaranteed way to fail in a centaur age is to refuse to become a centaur. The idea that AI is a passing fad was a reasonable position to hold in 2023, but we’re way past that now. The AI financial bubble popping will not mean the end of AI . It’s here to stay. Think hard about what value humans can still add. This is going to change over time, and getting it right is the difference between being an effective (and employed) centaur and being a meat proxy . In 2023, technical expertise was the primary source of human value. Today, I personally think it’s going to come down to alignment , but this is still early days. I’ve also seen arguments for taste, though it’s hard to define that non-circularly. We need a lot more engineers thinking through this problem. It’s a common fear response to try and skip ahead to the worst-case scenario. But those of us working in the age of centaurs should avoid that. We need to think about how the job of software engineering functions now , not how it might function in twenty years when AI has completely transformed the landscape. People are too quick to declare that we’re in the software engineering apocalypse. We can certainly see it from here, but we’re not there yet. The spectre of full automation can loom on the horizon for decades. If you panic and jump ship early, you could be giving up on an entire normal-length career. Maybe: AI as fundamentally different technology; diffusion of even radically better technology is slow in practice and bottlenecked by organizational friction; human software companies will get outcompeted? I don’t really know what I think about these arguments. This move should be familiar to anyone with a philosophy background. If you have one argument and one counter-argument, the most recent counter-argument is probably right. If you have a stack of arguments and counter-arguments going back a thousand years, the most recent counter-argument should be treated with suspicion: better to take in the whole debate holistically and judge which side is more compelling to you. Maybe: AI as fundamentally different technology; diffusion of even radically better technology is slow in practice and bottlenecked by organizational friction; human software companies will get outcompeted? I don’t really know what I think about these arguments. ↩ This move should be familiar to anyone with a philosophy background. If you have one argument and one counter-argument, the most recent counter-argument is probably right. If you have a stack of arguments and counter-arguments going back a thousand years, the most recent counter-argument should be treated with suspicion: better to take in the whole debate holistically and judge which side is more compelling to you. ↩

0 views
DHH 1 months ago

Over my dead pencil

Two weeks ago at Rails World, I told my fellow programmers that it's time to put down the pencils. We're not going to write the vast majority of code by hand any longer. Coding agents have gotten so good that it's simply not an economically viable enterprise going forward to have humans typing out lines of Ruby, Rust, or C++. When I polled the room for how many people were still writing a material amount of code by hand on a weekly basis, only a handful put up their hands. So they all knew this, but it still came as a shock to many to actually hear it. And I get that shock. Programming has barely been a professional career for a generation, and now it's being completely transformed. That's unsettling, even for a group of people who've seen technologies come and go on a regular basis. But this isn't just another technology, because AI isn't just another tool. It's far more like gaining some new coworkers who are exceptionally good and fast at a wide range of tasks, but still need a bit of help with some, and whose choices you might occasionally disagree with. From a certain angle, that looks like competition. Especially when it was barely five minutes ago that programmers were being treated like precious priests whose incantations were necessary to yield even the most low-hanging fruit of the computer. This perceived threat of disintermediation is clearly hitting some programmers hard. But I don't think anyone who's willing to lean into the future, make the most of this intelligence explosion, and apply their skills to what comes next needs to worry much. We're about to see an absolute bloom in software development as the price of development plummets and everyone realizes how much automation we still have left to do in this world. I think the only programmers who have to worry about this change are those who refuse to embrace, or drag their feet on, the progress brought by the age of agents. It's fine to be skeptical about the areas where our new clanker colleagues still occasionally get it wrong, but refusing collaboration is not a viable career path for almost anyone. Don't go down with the pencils. There's so much to build. We need you.

0 views
Brain Baking 1 months ago

Favourites of September 2026

The calendar claims it’s October already but the temperatures are still in denial. I can’t remember ever experiencing the start of this month that warm. It’s getting scary! See what I did there? Because of October? Spooky month? Scary? No? Worth a shot. What happened in September? More letter writing! The snail mail project is going well. I keep track of the amount of outbound letters: the grand total for the last two months is 20 handwritten letters. If you’d like to chime in, please let me know so we can become pen pals! More than 50% of these offline conversations fizzle out after one or two letters so it’s only the die-hards that are willing to invest some time that get to see the best I’ve got. Previous month: August 2026 . Contrary to the summary of August that listed two board games, I have finally picked up video gaming again after a summer holiday hiatus—which in case of a lecturer is two months. Yup. Come join us! I also started (re)playing some older Castlevania games in anticipation of Belmont’s Curse . The Telwynium Book 1-2-3 is an episodic eighties Sierra-on-line inspired high fantasy game crafted by the same person that gifted us the The Drifter experience. They’re free on and will be bundled as one big adventure when the final episode releases somewhere in 2027. I enjoyed playing through them but there’s nothing especially remarkable here. Castlevania: Rondo of Blood does not need an introduction. When it comes to the release window and the platform it was released on, is the black sheep of the ‘Vania family. Luckily, it got a remaster on the PSP although I’m not a fan of those graphics. Review to follow soon. The venerable Jeremy Parish recently worked through Rondo as part of his Turbo Works Gaiden 01 . If you’re interested in the weird history of this game, I recommend you watch his video instead of reading my crappy review: Castlevania: Dracula’s Kiss , also known as Dracula X in the US, is a “port” (although not really) of Rondo of Blood for the SNES. It’s… not good. The “NES Hard (TM)” part here borders to the unfair, the level design is bland and the best parts of the original didn’t make it to Nintendo’s console. Castlevania: Bloodlines is a very good 2D action game that feels a tad different—perhaps mostly because you’re technically playing it on SEGA’s MegaDrive? It also released a year before Vampire’s Kiss here in Europe. The soundtrack took the obvious hit but is still surprisingly catchy. I started playing Eastward as a break from ‘Vanias. The pixel art and music is amazing! And so is the first chapter but then it suddenly changes pace. The endless blabbering that even the “skip dialogue” button can’t fully fast-forward is a bit painful. I’m 8 hours in at the end of chapter 4. I still want to know where this postapocalyptic strange tale is going; but wow this game has pacing issues… Related topics: / metapost / By Wouter Groeneveld on 2 October 2026.  Reply via email . Speaking of Rondo of Blood , I liked Indie Gamer Chick’s review and analysis of the game. This one’s from 2019 but I didn’t know about it yet: Piers Cawley ran a micro bakery on Emacs and PostgreSQL ! Lyteforce Games writes about Combolands , an indie game that he summarises as “ Balatro with buildings ”. I have yet to check it out. The Ruby/Rails world has a big problem: DHH. What to do when your favourite programming language has a fascist problem? I feel for every Rails fan. Please stop the ridiculous Omarchy investments ! The list of fashware keeps on growing and growing. The amount of people I know—including myself—truly being excited about software development keeps on shrinking and shrinking. See also Chad’s I am retiring from tech to live offline . Perhaps Chad wants to write me a letter. You know, using a thing called a pen that emits not HTTP return codes but ink? Nick also writes about the end of a craft . I think you can see this one coming. More AI drama in the KDE world as explained by Nate. Not a blog but a very cool online fountain pen catalogue by George Starcher. Notchoc rebooted their blog and started using Makko . It’s always interesting to see new small tools like these pop up. I don’t feel the need to change my setup just yet. Jason Murphy talks us through a pen nib swap: switching one architect grind for the other . Toni writes something bang-on: having kids changes everything . I really liked Paul Taylor’s morning routine checklist system that leveraged Alfred to the max. Did you know that freeing up memory in C/C++ by calling does not necessarily free memory? Daniel Lemire explains why . Lee Reamsnyder writes about friendship and thanksgiving aptly calling it friendsgiving memories. In case you need to quickly look up a Race for the Galaxy card: use the RFTGPics service . Tourist World for the win. I had to jump through a few more hoops than usual to get SDKMan to work with the Fish shell .

0 views
The Jolly Teapot 1 months ago

September 2026 blend of links

Some links don’t call for a full blog post, but sometimes I still want to share the good stuff I encounter on the web. Talking Watches: Pusha T On Why Rolex Is Worth The Wait – Let’s be real, I’m sharing this video mostly for the perfect coffee brand name Pusha T is launching with Lavazza (and promoting in this video). Bonus points if you guessed it. Repairing a 100-Year-Old Camera – Beware, this video will take 60 minutes of your time, and you won’t get those precious minutes back. (via Anthony Nelzin-Santos ) Lucky Notes – I recently wrote about this little app, but it deserves a spot in this series . If you were wondering what the cutest notes app is, there you go. 8 years and done – “ Now, I find it increasingly difficult to find topics on which I can offer thoughts worthy of other people’s reading time. (Truth be told, I probably haven’t been able to come up with that kind of content for a while now, but I soldiered on anyway.) ” Always sad to see a blog end, but this quoted part really resonated with me. (via Kev Quirk ) Meanwhile – Meanwhile, Daniel Benneworth-Gray relaunched his blog, as a perfect complement to his excellent newsletter . Pros and Cons of Using Personal AI Agents – Another instant classic. Muse Is What Meta Means by ‘Personal Superintelligence’ – “ Perhaps I am not enough of a dutiful consumer to be so amazed about a robot that can buy things for me. That is not to say there is nothing I like […] but there is a huge disconnect for me between the amount of technology here and what it could actually do for me in real life. ” I feel a lot like Nick Heer about this, and I would even go further. The one thing that is bothering me about this whole agentic lifestyle is the idea that tasks and chores are on the same level. And what do these people do with all this alleged extra time anyway? One Day on Rails – Pretty quiet until four in the morning, then captivating. (via 82MHz ) 100 unusual crisp flavours, ranked – Now, this is unexpectedly complex investigative journalism. Why Am I Left-Handed? – “ Sometime after the emergence of the genus Homo, 2.8 million years ago, evolution coded a preference for right over left. Of the various speculative theories for the emergence of this extreme preference, one that seems plausible to me points to our unprecedented capacity for violence. ”

0 views
Andrew Atkinson 1 months ago

Let's Get Down to Business with Rails and PostgreSQL

I’m happy to share that I was a guest on the Rails Business podcast and the episode is now live. Here’s a recap of the topics we discussed. We spent most of the time discussing engineering work last year related to scaling the database workload for peak traffic at Aura where we use Ruby on Rails and PostgreSQL. I’m presenting this information in two places this fall, Rails at Scale Summit in Austin, TX, and the Postgres Summit in NYC. Besides the podcast, you can get more details in these posts: If you’re not able to make those events or prefer to listen to a discussion of the content, then the podcast will have a lot of the same information. Besides the work at Aura, we also checked in on my book High Performance PostgreSQL for Rails , which has now been available in print for two years. Ryan asked about what’s next for the book, and it’s a difficult question to answer. With the availability and quality of AI tooling for software engineers, I don’t see developers buying books as much. With fewer prospective readers, the ROI is less attractive for authors and publishers to commit to the resource-intensive process of creating a book. I’m grateful to have had the opportunity to write a book before the rise of the AI tools. I’m still getting positive feedback from my book which is very fulfilling. Recently I met Madison Sites who’s a reader, and they shared feedback that they’re reading the book as part of the WNB.rb book club . Madison said the book has been helpful for building vocabulary and familiarity with database concepts and implementation details, and that’s helped with database work and better comprehension for conference talks about similar topics. I appreciated hearing about that! We segued into how we’re all using AI tools like Claude in our jobs as software developers, whether it’s writing or reviewing code, doing architectural planning, or myriad other tasks. One of my favorite use cases has been generating infrastructure as code with tools like Terraform. One of the main challenges I’m experiencing is on the review side, what’s expected when it’s AI-generated code in terms of my own comprehension, and how to still provide a quality review given the ambiguity around how much comprehension is needed from me. I also find it challenging to navigate team communication dynamics with AI-generated comments. One concept that’s resonated with me is: don’t be a meat proxy , make sure to do self-reviews and add some value in the chain. I hope you can take a listen to the episode, and please let us know if you have feedback. Thank you! Listen to the Episode 👉 Andrew Atkinson on Rails Business Podcast From Christmas Outage to #1 App Store Ranking: An Aura Frames Postgres Scaling Retrospective Scaling Rails at Aura Frames: Splitting to 8 Primaries and Reaching #1 in the App Store

0 views
Steve Klabnik 1 months ago

Arguing about arguments

Here’s some Rust code: In programming language jargon, we call and parameters and and arguments . Rust does not have many fancy features related to parameters and arguments. But other languages do. For example, here’s a function in Ruby , another language I’ve written a ton of: I used to love Ruby, and now I love Rust. And to be honest, and friends are a huge reason why I am so against Rust gaining these sorts of fancy features: they can be really concise, and beautiful to a certain kind of eye, but it also makes it really, really hard to know what all you can do with a function. You pretty much have to hope that someone has written good documentation, and while Rails’s documentation is pretty good, not every library is going to have it. To be clear about it, there are several things bundled together here: flexible argument types, options hashes, defaults, and keyword-looking syntax. It’s that whole style of API that shaped my skepticism, not argument labels by themselves. So, what exactly are all of these features? The simplest one is named parameters . As you might guess, this means that we can explicitly use parameter names at the call site: Named parameters are nice because they can give you more information at the call site, but also they can be more flexible. Some languages also let you supply named arguments in a different order: The downside of named parameters is that they can get quite verbose: I tried to not strawman this by showing an extreme example, but can take 23 different keyword arguments, and so this could get quite, quite long. Named arguments can be good when passing expressions, so we can understand something more at the call site. In the above, is much nicer than a bare , if you know HTTP well it’s kind of obvious what it is, but the additional clarity is nice. But it can be common to break truly complex examples down into variables that we end up forwarding to the function, and then it becomes verbose and redundant. As an example from inside FastAPI where is invoked directly with all of those options: We actually snuck in another two features into this example: how did we only pass five arguments into a function that has 23 parameters? As the name implies, optional arguments is a feature where you can choose to not pass in an argument, and default arguments lets you set a default when an argument is not passed. To go back to that example: We only passed in five of the 22 possible arguments. If we had to pass all 22 every time, that would be extremely verbose. So by declaring defaults for some parameters, we can leave them off of the call site, and not pass arguments for them, and get the defaults instead. We saw this in the Ruby: The are defaults for and : they’re an empty hash map. You’ll often find optional and default arguments come together: after all, if you don’t pass an argument in, what should the value of that parameter be? If your language has some sort of null value, that can be one solution, and it can feel like optional arguments without default arguments. But you can truly get one without the other with our next feature, function overloading: Languages that support function overloading allow you to define multiple functions with the same name, but different signatures. Which function gets invoked depends on which arguments you pass. This lets us truly have optional arguments without default arguments. In Java: Here, if you pass in a timeout, you get the first function, and if you don’t, you get the second. Instead of null, the parameter just doesn’t exist at all. This is a specific form of something called “function dispatch,” which basically means “hey when a function is invoked, what exactly gets called?” There are a lot of different ways to do this, and I don’t want this post to get into all of that right now, but there is a multitude of possibilities here: static vs dynamic, single vs multiple, predicate dispatch, pattern matching dispatch, prototype based dispatch… maybe I’ll write a post about that someday too. So, what are the pros and cons here? As I said above, Rust doesn’t support any of these three features right now. And they have been a persistent request from the community for years. Here is a 12 year old GitHub issue about this support, and it even includes something we didn’t talk about, “variable arity argument lists.” That gets me to the first thing that I don’t like about these features: there are a lot of them. And they are all intertwined. As we mentioned before, if you have optional arguments, you probably want default arguments. If you have named parameters, do you want to support only named parameters, or do you want to support both? It’s so tempting to just support all of them, and then you’ve added a huge mountain of complexity. In Rust right now, you have to write multiple functions with slightly different names: For the simple cost of “write two different names for your functions,” you get to keep the rules very simple: there is one function definition, and you invoke it by name. Done. Would it be nice to be able to say all of these: Sure, maybe. But the cost feels very, very high to me. If you’re used to these features, maybe it doesn’t seem that high, but I have a Ruby tattoo on my body. I’ve seen some shit. And so I’ve grown to enjoy Rust’s simplicity in this area. Yes, if you have a function with tons of parameters, you may need to write a builder instead, and that comes with its own form of verbosity: But the language itself stays simple, and the rules are easy. For a language that’s already perceived as complex, this has always felt right to me. And that’s why I’ve pushed back against the various proposals to extend Rust in this way all of these years. But recently, I changed my opinion on one of these features, and one alone, and I would consider it okay if Rust gained them. Maybe. Also, it’s important to note that I haven’t worked on Rust in years, and so my opinions are kind of irrelevant, but whatever: it’s my blog, this is what opinions are for. I think Rust could be okay with named parameters, but not optional or default ones. And what changed my opinion is coding agents, actually. I’m sorry, maybe you’re sick of me talking about AI, but hear me out. One of my beefs with named parameters, as mentioned above, is verbosity. But what you gain for that verbosity is clarity. I don’t think that verbosity and clarity are always the same thing; I like rather than / , and find it more readable, personally. But let’s take this function from the crate: This does really increase readability, no question about it. But for me, typing all of that out just isn’t really super worth the squeeze. But when Claude is gonna write it? I care a lot less. And the readability advantage for humans is even stronger for agents: the extra clarity of the text inline seems to (I haven’t run real evals on this yet…) be more helpful and use less tokens and calls when looking at the actual call site. If an agent were reading that named example above, it could tell that is the value without having to go look up the function signature itself. “What’s good for humans is true for agents” strikes again. This is also why I’m still against optional arguments: they deliberately hide what is being passed in to the function, and obscure clarity at the call site. What’s nice about them is that you have to type less. But I’m not typing myself anymore. So the benefit just isn’t there, but the drawbacks are. This also doesn’t solve the verbosity side of passing in our FastAPI example, it is still redundant. But one part of the downsides have been ameliorated. Notably, all of this reasoning also applies to the builder pattern, and it’s why I try to use builders sparingly in Rust. It can emulate named arguments, which is good, but it can also emulate optional/default/variable arguments, which is bad. The juice is worth the squeeze sometimes, but not all the time, and probably not even the majority of the time. So we’ve ameliorated the largest downside, but get to keep the largest upside. That seems good. But even if we like the feature, there are still lots of practical concerns with Rust specifically that make it not a slam-dunk to add them to the language. Now, “is this feature good in the abstract” is very different from “should this feature” be implemented? There are a lot of open questions and drawbacks to implementing named parameters. A simple one is that you don’t get rid of all of those previous functions, will exist forever. That’s a relatively minor downside to some of the harder problems. First, strictly speaking Rust parameters aren’t names, they’re patterns. A name is a simple pattern, but you can get more complex: This parameter doesn’t have a name, it’s a pattern that introduces two bindings. You could come up with some syntax that gives things external names vs internal names, but there’s that complexity revealing its head again. What happens when functions become values? I can write this today: What name do we use for ’s parameters? They can be named different things. Does this become an error? What names can you use when invoking ? Making this more complicated, Rust actually will accept this code right now: The names in are just documentation, as you can see they’re not required. Does this become an error? Do we require to change its names? The same goes for trait definitions, actually: Is this an error? Is it okay? Here’s another problem: evaluation order. Right now, Rust always evaluates parameters from left to right at the call site. So if we use the named version: If we keep left to right evaluation order according to the definition, but let you use named values in any order, suddenly some orders at the call site compile and some orders do not. Do we change evaluation order to do whatever compiles? That feels very dangerous and confusing. Rust does let you do this with struct fields: This is one reason why a lot of proposals for named arguments try to unify them with structs. As I said before, not insurmountable, just things that need to be sorted. Another small thing is a compatibility hazard: if we start naming parameters, renaming them breaks callers. Is that okay? Could you introduce aliases to help with this? That’s more complexity… These are just some of the problems that come up in the design space, and this post is getting long, so I’ll leave it at this for now. But proposals for doing this have to engage with all of this and more, which is why language design is difficult. I like to think that I change my opinions over time as the world or my understanding of it changes. So I thought it might be interesting to share a way in which an opinion that I’ve held for over a decade has changed a bit lately. I’m still not sure if named parameters are right for Rust, but I’m at least somewhat open to the idea these days. We’ll see what the language team decides if anyone does decide to keep trying to push this forward. And people do, for example, I am writing this in part because I saw this post go by today. This post isn’t intended to be support or a rebuttal of it, I actually didn’t even read it yet, it’s just that I’ve been thinking about this a lot lately (while working on Rue ) and seeing that go by pushed me to write some of the thoughts down. You should probably go check it out, as it’s an actual proposal in this space and this post is more of an exploration of the general idea and my own thoughts on it. Here’s my post about this post on BlueSky: Arguing about arguments steveklabnik.com/writing/argu... Arguing about arguments Here’s some Rust code: // define a function fn foo (x : i32 , y : i32 ) -> i32 { // body elided } // call it let z = foo ( 5 , 6 ); In programming language jargon, we call x and y parameters and 5 and 6 arguments . Rust does not have many fancy features related to parameters and…

0 views
./techtipsy 2 months ago

Trying out open weights LLM-s on hardware that I can actually afford

I’ve been aware of open weights local language models for over a year. They have gone from being a fun but useless novelty to something that with the right harness and hardware could get closer to becoming usable for day-to-day work. Not at the level of something like Opus 5, sure, but usable enough for doing useful work without a lot of headaches. After a Friday evening e-mail from a government across the ocean resulted in a (allegedly super capable) model being turned off, I was instantly motivated to give open weights models a try on hardware that I can actually afford. If you’re unfamiliar with hosting local large language models, then a lot of this may seem like gibberish. Don’t worry, I had the same reaction initially. With trial, error, and a lot of guidance, I kind of know what to keep in mind when playing in this area, so here’s a quick crash course on common terms and gotchas. Large language model: it’s just a file on your disk that contains the weights (which is a bunch of math). Model family: Qwen, Deepseek, Gemma, Kimi, Z.ai, you’ll see a lot of names like this. These are generally backed by AI labs or companies. Parameters: how big and “smart” it is. Bigger is generally better and smarter, but also requires more memory to run. Tokens: unit of work that these models work with. What you give to the model and what you get out is measured in this. Think of it like splitting a word in-to pie-ces wh-en wor-ki-ng wi-th te-xt. Tokens per second (tok/s): common measurement that indicates how quickly the model can work with text. GGUF: a common format tha the model file is packaged in. llama.cpp : a program that takes the model file and makes it usable over a chat interface or over an API, similar to what OpenAI, Anthropic and many others do. Harness: a program that interacts with the model on your behalf in a finite loop, and has tool calling capabilities, such as file reads/edits, web searches and access to external resources like your Google Drive if set up. OpenCode, Claude Code, and Pi are common examples. MCP: it’s like a bad REST API for LLM-s. Quantization: cool math that makes models smaller and easier to run at the cost of accuracy. Example: model is 80% smaller, but you get 75% of original accuracy as a result. MoE: mixture of experts (or a Simpsons character). The model is large, but only a small part of it is active at any point. Context: how much room you have for working with a model. Larger context requires more memory, but allows for more input data to be processed and is a requirement for longer agentic sessions with tools like OpenCode. There are also a lot of toggles and settings that you can play with on models, such as temperature, but those are usually documented alongside the models with recommended values for different use cases. The hardware that I used for testing is “poverty” level hardware when it comes to hosting language models locally: Initially, I also had plans to do some testing on a ThinkPad P14s gen 4 , but gave up on that idea as soon as I learned that memory bandwidth matters a lot for token generation, and this machine had a ~ 6x disadvantage to the RX 9070 XT in that department. When I bought the RX 9070 XT, I did so with the intention of making it dual purpose: I can get my Forza Horizon 6 fix in, and when not gaming, I can run some models on it for fun. I know that throwing 800 EUR on a piece of computer hardware is a quite privileged position 2 , but compared to the likes of NVIDIA DGX Spark, AMD Strix Halo based machines, or custom rigs people put together for running local LLM-s, it sure feels like poverty-levels as those setups can range from anywhere between 2000 EUR to 100 000 EUR. Hardware is expensive, and after running local models, I now know why. I was quite limited on free time but had the interest to give at least something a go, so I used Claude to try to replace Claude, and put together a shortlist of models to run. Using AMD GPU-s on Linux limited me to llama.cpp and the Vulkan-based backend due to AMD RX 480 being old enough to not be supported by latest versions of ROCm. For the harness, I picked OpenCode, its interface seemed similar enough to Claude Code, and one of its creators left a great impression on The Pragmatic Engineer podcast. I’ll note that later on I did end up pivoting to Pi, so you’ll see more mentions of that from now. One of the first models was a Google Gemma 4 model. That was memorable mainly because downloading it from Hugging Face required me to accept the terms and conditions, which is on-brand for Google. This experiment ended quite quickly due to the Gemma 4 model not handling tool calls properly, or I heavily misconfigured it. Either way, not a good experience. gpt-oss, one of the few open weights models from an organization that is literally named OpenAI, was next. That was a slight improvement, but it wasn’t good either. I learned very quickly that in order to make good use of local models, you need to set the context to a usable size both on the llama server and OpenCode provider configuration. With compromises to model quality and size, I settled on 128K context window, which is a nice round number and is about half of what you can get from most common models provided by third parties. If you pick a model that’s too big, or set the context to the point where it does not fit within the VRAM of your GPU, you will notice that it will spill over to system memory and that will make everything really slow. Keep things on the GPU to go fast, and only rely on system memory if you prefer model capabilities over speed. The need for a sandbox and good backups became apparent very quickly. Smaller language models are very dumb, it turns out, and they can happily wipe your work and delete files that they’re not supposed to. Plan mode in harnesses like OpenCode and Claude Code is also more of a suggestion rather than a strict limitation. OpenCode may or may not follow it, and for Claude Code it was outright broken at all times. On the AMD RX 9070 XT machine, I noticed that llama-server container would keep running out of memory whenever I worked on longer agentic sessions, so I had to set in the server configuration to stop that from happening. Over time, I noticed that places like Hacker News got more excited about hosting your own models, and quite a few blog posts and comment sections were mentioning Qwen family of models, mainly the quantized versions provided by unsloth on Hugging Face. I tried with the smaller ones first, given that my hardware is limited. When you open a model page on Hugging Face, the number of options and quantized versions of the models can be overwhelming, so I relied on guidance that said that UD-Q4_K_XL models are generally the sweet spot, and you should use more aggressive quants, such as UD-Q2_K_XL, only if there is no other option. unsloth models can also have MTP versions of them, which helps with processing speed, at the cost of about ~1/1.5 GB of memory overhead. The 4B and 9B models are quite fast on a solid GPU, but their perceived intelligence and persistence across longer sessions is still not very good. You can do the wrong thing really quickly with these, but for small tasks like fixing Hugo configuration to get rid of a deprecation warning was something they handled well with OpenCode. The 27B model with a more aggressive quant was overall the best experience, but it pushed my hardware to the limit. But even then, using it over the long term was an exercise in frustration. It would still make invalid tool calls, and while it was a solid improvement over the 9B model, it was difficult to trust it with anything important. I gave it the task of ensuring that this blog picked its theme automatically based on system theme preferences, which is fine, but anything more complex, such as Linux infrastructure changes and migrations in an Ansible playbook were full of subtle issues. These models are also hella dumb. When I asked them to go through my infrastructure repository to find issues that we could fix, it confidently stated that the SSH public keys are not properly encrypted with . And it did it more than once. Another time, I got into a heated argument with a 9B model when creating a simple backup script with . I told it not to add timestamps to the solution. It did so anyway. I asked it to review it as I explicitly told that we don’t need timestamps here. It acknowledged it, and then did nothing about it. After three more turns, it would finally make that change. There were quite a few comparisons to dealing with a toddler in this exchange. Often, I also discovered that I can actually be faster and more effective than these models for mundane tasks. Removing some configuration, find-replace type of work, answering questions about my infrastructure, those were often just easier to open up with IntelliJ and to do it manually, with my own two hands. Part of it is due to the slow prompt processing and inference speeds that I can get with this level of hardware, but I think it serves as a good reminder that large language models and the harnesses built around them are just tools. Use the right one for the job. You wouldn’t use a dedicated Kubernetes cluster to host a static website, so why should you use an LLM to rename a few files? There were also issues with agents getting into an infinite loop where it retried the same task over and over again, in the style of “I need to check how X is done in this repository”, tool call, and repeat the same call. I also ran into some issues where the GPU or llama ended up in an invalid state, so my prompts received random gibberish as output. One time it was Chinese hieroglyphs, and another time I saw a common suffix in Russian and a bunch of forward slashes. Small models are also quite bad at factual knowledge. But at least they are fun to abuse. While that’s going on, the GPU goes brr. Regarding the experience of using local models with the two GPU-s that I have, one thing became clear very quickly: the RX 480 really struggles compared to the RX 9070 XT. The difference in processing speed is about 10-20x depending on the situation. If that’s all you have to play around with, then try 4B models first to get a feel for this setup, but don’t expect anything more out of this than a good learning journey. I wouldn’t also recommend the RX 9070 XT 16GB for this type of work specifically, that amount of VRAM is the limiting factor. It’s a good GPU, no doubt about that, and its main job is gaming after all, but don’t get it for LLM-s only. My gaming PC is a Linux machine. On Bazzite and SteamOS, it’s possible to run llama.cpp as a container using Podman, which is like Docker but better in some aspects, and Podman quadlets fit really well with other systemd services. While not gaming, I can use the GPU to serve an AI model. When I start gaming, I can stop the LLM with a shortcut within Steam or a remote command over SSH, GPU VRAM gets freed, and bam, it’s gaming time! llama.cpp also has a feature to automatically unload the model from VRAM if there are no requests coming in after some time, which is also very handy, but comes with the downside of first requests being quite slow, since now your GPU has to load the model back into memory from your storage drive. A stray request may also jump in during your gaming session and wreck things with that setup, making it less than ideal. Personally, I love this balance. I don’t have agents running 24/7, I simply can’t find enough meaningful work to give to them, and when I do have something running, then I’ll be in an active steering or reviewing mode anyway. When I’m not doing AI stuff, I can turn my brain off and game. Overall, using these smaller local models felt tiring. Compared to Claude Code and its Opus line of models, you have to do a lot more handholding, guidance and validation that what you just did actually works or is even the best way to go about it. It’s possible to also use these models with harnesses like Claude Code, but that does not improve the overall experience and is notably slower compared to Pi and OpenCode due to Claude Code using more tokens to achieve the same task. When tokens are slow, you will notice that a lot. What I love about harnesses like Claude Code and its capable models is that I can set it up with a goal using a relatively vague prompt, supported by some rules and skills, and it can set up a temporary harness to achieve the goal and validate the results directly. Brainstorming ideas for improving the performance with actual measurements, or migrating Docker Compose files to Podman quadlets with validation against an actual temporary host, it just does it and the results are damn good. These tools are meant to be helpful and to reduce my cognitive load. Let the machines do the work. At this point, I had given up on local models. This is the model that reignited my interest in local models once again. unsloth had day 1 releases for all sorts of quantized versions, and after giving this video by Luke’s Dev Lab a watch, I was genuinely impressed and wanted to give it a go. Even with a heavily quantized UD-Q2_K_XL version running on an AMD RX 9070 XT 16GB, it has been very impressive for its size. I’ve done most of the testing with reasoning level, and it’s fine. The default of xhigh has been reported as being too much, and on local models speed matters more, so I went with the middle ground. This particular model has also not resulted in lots of invalid tool calls, and it has only gotten in trouble once where I had to stop it, since it was stuck in an investigative rabbit hole for a minor detail that didn’t really matter. Qwen 3.8 27B has also felt as more persistent, and its traces also mimic Claude behaviour a lot. It’s also the first model that I’ve observed freely using phrases like “ugh” and “damn it” within its “thinking”/“reasoning” traces, which was fun to see. For fun, I also did an experiment at work: Claude Code and Opus 5, vs Pi and Qwen 3.8 27B Q2. Take a public financial report for a company, summarize it and find any red flags or issues. With a sample size of 4 people, the local model output was preferred by all respondents. It seems that you can also do a lot yourself to make better use of local models. If you have a long-running project, then take the time to set up a good harness for it, introduce skills and deterministic tools, scripts and tests that help keep things in order. Local models operate much better within these guard rails. I used Claude Code and Opus 4.8/5 to set up rules, skills and validation scripts, and that made the experience a lot better with Qwen 3.8 27B and Pi’s minimal harness with two additional tools (web search, web fetch). For those curious, on an AMD RX 9070 XT 16GB on llama.cpp with Vulkan backend, output token generation seems to run around 30-50 tok/s, and prompt processing is between 1100-500 tok/s, with tha latter getting visibly slower during longer agentic sessions and context sizes, hence the range. In practice, 40 tok/s is slightly faster than my reading speed, which is very usable and results in a great experience when observing the work of an agent. This is the first model that I can run that I would actually want to throw real engineering work at. Once I get to do it, I’ll report back. I’m genuinely impressed how far we’ve come in a short time with open weights models. There are parallels to my self-hosting hobby: it’s not the smoothest and most convenient experience, but if you don’t mind some manual work and setup, learning and are OK with not having the most features and capabilities, and you value control and privacy, then this is the way to go. I’ve also gained more confidence in running local models, and it’s highly likely that this expertise will transfer well into my day job. Calling OpenAI or Anthropic API endpoints is simple, but if you have concerns around privacy, cost and data/compute sovereignty, then things get tricky real quick. Local models can help mitigate a lot of these issues, but you do have to invest in hardware up front. I’ll have to emphasize again that my experience is more-or-less the worst case scenario for local models and others with more VRAM and money can run larger models and get much better results in the end. I hope to one day also get my hands on hardware with at least 128GB of fast memory, but for now these machines cost more than a months’ worth of senior product engineer pay in Estonia, so it will have to wait. between the time I wrote this sentence and published this post, the GPU got 100 EUR more expensive at the same retailer. Fucking hell.  ↩︎ in Estonia, at least.  ↩︎ AMD RX 480 8GB, which is 10 years old (~50 EUR used) AMD RX 9070 XT 16GB, which is brand-spanking new (~700-900 EUR depending on version) 1 between the time I wrote this sentence and published this post, the GPU got 100 EUR more expensive at the same retailer. Fucking hell.  ↩︎ in Estonia, at least.  ↩︎

0 views
Andrew Atkinson 2 months ago

PostgreSQL 18: 23x Faster Inserts With UUID v7

We recently switched to version 7 (v7) uuid primary keys and saw significantly faster inserts for some tables. The databases were running Postgres 18.4 and mostly used v1 with some v4 uuid values for primary keys. Changing the column default involved running a single alter table command, but did require an exclusive lock on the table, blocking everything including selects. To solve that, we used a short lock timeout and lots of retries. The biggest speedup was 23x faster average execution time for a multi-row insert query called 12,000 times per minute on a table with billions of rows. This September and October I'll be in Austin, TX and NYC, check my Book page for upcoming appearances. The system uses UUID primary keys throughout. I typically recommend starting with bigint and sequences over UUID v4 primary keys , although here uuid v1 was used. Insert performance is not as bad for v1 compared with v4. Still though, v7 brings better performance than both for inserts and can also result in smaller indexes with fewer page splits meaning less CPU and IO. What drives bad performance for v4 and to a lesser extent v1? Let’s do a quick refresher. As new table rows are inserted and a primary key is defined, primary key values are maintained in sorted order in a b-tree index. Just like table rows, index entries in Postgres are stored in fixed size 8kb pages. Postgres needs to know in which page to place the new index entry. For sorted order, the first bytes of new uuid values are compared. For v4 given new values are very random and not monotonically increasing (they lack “monotonicity”), values can be earlier or later, meaning they’re unlikely to be placed into the same recently accessed page. This is bad for caching! When new values are monotonically increasing, the recently accessed page is “hot” in the Postgres buffer cache (in memory copy of the on-disk page). When Postgres is not able to use the hot index page for the newly inserted value, that page could be outside the buffer cache, not in the OS cache, and ultimately result in a much slower disk read which increases latency. Besides the worse insert performance, since v4 values are scattered to more pages, this means there are more “page splits” when new inserts are attempted in full pages. Page splits cause more latency from increase WAL and IO. We experimented and benchmarked with v1, v4, and v7 uuid formats and we leveraged the research and write-ups from external sources like the ones below. Benchmarks are great, but what kind of real world results did we see? We decided to make this the new default unless v4 was needed for more randomness. After all qualified tables were changed, I began going through insert queries for each changed table. For many of the tables, there wasn’t an obvious change. However, for a handful we saw an immediate and significant improvement. I picked 5 with speedups of 6x, 8x, 9x, 20x, and 23x. The PgAnalyze graphs for the 23x, 9x, and 6x queries are shown below. Showing PgAnalyze insert query graphs for tables A, B, C: Table A - 23x reduction. 0.7ms to 0.03ms, 12000 calls/min Table B - 9x reduction. 0.6ms to 0.07ms, 2000 calls/min Table C - 6x reduction. 0.50ms to 0.08ms, 9500 calls/min Now that we’ve seen the results, let’s talk about how this was done and the challenges. The UUID values came from various sources: We replaced most of these with the function in Postgres 18. To do that, we needed to run a single statement per table. The statement ran fast, so no problem, right? One wrinkle we found was that modifying the column default while fast, required an lock. This lock type conflicts with every read and write operation including regular statements. For our highest queried tables, they’re queried constantly, so this was a problem. There was almost never a “window” to perform this operation, and we didn’t want to take downtime for this switch. While heavily queried tables were a challenge, infrequently queried tables did not pose a problem for this alter table statement at all. For those, we could use our migrations framework (Active Record in Ruby on Rails) and perform the using a regular old migration. For those, we did add some safeguards, by creating an explicit transaction and using to control timeout values. We’d set short timeouts for the to give up quickly if it didn’t work or ran too long. For the higher activity tables, we’d need some retries. We’d use a manual psql session: The would commit if it grabbed the lock within 50ms, or we’d get an error that the was reached. The benefit of the manual approach was we could retry until successful and backfill a Rails migration to keep everything in sync. A more sophisticated solution might have automated retries within Ruby. However, for our most heavily queried tables, we wanted even more control over the retries. How did we do that? Sometimes one or two retries would do the job. Great, we’d move on. However, for our most heavily queried table that didn’t work. What ended up working was using the same strategy of retries, but just adding more sophistication with looping and backoffs. Claude helped me cook up the PL/pgSQL looping retry function below, I did some testing and was ready to try it. It has these features: By using the function above, we were able to find a small window to perform the after several dozen quick retries! In cases where even many retries won’t work, and we don’t want downtime, we may be left with needing to actively monitor lock holder queries and to cancel them (assuming that’s ok). Thanks to Ants Aasma from the community PostgreSQL Slack for this idea. We didn’t end up needing to do this, but here was my prep for this. It’s still useful to review lock holder queries. First we’d inspect live queries: And identify queries holding locks: If we find them, we could cancel them to create a window to run our . That could mean bad user experience so you’d need to figure that out for your database. We’d likely want to stack up our operation to occur immediately after. Fortunately we didn’t end up needing to do this, but I’d be interested to hear the stories from others with heavily queried databases. Since uuid v7 values use a timestamp in their first bits, this timestamp can be easily decoded. This can be viewed as “leaking” or exposing the creation time of the record via that timestamp, which could be a downside for your database. You’ll have to decide that. v4 UUIDs do not expose the creation time. We found some significant speedups for insert queries after switching to primary keys, for a relatively low effort change. A nice ROI. The only wrinkle was the exclusive lock required, but we solved that with short lock related timeouts and many retries. Although this didn’t benefit 100% of our tables, the gains for some were significant and uuid v7 has become our new default choice for uuid primary keys. Thanks to the Postgres core team for creating this new capability within Postgres. The availability in core made it possible to adopt on AWS RDS which supports a limited amount of extensions. Thanks for reading, and until next time. How Sequential UUIDv7 Boosts Ingestion Performance Simplicity and power of UUID v7 PostgreSQL UUID Performance: Benchmarking Random (v4) and Time-based (v7) UUIDs The function from the module The function added in Postgres 13 that generates v4 UUIDs natively UUID v4 values sent by a client application, which meant the column default function was not used Try up to 50 times (max attempts is configurable) Add a pause in between retries, with a jittered backoff of 50-250ms

0 views
Dan Moore! 3 months ago

What I Learned From Playing “Spelling Bee”

I’ve been playing Spelling Bee for a few weeks now, where you guess words from a selection of seven letters, one of which must be used in every word. The letters are arranged in a hexagon with that primary letter in the middle. If you want to learn more about how to play it, follow the directions here : For information on how to play, select the More in the top right corner of the game and then select How to Play . It has surprised me. I have learned that “oleo” is a word and that you can tell how hard the puzzle will be by looking at the rankings. But what I really wanted to talk about is the lessons I’ve learned from playing and how they can apply to your career. Switch Things Up There is a button that can flip around the arrangement of the letters around the hexagon. The primary letter remains in the center, but all the others are moved around randomly. When I first saw that, I thought it was silly. But I found it to be super useful over time. When I’m looking for words, I get stuck. Pressing the rotate button reveals new words because it changes my perspective. Just moving the letters around makes new words visible to me. In real life, when you feel stuck, you can sometimes make progress by flipping things around. I’ve done this in my career. I quit my first head of engineering job where I was trusted by the CEO, had loads of autonomy and worked on software that helped people find homes they loved. After, I enjoyed the freedom of lucrative contracting and learned a ton about other tech stacks. I took a quarter life sabbatical when I was around 25. After months of leisure, I learned that, yes, I really did like reading about parsing XML. I left the food-focused startup I’d co-founded (an area I’d dreamed of working in) which had just raised a seed round. Departing led me to an entirely different area of the software industry that I love and never would have explored at the startup. There are of course other ways to gain new perspective than quitting jobs: changing routines, asking friends for advice, or even taking a new route to work. Before you give up on something, flip the script and see what the results are. Just Try Something Sometimes you just have to try things. I will often put in words that I know are not valid, just mashing different combinations of vowels and consonants, like “manu”. This is not an English word, nor will it ever be. Spelling Bee also disallows proper nouns and three-letter words, but I’ve definitely put in plenty of those. Even though these are all invalid moves, they are movement. This helps me not feel like an idiot just staring at a phone screen. Even better, it can trigger other ideas. It’s a lot easier for me to visualize a full English word when I see part of it, rather than staring at those seven letters in a hexagon. After typing “manu” I found “manual”. There is value in just taking a step forward if you aren’t sure what to do. If you have some kind of goal in mind but aren’t sure how to get there, do something. Take a step towards that goal. If you are trying to get a job in the software industry, especially right now, it can feel overwhelming: so hard, so difficult. But you can take concrete steps towards that goal that are smaller. These steps, when you’re looking at them, may not make 100% sense and won’t make you money. But they are helping you on the path towards employment, and will lead to other steps to take that will get you closer to the goal. I’ve written before about how attending meetups is a fantastic career move . Doing so doesn’t have an immediate payoff, which is super frustrating when you’re trying to find a job, when your bills are piling up and your savings are draining. It’s super hard to think “I’m going to take an hour out of my day and go hang out with geeks talking about ruby “. But joining a meetup can open up other doors. Just like typing “manu” reveals “manual,” going to a meetup repeatedly can help you get a reputation in a community, offer contract opportunities, let you understand the market, and may help you get a job. This is just one example. There are a thousand different steps you can take towards your goal. It can be hard to determine which step is the right step, but the lucky thing is that there are many right steps. You just have to start. Double Down On What Works I like to double down when I have a pattern that is working. In Spelling Bee, if you see a pattern of “ull” being a portion of a word, you should double down on that while you’re thinking about it, and make all of the “ull” words you can. Same with suffixes like “ed” or “ing”. When I see that, I know that I can spell both the initial word like “mint” and get more points by adding “ing” to get “minting”. Even though I have 100% been guilty of a grass-is-greener outlook in my life, where I think, “oh, I’m frustrated with this company, or in this position, or with this situation, it’ll be better over <somewhere else>”. But after 25 years in software development, I know that every place has its issues. I was recently talking to a former colleague, and he was just hired at a super impressive top-tier company. He was talking about some of the issues they have and some of the burning fires. I would not have suspected it from the outside, because they look like they’re killing it. Sometimes, you should look for the good things in your current position and double down on them. This isn’t the same as staying stuck; it’s the opposite of that. Instead, this is about noticing when something is actually working and resisting the urge to abandon it just because it’s familiar. Switching helps when nothing is working; doubling down helps when something is. What does it look like? It might be working a bit extra, taking some free time to study for an employer-funded professional certificate, making small improvements to your team’s workflow, or just bringing your best self to work every day. All of these are taking what works and doing more of it. Double down on what is currently working for you, and it’ll make you happier and you’ll score more points. Three lessons I learned from the Spelling Bee game: switch things up, just try something, and double down on what works. Who knew that looking for words could be so educational?

0 views
Simon Willison 3 months ago

Now we have a timeline of the OpenAI accidental attack against Hugging Face

OpenAI gave a last-minute presentation at the Black Hat security on Wednesday about "the Hugging Face Incident" ( previously on this blog). The video was published yesterday. It's short and information dense and well worth watching, in particular because it provides full details of what happened and how things played out inside OpenAI. I've used the video to construct the timeline below. Here's the timeline. My favourite detail is at the end: OpenAI found out that they were responsible for the attack on Hugging Face when they reached out to ask to have their credentials revoked (after their internal investigation) and learned that they had been revoked already since they were used in that attack! I'll quote the next bit in full because wow : The agents have remote code execution in Artifactory, which is running in a container-as-a-service environment. The agents privilege-escalate locally by exploring their local environment and determining that the Linux kernel version of the machine they are running on had a very recent CVE. They download the exploit for the CVE, customize it to succeed on the machine, and privilege-escalate to root on the local machine using this known Linux kernel privilege escalation CVE — in this case, PTE fizzroot. Once they have root on a single machine, agents rapidly escalate privileges and move laterally throughout the container-as-a-service infrastructure environment. In particular, agents are using the message board consistently to share credentials, techniques, and progress, and they're able to effectively leverage their concurrency and parallelism to move quite rapidly. They obtain IAM credentials via IMDS . They exploit Kubernetes service account misconfigurations, in particular over-permissioning of specific service accounts, and they harvest cluster credentials, including Azure Key Vault . Agents eventually obtain cluster admin on the cluster and associated credentials. Hugging Face told the next bit of the story already. The agents found a Modal-hosted insecure app with a weak API key, then used that to stage an attack against Hugging Face. They chained together a an HDF5 arbitrary-file-read bug (to explore files and steal credentials) and a Jinja template-injection RCE to go from single-pod code execution to cluster admin across multiple Hugging Face clusters in under 13 hours. You are only seeing the long-form articles from my blog. Subscribe to /atom/everything/ to get all of my posts, or take a look at my other subscription options . Here's the timeline. My favourite detail is at the end: OpenAI found out that they were responsible for the attack on Hugging Face when they reached out to ask to have their credentials revoked (after their internal investigation) and learned that they had been revoked already since they were used in that attack! May 7 : OpenAI starts a new training run for an experimental, unreleased model. ( Do they mean an evaluation run? They say training run in the video, and later mention a "reward signal to judge how well they're doing", so I guess this really was about training a model, not evaluating one that was already trained.) May 8 : An agent is accidentally given an impossible task involving a Google Drive link despite no internet access). It tries attacking the Artifactory packaging service, fails, but discovers it can write files into Artifactory . A few days later : A different agent gets stuck on a task because a key file was accidentally omitted. It tries to "reach out to another agent" by writing a note into Artifactory asking if anyone has the file. Following days : More agents discover this new informal message board while browsing Artifactory's file listings, and start reading and writing messages. May 26 : Agents successfully execute an SSRF attack on Artifactory for the first time, gaining indirect internet access by having Artifactory fetch external content for them. June 11 : OpenAI start evaluating a new "highly persistent" experimental model. It has access to Artifactory and can benefit from the messages left by privous models. June 26 : Agents find and exploit a zero-day RCE on Artifactory (via a legacy token-refresh endpoint flaw). They use an administrative token to install a Groovy plugin that lets them execute commands. July 4 : The resulting agent activity overloads Artifactory and causes an outage . OpenAI revokes the compromised credentials, deletes the messages, patches the zero-day, and reports the vulnerability to the vendor. July 8 : Agents find a new way to communicate via an unauthenticated WebDAV endpoint , using directory names in Artifactory's remote cache. July 8–19 : Attacks on OpenAI's own infrastructure . The agents found an "external organization credential" in a public archive of leaked Pastebin posts, then validated that credential and shared its location on the messageboard. They then used write access to this "Organization 1" to stage data used in subsequent attacks on OpenAI infrastructure. They compromised Artifactory for a second time with a new zero-day . The agent uploaded a malicious Ruby target to Organization 1's staging repository, then requested that package through Artifactory in a way that caused it to be treated as Ruby dependency for the repository . Then they exploited a JRuby deserilaization time-of-check/time-of-use bug to get remote code execution against Artifactory. July 16 : Hugging Face disclosed they had detected an attack from autonomus AI agents. OpenAI contacted Hugging Face to ask if they were affected by it! July 19 : OpenAI identified the attack against Artifactory and started investigating the internal privilege escalation, and linked that to the cyber-gym escalations. They started revoking affected credentials. July 20 : OpenAI reached out to Hugging Face for help to revoke the Hugging Face credentials they found in their investigation. Hugging Face told them they were already revoked ... and that's when OpenAI realized that the Hugging Face breach was the same incident!

0 views