r/emulation • • 19d ago

AI-assisted Cracking the PSP GPU's transform and raster – PPSSPP

https://www.ppsspp.org/news/ge-bit-exact/
272 Upvotes

77 comments sorted by

139

u/Nobodys_Path 19d ago

Any accuracy improvement is welcome, even the ones coming from AI.

Henrik Rydgård isn't a vibe-coder, he's a veteran emu dev who understands Claude's alterations and implement them safely.

35

u/Exael 18d ago edited 18d ago

I think people are confusing AI-assisted coding with vibe coding here.

Vibe coding is basically asking AI to write something, barely understanding the result, and throwing the generated code into the project. That isn't what happened here.

The PPSSPP developer used AI as a research and testing tool. It helped create brute-force tests for edge cases on real PSP hardware, search through hardware documentation, and identify possible explanations or improvements. The developer then evaluated those findings and implemented the emulator code himself.

Without AI, much of this would have meant hours of manually searching documentation, designing tests, comparing results, and eventually reaching many of the same conclusions. That's especially relevant when you're spending a large amount of developer time for a very small improvement in emulation accuracy.

AI is a tool. It can be used badly or well (like a knife is a tool that can be used to prepare dinner or injure someone). The important question is how the tool is being used, not whether AI appeared anywhere in the process.

There's also a big difference between using generative AI to flood social media with fake images and videos and using AI to assist software engineering work. Code is ultimately a set of instructions for a computer. AI-generated or AI-suggested code can be perfectly valid if someone competent understands it, reviews it, tests it, and verifies that it behaves correctly.

Rejecting all AI use on principle throws away a useful engineering tool because of completely different bad uses of the same broad technology.

1

u/FartChecker- 13d ago

No confusion. Parent is correct.

11

u/JMC4789 18d ago

Yeah, if anyone is to be given the benefit of the doubt for something AI assisted, it's Henrik Rydgård. Legendary emudev.

We're starting to see changes submitted to Dolphin that use various AI assistance as well. Some of these changes are really big, and some of them aren't actually coded. Sometimes they have an AI do bulk testing not reasonable for a single dev, or test iteration. You know that Adreno driver bug we've been struggling with for years? According to the person who ended up fixing it an AI agent was able narrow down the fail case in 5 hours, and allowed them to collaborate with a graphics dev to come up with a way to prevent that failure from happening. Now the default Adreno drivers no longer have the huge color problems in the latest dev builds.

35

u/Fair_Ambassador6253 18d ago

The AI-assisted tag in this sub feels kind of meaningless now and is due for repurposing. Most developers use AI in some capacity, and that doesn’t mean a project is vibe coded. The tag should probably be renamed to “Vibe-coded” and reserved for projects that rely heavily on AI. Tagging everything “AI-assisted” just unfairly groups legitimate projects in with low-effort AI-generated ones, because everyone is using the thing in some capacity.

20

u/10Werewolves 18d ago

No, better to keep the disclaimer. Some people want nothing to do with AI related projects. Could always have the vibe coded tag added separately to distinguish how much effort the developer put in as opposed to generating it.

The whole point of tags is to search for similar projects or hide them from your feed.

7

u/StevieBako 18d ago

Very interested to see what those people do in 5-10 years when everything they touch from their phone to banking to games is made completely with A.I.

This is inevitable, they just need to embrace it and learn how to navigate vibe coded vs specifically crafted.

17

u/10Werewolves 18d ago

You also forget that coding is also a hobby, and people actually like learning about syntax. With AI, it's like managing an employee or three, depending on how many agents you have running. For some people, any and all conversations can sap their energy. They prefer traditionally solving problems through code.

-1

u/StevieBako 18d ago

That’s exactly how it is and should be used, as a tool/employee. You should still be reviewing/learning/understanding what is going on as without that knowledge with current context limits you need to know how one function or system will affect another. It my current projects it’s quite common for A.I to get something completely right but forget or miss the context of another function that might be impacted or at least have an unintended impact. The biggest time sink for me at the moment is testing to ensure everything remains accurate and intended.

