126 comments

[ 2.4 ms ] story [ 22.1 ms ] thread
Safe rocket jumping? Unlikely.
It's much safer now that it's written in rust

.... /s, if it needed to be said

I remember seeing the QuakeC line of code that halved self-damage from rockets. It enabled rocket jumping, but it also made the rocket launcher a much, much better close quarters deathmatch weapon than in Doom, so I thought it was a bit lame.
How? Was it a LLM-assisted rewrite?
Mindboggling that people used to do this by hand.
They didnt though, because there was no reason too.
There’ve been plenty of similar projects posted on HN over the years.
Of course it was.
No one does any porting by hand anymore. Without LLMs this port would never have happened.
Code lives here - https://github.com/terrapapagalli1516/quake-srp (SRP stands for 'slop rust port'.)

I think 'standing on the shoulders of giants' is the phrase for something like this. It's the confluence of browser rendering, WASM, Rust, and LLMs. For me it's less a demo of what AI can do, and more a showcase of the human effort from the past few decades on the parts that needed to fall into place for an LLM to come in at the (relatively speaking) last second and claim a win. Sure, an LLM did the port from C to Rust, but think of all the things needed for it to all work. That's pretty damn amazing, and it wasn't done with AI.

I would never have imagined a phone web browser capable of this in 1996 between playing Quake and testing out the hot new JavaScript powered mouse rollover image effects in Netscape Navigator 2.0
wow, that must feel quite surreal. i’ve been using the internet since 2001-02 and became a web dev in 2006-08 (discovered what js was), and even I find this impressive & fun (especially that the code isn’t written by a person). But to see both JS and Quake as fresh new things to here in 30 years would feel crazy.
Oh my god, and the author even supplied a "proof"[0] visual diff harness... that it replicates the original game pixel for pixel.

Just the cherry on top of great demonstration of our collective new superpower: asking computers to do something we can describe how to do, but would (probably) never take the time to do ourselves.

[0] https://github.com/terrapapagalli1516/quake-srp/tree/main/or...

(comment deleted)
Yeah cool.

How long before the same thing is done to like, banking back ends? Wallstreet proprietary software? Amazons logistics and distribution systems?

It seems like we might be weeks/days/hours before a situation where someone back engineers and spoofs a system so pivotal to modern human society that the plug needs to be pulled.

If someone recreates Amazon's logistics and distribution systems they could try to compete with Amazon? But they'd also need the connections, distributors, transportation, etc. same with banking software, you need capital to be a bank not just software, and if they have the capital then the technology is working we intended making it easier to make new things and innovate, or at least just compete?
I mean some people (me included) have been begging society to pull that plug since over 10 years now.

The plug being "the cloud" and "hooking everything up to the same internet".

These confusion attacks can only confuse people, because critical systems can exist in the same space where entertainment systems and all other categories of systems live. This was wrong even before LLMs.

(comment deleted)
> spoofs a system so pivotal to modern human society that the plug needs to be pulled.

why would a recreated system be detrimental?

If currently there's a monopoly on a software, this AI recreation is a good outcome to poke holes in that monopoly. It's only bad if you are financially invested in said monopoly, and this would be a minority compared to the amount of benefits that society at large could obtain.

This is basically a digital era anarchist view - the problem you're overlooking is that a lot of critical infrastructure we rely on runs on systems that are considered security through obscurity. Software most people probably wouldn't even know or care that it exists. If you can break the trust of vendors by being able to spoof their proprietary platforms, a lot of the highly efficient networked systems becomes vulnerable to injection and abuse if you can't trust whos making calls to it.

In the past you'd need nation state actors with considerable budgets to do this kind of thing, and we're on a trajectory that could see any kid in his bedroom could do it.

revealing that security thru obscurity is broken can only lead to a better future, even if in the intermediate one there are lots of breakages. It's suffering that needs to happen, and better sooner rather than later imho.

And i assume you don't truly mean spoof as in man-in-the-middling someone - i assume you mean the end user knows they are using an alternate system and are not being defrauded. Like using a photoshop replacement.

