AI’s Code Refactoring Leap: Adam Tornhill’s Street Fighter III Overhaul Explored by Luca Rossi

?

πŸŒ€ Luca Rossi

LinkedIn Author

I write about how to run better software engineering teams, to 200K+ engineers and managers

In a recent LinkedIn post, πŸŒ€ Luca Rossi discusses a remarkable project undertaken by Adam Tornhill, founder of CodeScene and author of “Your Code as a Crime Scene.” Rossi highlights how Tornhill and his team utilized AI coding agents and CodeScene to refactor the entire 300,000-line C codebase of the decompiled Street Fighter III game, significantly improving its code health score.

According to Rossi, the team managed to elevate the game’s code health from a score of 5.6 to a perfect 10.0 in just three weeks, at an estimated cost of $4,000 in token usage. This achievement, Rossi points out, would have represented a year-long rewrite just a few years prior, underscoring the rapid advancements in AI-assisted software development.

AI Agents: Inventing the Refactoring Playbook

πŸŒ€ Luca Rossi shares that one of the key takeaways from Tornhill’s experience was the innovative way AI agents approached the refactoring task. These agents didn’t just apply existing refactoring patterns; they also devised entirely new, codebase-specific recipes. Rossi elaborates on this, quoting Tornhill’s insights:

“The agents invent the playbook β€” they used classic refactoring patterns but also invented codebase-specific recipes, wrote preconditions, and kept the failures.”

As πŸŒ€ Luca Rossi notes, this ability of AI to both leverage established techniques and generate novel solutions specific to the project’s context is a significant development in software engineering.

The Crucial Role of Testing and Code Health Metrics

A critical enabler for the AI’s success, as detailed by πŸŒ€ Luca Rossi, was the robust testing strategy employed for Street Fighter III. The game featured a sophisticated testing mechanism that involved computing the hash of each rendered frame and comparing them.

This, combined with a clear, deterministic target for code health, allowed the AI agents to make consistent, autonomous progress. πŸŒ€ Luca Rossi emphasizes this synergy:

“Good testing + code health β€” SF had a clever test approach: computing the hash of each rendered frame and comparing them. This, together with the deterministic code health target, allowed agents to make continuous progress autonomously.”

In πŸŒ€ Luca Rossi’s view, this highlights the indispensable nature of well-defined quality metrics and effective testing frameworks when implementing advanced automation in software development.

Human Oversight and the Bottleneck of Validation

While AI agents can perform extensive code refactoring, πŸŒ€ Luca Rossi also relays Tornhill’s perspective on the areas where human expertise remains paramount. Tornhill indicates that the depth of his review of AI-generated code varies based on its uncertainty and importance.

As πŸŒ€ Luca Rossi relays Tornhill’s strategy:

“Uncertainty drives how deep you go β€” Adam doesn’t read every LOC that AI writes: it depends on the level of uncertainty and importance of that code. Bug fixes stay shallow, while novel features get more human attention.”

Furthermore, πŸŒ€ Luca Rossi points out that the true bottleneck in this AI-driven process is not the code generation itself, but the validation of that code. He quotes Tornhill’s observation:

“Validation is the bottleneck β€” writing code is cheap, and also verifying it (with good tests) is becoming so. Proving the system still behaves, stays maintainable, and stays inside architectural bounds is where humans still earn their keep.”

This suggests that while AI can accelerate the creation and refinement of code, the critical task of ensuring its correctness, maintainability, and adherence to architectural principles still relies heavily on human judgment and expertise.

📝 About This Content

This article is based on insights shared by πŸŒ€ Luca Rossi on LinkedIn.

📅 Originally posted on October 2, 2026 | View original post on LinkedIn β†’