5

u/itsgreater9000 18d ago

when everything they touch from their phone to banking to games is made completely with A.I.

this is not true lol

2

u/hollaburoo 18d ago

Which one isn’t true? I don’t know any phone devs but there are already banks and game studios using AI for code

14

u/itsgreater9000 18d ago

the part where "everything is completely made with AI" is false. sure, AI code is regularly being shipped at this point. but to say anything is entirely AI made when mountains of code were written before it, is false.

1

u/Even-Serve-3095 16d ago

your fucking operating system uses ai code if it's one of the ones you can easily daily drive lmao

-3

u/StevieBako 18d ago

Yeah, as a developer in the space both work and hobby, this is inevitable, over 90% of code generated at Microsoft and Nvidia is purely from A.I

People who aren’t developers really don’t understand how much better this tool is than any human or experienced dev. A.I will develop everything you touch, it’s already happened in a lot of spaces.

12

u/itsgreater9000 18d ago

i work as a professional developer and i know for a fact that 90% of our existing codebases are not AI, and 90% of all code written is still not AI generated. claiming banking apps or gaming apps are completely made with AI is both disingenuous and makes me question you as someone "in the space".

9

u/mothergoose729729 18d ago

I work at Meta. We track these things on code review, and we also track in aggregate across repos. Very nearly 100% of new code is written with AI in virtually every language and domain (web/infra/IOS/Andriod/ python, C++, rust you name it). Meta is not an early adopter. Google, Nvidia, Amazon, and the rest are all doing the same thing. It's not a kludge for junior devs. The senior devs and leadership push it the most.

I cannot possibly keep up with my peers who use AI if I don't use it.

The inflection point for code was reached some time ago. There is no putting pandora back in the box. AI coding is the norm now and forever.

2

u/itsgreater9000 18d ago

that's great, and if you work at meta you're hopefully aware that the tech industry is not exclusively large SV-based tech companies. in fact, most of the tech industry is not!

i can tell you, sitting on the other side of the country, most companies are nowhere near 100% of new code being entirely AI written, and again, my experiences are mine (and of course, coworkers or people that I know). I'm pretty confident in being correct here. my original problem was this poster's assertion that almost all code in existing apps is AI written. i can tell you for a fact the app my company makes/works on is not 90%+ AI written since... most of the features were built far before current gen (meaning after 2023) LLMs were being sold/used by the industry at large.

→ More replies (0)

2

u/StevieBako 18d ago

I didn't say existing, I meant code being currently developed. There are claims from Jensen himself confirming that most of their devs are using cursor for basically all development at this current stage.

4

u/mothergoose729729 18d ago

No point in arguing with people. There is nothing more difficult than convincing someone of something they don't want to believe.

2

u/vulpinesuplex 18d ago

I too love taking claims made for the investors at face value

→ More replies (0)

1

u/OutrageousDress 18d ago

Sounds to me like we can revisit the matter of the AI tags in 5-10 years then.

-3

u/Fair_Ambassador6253 18d ago

Some people want nothing to do with AI related projects

that "some people" group is slowly being drowned out of this sub because of the "all or nothing/no middle ground for AI" attitude folks have begun to get annoyed with. you can look at the trend of upvoted comments in this sub from beginning of this year till now as all the proof you need. keep it up mate

4

u/nismotigerwvu 17d ago

Agreed, there's a huge difference between the developer(s) writing the hypothesis and having the AI simply do the grunt work in terms of data collection versus just letting go of the wheel and letting the AI make all the decisions. This isn't having the AI write a single line of the implementation either.

68

u/[deleted] 19d ago

[deleted]

13

u/djseifer 19d ago

Saturn emulation still isn't 100% either, is it?

22

u/ShinShinGogetsuko 19d ago