I’m already seeing videos of people who have used LMs to reverse engineer and clean room reimplement entire video games. I estimate this shit is minutes away from being shut down, because as we’ve all seen companies stealing is OK, but individuals stealing is heinous and a crime.
>banking back ends

As someone who works in a bank: depending on the exacty subsystem of a bank the answer is from "already" to "in 3-5 years".

Making predictions for in 5 years with the current dynamic of the ecosystem seems rather speculative
Like I've said many times: LLMs are useful for this (i.e. porting software from one programming language to another).

Porting software is painstaking grunt work which still takes a moderate amount of intelligence. It's therefore extremely expensive to port say, COBOL banking software running on mainframes, to another language like Java. That's why a lot of COBOL software is still in use. I expect this to die out in the coming years as many of these systems will finally be ported to another language (could be Rust or any other language).

In many ways the financial system is a distributed monolith. COBOL is still around because of bugs and issues (sometimes in code, sometimes in the OS it ran on, sometimes in the computer hardware) that have been around for decades are often dealt with downstream with their own exceptions. This is why IBM still sells mainframes. They literally emulate software and hardware bugs from equipment as far back as the 1960s.

I spoke with a semi-retired COBOL programer about a decade ago. They literally often can't fix specific bugs because multiple other consumers (from banks, hedge funds, insurance companies, the central bank) outside of their organization (and subsequent downstream consumers as well) would all need to adjust their code. Rewriting it is grand, but won't fix the spaghetti code mess. This is made even worse in the US, which has a much more fragmented banking system. "Modern" COBOL isn't even that bad, but they can't even use it most of the time. There is SO MUCH that isn't even documented - and if it is, is in a binder that's been shelved decades ago and half of this developers time was going into the corporate archives to dig it up.

This isn't to say that a lot of legacy code can't be modernized, but it's not always that easy.

The visual diff harness was probably how they got rid of a lot of visual bugs, just tell the LLM to keep going until the pixels match exactly as the verification criteria
Using pixel data might be unusual, but anyone porting a game with a replay feature is going to realize it's an easy way to compare implementations.
I suspect it's inspired by gbaeval. Both have the "oracle" and other similarities. https://gbaeval.com/
I've recently gotten an Oracle in my translation system too, I think it's a common need to compare bytes betwitx to different systems. I didn't think it was specific to one company.
Imagine the power of this magic superpower in the hands of business owners....
You must be fun at parties
It won't be long until we can ask it to replicate iOS or MacOS.

Apple needs to up its game, fast.

It won't be long until corporations will start paying AI companies to block such requests or even lobby governments to make it illegal to do.
Actually Claude just did something similar for me, as I'm working on something else with Quake.

On its own it decided to do demo playbacks and take periodic snapshots, and compare them pixel by pixel if the PNGs differ.

I was also working on a web-based port but it saw the original Quake code was not modified so it compiled a native version on its own to use for this.

It had to apply a small patch to make the game completely deterministic, but it figured that out on its own by reading the code.

It then asked me to record a demo with various elements, say an explosion or being under water, and visually verified that the screenshots had those elements present.

So now I have a solid set of tests to verify against.

Opus 5.5 Medium. Used at most 1% of the weekly limit of my $20 plan.

There are several good algos used for diffing graphics for not so pixel-for-pixel rendering allowing thresholds (you are going to end up with differences between software and GPU rendering at least - it's inevitable):

https://github.com/NVlabs/flip

But also SSIM, perceptualdiff, and many others

For UI/web certain other methods are better, for video - I'm sure there are prefferences there too.

It's so smooth
This may sound funny but I feel games would lose a lot of fun if they were all written in rust and had classes of bugs just not available to them. For better or for worse quirks and bugs in games have shaped how people approach games, and also have given games charm for decades.
Fortunately for gamers, Rust doesn't do anything to stop physics engines from going haywire or preventing players from clipping out of bounds. A Mario 64 written in Rust still has parallel universes (well, assuming that you translated the out-of-bounds float-to-short cast as a modulo, which is actually UB in the C implementation).
Rust does, however, kill Missingno. No thanks.
To be pedantic, even being written in C would have killed Missingno. Pokemon Red/Blue were written in raw assembly.
C doesn't bounds check arrays. A C compiler is perfectly capable of producing the same machine code as an assembler when given a loop that writes bytes to an array and then keeps writing beyond the space allocated for the array.
Missingno wasn't the result of an array overrun, it was due to data in a set of registers (which had temporarily been used to store a string) being arbitrarily reinterpreted as structured data governing which pokemon were allowed to be encountered. It more closely resembles a compiler miscompilation than a typical logic bug that you'd encounter in a C program. An idiomatic C implementation of Pokemon Red/Blue (ignoring hardware limitations, which is of course why it was written in assembly in the first place) would have used a static array to hold the per-area pokemon encounter table, and would have used a global variable to hold the index into this array representing the player's currently-loaded encounter zone; at no point would the static encounter array have been overwritten by a string temporary (which, in our C implementation, is just a function local variable on the stack), and at no point would the global location index be overwritten with garbage, because just like in the original game it only gets updated when we load a zone where wild pokemon can be encountered (which means that surfing on the side of Cinnabar Island would result in encounters drawing from whatever encounter zone we had most recently visited).
Rust only prevents types of bugs where the game crashes because of invalid memory access, or exploits.
Since when are Rust programs unexploitable..
They aren't obviously, but iirc around 70% of vulnerabilities in Chrome and Windows have been memory safety bugs.
Nah it prevents all kinds of bugs that exploit things like integer overflows, invalid values, etc.

Obviously gameplay bugs are still possible in Rust, but many of them are not.

> ...that exploit things like integer overflows...

AFAIK Rust doesn't check for integer overflow in release builds, so that would still be exploitable.

Rust doesn't check for integer overflow in release builds by default (ignoring the explicitly-checked methods, of course). At least when building with Cargo whoever builds the binary sets overflow behavior.
‘Safe rust’ just being used to mean ‘no unsafe’ is kind of a shallow understanding of the language. You can write code without unsafe that is not really ideal at all eg abusing vector/slice indexing to create a kind of interior mutability that the borrow checker is blind to. Which as a C port I’m going to guess it probably ends up doing
Almost hard to believe that someone using an LLM to mindlessly migrate software from one language to another for no practical reason at all would have a shallow understanding of those languages...
It's a videogame, there doesn't have to be a 'practical" reason. Somebody does something for fun and all you get is negativity. Some of you have lost your sense of curiosity.
What "curiosity" is there in telling Claude: "Do Quake, but Rust this time"?

Taking apart a codebase and rebuilding it in another language can be a deeply fun and rewarding experience if you're trying to understand a system better or sharpen your language skills or engage with an old problem in a new way. But none of that is what's happening here.

Having an LLM do things like this when there's no other practical need for it only accomplishes the cheap dopamine hit of "result", and people who do that are only mortgaging their own curiosity and increasing their dependency on a machine to run their own mind for them. Maybe I'm just a curmudgeon, but that seems pretty worthy of 'negativity' to me.

They said they worked on it over about 4 months. I'm assuming that takes a pretty decent amount of prompting and therefore effort and learning.
Another slop project highly likely to be abandoned in about a month.
What kind of non-abandonment would you want for a quake port?
Adding support for larger maps and colored lightmaps, for example. Quake still has an active modding community, and many of the most impressive maps require a source port with increased engine limits. The original engine just can't handle their scale and complexity.
Luckily your tokens are equally accepted as legal tender to the code machine, so if you want it, you can have it.

It a new world. You can literally maintain your own fork with the features you want.

Even the AI models are not gate-kept, soon. In 2030 you'll be able to affordably buy a GPU that can run an open weight model equal to the best that 2026 had to offer. I.e. projects like this.

> In 2030 you'll be able to affordably buy a GPU

One can dream.

Well, what year do you want to put on it? You think that literally never you will be able to buy hardware than can run a model equivalent of the best that 2026 can offer?

Short of the world ending in the next 10 years, it's obviously just a matter of when.

In his 3rd term, Trump will increase tariffs on hardware to 1000% and start a shooting war with China, and focus on replacing all renewables with coal. Then it'll be a race between when civilization as we know it ends, and when GPU prices come down.
(comment deleted)
I spent five years on and off porting Neverball to the web by hand and waited for the perfect moment to announce it while tweaking the UX.

Fucking missed it.

https://play.neverball.org/

Are hordes of developers now going to port all sorts of open-source software to Rust using LLMs and passing it off as their own work?

I don't see any need for this. Rust is brilliant but the Quake C++ code was already more or less bug-free.

I suppose it will fizzle out in a few weeks.

What this exploits is the mental shortcut of "rust = good", which might be a good thing, as that was always wrong. But now it is being pushed to its breaking point so that that idea will eventually collapse.

Accelerationalism on a micro scale, basically.

AI keeps breaking things that were broken before like this constantly. It's the great cleanup of old bullshit. (Unfortunately through even more bullshit, but at least there is a silver lining)

Well look at Adobe, this just happened to the entire CSS suite. Not open source but proprietary.
Quake was written C, not C++. The first id game written in C++ was Doom 3 around 2004.
I mean...why not do it? Are you implying it would only have value if someone painstakingly did it by hand?
I see the result of an LLM port only as a baseline. I would expect any serious developer to rewrite and refactor the code beyond a verbatim translation and to make it more maintainable, readable and robust. In short, to turn it into idiomatic Rust.

If you're not going to do that don't post your results online, just keep it to yourself. Anyone could've done this. Even people without any programming skills.

> If you're not going to do that don't post your results online, just keep it to yourself

...I mean...I just don't really know how to respond to that. Who the heck cares if someone posts this online? If you don't like it, just move on. Sheesh. Lookout everyone, this guy doesn't approve of your side project.

The definition of "serious" developer is changing. An LLM can already produce maintainable, readable, robust code.

It's getting to the point that LLM produced code is indistinguishable from even the best handwritten code.

There's no value in gatekeeping,the code side of software is becoming increasingly democratised, and the barrier to entry is getting closer to no barrier at all.

> It's getting to the point that LLM produced code is indistinguishable from even the best handwritten code.

I think you should read more code ;)