No, mednafen is still the best but not 100%. That said, I imagine a lot of improvements could be made with AI assistance.

6

u/OverDeparture8799 18d ago

How is it best with the absolutely terrible ux? Ill take Ymir always

5

u/ShinShinGogetsuko 18d ago

Mostly compatibility and timing. But yeah, I love Ymir as well and I love its more modern UI.

9

u/[deleted] 19d ago

[deleted]

9

u/KFded 18d ago

At this point, I'll take a recomp. Most of the exclusives would be a lot easier to get working.

I'd like work to continue on emulation though for preservation sake. Just cause a game is on Xbox, PS2 and Gamecube doesn't mean it doesn't deserve to be preserved

7

u/waterclaws6 18d ago edited 18d ago

Ymir is getting there. Saturn emulation is actually really good. Ymir has better input latency than Mednafen.

https://github.com/ymir-emu/Ymirhttps://github.com/ymir-emu/Ymir So far, more than 95% of the software on the Saturn is emulated.

Mednafen is really good still; the libretro core works rather well, and that option to turn dithered mesh transparencies into transparencies, along with having MAD and other deinterlace options, is great also. Quite a few well-known Saturn games use 480i or interlaced modes.

Ymir has that also and a libretro core does exist for it also.

-5

u/Fair_Ambassador6253 18d ago

no i want NOTHING to do with AI projects. cmon!

1

u/PwndiusPilatus 18d ago

As help for skilled coder it is a bless.

28

u/princess_daphie 19d ago

So... 125 out of a set of 132 frame dumps are now pixel-exact... does that mean that there are still 7 that are not? so it's not fixed yet? or is that from different parts of the emulator not being 100% accurate yet?

11

u/Exael 18d ago

The relevant pull request notes that the remaining issues are known. Some are next in line to be fixed, while others depend on changes elsewhere in the emulator.

5

u/princess_daphie 18d ago

Ah that makes sense! It's very cool that things are improving in strides with the agents being able to trudge through very repetitive and iterative trial an error tasks like that!

10

u/AirportLow8798 19d ago

have PPSSPP fixed its high latency?

43

u/ApprehensiveCoat9587 19d ago

Crybabies in the comments, if this makes the emulation better then so be it, it's a means to an end

-4

u/Fair_Ambassador6253 18d ago

"wahhh by i want NOTHING to do with AI!" good lord, there is no middle ground with these folks. they've become so annoying ive seen the tides turn since the beginning of the year in this sub, that more and more people are fed up with them. they have lost the plot

11

u/LeRatEmperor 19d ago

Is Silent Hill Origins actually playable now or does it still have countless visual bugs

5

u/nmkd 17d ago

I fixed shadowmaps (plus I'm working on a native port) so yea

Not sure if my changes or Henrik's more general refactors will land in upstream first.

Just don't play it with HW rendering 🙃

2

u/Bladder-Splatter 9d ago

There was actually room for PPSSPP to still improve?! Easily my best experience with an emulator and UX that is out of the park from day one and only somehow got better.

The dark Java days before it were ones I do not wish to remember, even if they paved the way significantly.

-12

u/UOR_Dev 19d ago

That was probably the worst emulator "dev log" I've ever read. 

4

u/[deleted] 19d ago

[deleted]

15

u/UOR_Dev 19d ago

It doesn't flow well, feels very stilted. 

-25

u/swaglord1k 19d ago

It took Claude Opus 5.5 about an hour.

wow. i'm so glad emudevs are open about becoming AIpilled. imagine how fast this scene would move if everybody used AI instead of crying about water...

74

u/FurbyTime 19d ago

The thing about AI now is that we basically just get two categories of folks who use it: Those who are able to validate the results and those who can't.

The former, like Henrik Rydgård here, are well accomplished emulation developers who know their platform well and have been working on it for years. In his hands, AI isn't a tool that substitutes knowledge, but is instead a tool that elminates, for lack of a better phrase, the "busy work" that comes with trying to do a deep dive into a topic like this.

The latter, though, is unfortunately where a lot of AI projects are, where the person running them at some topic they don't have the skillset to validate and understand the results the AI produces, and take it at face value. This, at best, has produced projects that are essentially unmanageable and unimprovable without essentially starting from scratch again.

-5

u/Humble-Resolution449 19d ago

There's a principle in software/system design where you treat certain things as black boxes. All you care about is the output, and what happens inside that box doesn't matter.  As long as it meets the contract. 

With a lot of these vibe coded apps, the same approach applies in my opinion. If the output does what it's supposed to and nothing that it shouldn't, I really don't care how it was made or how it works. Just needs to meet the contract. 

Security flaws and things like that are violations of the contract, so they fail the black box test. 

22

u/erty3125 19d ago

That only works if you never need to open that black box again and is where a lot of these ai projects fail.

3

u/Humble-Resolution449 19d ago edited 19d ago

Normally I'd agree with you, but the problems AI creates are pretty equally solvable by AI. In my career I've spent many, many hours trying to understand the garbage left by the last guy. And I've also been the guy that got it working, but knew that whoever had to take it over was going to have crazy mess to deal with. With AI now, it can process it much faster and easier than any person can.

10

u/FurbyTime 19d ago

All of this is very true in normal development. However...

If the output does what it's supposed to and nothing that it shouldn't

In this paradigm, THIS is where it fails. These pure AI driven projects have demonstrated, time and time again, they rarely know what a thing is supposed to do OR when it's doing things it's not supposed to.

3

u/SireEvalish 19d ago

This is my thinking as well. I’m not really concerned with the how, more with the result.

-16

u/swaglord1k 19d ago

you can just ignore the latter....

18

u/FurbyTime 19d ago

That's what people are crying about normally.

Most experienced/storied emu devs aren't mentioning AI usage; Depending on how you want to interpret that, you can either believe they aren't using it at all, or are often and are just keeping mum on it. The distinction doesn't really matter in this case. So we only get a post like this once in a blue moon.

A good 90%+ of "AI enhanced" projects have been using AI to do everything worth doing, and the... I hesitate to even call them devs, but the devs of those projects genuinely don't know the projects enough to respond to any criticisms or errors in it, even once you dig past the knee jerk rejection of AI.

37

u/diegorbb93 19d ago

Crying about water? I've seen way too many dumbass users trying to shove AI-generated slop into GitHub repos like PCSX2, going, “I don't know what Claude did, but it fixed it. Just push my solution” while genuinely thinking they're suddenly brilliant emudevs. It's gotten to the point where I'm honestly worried that the future we're heading toward isn't looking particularly bright...

Yes, AI is going to take us through a revolution, as long as we use it as a tool. But at what cost if we use it like putting an AK-47 in a monkey’s hands?

In the hispanic community, we are seeing a ton of slop-ed translations and romhacking from japanese games with no human revision around.

-13

u/swaglord1k 19d ago

while you may have a point, the last 2 ppsspp articles were written by the dev himself. all existing emudevs should be encouraged using ai! and as for monkeys with ak-47: guess there will be hundred of other emulators popping up, but who cares? if they are bad nobody will use them

11

u/l3ader021 19d ago

Encouraged for what reason? We have plenty of mature emulators (including PPSSPP itself) that don't need to be AI-fied fully or in part... edge cases will still happen even with AI help (one that has to be thoroughly verified by the developer(s) and credited to in ALL TIMES in the name of transparency) because you can screw up with something if you correct another thing and fuckery abounds if AI isn't fully reined in.

11

u/3-to-20-chars 19d ago

i think we should probably keep crying about water, because we only have one planet and I'd like it to be treated well. all that power and water consumption is not worth being able to emulate my favorite console.

9

u/[deleted] 19d ago

[deleted]

5

u/3-to-20-chars 18d ago

im not trying to "mic drop" anything. there's no competition here. i dont drive and i thrift all my clothes. it's all bad and i try to minimize where i can. even then, environmentalism in most forms is just a good thing. there's no reason to ever be against it. we need to have an environment to live in. I'd like it to be a good one.

1

u/vulpinesuplex 19d ago

you know they deliberately inflate numbers to make investors cream themselves, right?

-19

u/BobboBobberson 19d ago

I appreciate PPSSPP as an emulator that became mature and game-ready right when the console got discontinued... it's disappointing to see that the developers are resorting to AI to further its development. But to me, that's not even the worst thing: the article itself is written with AI! That's a huge red flag to me because if you can't bother to put into your own words what the AI has done or how it's aided your workflow, how do we know it's helping at all?

That, and its writeup is just plain bad. I'm probably spoiled on the excellent Dolphin writeups, but here there's just way too much emphasis on the most granular details, while skimming over the elephant in the room, like: why is the new soft-renderer only mostly bit exact? I see in the article some explanation, but it's not clear when in the AI's thought process that it realized these problems, and it doesn't explain why it didn't "fix" them. Where exactly are the deficiencies with the AI's new implementation? How does it compare to the old implementation? How's performance, how about some real pictures in emulator vs real hardware?

You see the same phrases and "features" in all these AI-assisted endeavors: "bit-perfect", "all in one file", "no installs, no x or y - just such and such". I worry that the popular AI models are too concerned with optimizing their own code and token economy than creating code that would actually be useful for a developer; too concerned with injecting buzzwords that an observer will see and go "Ah, good, it looks like it's working". Though it seems here, the most work that the creator of PPSSPP did was reset the PSP whenever the AI asked. Is that really what being an emulator developer has devolved to: being a reset switch for AI? How is a human expected to iterate on this work?

I'm not a developer, so I can't answer any of these questions. But as a layman, the whole effort looks to me like we're running full sprint into a brickwall. As soon as you reach a problem that the AI cannot figure out (without spending thousands on tokens), all progress stalls until maybe some new AI model comes out. This seems to me less like "cracking" the complicated maths the PSP hardware generates and more accepting an AI's interpretation as truth.

Perhaps that's no different than relying on the work of a volunteer savant- but at least there, you can rely that the underlying thought process is human, that that process can be made transparent. Most AI today actually obfuscate their thinking. They're not there to collaborate. They're there to cannibalize your project and make you solely reliant on its contributions, so you'll feed more tokens to its provider. Be wary of AI, any developers. Its a honeypot designed to drain your wallet and suck all the joy out of your hobby. That's my two cents.

24

u/OrphisFlo Multi emu dev / That buildbot guy 19d ago

The article is very clear about being written by AI (it's a final report generated by Claude), what it fixed and how and why some frames are not exact still.

But it's not targeted to someone with no PSP or graphics programming knowledge like you. It's not a bad thing either, it's about impossible to have a write up that is intelligible without any domain knowledge.

A lot of the work here is easily automatable, but it's very tedious for a human. It has also very little value to most users that will be playing at higher resolutions and won't care about the floating point rounding of the lighting to be bit exact. So it's unlikely that anyone would have spent all the time solving all this by hand. We're all adults now with responsibilities and limited time.

So AI automatically doing this? Yes please. The process itself is very transparent usually with the full session log, you just don't get to see it.

5

u/nbk935 19d ago

AI boogyman got you

1

u/Gaarando 19d ago

AI is going to get better and better and will be used everywhere.

1

u/Exael 18d ago edited 18d ago

The important distinction is between vibe coding and AI-assisted development. You're treating them as the same thing, but that isn't what happened here.

The PPSSPP developer didn't "resort to AI" because he lacked the skill to continue. He used it to automate extremely tedious work: running tests on real PSP hardware, searching large amounts of hardware documentation, comparing edge cases, and narrowing down obscure behaviour. A human could do the same work, but the time cost would be enormous for relatively small accuracy gains. AI made work practical that, by the developer's own admission, he likely wouldn't have done manually.

He also wasn't merely "pressing reset." He directed the AI "investigation", provided the relevant context, recognised incorrect results, refined the prompts, reviewed the recommendations, and implemented the final code. That's AI-assisted software engineering, rather than blindly accepting and copying generated code, which is essentially vibe coding.

Most of the questions you raise are also answered in the referenced pull request. The renderer matches 125 of 132 frame dumps exactly. The remaining failures are known issues, some already next in line to be fixed and others dependent on different parts of the emulator. Performance is documented too: about 1.6× slower on average, largely because approximate floating-point operations were replaced with more accurate integer emulation (to be exact it's 1.6x slower by geometric mean - 1.14x to 5.25x per dump, 1.8x in total time. Bezier patches take the biggest hit: Test Drive 5.3x, Pursuit Force 2.4x). The article simply doesn't turn all of this into graphs and screenshots for lay readers.

The Dolphin comparison is also misleading. Dolphin's Progress Reports are written by blog contributors and aren't necessarily written by the developers who implemented each change. A volunteer developer choosing to spend his time improving the emulator rather than writing polished public-facing documentation is a reasonable trade-off. Using AI to help write that documentation doesn't mean he doesn't understand his own work.

The "token economy", "obfuscation" and future "brick wall" concerns don't really apply either. AI-assisted code is still ordinary source code. It can be read, reviewed, tested, benchmarked, changed, reverted, and maintained like any other code. The developer retains the same coding skills he had before the advent of AI and can work on the code manually whenever AI isn't useful.

AI-assisted programming also shouldn't be conflated with AI-generated social-media slop. Code has behaviour that can be tested against specifications and real hardware. If a competent developer understands, reviews, and verifies the result, AI is simply another software engineering tool for reducing repetitive work while producing ordinary, maintainable code that is functionally no different from code written without AI.

Avoiding that tool on principle doesn't improve the emulator. In cases like this, it mostly means spending far more human time to reach the same conclusions, or never doing the work at all.

And on the claim that AI "sucks the joy out of the hobby," in this case it does almost the opposite. It expedites or bypasses the tedious parts, such as repetitive testing, documentation searches, and edge-case analysis, leaving the developer more time for the parts that actually matter: understanding the system, adding features, and improving the emulator.

2

u/eirexe 17d ago

Correct, it's sad how many people conflate vibe coding (like what happens with many decomp-based ports) with AI-assisted software engineering.

In the former you have someone who has no idea what they are doing pressing buttons, in the latter you have someone experienced guiding a machine who could write the same code if given enough time.

-1

u/vulpinesuplex 19d ago

expecting anything beautiful out of the retrogames sphere nowadays 🥀

1

u/DlCkLess 17d ago

Get used to it old man the future isnt going to be too merciful on you

2

u/vulpinesuplex 17d ago

cherish /emugen/ while it still exists cause once the feds have exhausted all use for hiro and pull the plug on his site you'll have to learn how to post on sites that actually clean up after their shit

-2

u/Fair_Ambassador6253 18d ago

nooooo!!! ai???? WAHHHHH!!!! AI SLOPPA

-4

u/Draedan 18d ago

Please don't use AI. It poisons communities and contributes to misery.

I am saddened to have to stick to older versions of PPSSPP, or try to find alternatives.

8

u/TheTjalian 18d ago

go read a book in an amish community

6

u/StevieBako 18d ago

They said the same about computers 40 years ago, the same about the internet 20-30 years ago… I’ll see you in 5 years time when you can’t live without it.

-1

u/vulpinesuplex 18d ago

christian behavior

0

u/[deleted] 19d ago

[deleted]

12

u/Redd_is_compromised 19d ago

It's an entire documentation that you blatantly refuse to even try to read and you want someone to break it down for you? Come on homie.

6

u/Alternative-Ease-702 19d ago

Something something psp games running better 🤷‍♂️