Yeah when I read comments like this I'm thinking either the commenters did not actually bother reviewing the LLM code or they must have access to much better models than those I'm using (claude). Yesterday I reviewed 1500 lines of code which was reduced to 500 by just asking claude "why do we need this" on well chosen parts of the code 3-4 times, to which it would say things like "I made an optimization, but actually this doesn't pay for itself" then explain how the optimizations would actually make the whole thing slower...
Quake is to some extend a reference implementation of a modern FPS-type game. Because it is open source and because it is well written.

Now I'm no hero in C (doing slightly better in C++). But I have quite some experience with Rust. I rather read Quake in Rust than in C. So I'm happy with the port.

Also, you talk down on the effort but porting over a codebase this size is no small feat even with the help of LLMs. I think the "author" (human creator) learned a thing or two along the way.

Vibe coders need to stop trying to use the browser as a platform for complex games. It's never going to work out and will always lead to a slow, unplayable, piece of shit. If you want to make a game then just make it a desktop program... There's a reason why literally every modern game is built in this way.
These aren’t JavaScript apps, they compile to WASM which actually has really good performance. Probably not as good as native assembly but for an old game it’s easily more than enough.
it's a desktop program that happens to compile for the browser...
WASM is about 50%-70% of the speed of native code. That's like having a CPU that's a couple of years older.

It's plenty for a 1996 game.

Rust has first-class support for WASM, so building a browser version isn't hard.

indeed playable.
would be even greater if multiplayer worked as well
I guess they left it out because there was no way to test it. i guess you would need a closed local area network and a local ai.
It's funny how this type of thing makes me feel absolutely nothing inside. But hey, it's a free country.
Is the point of somebody's project to make you feel something inside? Up your curiosity.

It's amazing it is even possible.

If it's "safe" Rust it means you can't kill the last boss by telefragging it any more?